Skip to content

feat(pm-stack): live outcome-attribution consumer on the aggregator sweep (#10910) - #13022

Merged
dezren39 merged 1 commit into
mainfrom
lane-io-10910
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-io-10910

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

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

  • New 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 as GithubHotListConsumer (page-sequence / high-water-stability / next-cursor validation). Per page it resolves bindings and calls OutcomeFactStore.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 returns lagging, 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 explicitly unattributed / no-binding, per the spec's no-guessing rule); a corrupt line fails the sweep with outcome_binding_source_corrupt instead 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] WARNING with the sync state.
  • config.ts — PM_AGG_OUTCOME_FILE (default ~/.local/state/pm-aggregator/outcome-facts.jsonl) and PM_AGG_OUTCOME_BINDINGS_FILE (default ~/.local/state/pm-aggregator/outcome-bindings.jsonl).

Verification

  • New 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 --noEmit clean.
  • Full aggregator suite on the worktree: 3063 pass / 22 fail — every failure is a server-boot timeout or port 4871 in use collision, 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.


Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 360821c2-580b-4f72-8d1a-a00e2480979e
Commits

Reviewing files that changed from the base of the PR and between ab12d7f and f99c848.

Files selected for processing: 4

  • pm-stack/aggregator/src/config.ts
  • pm-stack/aggregator/src/outcome-consumer.ts
  • pm-stack/aggregator/src/server.ts
  • pm-stack/aggregator/test/outcome-consumer.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T07:15:50.954130Z f99c848 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant