Skip to content

fix(orchestrator): delete SystemOrchestrator stub + retarget test runner (#1196) - #1240

Merged
joelteply merged 3 commits into
canaryfrom
fix/delete-system-orchestrator-stub-1196
May 14, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fix/delete-system-orchestrator-stub-1196

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Closes #1196.

Smell

src/system/core/SystemOrchestrator.ts was a 272-line scaffold where every method threw 'Not implemented'. The SystemOrchestration factory (forDevelopment, forTesting, forValidation, forCLI) wrapped these throwing methods, so callers got a friendly entry point that exploded at runtime the moment it tried to plan actions.

Found while fixing #1120: scripts/test-with-server.ts was calling SystemOrchestration.forTesting() and would have crashed cold the first time the system needed a fresh start.

Fix

The real orchestrator already exists at src/system/orchestration/SystemOrchestrator.ts (1486 LOC, exports systemOrchestrator singleton). Its orchestrate(entryPoint, options) method understands 'npm-test' as one of the EntryPointType values declared in SystemMilestones.ts:125 — requiring SERVER_READY + BROWSER_READY milestones, exactly what the test runner needs.

This PR:

  • Deletes src/system/core/SystemOrchestrator.ts (the 272-line stub)
  • Retargets the single caller (scripts/test-with-server.ts:257) to systemOrchestrator.orchestrate('npm-test')
  • Improves the error path to surface result.error from the orchestrator instead of the previous vague `'System startup failed for npm-test mode'` message

Verification

  • npm run build:ts — clean compile
  • grep -rn "SystemOrchestration\|system/core/SystemOrchestrator" returns only the in-line comment explaining the migration
  • ESLint baseline ratcheted -1 (5462 → 5461) — the deleted stub had 1 baseline error

Why this is the right call

The card raised two options:

  1. Implement the orchestrator
  2. Delete + retarget to whatever actually works

Option 2 is correct because the real implementation already exists — the stub at system/core/ was dead-on-arrival, and adding a second working orchestrator would have violated the "one logical decision, one place" compression principle from CLAUDE.md.

CLAUDE.md alignment

Don't add features, refactor, or introduce abstractions beyond what the task requires. [...] No half-finished implementations either.

The stub was a textbook half-finished implementation. Deleted.

Test added 2 commits May 14, 2026 15:15
…ner (#1196)

`src/system/core/SystemOrchestrator.ts` was a 272-line scaffold where
every method threw 'Not implemented'. The factory `SystemOrchestration`
exposed friendly entry points (`forDevelopment`, `forTesting`,
`forValidation`, `forCLI`) that all routed through the throwing methods,
so any caller hit a runtime error the moment it tried to plan actions.

The real orchestrator lives at `src/system/orchestration/SystemOrchestrator.ts`
(1486 LOC) and exports the `systemOrchestrator` singleton. Its
`orchestrate(entryPoint, options)` method already understands `'npm-test'`
as one of the `EntryPointType` values, requiring SERVER_READY +
BROWSER_READY milestones — exactly what the test runner needs.

Single caller of the stub was `scripts/test-with-server.ts:257`
(wired in by continuum#1120). Retargeted to
`systemOrchestrator.orchestrate('npm-test')`. Error path now surfaces
the orchestrator's `result.error` field instead of a vague generic
'System startup failed' message.

`npm run build:ts` clean.

Half-finished implementation rule (CLAUDE.md): deleted rather than
preserved as a "we'll fill it in later" stub.
The deleted SystemOrchestrator stub had 1 ESLint baseline error.
Locking the win in this PR per pre-push ratchet contract.
@joelteply
joelteply merged commit 09412be into canary May 14, 2026
4 checks passed
@joelteply
joelteply deleted the fix/delete-system-orchestrator-stub-1196 branch May 14, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant