fix(core/agent)!: make the driver's store contract true, and drop Task.History #789
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.47) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 493 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 40% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #789"
general
weight: 0.35
github-actions[bot]
Two claims that the code did not keep
agent.Saverwas not the driver's contract. It was documented as "the narrow half ofStore, so a driver cannot compact the log or delete a task", andRunTurnderived it fromRequest.Store. ButRequest.Storealso handed the wholeStoreto every driver: the graph saves its own sections and compacts throughTruncateThrough, and nothing prevented a driver fromList,DeleteorTruncateEvents. A claim enforced only by a comment is a claim a third-party driver gets wrong.Task.Historywas a field nothing could fill. Every store nilled it on save and on load; the event log is documented as the transcript's only source, and carrying it in the projection is what made a save cost O(n²) bytes. Since #787 the decorator also writesmessagerecords, so the honest answer to "where is the conversation?" exists and the field was answering it with a lie.The change
Request.Storecarries it;Request.Saverandagent.Saverare gone, so there is one field and one answer.Events,List,Delete,TruncateEvents,SetServerVersion.LatestForSessionis included: the graph carries declared state keys from the session's previous task, so a driver bound to one conversation needs its own resume point.DriverStoreOfis the adapter the host applies — the narrowing happens where the full store lives. Stores that already satisfy both (agenttest.MemStore,checkpoint.SQLite) are handed over directly, and each now asserts it.Task.Historyand every reference to it are removed; the conformance suite, the SQLite test anddocs/guides/checkpoint.mdnow say the projection carries where the run stands and the log carries the transcript.Side effect in
agent/a2a: the round-trip record moves into the sameSaveas the peer's identity. One commit per proxied call instead of two, and no window where the peer task exists without the record of the call. Its old path appended through a fresh projection, which would have clobbered the task state the decorator writes last.Breaking changes
agent.Saverremoved;Request.Saverremoved;Request.Storeisagent.DriverStoreTask.Historyremovedgraph.WithStoretakesagent.DriverStoreCallers holding a full store pass
agent.DriverStoreOf(store), or the store itself when it already satisfies the narrow contract.Tests
TestDriverStoreOfIsTheDriversHalf: the adapter delegatesSave(including the compaction option that is the reasonSavetakes options),EventsAfter,LatestForSessionand both blob calls, and a nil store narrows to nil.Loadreturns the projection.docs/guides/checkpoint.mdgets the two lines this change makes wrong — theTask.Historyclaim and a paragraph on the driver's half — and nothing else (the rest of the guide is still pre-rewrite and wants its own pass).Verification
make ci(vet + tests +GOWORK=offconsumer build),make lint(0 issues),make release-check,git diff --check. No release changeset: nothing is being tagged here.