Skip to content

fix(event): stop the quoting sink from swallowing every audit channel - #8411

Open
esengine wants to merge 1 commit into
main-v2from
fix/costquote-sink-audit-capability
Open

fix(event): stop the quoting sink from swallowing every audit channel#8411
esengine wants to merge 1 commit into
main-v2from
fix/costquote-sink-audit-capability

Conversation

@esengine

Copy link
Copy Markdown
Owner

Found by running reasonix run --trajectory for real while verifying #8404, not
by a test — every test in the tree wires recorders directly and stayed green.

CostQuoteSink forwards Emit but not the optional sink capabilities, so every
recorder below it in a chain receives nothing. In the CLI run chain that is the
stats recorder and the trajectory recorder, both of which sit under it:

inboxEventSink        capable=true
goalUsageTee          capable=true
event.coalescer       capable=true
event.syncSink        capable=true
event.CostQuoteSink   capable=false   <-- chain ends here
stats.Recorder        capable=true    (never reached)
trajectory.Recorder   capable=true    (never reached)

A real research run wrote 2130 event records and zero audit records: no
outcome progress, no readiness audits, no completion reports, no delegation
admissions, no protocol recovery, no workspace mutations.

That matters beyond diagnostics. Those channels carry the shadow samples the EBM
and reasoning-governor experiments were built to compare (ebm_eligible,
governor_engaged, debt_age, blind_mutations), so CLI trajectories have been
empty of them, and cmd/e2ebench has been silently taking its
"older recordings" fallback — the one its own comment notes cannot price scorer
claims — instead of reading recorded samples.

The fix is to embed AuditForwarder, which exists for exactly this case and
whose comment already records the lesson: hand-written forwarding lost
capabilities at multiple wrappers even while their owning tests stayed green.

The quoting sink simply never adopted it.

The regression test drives the package-level dispatchers rather than calling the
methods directly. That matters: the dispatchers are the path the host actually
uses and they no-op silently on a wrapper that lost the capability, so the test
fails with a named channel per capability. Calling the methods directly would
only produce a build error, and only if they vanished outright.

Verified end to end: with the fix, the same reasonix run --trajectory now
records outcome_progress.

Cache-impact: none - sink capability plumbing only; no tool schema, prompt, or provider request surface is touched, so the system-prompt prefix stays byte-identical.
Cache-guard: go test ./internal/boot/ (provider_request golden), unchanged and green.
Documentation-impact: none - no user-facing behaviour or documented contract changes; this restores recording that the docs already assume happens.

CostQuoteSink forwarded Emit but not the optional sink capabilities, so every
recorder below it received nothing. In the CLI run chain that is the stats
recorder and the trajectory recorder: a real `reasonix run --trajectory` wrote
2130 event records and zero audit records — no outcome progress, no readiness
audits, no completion reports, no delegation admissions, no protocol recovery.

The shadow instrumentation those channels carry is the input to the EBM and
reasoning-governor experiments, so their trajectories have been empty of the
samples they were built to compare, and cmd/e2ebench has been silently falling
back to its verification backfill.

Embed AuditForwarder, which exists for exactly this and whose own comment
records the lesson: hand-written forwarding lost capabilities at multiple
wrappers while their owning tests stayed green.

The regression test drives the package dispatchers rather than the methods, so
it fails with a named channel per capability instead of a build error — the
dispatchers are the real path, and a wrapper that loses one no-ops silently.
@esengine
esengine requested a review from SivanCola as a code owner August 11, 2026 15:07
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant