Repository navigation
Coordinate aggregate recording for hook invocations - #330
Open
gmemuriuki wants to merge 2 commits into
Open
gmemuriuki wants to merge 2 commits into
gmemuriuki wants to merge 2 commits into
Conversation
gmemuriuki
added this pull request to stack #331
October 8, 2026 18:34
gmemuriuki
force-pushed
the
telemetry/aggregate-recording-coordinator
branch
2 times, most recently
from
October 14, 2026 07:51
607e9c4 to
73cf76e
Compare
nikomatsakis
force-pushed
the
telemetry/aggregate-recording-coordinator
branch
from
October 16, 2026 09:02
73cf76e to
12e8ffe
Compare
gmemuriuki
force-pushed
the
telemetry/aggregate-recording-coordinator
branch
from
October 20, 2026 13:23
12e8ffe to
f88e0f3
Compare
Define one invocation-scoped input that carries the hook result, each plugin attempt, and an optional skill signal. Derive plugin totals from that collection so callers cannot supply counters that disagree with the rows staged later. Validate the consent-version-one extension agent and hook-to-phase mapping before private aggregate state is opened. Add shared aggregate family vocabulary and wire-label formatting for typed diagnostics. Keep the coordinator dependency explicit with temporary dead-code expectations that the next commit removes.
Stage hook, plugin-hook, and optional extension-invocation rows from one normalized input. Derive plugin totals from that input, edit an owned metric snapshot, and keep copy-on-write private stages for all three families alive together. Check snapshot day ownership before opening private stages, propagate every selection and row error, and preflight poisoned stages before the three infallible commits. Failures discard the complete staged unit; success returns an unpublished token for persistence. Add coverage for mid-loop plugin rollback, later-family failure, recovery, rollover, repeated buckets, and the three-family success path. Update the recording contract and module map with the new atomicity boundary.
gmemuriuki
force-pushed
the
telemetry/aggregate-recording-coordinator
branch
from
October 20, 2026 13:26
f88e0f3 to
e16e922
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR coordinates aggregate recording for one complete hook invocation.
One input carries the hook result, every plugin attempt, and an optional skill observation. The hook row's plugin totals are derived from that collection, so claimed counters cannot disagree with the plugin attempts supplied to the coordinator.
The coordinator owns the metric snapshot, opens all three private stages, checks snapshot-day ownership, and applies hook, terminal plugin-hook, and optional extension-invocation rows as one staged unit. Any selection or row-update failure discards the snapshot and all three private stages. Success returns an unpublished value for the later persistence transaction.
Tests cover non-terminal plugin attempts, mid-loop plugin failure, later-family failure, cross-family
event_idmismatch, rollover, recovery, repeated plugin buckets, and the complete three-family success path.Disclosure questions
AI disclosure.
Questions for reviewers.
Does the invocation input make plugin-count disagreement unrepresentable, and is the all-or-none in-memory staging guarantee clear without reading as a durability promise?