Repository navigation
feat(orchestrator): Phase 3 — execute + rollback for stack-orchestrator-mcp - #8
Merged
Merged
Conversation
…or-mcp Ports polystack/poly-orchestrator-lsp/lib/orchestrator/executor.ex + lsp_client.ex to Deno per handover/cartridge-02-phase-3-execute-rollback.adoc. Wires the `stack_execute_phase` and `stack_rollback` MCP tools. New adapter modules: - adapter/executor.ts: phase loop, parallel-group dispatch, retry, output propagation, dryRun matrix, maxParallel slicing - adapter/lsp_client.ts: LspClient interface + StdioLspClient (spawns per-cartridge subprocesses, JSON-RPC over stdio) + MockLspClient for testing + lspServerToPath() name resolver (direct + legacy poly-* aliases) - adapter/rollback.ts: reverse-execute via planner.buildRollbackPlan, honours toPhase, skips non-succeeded steps, refuses when disabled Tests (51 passed, 0 failed; was 23): - executor_test.ts (13): forward + dryRun + parallel + sibling-failure + retry success/exhaustion + maxParallel + interpolation + all-phases propagation + halt-on-error + dispatch matrix - rollback_test.ts (4): reverse order + toPhase + skip-failed + disabled - lsp_client_test.ts (10): MockLspClient default/override/error/failOnce /call-recording + lspServerToPath direct/legacy/unknown - integration_test.ts: StdioLspClient drives the *real* proof-lsp cartridge (from PR #7) end-to-end — verifies framing + JSON-RPC round-trip including error responses Manifest: - states[] adds `phase-3-execute-rollback` - deno.json bumps to 0.2.0, exports executor/rollback/lsp_client, test task gains --allow-run Deferred (per handover doc): - VerisimDB-backed persistence (in-memory only for now) - Per-LSP `execute_component` handler is the natural next step on each domain LSP adapter; until then StdioLspClient surfaces the unknown- method error path cleanly Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2 tasks done
hyperpolymath
added a commit
that referenced
this pull request
May 26, 2026
Adds STATUS banners to two handover prompts so a future session doesn't re-execute completed work: - cartridge-02 (Phase 3 execute+rollback) — landed as PR #8. - cartridge-04 (LSP adapter pattern) — proof-lsp landed as PR #7; remaining 10 listed in suggested order. The other 8 prompts remain live (cartridge-03 Idris2/Shield, cartridge-05 boj-server cleanup, cartridge-06 standards#200 follow-through, cartridge-07 boj-server#158 follow-through, plus earlier-01/02/03). Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
hyperpolymath
added a commit
that referenced
this pull request
May 26, 2026
…al (#10) Aligns the machine-readable handover with the prose banners just landed in PR #9, so an ingesting agent doesn't pick up tasks that are already done. Status updates: - cartridge-01: done (PR #6) - cartridge-02: done (PR #8, 28 tests added) - cartridge-04: partial (proof-lsp done as PR #7; 10 remain) - earlier-02: closed_abandoned (with resolution rationale) - earlier-03: in_flight (hypatia#344, auto-merge ON) - cartridge-06 + cartridge-07: blockers cleared (standards#200 + boj-server#158 both merged today) Remaining live work: - cartridge-03 Phase 4 Idris2/Shield (12h, blocks on #2 only — now unblocked) - cartridge-04 sub-tasks (10 LSP adapters, ~20h) - cartridge-05 (boj-server cartridges/ removal, gated on #158 burn-in judgment) - cartridge-06/07 follow-throughs (1h + 4h) - earlier-01 (duplicate-reconciliation, 3h) Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 of the stack-orchestrator-mcp cartridge per
docs/handover/2026-05-26/prompts/cartridge-02-phase-3-execute-rollback.adoc. Ports the polystack Elixirexecutor.ex+lsp_client.exto Deno; wires thestack_execute_phaseandstack_rollbackMCP tools.What's new in
adapter/executor.ts— phase loop, parallel-group dispatch, retry,\${id.field}interpolation,dryRunmatrix,maxParallelslicing. Sibling failures don't cancel in-flight peers.lsp_client.ts—LspClientinterface,StdioLspClient(spawns target cartridge subprocesses + JSON-RPC over stdio),MockLspClient(test stub),lspServerToPath()direct + legacypoly-*resolver.rollback.ts— reverse-executes a plan viaplanner.buildRollbackPlan, honourstoPhase, skips non-succeeded steps, refuses when the stack's rollback strategy is disabled.Tests — 51 passed, 0 failed (was 23 on Phase 2)
executor_test.ts: forward, dryRun, parallel concurrency, sibling-failure isolation, retry success + exhaustion,maxParallelslicing,interpolateConfig, full-plan propagation, halt-on-error, dispatch matrix.rollback_test.ts: reverse-phase order,toPhasetruncation, skip-failed steps, disabled-strategy error.lsp_client_test.ts: MockLspClient default/override/error/failOnce/call-recording,lspServerToPathdirect/legacy/unknown.integration_test.ts:StdioLspClientspawns the realproof-lspcartridge from PR feat(proof-lsp): implement Deno LSP adapter (Coq/Lean/Isabelle/Agda) #7, sendsexecute_component, asserts the JSON-RPC error round-trip (proof-lsp doesn't yet knowexecute_component, so -32601 is the expected and verifying response — proves the wire works end-to-end).Manifest + packaging
cartridge.json#/states[]advances:phase-2-parser-planner→phase-3-execute-rollbackadapter/deno.json→0.2.0; new exports for./executor,./rollback,./lsp_client; test task gains--allow-run; adds@std/path@1.Deferred (per handover doc)
execute_componenthandler — each domain LSP cartridge needs to learnworkspace/executeCommand execute_componentfor its component types. That's the natural follow-up on each adapter (PR feat(proof-lsp): implement Deno LSP adapter (Coq/Lean/Isabelle/Agda) #7 onward).Pitfalls noted in handover
executePhase: sibling failure does not abort other siblings).maxParallelrespected (test:maxParallel slices group).StdioLspClient.close()— cancels stdout/stderr, closes writer, kills + awaits status.rollback_strategy.enabledflag.Test plan
deno check executor.ts lsp_client.ts rollback.tspasses.deno test --allow-read --allow-run --allow-env --allow-writepasses (51/51).🤖 Generated with Claude Code