Skip to content

feat(agent): materialize invocation evidence - #97

Merged
Pepps233 merged 3 commits into
feat/invocation-trace-lifecyclefrom
feat/materialize-invocation-evidence
Aug 23, 2026
Merged

Pepps233 merged 3 commits into
feat/invocation-trace-lifecyclefrom
feat/materialize-invocation-evidence

Conversation

@Pepps233

@Pepps233 Pepps233 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Build a deterministic, self-contained evidence document from each complete or partially recoverable invocation trace.

The materializer validates trace structure, resolves referenced session segments, and preserves source provenance without duplicating transcript content into trace records.

Reasoning

Invocation traces contain execution facts while session JSONL remains authoritative for messages, tool calls, tool results, usage, and compactions.

Keeping those ownership boundaries explicit avoids competing copies and lets missing or changed session data surface as diagnostics instead of silently producing unsupported conclusions.

The normalized model is runtime-neutral, so coding-agent v3 entry cursors and AgentHarness durable sequence cursors produce the same evidence shape without coupling either runtime to the other's internal types.

Developers gain a bounded, LLM-ready diagnostic document that remains useful when an invocation or one of its referenced sessions is incomplete.

Changes

  • Add the versioned MaterializedInvocation model and stable JSON serialization.
  • Consolidate trace span starts, events, and settlements while preserving every contributing trace record ID and span ID.
  • Stream coding-agent v3 and AgentHarness session files, verify cursor bounds and digests, and support relocated session paths.
  • Preserve causal identifiers, session binding IDs, entry IDs, sequence numbers, timestamps, parent span IDs, and explicit ordering ambiguity.
  • Report missing, changed, truncated, incompatible, writer-degraded, and crashed evidence as partial diagnostics.
  • Add fixtures covering coding-agent transcript content and AgentHarness durable records.
  • Document evidence ownership and exclude claim extraction, proposal aggregation, approval, and behavior mutation work.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/harness-trace.test.ts test/materializer.test.ts
  • npm run check
  • git diff --check feat/invocation-trace-lifecycle...HEAD

- Preserves trace provenance while consolidating related span records
- Keeps degraded and crashed invocations usable for diagnostics
- Verifies coding-agent digests and AgentHarness sequence bounds while streaming session files
- Preserves partial evidence with explicit integrity and ordering diagnostics
- Prevents transcript facts from being duplicated into invocation traces
- Documents deterministic ordering, digest verification, and partial recovery behavior
@Pepps233 Pepps233 self-assigned this Aug 19, 2026
@Pepps233
Pepps233 requested a review from Issacboy123 August 19, 2026 04:50
@Pepps233
Pepps233 marked this pull request as ready for review August 19, 2026 05:24
@Pepps233
Pepps233 merged commit b2a8b0e into main Aug 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant