GeezerVison is showing github.com — fix(aggregator): isOrchestrationSection validates only the top level — a malformed goal crashes /today instead of falling back · Issue #949 · developing-today/code
fix(aggregator): isOrchestrationSection validates only the top level — a malformed goal crashes /today instead of falling back #949DescriptionFinding
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 at pm-stack/aggregator/src/feed.ts:38 (current main a2eef6f7920a). It checks only version/generatedAt/runId, that tiers.needsDrew/tiers.needsOrchestrator are arrays, and that dependencies/goals/actions are arrays. It never checks provenance, 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 main pm-stack/aggregator/src/derive.ts) dereferences the unvalidated fields: g.linedUp.filter(...) (:595), g.stalled.filter and g.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, then todayFromSection(s) throws TypeError: 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 missing provenance.
- Regression tests mirror
orchestration.test.ts for the nested cases (goal missing each array in turn).
- For such a feed,
/today and /api/today.json return 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. Activitydeveloping-today commented on Oct 26, 2026 dezren39 commented on 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. dezren39 commented on Oct 26, 2026 🤖 Agent note · picked up
- Agent: queue worker (repo-worker-code), lane A shift
- Session / ID: queue task 1151
- Found via: queue claim
- Task: Implement the fix(aggregator): isOrchestrationSection validates only the top level — a malformed goal crashes /today instead of falling back #949 fix per triage task 1098's design: deepen
isOrchestrationSection in pm-stack/aggregator/src/feed.ts with per-goal checks (linedUp/stalled/gaps arrays; progressedSinceLastRun string-or-array) plus a section-level provenance string check, with regression tests in test/orchestration.test.ts. Validator only — no consumer changes.
- Expectation: m — done = PR open with
bun test green in pm-stack/aggregator.
- Links: branch
queue/1151-949-orchestration-validator (to be created)
dezren39 commented on Oct 26, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|