Skip to content

fix(orchestration): close Spectrum and Run group gaps - #645

Merged
lukemaj merged 1 commit into
mainfrom
fix/515-spectrum-acceptance
Nov 6, 2026
Merged

lukemaj merged 1 commit into
mainfrom
fix/515-spectrum-acceptance

Conversation

@lukemaj

@lukemaj lukemaj commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What: Fix the three Spectrum and Run group acceptance gaps in #515.
Why: Project decoding froze inherited Spectrum fields, Run groups skipped local project validation, and a failed first refresh could strand a settled report.
So what: The coordinator merges under the user's existing approval after CI and fresh exact-head independent review pass.

Closes #515.

Change

  • Decode project Spectrum settings as optional field overlays, retaining slot validation and legacy White-label normalization. The shared resolver inherits omitted environment fields, including later environment changes, while explicit empty slots and null White still win.
  • Validate a local target.projectId before Run group admission or receipt replay, with the same error as single-task delegation.
  • Keep failed watch refresh IDs until indexing succeeds, so the existing 60-second reconciliation tick retries settled Spectrums as well as active ones. No new scheduler or background loop.

These changes support the Objective's working Spectrum council/free modes. The shared settings resolution applies to all clients and server launches; Run group admission is in the MCP service, and wake recovery is provider independent. No client UI, provider protocol, wire method, version, installation, or live-userdata changes. Website impact: none.

Proof

Each defect had a failing test before its production fix. Baseline evidence and the upstream search are recorded on the Issue.

Run separately, one test file at a time:

  • pnpm exec vp test run packages/shared/src/projectSettings.test.ts: 21 passed. The baseline returned council / 2 / 3 instead of environment free / 5 / 7; the fix also preserves later environment changes, slots-only overrides, explicit mode, empty slots and null White.
  • pnpm exec vp test run apps/server/src/mcp/RunGroups.integration.test.ts: 27 passed. Rejects a foreign project without creating children, admits the caller's explicit project, and rejects a foreign-project retry of an existing group.
  • pnpm exec vp test run apps/server/src/spectrum/wakes.integration.test.ts: 15 passed. Runtime sequence: settle a report before startup, temporarily make its persisted state unreadable, observe Spectrum watch refresh failed, restore the state without an event, advance TestClock 60 seconds, observe the report dispatched with its original text. Baseline remained unwoken and hit the unchanged project timeout.

Fresh verification on rebased head 1032ba22ad1f88c5625879ddaefed8230b6a8fb6, based on live main 653c85f22dce389527cc44ff37dd99d9237d3693: the three focused files above passed again, one at a time. VITEST_MAX_WORKERS=1 pnpm exec vp run check:changed --concurrency 1 ran once and passed formatting, lint, both Knip checks, GraphQL generation, all 36 affected package typechecks and all 202 tests in 9 files. bash scripts/fork-check.sh --upstream upstream passed on this exact head. CI owns the full suite; no real provider turns or live-userdata writes were used.

The rebase retains sibling PRs #640, #642, #643, #644, #628, #641 and #646. The only conflict was the Spectrum feature-map row, resolved by preserving both #293 and #515. git range-diff confirms the implementation/regression patch is unchanged, and all eight code/test files are byte-identical to the previous reviewed head. The branch was pushed with an explicit force-with-lease against 3e8d01f4d805fcd795e0d9d57fd5bdc301cc515c; fresh independent review is required on the new SHA.

Elon record

Requirements and who asked: User and #515 require the three acceptance fixes, focused failing-then-passing regressions, one PR, independent review and no merge.
Deleted: No Spec, version bump, new scheduler, client redesign or unrelated refactor; retain project Spectrum configuration as a partial overlay.
Bottleneck: Faithful regression proof and serial local verification after memory pressure; CI runs the suite.
Checked myself: Read #515 in full with comments, searched upstream main/open PRs/Issues, inspected the real schema/resolver and both delegation paths, reproduced all three failures, and ran each focused file separately.

Model: gpt-6.1-sol. Harness: Codex.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M labels Nov 6, 2026
@lukemaj

lukemaj commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

What: Independent source review found no blocking findings for 3e8d01f4d805fcd795e0d9d57fd5bdc301cc515c against Issue #515.
Why: The candidate closes the three acceptance gaps at their existing settings, delegation and wake boundaries without adding a scheduler or broadening the implementation.
So what: Record review/independent=success for this exact SHA; full CI and human merge approval remain separate gates.

Reviewed exact base ec50dd0af2af1efc261ab0471966141d1a8062d8 and head 3e8d01f4d805fcd795e0d9d57fd5bdc301cc515c, the complete diff, Issue #515 in full with both comments, candidate AGENTS.md, docs/fork.md, and relevant consumers. Live PR base/head match those pins.

No blocking findings:

  • Settings: packages/contracts/src/spectrumSettings.ts:91 makes each project field optional without decoding defaults. packages/shared/src/projectSettings.ts:157 overlays those fields on the current environment value, so later environment edits remain visible. Explicit fields, empty slots and null White win. Both schemas use the same slot validation and legacy White-label normalization; the existing contracts regression still exercises project normalization. The new shared regression checks decode, resolution, later environment edits and explicit values. Launch resolution and the web editor consume the shared effective settings.
  • Run groups: apps/server/src/mcp/OrchestratorMcpService.ts:2337 applies the same local project rule and message as single delegation before request-key/receipt replay. Same-project targets pass; new remote Run groups retain their existing refusal. The extended regression covers foreign-project refusal without children, same-project acceptance and a foreign-project retry using an accepted group's key.
  • Wake recovery and lifecycle: apps/server/src/spectrum/wakes.ts:189 retains a failed initial refresh ID, and the existing tick at line 301 wakes it even when the Spectrum is settled and absent from the watch index. Successful indexing removes the ID, including when the row is missing. Watch replacement, effect-waiter interruption and scoped fiber shutdown remain in their existing owners. With no active watches or failed IDs, the tick retains its one indexed active-row query. The new regression corrupts a settled row before startup, observes the refresh failure, restores it without an event and awaits report dispatch after advancing TestClock.
  • Fork scope: The map covers both affected parts. The newly carried shared settings test is registered to Spectrum in the allowlist and owner registry; the shared resolver remains listed as a dependency. No version bump or unrelated implementation change was found.

Evidence limits: No tests, installs, builds or servers were run during this review, per the memory-pressure constraint. The supplied failing-before outcomes are consistent with the base code and regression assertions; the reported focused results (21/27/15), 202 changed-scope tests and 36 affected typechecks are parent-provided execution evidence, not independently rerun results. GitHub currently confirms successful Lint and Fork Stack Model checks on this exact SHA; full CI is still running. Source review does not claim full-suite success.

Requirements and who asked: User and Issue #515 require the three focused acceptance fixes and independent exact-SHA review.
Deleted: No new Spec, implementation, extra agents, local runtime verification or merge action.
Bottleneck: Establishing correctness from source and retained evidence while avoiding additional machine load.
Checked myself: Read the pinned diff and relevant consumers, compared single/group admission ordering, traced failed-refresh retention and cleanup, inspected regression assertions and checked live PR identity and CI state.

Reviewer model: gpt-6.1-sol. Harness: Codex. Verdict: no blocking findings for 3e8d01f4d805fcd795e0d9d57fd5bdc301cc515c.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Baseline: 653c85f · PR result: 1032ba2 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@lukemaj

lukemaj commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

What: Fresh independent source review found no blocking findings for 1032ba22ad1f88c5625879ddaefed8230b6a8fb6 against Issue #515.
Why: The three acceptance fixes remain correct on the rebased candidate, and the relevant remote-delegation and Spectrum attachment integrations are preserved.
So what: Record review/independent=success for this exact head; the coordinator retains the CI and approved-merge decision.

Reviewed new base 653c85f22dce389527cc44ff37dd99d9237d3693 and new head 1032ba22ad1f88c5625879ddaefed8230b6a8fb6. Read Issue #515 with all three comments, the current PR body, candidate AGENTS.md and docs/fork.md, the complete cumulative PR diff, and relevant consumers. This is existing-component work supporting the Objective's Spectrum behavior; no Spec is required. The old-head verdict was not reused as the verdict for this candidate.

Verdict: no blocking findings on the new head.

  • Project settings: packages/contracts/src/spectrumSettings.ts:91 keeps every project top-level field optional, without filling environment defaults. packages/shared/src/projectSettings.ts:157 overlays those fields on the current environment settings. Omitted fields therefore follow later environment changes; explicit mode/numeric values, empty slots and null White win. Both shapes share slot validation, and both decode paths retain legacy White-label normalization. The existing contracts regression exercises project normalization. The shared regression covers decoding, later environment edits, slots-only overrides and explicit values. The launch service resolves through the shared helper and validates the resulting launch, while scoped web settings use the same effective settings.
  • Run groups: apps/server/src/mcp/OrchestratorMcpService.ts:2337 checks a local target.projectId before request-key lookup and group receipt replay, using the single-task rule and error. Explicit same-project targets pass. Remote identification still uses PeerForwarding.remoteTarget, including its same-environment handling, and new remote Run groups retain their refusal before admission. Explicit model/provider, bare, tool-policy and Run=1 paths still pass to single-task delegation. The regression checks refusal without children, same-project admission and rejection of a foreign-project retry of an accepted group.
  • Wake recovery: apps/server/src/spectrum/wakes.ts:189 retains failed refresh IDs; line 301 includes them in the existing 60-second tick even when a settled Spectrum never entered watches. A successful read/index clears the failed ID, including a missing row. Existing index replacement still removes obsolete thread interests and interrupts obsolete effect waiters; fibers remain scoped. The idle tick adds no database scan and retains its indexed active-row query. The regression makes an already-settled row unreadable before startup, awaits the actual refresh failure, restores it without an event and awaits dispatch after advancing TestClock.
  • Sibling integration: Git history contains all seven sibling commits, fix(research): normalize extracted whitespace in linear time #640, fix(scheduled-tasks): own same-key manual dispatch recovery #642, fix(contextmd): acknowledge full Codex cmd reads #643, fix(spectrum): acknowledge attachment transcript delivery #644, fix(preview): keep human control across viewer disconnects #628, fix(server): settle refused remote delegated launches #641 and fix(clients): show accurate child status in Lineage #646, beneath the pinned base. Inspected their production integration changes, with particular attention to fix(server): settle refused remote delegated launches #641's PeerForwarding, PeerMcpClient, remote launch settlement and destination refusal receipts, and fix(spectrum): acknowledge attachment transcript delivery #644's attachment handler, success union, providerless intake and regression. The new guard only rejects local project mismatches and leaves remote single-task forwarding and its refusal/uncertainty lifecycle intact. Spectrum attachment intake still persists transcript messages and returns a null-run transcript acknowledgement; its non-streaming message events still reach the Spectrum's existing event wake path. The wake retry change does not replace intake, attachment claims, dispatch receipts or report-delivery policy. The other sibling changes remain in their separate research, scheduling, ContextMD, browser-control and Lineage owners.
  • Rebase and fork evidence: git rev-list --parents shows the new head is one single-parent commit directly on the pinned new base. git range-diff ec50dd0af2af1efc261ab0471966141d1a8062d8..3e8d01f4d805fcd795e0d9d57fd5bdc301cc515c 653c85f22dce389527cc44ff37dd99d9237d3693..1032ba22ad1f88c5625879ddaefed8230b6a8fb6 shows only the Spectrum map context adjustment, retaining both Spectrum attachment sends append before failing the ordinary run receipt #293 and fix: follow-ups from the #393 final train review #515. Direct old/new tree comparison of all eight implementation/regression files returned no differences. The complete new-base-to-head diff contains the scoped fixes and their fork registry/map bookkeeping. Live PR identity and git ls-remote origin both match the new pins, and GitHub reports MERGEABLE.

Evidence limits: This was source-only review. No tests, builds, installs, servers, extra agents, process cleanup or Git mutations were performed. The reported fresh focused results (21/27/15), serial changed-scope gate (202 tests and 36 affected typechecks) and fork guard are coordinator-provided execution evidence, not independently rerun results. The original failing-before evidence remains on Issue #515; the regression assertions and original base code support those failure mechanisms. GitHub currently shows successful Lint, Fork Stack Model, native fingerprint and Release Smoke checks, with build/typecheck and test jobs still running. This review does not claim full CI success and does not authorize a merge.

Requirements and who asked: User and Issue #515 require the three acceptance fixes, preservation of both sides of the rebase and a fresh independent verdict on the exact new head.
Deleted: No Spec, implementation, additional agents, local runtime checks, merge or watch action.
Bottleneck: Exact-candidate source and integration verification under the explicit memory-pressure constraint.
Checked myself: Read the full pinned diff and relevant consumers, compared admission ordering and schema/resolution behavior, traced retry cleanup and event delivery, inspected sibling integration changes, verified range-diff/blob identity, and checked live PR pins, authentication and CI state.

Reviewer model: gpt-6.1-sol. Harness: Codex.

@lukemaj
lukemaj merged commit 06b3a74 into main Nov 6, 2026
28 of 29 checks passed
@lukemaj
lukemaj deleted the fix/515-spectrum-acceptance branch November 6, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: follow-ups from the #393 final train review

1 participant