GeezerVison is showing github.com — fix(aggregator/orchestrator): orchestration section rejected — provenance is an object, isOrchestrationSection requires a string · Issue #1110 · developing-today/code
fix(aggregator/orchestrator): orchestration section rejected — provenance is an object, isOrchestrationSection requires a string #1110DescriptionSummary
The orchestration section is currently rejected fleet-wide by the aggregator: /api/orchestration.json reports "absent", /today falls back to derived mode, and the /program page's orchestration-freshness card reads "no orchestration section in the current feed yet" — even though the orchestrator publishes hourly and the collector embeds its section in the fleet feed.
Root cause is a contract-shape drift on one field, verified 2026-10-26 from both sides:
- Publisher (orchestration-pass,
orchestration.json): provenance is an object — { "sources": [ "fleet-feed.json …", "laptop attention via laptop-ssh …", … ] }. Verified in the latest published file (run orch-2026-10-27T03:14:56Z).
- Aggregator check (
pm-stack/aggregator/src/feed.ts, isOrchestrationSection, line ~92): requires typeof s.provenance === "string". The type in pm-stack/aggregator/src/model.ts (~line 455) likewise declares provenance: string ("Sources + run, human-readable").
So the check fails on every current feed, and src/sources/live.ts (~lines 587, 791) never takes the live-orchestration branch.
Background
Fix options (pick one, apply consistently)
- Publisher aligns to the existing contract — orchestrator emits
provenance as a single human-readable string (its sources[] joined), and the orchestration-pass cron body's CONTRACT FIDELITY section / pre-publish self-check is updated to pin the string form so it cannot drift again.
- Aggregator aligns to the publisher —
OrchestrationSection.provenance becomes the object shape (or string | { sources: string[] }), isOrchestrationSection validates that shape, and the render/provenance-string usages summarize it.
Either is acceptable; what matters is that publisher, cron-body contract text, aggregator type, and validator all agree afterward. Option 1 is the smaller change; option 2 keeps the richer per-source detail. The chooser should record which contract won, in the PR and on #899's contract notes if they are amended.
Acceptance
- With a current fleet feed,
/api/orchestration.json on the laptop aggregator returns the live section (tiers/goals/dependencies) instead of {status: "absent", …}.
/today renders from the orchestration section (not labelled derived), and /program's freshness card shows the section's run id / generated-at.
- A regression test feeds an orchestration section in the chosen shape through
isOrchestrationSection / the live source and asserts acceptance; a mismatched-shape section still fails closed to "absent" rather than crashing.
- The orchestration-pass publisher's self-check validates the same shape the aggregator accepts (no silent drift path).
Scope notes
- Small, bounded fix. No new fields, no Project writes, no dashboard redesign.
- Refs: impl(orchestrator): recurring orchestration job — queue triage, priority ladder, blocker awareness, goal measurement #899 (orchestrator), impl(aggregator): slice 2 — mobile, needs-Drew/needs-orchestrator tiers, time-granular roadmap, session clarity #898 (dashboard contract), Dashboard: add program status/roadmap page (/program) #1046 (where this was found).
Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 27, 2026 Agent note — pickup (2026-10-26, Muse): Implementing the fix end-to-end under epic #1184.
Contract decision: option 2 — the aggregator aligns to the publisher. The publisher's object form provenance: { sources: string[], runId: string } wins: it is strictly richer (per-source notes), it is what every current run actually emits (verified in run orch-2026-10-27T03:14:56Z and in the live fleet feed on the laptop, generated 04:06:59Z, section present with needsDrew 11 / needsOrchestrator 9), and no consumer reads section.provenance as a string today — only the validator's type check rejects it.
Design:
OrchestrationSection.provenance becomes the object shape in model.ts; isOrchestrationSection validates it (sources = string array; runId optional string).
- Normalization at the boundary, per the
progressedSinceLastRun string-or-array precedent (PR Fix /today 500: tolerate string-shaped progressedSinceLastRun #989): the validator also accepts the legacy plain-string form and a normalize step converts it to { sources: [string] }, so the collector, the live source, and /api/orchestration.json all see exactly one shape. A malformed provenance (number, object without sources, non-string sources) still fails closed.
- Regression tests fixture the REAL published shape from the current orchestration.json so this drift class fails loudly in tests.
- The orchestration-pass cron body's publish step will be amended to pin the object shape explicitly (its current wording — 'provenance (the sources you read + the run id)' — is what allowed the drift).
- Same pass: the live source will distinguish absent vs present-but-invalid in its provenance line (that misdiagnosis is fix(aggregator): health/footer misdiagnoses a rejected orchestration section as 'has not published' - distinguish absent vs invalid #1140; fixing it here since it is the same code path).
Before values (laptop, live): /api/orchestration.json = {status: absent}; /api/today.json fromOrchestrator = false; /api/health orchestration = 'none yet — has not published'. After values will be posted on completion. dezren39 commented on Oct 27, 2026 Agent note — complete (2026-10-26, Muse). Closed by PR #1244, merge commit 2f06933d1564cefe38d6c10202903ab46e98a97f (cross-verified via gh + git log origin/main). CI: treefmt ✓, Nix flake evaluation ✓, run ✓ (treefmt needed one formatting commit with the schema-pinned biome 2.3.2 — the #1060/#1142 class). Local: bun test 150 pass / 0 fail (143 pre-change + 7 new), tsc clean.
Winning contract (option 2, as picked up): the publisher's object form. OrchestrationSection.provenance is now OrchestrationProvenance { sources: string[]; runId?: string }. The validator accepts that object plus the legacy plain-string form, and normalizeOrchestrationSection converts a string to { sources: [it] } at the boundary (collector embed + live source), so exactly one shape is ever served. Malformed provenance still fails closed, and orchestrationSectionProblem() names the first failing check — it is the single source of truth behind the guard, so diagnosis cannot drift from the gate. Regression tests fixture the real published shape (run orch-2026-10-27T03:14:56Z).
Publisher side aligned in the same pass: the orchestration-pass cron body's publish step now pins the object shape explicitly (with a pre-publish assertion), replacing the ambiguous 'sources you read + the run id' wording that allowed the drift.
Deployed to the laptop aggregator (pull → 2f06933, install.sh, explicit restart 2026-10-26 23:59:14 CDT). Live before → after:
- /api/orchestration.json:
{status: absent} → the real section. At verify time both the API and the on-disk orchestration.json were run orch-2026-10-27T04:13:53Z: needsDrew 11, needsOrchestrator 9, goals 8, dependencies 9, provenance served as the object (8 sources).
- /api/today.json: fromOrchestrator false → true (16 objectives).
- /attention: 'Needs Drew (0)' (false) → Needs Drew (11).
- /program + /program/pm-dashboard + /today footers: 'no orchestration section yet' → 'live (orchestration section orch-2026-10-27T04:13:53Z)'; /api/health agrees.
- /, /projects, /roadmap, /quota all still 200.
Note on the collector: the running sandbox collector (~/git/pm-feed checkout) predates the string check and already embedded the section unchecked — which is why the feed carried it while the aggregator rejected it. The repo collector now shares the fixed validator + normalization and takes effect whenever that checkout next updates; no bulk pull was done (out of scope for this fix).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|