Skip to content

feat(telemetry): carry agent_version in the trajectory envelope (DGM variant attribution)#166

Open
justrach wants to merge 2 commits into
release/0.2.17from
feat/trajectory-agent-version
Open

feat(telemetry): carry agent_version in the trajectory envelope (DGM variant attribution)#166
justrach wants to merge 2 commits into
release/0.2.17from
feat/trajectory-agent-version

Conversation

@justrach

@justrach justrach commented Jun 4, 2026

Copy link
Copy Markdown
Owner

What

The trajectory telemetry was designed as a Darwin-Goedel-Machine fitness substrate (the AgentRunEnd doc-comment in forge_domain/src/trajectory.rs says so: "rollup over (agent_id, agent_version) reveals which variants are efficient vs wasteful... substrate for DGM-style sampling"). But agent_version was dropped before upload — so graff.trajectory.v1 carried which agent (agent_id via run.id) but not which variant of its prompt. Without that you can't compare prompt/scaffolding variant A vs B and select the winner — the core move DGM / ADAS / SICA all depend on.

Fix

crates/forge_app/src/trajectory_upload.rs — thread the existing agent_version (sha256 of the agent definition, app.rs:223) from the AgentRun event through RunBuf into the Run envelope (skip_serializing_if when None). 5 small edits, no new computation — the hash already existed.

Why this and not the verifiable reward

The other half (tests_passed/build_ok/diff_committed) is server-side, not a client gap: the full steps (every tool call/result) are already uploaded, so the data.codegraff.com ingest worker can derive verification + refine reward. The client's only missing piece was variant attribution — which this closes.

Verification

cargo check -p forge_app clean; envelope now includes agent_version when the agent has a prompt hash.

🤖 Generated with Claude Code

justrach and others added 2 commits June 4, 2026 16:49
…ant attribution)

`agent_version` (sha256 of the agent's prompt frontmatter+body, app.rs:223)
already rides the AgentRun trajectory event, but the uploader destructured it
away -- so graff.trajectory.v1 identified WHICH agent (agent_id via run.id) but
not WHICH VARIANT of its prompt. That's the missing piece for attributing fleet
fitness to a specific variant.

Thread it through: RunBuf captures agent_version from AgentRun; the Run envelope
carries it (skipped when None). A rollup over (agent_id, agent_version) can now
compare prompt/scaffolding variants and select the better one -- the
Darwin-Goedel-Machine substrate the schema was designed for (see the AgentRunEnd
doc-comment in forge_domain/trajectory.rs).

The verifiable reward (tests/build/git) stays server-side: the full steps are
already uploaded, so the ingest worker can derive it; the client only lacked
variant attribution, which this closes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…envelope

Deterministic coverage for the variant-attribution field: builds a Run
envelope and checks agent_version serializes when present and is skipped
when None. (A live wire capture is blocked by intermittent Codex stalls;
this proves the serialization without a model call.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions Bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: inactive No current action needed/possible; issue fixed, out of scope, or superseded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant