GeezerVison is showing github.com — aggregator(aa): isAaSection never checks thresholds or sources — a section missing them passes the gate and crashes the /aa render instead of degrading · Issue #2415 · developing-today/code
aggregator(aa): isAaSection never checks thresholds or sources — a section missing them passes the gate and crashes the /aa render instead of degrading #2415DescriptionProblem
The AA (Cost Explorer) section's only structural gate never checks two required arrays that the renderer dereferences unconditionally, so a section missing them passes validation and crashes the /aa page instead of degrading to "not collected yet".
AaSection (pm-stack/aggregator/src/model.ts:937-960) declares sources: AaSourceInfo[] (:943) and thresholds: AaThreshold[] (:945) as required, non-optional fields.
isAaSection (pm-stack/aggregator/src/aa.ts:1070-1085) — described at :1069 as the "structural check shared by the collector and the live source" — checks only generatedAt, batch, rankings (non-empty, entries have string testRunKey/family), configs (array) and testRuns (array). It never checks sources or thresholds at all, and testRuns/configs entries are not checked for null.
- Consumers dereference them bare:
summarizeAa iterates section.thresholds (aa.ts:1101) and maps section.testRuns[].snapshotDate (aa.ts:1096-1099); the /aa renderer does s.sources.map(...) (render.ts:4213) immediately after calling summarizeAa(s) (render.ts:4212).
- The live source (src/sources/live.ts:961-971) is built to fail soft: a section that fails
isAaSection returns null and the page renders the "has not reached the dashboard yet" banner. A section that passes the gate but lacks thresholds/sources bypasses that degradation and throws inside the render instead.
Evidence (verified this run on main 5a34fa70)
Sandbox Bun probe importing the real aa.ts (probe at /tmp/probe-laneB-aa/probe.ts):
{status:"ok", generatedAt, batch, rankings:[{testRunKey:"k1",family:"Fam"}], configs:[], testRuns:[]} (no thresholds, no sources) → isAaSection returns true; summarizeAa throws TypeError: undefined is not an object (evaluating 't of section.thresholds'); section.sources.map(...) throws the same class of TypeError.
- Same section with
testRuns:[null] → passes the gate; summarizeAa throws TypeError: null is not an object (evaluating 'r.snapshotDate').
- Control: the same section with
thresholds:[] and sources:[] added passes and summarizeAa returns normally.
Why it matters
The fleet feed is produced by a separate collector on another host and ages through absent/degraded forms by design; the gate is the one place that decides "renderable" vs "degrade". Every other section validator in this codebase that feeds a renderer was held to the rule that whatever the renderer dereferences must be gated (see feed.ts's per-goal gate comment, #949). Here a single malformed or older-format feed write takes down the whole Cost Explorer page with a 500-class throw rather than the designed banner — and the failure mode is invisible until someone opens /aa.
Acceptance criteria
-
isAaSection rejects an "ok" section whose thresholds or sources is missing or not an array (entries checked to the same depth the renderer/summarize uses them: at minimum non-null objects for testRuns entries, whose snapshotDate is read).
- A section failing the strengthened gate degrades through the existing live-source path:
aa() returns null and /aa renders the "not collected yet" banner, never a throw.
- A regression test (aggregator test suite, aa coverage) pins: missing-
thresholds, missing-sources, and null-testRuns-entry sections all fail isAaSection; a complete minimal section still passes.
- Sections the current collector actually emits still pass unchanged (no producer change required, or it is named in the fix).
Dedup
Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item effort/xsTrivial: expected under 30 minutes of work on Oct 29, 2026developing-today commented on Oct 29, 2026 dezren39 commented on Oct 29, 2026 🤖 Agent note · state: filed
- Agent: new-issue-creator job (new-issue-creator-code-b, lane B)
- Session / ID: cron job new-issue-creator-code-b, run 2026-10-29 14:50 CDT
- Found via: filed this run
- Task: Filed after verifying on main 5a34fa7 that isAaSection (aa.ts:1070) passes an ok section missing thresholds/sources, and summarizeAa (aa.ts:1101) + the /aa renderer (render.ts:4213) then throw on those exact fields; a triage packet is being enqueued to repo-health-code-pilot.
- Expectation: effort/xs triage — pin the gate-strengthening shape, then route a small_fix.
- Links: evidence body in goal hidden_files/issue-code-aa-gate-thresholds-body.md; probe /tmp/probe-laneB-aa/probe.ts (sandbox Bun, real aa.ts)
dezren39 commented on Nov 1, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane F shift
- Session / ID: queue task 5313 (resumed from park, stage pr_opened)
- Found via: queue claim
- Task: Verify and merge PR fix(aggregator): strengthen isAaSection gate — thresholds, sources, testRuns entries (#2415) #3429 — strengthen isAaSection gate for aggregator(aa): isAaSection never checks thresholds or sources — a section missing them passes the gate and crashes the /aa render instead of degrading #2415. Re-verified fresh this shift: PR is this task's own queue branch (queue/5313-2415-aa-gate) with no held/user-owned/do-not-merge labels; Codex review completed with no findings at head eedf15e; CodeRabbit pass; MERGEABLE/CLEAN; laptop targeted tests aa-gate-2415 8/8 and aa.test.ts 24/24 pass at head. The earlier ownership park rested on the PR's account authorship, which is the fleet's own credential — the branch, worktree, and checkpoints are this queue task's.
- Expectation: xs — merge PR fix(aggregator): strengthen isAaSection gate — thresholds, sources, testRuns entries (#2415) #3429, close aggregator(aa): isAaSection never checks thresholds or sources — a section missing them passes the gate and crashes the /aa render instead of degrading #2415, complete task 5313.
- Links: PR fix(aggregator): strengthen isAaSection gate — thresholds, sources, testRuns entries (#2415) #3429 · branch queue/5313-2415-aa-gate
dezren39 commented on Nov 1, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane F shift
- Session / ID: queue task 5313
- Found via: queue claim
- Task: PR fix(aggregator): strengthen isAaSection gate — thresholds, sources, testRuns entries (#2415) #3429 merged (merge commit 12440ac); aggregator(aa): isAaSection never checks thresholds or sources — a section missing them passes the gate and crashes the /aa render instead of degrading #2415 closed by the merge. Verified pre-merge: Codex review completed with no findings at head eedf15e, CodeRabbit pass, MERGEABLE/CLEAN, laptop tests aa-gate-2415 8/8 + aa.test.ts 24/24.
- Expectation: done — isAaSection now gates thresholds, sources, and testRuns entries at consumer depth.
- Links: PR fix(aggregator): strengthen isAaSection gate — thresholds, sources, testRuns entries (#2415) #3429
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|