Skip to content
Edit this page

Evidence health

Evidence health answers a narrow review question: is this captured session structurally usable as evidence, and what limitations should the reviewer know about?

It does not score agent quality, infer misconduct, or claim that a provider exposed everything that happened.

Versioned result

agent_trace.evidence_health.assess_evidence_health() returns a versioned result with one of four statuses:

  • healthy — the observed stream has the expected boundaries and relationships and no declared capture limitation was supplied.
  • partial — the stream is reviewable but has an observed gap or a declared provider limitation.
  • unknown — there is not enough completed evidence to judge yet, for example an active session without an end marker.
  • invalid — the stream is internally contradictory, for example duplicate boundaries, duplicate event IDs, mixed session IDs, or a non-finite timestamp.

Every non-healthy result includes machine-readable reason codes and human explanations. Reasons also distinguish observed defects from provider limitations.

Observed checks

The first version checks:

  • session start/end boundaries, allowing continuation starts;
  • events before start or after end;
  • duplicate event IDs;
  • mixed session IDs;
  • non-finite timestamps and timestamp regressions;
  • unpaired tool calls/results once the session is finalized;
  • unpaired LLM requests/responses once the session is finalized;
  • ERROR events with a missing or unknown parent request (retaining the error event ID); and
  • export/drop failures explicitly reported by the caller.

The calculation is deterministic and local. It performs no network calls.

For an active session (session_finalized=False), a tool call or LLM request without a terminal outcome is treated as in flight rather than as missing evidence only if no recorded session_end follows that request. A missing outcome from a closed span stays a gap, even if a later resume is still active. Orphan, duplicate, invalid, and out-of-order outcomes are still reported immediately.

Session boundaries

Boundaries are checked in event order. The first session_start opens the session and a session_end closes it.

A later session_start continues the same session when its source is resume or compact (CONTINUATION_START_SOURCES). Claude Code and Codex keep the session ID when a session is resumed or compacted, and Gemini CLI and GitHub Copilot CLI keep it on resume, so the hooks record these starts in the existing trace. A continuation start:

  • is not a duplicate_session_start;
  • re-opens a session that a session_end closed, so the next session_end is not a duplicate_session_end and the events after the continuation start are not events_after_session_end.

These stay invalid:

  • a later start with any other source is duplicate_session_start. This includes startup, clear, fork, new, a hook event name such as SessionStart, and a missing source. Only resume and compact are known to keep the session ID, so any other repeated start contradicts the trace;
  • a session_end with no continuation start since the previous end is duplicate_session_end;
  • any other event after a session_end with no continuation start is events_after_session_end, reported once per closed span on the first such event.

A start and an end that each appear twice, with every other event doubled, usually means the same hooks are registered twice, for example by the GitHub Copilot CLI plugin and by agent-strace setup --cli copilot. Keep one registration; see GitHub Copilot CLI hooks.

Source matching is exact and case-sensitive. When a continued session has no end after its last continuation start, it reports session_active or missing_session_end like any other open session. observed_end still reports whether any end marker was captured.

Some providers send events before their session start hook. A caller can declare those event types with allowed_pre_start_event_types. When every event before the first session_start has a declared type, the result reports one declared_events_before_session_start provider limitation instead of the invalid events_before_session_start. Any undeclared event type before the start is still invalid, and a session with no start is still missing_session_start. agent-strace health, agent-strace validate and the agent.strace.evidence.* attributes of --format otlp-genai take the declared types from the capture matrix's events_before_start.

Some providers record results with no request event. A caller can declare those result types with allowed_unrequested_result_types. Result events of a declared type with no parent_id are then reported once as the provider limitation declared_results_without_requests, instead of one orphan_<type> each. A result that names a request missing from the trace is still an orphan. agent-strace health, agent-strace validate and the agent.strace.evidence.* attributes of --format otlp-genai take the declared types from the capture matrix's results_without_requests; Codex declares llm_response, because agent-trace records its model requests from PostModelRequest alone.

Provider limitations

A missing event alone is not enough to conclude that capture failed: some providers never expose certain categories of activity. Callers should therefore pass known blind spots from a versioned provider/capture matrix:

from agent_trace.evidence_health import assess_evidence_health

health = assess_evidence_health(
    events,
    provider="codex",
    capture_method="hooks",
    capture_matrix_version="<actual matrix version or stable reference>",
    provider_blind_spots=[
        "example limitation supplied by the capture matrix",
    ],
    session_finalized=True,
)

A declared blind spot makes the result partial even when the observed event stream is structurally clean. Include the applicable capture_matrix_version in the assessment so downstream consumers can interpret provider limitations against the version of the matrix used to declare them. An empty version means the adapter did not supply a reference; it must not be interpreted as verified completeness. This prevents healthy from becoming a false claim about activity a provider cannot expose.

External evidence

Other tools record evidence that agent-strace did not capture. health, review and pr-comment --review can read it with --commits RANGE, --otel-logs FILE and --agent-trace-records FILE: Entire checkpoints, Copilot cloud agent commits, Claude Code session links, declared AI assistance, Claude Code OpenTelemetry logs, git-ai notes and Agent Trace records. Each one is reported as an external signal with a source, a status and a confidence. Signals are reported, not graded: they never change the health status, a review finding's status, the threshold result or the exit code. A trailer alone never shows that the evidence behind it is complete.

Status Meaning
present The tool's evidence exists where it says it is
unpushed The trailer is present but the checkpoint has not reached the remote
missing The input was read and has no evidence from this tool
inconclusive The input cannot say either way

Agent involvement

JSON output sets shows_agent to true when at least one signal shows that an agent took part. A present, unpushed, or inconclusive signal counts, with two exceptions that only describe the input: the commit_trailers signal for a range that could not be read or has no commits, and a signal with facts.read_error set, such as a logs file that could not be read. A missing signal never counts. Declared assistance counts too: a pull request whose commits carry an Assisted-by or Generated-by trailer or an agent co-author line, such as the Copilot app's, shows agent involvement. A git-ai notes or Agent Trace records signal counts only when it attributes at least one line to an agent. The GitHub Action uses it to decide whether to post a PR comment when there is no session. It is not graded.

The review disclosure check compares these signals, with the linked sessions, against the AI assistance the pull request declares. Only that check can fail on them, and only in check mode.

Nothing is fetched. Remote state is read only from local remote-tracking refs, so a stale fetch can make pushed evidence read as unpushed. With actions/checkout, set fetch-depth: 0 so the range is in the clone.

Entire checkpoints

Entire links a commit to a checkpoint with an Entire-Checkpoint: <id> trailer. Since Entire CLI 0.13.1, only lines in the commit message's last paragraph link; a line pasted into the body does not. The ID is 12 lowercase hex characters or a 26 character ULID. Entire stores checkpoints either as refs under refs/entire/checkpoints/ or on the entire/checkpoints/v1 branch, and since 0.13.1 a clone can keep them local until they are sent. On a case-insensitive filesystem, such as the macOS and Windows defaults, Entire writes the local ref with its two-character shard lowercased, while the remote gets the ID's own case. Both spellings are matched.

Signal Status Confidence
Ref exists and is listed in entire-checkpoint-push-queue.jsonl unpushed high
Ref exists, not queued, push_sessions is false in .entire/settings.json or settings.local.json unpushed medium
Ref exists, not queued present medium. The remote is not checked.
On entire/checkpoints/v1 and on a refs/remotes/*/entire/checkpoints/v1 tree present medium
On entire/checkpoints/v1, a remote-tracking branch exists without it unpushed medium
On entire/checkpoints/v1, no remote-tracking branch unpushed low
No local entire/checkpoints/v1, but on a refs/remotes/*/entire/checkpoints/v1 tree, as in a reviewer clone or CI fetch present medium
Trailer present, checkpoint in neither store inconclusive low. It may be on the remote; the detail gives the git fetch origin 'refs/entire/checkpoints/*:refs/entire/checkpoints/*' command.
Entire-Checkpoint: line outside the last paragraph, or an invalid ID inconclusive medium
No trailer in the range missing high, or medium when more than 500 commits were in the range

The push policy in .git/entire/checkpoint-push-policy (automatic, the default, or manual) is named in the detail. A policy that cannot be read is named as unreadable, matching Entire, which then uploads nothing.

Sessions read from a checkpoint

The signal above says only whether a checkpoint exists. review --entire reads the checkpoints themselves as sessions when no agent-trace session is linked; see review. import --entire stores them in the trace store with the same reader, and skips a session that is already there. The reader reads, with git, each checkpoint's metadata.json and, for each session in it, the session's metadata.json, its compact transcript transcript.jsonl and its prompt.txt. It never reads full.jsonl, the agent's native transcript. Sessions of other kinds, such as Entire's own review runs, are skipped. A session that spans several checkpoints is joined into one.

Every string is scrubbed of the project root and home directories, and agent-strace's secret redaction runs before any text is cut, unless redaction is turned off. The session_start the reader writes records the mode entire-checkpoint and redaction as on or off. It also records transcript, whether the session had a compact transcript, and timestamps, where event times came from: transcript, checkpoint_created_at, or import_time when the checkpoint gives no time. Without a compact transcript, each file in the session's files_touched list becomes a file_write with the source entire files_touched. A session is named the way the agent's hooks name it, by the first 16 characters of the agent's own session ID, so a session captured by hooks and read from a checkpoint has one ID. Older Entire versions put the date before that ID; the dated and undated forms are one session. A checkpoint session without that ID, or whose ID would put part of a path or a secret in its name, is named entire-<checkpoint ID>-<index>. When two sessions in the range get the same name, the first is read and the other is skipped with a note on stderr.

Evidence health applies the entire entry of the capture matrix, with the capture method checkpoint_import. Its known gaps make every such session partial with the reason provider_blind_spot, never healthy, even when its event stream is clean:

  • The checkpoint is read after the session, not captured by hooks while it ran. It is the session author's own record and is unsigned.
  • The compact transcript leaves out reasoning, system prompts, approval decisions and subagent transcripts, and long tool results keep only their start and end.
  • The session start and end events are written by agent-strace; the checkpoint records neither, and some turns carry no timestamp.

In review, the Evidence health finding is then partial with high confidence, and its facts name the provider entire and the reason code. For the reviewer workflow, see Review PRs from Entire users.

Copilot cloud agent

GitHub's March 2026 changelog says Copilot cloud agent commits are authored by Copilot and carry an Agent-Logs-Url trailer that links to the agent session log, such as https://github.com/OWNER/REPO/sessions/<id>. The observed format differs. On 2026-11-16 the commits of a pull request the cloud agent made, Siddhant-K-code/agent-trace-demo#3, were authored by the human who assigned the issue, committed by GitHub <noreply@github.com>, and had no Agent-Logs-Url trailer. The only sign of the agent was a co-author trailer on the commit with the change:

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

The first commit, Initial plan, had no trailer at all.

So the signal reads three things in every commit of the range: the Agent-Logs-Url trailer, a Co-authored-by line that names the agent, and an agent commit author. The agent identity is matched strictly: the name copilot-swe-agent[bot], or a GitHub noreply address with the agent's numeric ID, 198982749+<login>@users.noreply.github.com. A line that only mentions Copilot does not count. The Copilot App adds Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> to local commits; that ID is not the cloud agent's. Both lines are also found inside squash-merge bodies, where they are often indented or in a bullet.

Signal Status Confidence
An Agent-Logs-Url trailer with a GitHub session URL present low. The log is not read, and it may be private or expired.
An Agent-Logs-Url trailer with any other value inconclusive medium
No trailer, one or more commits name the agent as author or co-author inconclusive medium. The agent took part, but no commit links its session log.
No trailer and no agent commit in the range missing high, or medium when more than 500 commits were in the range

Agent commits without a trailer are inconclusive, not present: present means the evidence is where a trailer says it is, and here nothing links the session log. They are not missing either, because the cloud agent did work on the range and its session log exists on GitHub; find it from the pull request. The confidence is medium because the identity match is strict but the log itself was not found or read. The detail gives the count of agent commits, and facts lists them with agent_authored and agent_coauthored counts.

Claude Code sessions and declared assistance

Four more commit signals show that an agent took part. They are read on every line of every commit in the range, like Agent-Logs-Url, so squash-merge bodies count. They differ from the signals above in one way: they are added only when found. These lines are optional and easy to strip, and Claude Code users can turn them off with attribution: false, so a range without them gets no missing signal. Their absence never shows that no agent took part.

claude_session. In a Claude Code on the web or Remote Control session, Claude Code tells Claude to add a Claude-Session: https://claude.ai/code/session_<id> trailer to its commits, unless attribution.sessionUrl is false. Because the model writes the line, it can be missing or reworded. There is one signal per distinct value, and facts.commits lists the commits that carry it.

assisted_by and generated_by. Some projects ask contributors to declare AI assistance with a trailer that names the tool instead of a co-author line. Fedora recommends Assisted-by: with free text, such as Assisted-by: generic LLM chatbot. The Apache Software Foundation recommends Generated-by: <Name of Tool> <Version>, which Apache projects such as Flink and Kafka use. Each trailer is its own source, with one signal per distinct value. facts.value is the value as written, with whitespace collapsed.

Older Linux kernel commits also carry Assisted-by. The kernel's 7.2 docs asked for Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2], such as Assisted-by: Claude:claude-3-opus coccinelle sparse, 7.3 reduced it to Assisted-by: LLM [TOOL1] [TOOL2], and the kernel removed the tag on 2026-10-13. When the first word of an Assisted-by value has the 7.2 AGENT:MODEL form, facts also has agent, model, and the remaining words as tools.

A value that is not short plain text (letters, digits, spaces and ._:+/()[],@-, at most 100 characters) is never printed: its signals share an empty subject and facts.value is null.

agent_coauthor. Agents add a Co-authored-by line with a fixed address. The address identifies the agent; the name is reported in facts.names but never used to match, because Claude Code puts the model in it, such as Claude Opus 4.5:

Address Agent (subject and facts.agent)
noreply@anthropic.com claude_code, Claude Code
noreply@openai.com codex, OpenAI Codex
cursoragent@cursor.com cursor, Cursor
223556219+Copilot@users.noreply.github.com copilot, the GitHub Copilot CLI and app

There is one signal per agent. The Copilot cloud agent co-author is reported only by the copilot_agent_logs signal above.

Signal Status Confidence
A Claude-Session trailer with a claude.ai session URL present low. The session is not read, and it may be private.
A Claude-Session trailer with any other value inconclusive medium
An Assisted-by or Generated-by trailer inconclusive medium. It declares assistance but links no session log.
A Co-authored-by line with an agent address inconclusive medium. It shows the agent took part but links no session log.
None of these in the range no signal

At most 500 commits are read, as for the signals above, so a commit count can be a floor. JSON output names the source of each signal, so a consumer can tell a declaration (assisted_by, generated_by, agent_coauthor) from a link to evidence (claude_session).

Claude Code OpenTelemetry

--otel-logs reads a Claude Code OpenTelemetry logs export: an OTLP JSON resourceLogs document, a JSON list of records, or JSON Lines of either. Records count as Claude Code when their body starts with claude_code., their service.name is claude-code, or they have no service.name and their event.name is a Claude Code event name. Counts, decisions, categories and versions are reported. Prompt text and commands are never printed.

Signal Status Confidence
One or more safety_event records present medium. The count is a floor.
No safety_event, every recorded service.version before 2.1.307 inconclusive medium
No safety_event, otherwise inconclusive medium
No Claude Code events missing high, or medium when some lines could not be parsed
File cannot be read inconclusive low

Some refusals log only a tool_decision with decision: reject and no safety event. Those rejects are counted, and the ones whose tool_use_id has no matching safety event are reported as rejects_without_safety_event.

git-ai notes and Agent Trace records

--commits also reads the git-ai note of each commit under refs/notes/ai, and --agent-trace-records FILE reads Agent Trace records. Each source is one signal, git_ai_notes or agent_trace_records, with the AI, mixed, human and unknown line counts. Agent lines make it present at medium confidence; read input with no agent line makes it missing. actions/checkout does not fetch notes. See git-ai notes and Agent Trace records for the formats, the statuses, the limits on untrusted input and the CI fetch step.

Sources

Integration boundary

The core assessment module intentionally does not read configuration files, provider matrices, session metadata, or UI state. Those surfaces should adapt their existing data into the same function so CLI, JSON/API, replay, and the local dashboard can expose one consistent result.

agent-strace health is the CLI adapter. It reads session metadata, hook active-session markers, and the capture matrix packaged with agent-strace, then passes them to this function.

This keeps the health rules independently testable and gives later integration work one stable source of reason codes rather than several slightly different implementations.

agent-strace review reuses this adapter as the evidence health finding in the PR reviewability check.