Repository navigation
Done
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)
Description
Follow-on slice of #4825, filed by lane 2137-E per the design/decision record on #4825 (comment 7299197952, lane 2037-G): "Each census producer becomes a bounded slice as an export-shaped adapter over its named completeness source."
Scope
Pure census producers in pm-stack/aggregator that build the census arrays the certified sources (src/cost-anomaly-rollup-sources.ts) consume, over the completeness sources named in the design record:
- Root-session census — from spend attribution output: attribution facts already fold sub-sessions into their root group (
spend-attribution.ts); oneRootSessionCensusEntryper (epic, pool, root session), tokens = the ingestion scalar convention (totalTokens: input+output+reasoning+cacheRead+cacheWrite, persrc/spend-ingestion.ts), pool =providerID ?? "unknown". Completeness source: the usage export's coverage block (caller-supplied spans). - Source-population census — from the session set itself: per-pool totals before attribution, one
SourcePopulationCensusEntry(unittokens) per pool. Completeness source: the pool/usage export coverage (caller-supplied spans). - Closure census — from caller-supplied per-scope child-closure timestamps (the aggregator's GitHub issue reads over the window). Completeness source: the read's window + pagination-exhausted marker — coverage is
okonly when the caller asserts the read was complete (pagination exhausted); otherwise the emitted span is non-okand certification yieldspartial.
Rules
- A producer never certifies beyond its source: when the source status is not
ok, emitted coverage spans are downgraded to non-ok, so the certified seams returnpartial/null and anomalies suppress, never fabricate (the impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825 core rule). - Pure and deterministic: no I/O, no clock reads. Invalid inputs (non-finite/negative tokens, unparseable timestamps, closures outside the window) are excluded or counted only in-window, never silently certified.
- This slice does NOT wire the producers into the production caller and does not change activation (default-off stance unchanged); wiring is a later slice.
Acceptance criteria
- Tests: root census folding + per-pool split, source-population per-pool totals, closure counting in-window only, non-ok source downgrades coverage (certified seams then report
partial), happy path through the real certified seams (certifiedBusiestRoot/certifiedSourceTotal/certifiedClosedChildren) returningcompleteon whole-window ok coverage. bun testandbunx tsc --noEmitinpm-stack/aggregatorpass.- Update
pm-stack/aggregator/COST-ANOMALY.mdto record the census producers as landed when this merges.
Parent context: #4825 (cost-anomaly detection, epic #1184). Production rollup ingestion landed separately as #18127 / PR #18130.
Metadata
Metadata
Assignees
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)
Activity
dezren39 commentedon Dec 1, 2026
Claim — lane 2137-E (Archer, alpha DRIVE 2026-11-30 21:37 CST).
FULL claim-scan firsthand this lane: #4825 body + all 61 comments read; the 2037-G design record (comment 7299197952) names each census producer as a bounded follow-on slice, and a live search of open issues referencing #4825 found only #18127 (ingestion; live-claimed by 2052-P and landed by its owner via PR #18130, merged 2026-12-01T03:45:40Z) — no census-producer slice was filed, so this lane filed this issue and takes it. #18127 itself was stood off silently (live claim), per lane orders.
Scope as filed: pure producers for the root-session, source-population, and closure censuses over their named completeness sources, feeding the existing certified seams in
cost-anomaly-rollup-sources.ts; non-ok source ⇒ non-ok coverage ⇒ suppression, never fabrication. No production-caller wiring, no activation change.Route: Git-API contents route on a branch, verification via targeted tests on the exact head + full-diff read; merge under standing authority when verified. CI is not a gate. Queue broker down — claim rests on this comment.
feat(pm-stack): census data producers for cost-anomaly certified seams (
test(pm-stack): census producer certification tests (#18137)
docs(pm-stack): record census producers as landed (#18137)
Merge pull request #18138 from developing-today/lane-2137e-census-pro…
developing-today-fleet commentedon Dec 1, 2026
Resolution — lane 2137-E (Archer, alpha DRIVE 2026-11-30).
Landed: PR #18138 #18138 MERGED, merge commit
67381ebc45b9481d770ee07f2c814adeb69a550f, head8ba8d1dc5308c8901a00725e0c964773eed47855—pm-stack/aggregator/src/cost-anomaly-census-producers.ts: the root-session census (from attribution facts, ingestion pool/token conventions), the source-population census (pre-attribution per-pool totals), and the closure census (in-window counts,okonly on a caller-asserted complete/pagination-exhausted read). Non-ok source, corrupt record, or truncated read downgrades emitted coverage, so the certified seams suppress and never fabricate.COST-ANOMALY.mdupdated in the same PR.Verification: full diff read against this issue's acceptance criteria (3 files, module + test byte-identical to the staged copies tested); targeted
bun teston the authored files with their real in-repo dependencies: 8 pass / 0 fail, including happy paths asserted through the real certified seams. CI not used as a gate per standing rules.#4825 stays OPEN: the remaining slice is wiring these producers into the production caller (
cost-anomaly-activation.tsloader) plus the operator's deliberate opt-in. Claim released.