fix(controller): correlate model results by call ID #299
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.48) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 506 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · 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.373
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #299"
general
weight: 0.35
aramase
Summary
OUTPUTrecords with theirMODEL_CALLIDsFixes #93.
Problem
MODEL_CALLalready had an ID, but its durable completion was an ordinaryOUTPUTcorrelated only by position. DirectEventSink.Outputproduced the same shape.An in-process harness could therefore handle a provider error, emit fallback output, and crash before
END. Replay or Resume would consume that fallback as the successful model response and enter a control-flow branch the original execution never took.Durable format
New journaled calls carry:
Direct harness output leaves
Event.model_call_idabsent. The field is proto-optional so absent and explicitly empty remain distinguishable; present-empty is malformed evidence.ModelCall.result_correlationis the compatibility discriminator. Markerless calls retain legacy positional behavior, because old calls already had nonempty IDs and absence of an output ID alone cannot distinguish an old completion from new direct output.Replay and recovery
A shared matcher enforces:
BY_IDcalls consume only an immediately adjacentOUTPUTwith the exact nonempty IDBY_IDis direct output and remains unconsumedErrReplayDivergedOutputcannot consume a correlated model resultA failed re-drive of a pre-v11 positional call cannot immediately append direct fallback output: that would create a newly ambiguous journal. The host fails closed before the fallback append. A fresh model-call retry is still allowed because it records a new
BY_IDcall first.Compatibility
SQLite schema v11 is stamp-only:
Tests
Coverage includes:
BY_IDcall and resultVerification
go test -race -shuffle=on ./controller ./wire ./canon ./sqliteloggo test -race -shuffle=on ./session ./placement ./conformance ./harnesswirego test -race -shuffle=on ./...inintegrations/substratego test -race -shuffle=on ./...inintegrations/claudecodego build ./...go vet ./...buf lintbuf breaking --against ".git#tag=v0.4.0,subdir=api"go run ./hack/doccheck./hack/verify_chain.shgofmt -l .git diff --checkThe repository-wide root test command still reaches the pre-existing Python 3.9 portability failure in
internal/agentsessionsd.TestDocumentedPythonExecutorLogsStorageFailureWithoutPayload; all changed and dependent packages pass, including race-enabled tests.