Skip to content

feat(eval): checkpoint fidelity eval with decay round - #454

Open
bobzhang wants to merge 3 commits into
agent/compaction-telemetryfrom
agent/compaction-fidelity-eval
Open

feat(eval): checkpoint fidelity eval with decay round#454
bobzhang wants to merge 3 commits into
agent/compaction-telemetryfrom
agent/compaction-fidelity-eval

Conversation

@bobzhang

Copy link
Copy Markdown
Collaborator

Summary

Second slice of the compaction production-hardening plan (R0: baseline fidelity before changing summarizer behavior). Stacked on #453 (consumes CompactionSummary's usage/duration telemetry for its cost rows).

eval/compaction_fidelity scores whether a checkpoint summary lets the next turn continue accurately:

  • Facts: a real checkpoint over programmatic fixture sessions, scored on verbatim preservation of planted facts — error codes, crash sites, versions.
  • Probes: scripted questions asked from the compacted projection (summary in place of covered events), token-boundary matched against accepted phrasings.
  • Decay round: a second checkpoint over the compacted session plus follow-up work — the summary-of-summary measurement.
  • Each checkpoint prints its cost row: token usage, prompt-cache hit/miss, wall-clock duration.

Fixtures include a finished turn, a mid-session user redirection, an exact-error tool failure, and a prompt-injection line inside a tool result. Deterministic tests (run in CI) pin that fixture projections are API-valid, every planted fact exists in the raw projection, and follow-ups never replant a fact in any model-visible field.

First live baseline (deepseek-v4-pro)

  • facts preserved: 4/5 after one checkpoint (error code dropped), 3/5 after the decay round — summary-of-summary decay measured directly
  • probes: 4/4
  • checkpoint requests: ~8–10s wall-clock; cache counters live (first-ever run: 100% miss; identical re-run: 640/650 hit)

Review

Three subal (codex) rounds: two substring-collision scoring bugs and a surrogate-pair panic found and fixed (each with pinning tests); final round clean.

🤖 Generated with Claude Code

bobzhang and others added 3 commits July 11, 2026 12:06
eval/compaction_fidelity scores whether a compaction summary lets the
next turn continue accurately: planted-fact preservation in the summary
text (error codes, crash sites, versions), scripted probes answered
from the compacted projection, and a second summary-of-summary round
that measures fact decay directly. Fixtures are built programmatically
with complete assistant/tool batches; deterministic tests pin that the
projections are API-valid and that every planted fact is present in the
raw projection, so a perfect summarizer could score 100%.

Probe questions carry a no-tools prefix: the projection keeps the
fixture's agent system prompt, and without the prefix a probe can come
back as tool-call markup instead of an answer — the summarizer-side
twin of a26456b.

First live run: 4/5 facts after one checkpoint, 3/5 after the decay
round, 4/4 probes, and both checkpoint requests were full prompt-cache
misses — the baseline the compaction-hardening plan builds against.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two subal review findings: the decay follow-up bumped the version to
0.9.2-rc1, whose text contains the original 0.9.2 release needle, so a
second summary that forgot the release blocker still scored the fact as
preserved — the follow-up now bumps to 1.0.0-rc1, and a deterministic
test pins that follow-up content never replants any planted fact. Probe
matching is now token-delimited instead of raw substring, so a "no"
acceptance no longer matches inside "now" or "unknown".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two more subal findings: a rejected token match starting with a
supplementary character advanced the retry cursor into its low
surrogate, and the next slice panics — the cursor now steps a whole
code point (whitebox test pins the repro). The anti-replant guard now
checks every assistant field the projection replays to the summarizer
(reasoning and tool-call names/arguments), not just visible content.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant