Repository navigation
feat(pm-stack): live outcome-attribution consumer on the aggregator sweep (#10910) - #13022
Merged
Merged
Conversation
…weep (#10910) Wires the #2072 slice-4 outcome projector into the aggregator's live cadence: GithubOutcomeConsumer sweeps the projector hot list under its own consumer checkpoint (pm-aggregator-outcome-v1), next to GithubHotListConsumer, projecting each fixed high-water into the append-only outcome-fact ledger. The ledger cursor is the resume point and advances only after a page's facts are durably written; the projector checkpoint is acked only when the ledger covers the full high-water; fact-id dedupe makes replays no-ops. A failed sweep records a source-gap fact and moves no cursor. Bindings resolve through an OutcomeBindingSource; the wired FileOutcomeBindingSource reads JSONL queue/session binding records (PM_AGG_OUTCOME_BINDINGS_FILE) — a missing file means every fact lands explicitly unattributed, and a corrupt line fails the sweep visibly instead of rendering as no-bindings. Refs #10910 — this lands the live cadence wiring remainder named on the issue; the outcome/rollup view remainder stays open there.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 23, 2026
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.
Lands the live cadence wiring remainder of #10910 (named in felix's PR #12709 landing record): the outcome projector is no longer test-only — it now runs on the aggregator's sweep.
What it does
pm-stack/aggregator/src/outcome-consumer.ts:GithubOutcomeConsumer— sweeps the projector's impl(observability): GitHub webhook ingestion + hot list (#2072 slice 2) #5204 hot list under its own consumer identity (pm-aggregator-outcome-v1) with the same fixed-high-water discipline asGithubHotListConsumer(page-sequence / high-water-stability / next-cursor validation). Per page it resolves bindings and callsOutcomeFactStore.applySweep. The ledger cursor is the resume point and advances only after a page's facts are durably written; the projector checkpoint is acked only when the ledger covers the full high-water; fact-id dedupe makes any replay a no-op. A failed sweep records a source-gap fact in the ledger and moves no cursor; a page-budget-exhausted sweep returnslagging, keeps its durable facts, and acks nothing.OutcomeBindingSource+FileOutcomeBindingSource— bindings are read from JSONL queue/session binding records (PM_AGG_OUTCOME_BINDINGS_FILE). A missing file is an empty source (every fact lands explicitlyunattributed/no-binding, per the spec's no-guessing rule); a corrupt line fails the sweep withoutcome_binding_source_corruptinstead of silently rendering as "no bindings exist".server.ts— the consumer is constructed under the same live + projector-configured condition as the hot-list consumer and runs on the same 60s worker tick, immediately after the hot-list sync; failures log an[activity] WARNINGwith the sync state.config.ts—PM_AGG_OUTCOME_FILE(default~/.local/state/pm-aggregator/outcome-facts.jsonl) andPM_AGG_OUTCOME_BINDINGS_FILE(default~/.local/state/pm-aggregator/outcome-bindings.jsonl).Verification
test/outcome-consumer.test.ts: 8 tests against a fake projector — sweep projects facts + advances cursor + acks; file-source bindings attach job/session/model identities while unbound events stay unattributed; missing bindings file is an empty source; replay/restart append nothing; a failed sweep records a source-gap fact, moves no cursor, acks nothing, and recovers next tick; page-budget partial sweep keeps durable facts and resumes; corrupt bindings file fails visibly; ledger stays append-only JSONL in sweep order. 16/16 pass together with the existing outcome-attribution suite;tsc --noEmitclean.port 4871 in usecollision, reproduced identically (in one file, worse) on a pristine origin/main worktree under the same multi-lane laptop load; none touch this change, and the new wiring is inert outside live mode.Refs #10910 — the issue stays open for its remaining slice: the outcome/rollup view with issue/job drill-through.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.