Repository navigation
Description
Finding
isOrchestrationSection validates only the orchestration section's top level, but the today-view consumer dereferences nested per-goal arrays unconditionally. A section that passes the validator can still crash /today and /api/today.json with a TypeError instead of falling back to the locally derived view.
Evidence
- PR feat(aggregator): orchestration section in the fleet feed + /api/orchestration.json #900 (commit
92d17e356135) added the validator atpm-stack/aggregator/src/feed.ts:38(current maina2eef6f7920a). It checks onlyversion/generatedAt/runId, thattiers.needsDrew/tiers.needsOrchestratorare arrays, and thatdependencies/goals/actionsare arrays. It never checksprovenance, nor any per-goal field, nor tier-item fields. - PR feat(aggregator): slice 2 — mobile, needs-Drew/orchestrator tiers, roadmap horizons, today view, session clarity #901's
todayFromSection(current mainpm-stack/aggregator/src/derive.ts) dereferences the unvalidated fields:g.linedUp.filter(...)(:595),g.stalled.filterandg.linedUp.flatMap(:614-615),...g.gaps(:622),g.progressedSinceLastRun(:618),section.actions.slice(:630). - Reproduced against current main with a section whose single goal omits
linedUp:isOrchestrationSection(s) === true, thentodayFromSection(s)throwsTypeError: undefined is not an object (evaluating 'g.linedUp.filter'). - PR feat(aggregator): orchestration section in the fleet feed + /api/orchestration.json #900's own tests (
pm-stack/aggregator/test/orchestration.test.ts:50,56) only reject a wrong version / missing top-level tier arrays — no nested-shape case exists.
Why it matters
The section is produced by an LLM-run orchestration job writing JSON by hand — exactly the producer a structural check exists to fail-soft against. The validator's documented contract (feed.ts comment: "Absent or malformed = 'not measured'") promises the derived fallback; instead, one malformed goal takes down the today view with a 500, which is the aggregator's headline page.
Acceptance criteria
- The validator rejects (or the consumer tolerates) a goal missing any of
linedUp/stalled/gaps/progressedSinceLastRun, and a section missingprovenance. - Regression tests mirror
orchestration.test.tsfor the nested cases (goal missing each array in turn). - For such a feed,
/todayand/api/today.jsonreturn the locally derived view, not an error.
Found by the pr-diff-review job reviewing PRs #900 and #901 against current main (one finding covering both PRs: #900 introduced the validator, #901 the consumer). Dedupe: searches for isOrchestrationSection / orchestration linedUp validator returned only the closed implementation issue #899.
Activity
developing-today commentedon Oct 26, 2026
CODE-161
dezren39 commentedon Oct 26, 2026
Agent note — state: filed; Agent: pr-diff-review job; Session/ID: pr-diff-review run 2026-10-25 23:37 CDT; Found via: filed this run (PR diff review against current main a2eef6f). A repo-task/v1 packet for this issue is being enqueued to the repo-health-code-pilot queue.
8 remaining items
dezren39 commentedon Oct 26, 2026
🤖 Agent note · picked up
isOrchestrationSectioninpm-stack/aggregator/src/feed.tswith per-goal checks (linedUp/stalled/gaps arrays; progressedSinceLastRun string-or-array) plus a section-levelprovenancestring check, with regression tests intest/orchestration.test.ts. Validator only — no consumer changes.bun testgreen in pm-stack/aggregator.queue/1151-949-orchestration-validator(to be created)style(aggregator): biome-format feed.ts and orchestration.test.ts (#949)
fix(aggregator): deepen isOrchestrationSection to per-goal fields (#949…
dezren39 commentedon Oct 26, 2026
🤖 Agent note · done
isOrchestrationSectionnow validates per-goal fields (linedUp/stalled/gaps arrays; progressedSinceLastRun string-or-array) and section provenance, so a malformed goal fails validation and /today falls back to the derived view instead of crashing. Full aggregator suite (130 tests) and typecheck green locally; CI green after a biome format fix.fixed_merged.