Skip to content

feat(orchestration): stack-orchestrator-mcp — scaffold + ADR-002 + Phase 2 + handover docs - #6

Merged
hyperpolymath merged 3 commits into
mainfrom
feat/fleet-mcp-adr-redesign
May 26, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
feat/fleet-mcp-adr-redesign

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Course-correction PR. Renames the 'fleet-mcp redesign' work to stack-orchestrator-mcp (new cartridge, not a redesign of fleet-mcp). 3 commits: scaffold + ADR-002, Phase 2 parser/planner (23 tests green), and handover docs. See docs/handover/2026-05-26/README.adoc for full state + remaining work.

hyperpolymath and others added 3 commits May 26, 2026 17:01
…fleet-mcp redesign)

Adds:
- docs/decisions/ADR-002-stack-orchestrator-vs-fleet-mcp.adoc — design record
- cartridges/cross-cutting/orchestration/stack-orchestrator-mcp/ — scaffolded cartridge
- new cross-cutting category: orchestration/

The cartridge-extraction initiative tracked the poly-orchestrator-lsp port
under the working name "fleet-mcp redesign". On inspection this is wrong:
the existing cross-cutting/fleet/fleet-mcp is a gitbot-fleet compliance
tracker, and stack orchestration is a distinct concern. The two share the
English word "fleet" but not the concept.

Decision (ADR-002):
1. Keep cross-cutting/fleet/fleet-mcp unchanged.
2. Port poly-orchestrator-lsp as a NEW cartridge: stack-orchestrator-mcp.
3. New cross-cutting category: cross-cutting/orchestration/.
4. The new cartridge coordinates the 11 existing LSP cartridges
   (proof/cloud/container/database/k8s/git/iac/observe/queues/secrets/ssg);
   it does not replace them.

Cartridge facts:
- Name: stack-orchestrator-mcp
- Domain: Orchestration (new)
- Category: cross-cutting (new sub-category: orchestration)
- Tier: Ayo (target Shield after Idris2 ABI work)
- Protocols: MCP + REST
- Loopback: 127.0.0.1:5190 (next after the LSP scaffolds at 5179-5189)
- Tool surface: stack_parse, stack_plan, stack_execute_phase,
  stack_rollback, stack_verify
- Coordinated LSPs: 11 (listed in manifest)

State: scaffolded. adapter/abi/ffi/panels carry .gitkeep placeholders.

Source archived verbatim under _source-archive/:
- elixir-lib/ (8 modules from polystack/poly-orchestrator-lsp/lib/)
- mix.exs, README.md, test-stack.compose.toml, ABI-FFI-README.md

ADR-002 lays out the 4-phase port plan:
- Phase 1: scaffold (this PR)
- Phase 2: parse + plan (next PR, ~600 LOC Elixir → ~400 LOC Deno)
- Phase 3: execute + rollback (depends on LSP adapter impls)
- Phase 4: verify + Idris2 ABI for Shield-tier promotion

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Implements Phase 2 of the stack-orchestrator-mcp port per ADR-002:
- adapter/types.ts — domain types (Stack, Component, Phase, ExecutionPlan, ComponentStep, RollbackStrategy, SecurityPolicies, Result<T, E>)
- adapter/parser.ts — port of orchestrator/stack_parser.ex (TOML parsing, structure validation, ${var} + ${env:VAR} interpolation, dependency graph extraction, security policy extraction)
- adapter/planner.ts — port of orchestrator/planner.ex (Kahn's algorithm topological sort, cycle detection via DFS colouring, phase grouping, parallel-component identification, rollback plan derivation, duration estimation heuristic)
- adapter/parser_test.ts + planner_test.ts — 23 tests, all green
- adapter/deno.json — pinned imports + test task

Manifest state advances from "scaffolded" → "phase-2-parser-planner".

Verified end-to-end against the polystack sample stack
(_source-archive/test-stack.compose.toml): parses + plans correctly,
producing:
  phase 1: [cloud-server] → [database, monitoring] → [app-container]
  estimated 720s total / 480s adjusted (parallel factor 1.50)

LOC counts:
- types.ts: ~100 LOC
- parser.ts: ~200 LOC (from 226 LOC Elixir stack_parser.ex)
- planner.ts: ~280 LOC (from 225 LOC Elixir planner.ex)
- tests: ~280 LOC (no Elixir counterpart shipped in polystack)

Net 451 LOC Elixir → ~580 LOC Deno (slight expansion driven by explicit
return-type Result<T, E> threading and stable-sort Kahn's algorithm).

Remaining for the full ADR-002 plan:
- Phase 3 (execute + rollback) — depends on per-LSP-cartridge adapter
  implementations being available to dispatch to.
- Phase 4 (verify + Idris2 ABI) — for Shield-tier promotion.

This commit adds to the existing scaffold branch
feat/fleet-mcp-adr-redesign. PR creation is currently blocked on
GitHub's secondary rate-limit (see feedback_github_secondary_rate_limit_burst).
Branch is pushed; when the limit clears, the PR will land both the
scaffold + ADR-002 + this Phase 2 implementation together.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…nitiative + earlier work

Adds docs/handover/2026-05-26/ with:

- README.adoc — index, state snapshot, standing constraints, prompt map
- handover.machine.yaml — structured (YAML) mirror with dependency graph,
  effort estimates, blockers, suggested ordering. Schema "format_version: 1".
- prompts/cartridge-01-open-pr-6.adoc — open the rate-limited PR via web UI
- prompts/cartridge-02-phase-3-execute-rollback.adoc — port executor.ex + lsp_client.ex
- prompts/cartridge-03-phase-4-verify-idris-abi.adoc — Shield-tier promotion
- prompts/cartridge-04-lsp-adapter-pattern.adoc — template for the 11 per-cartridge Deno LSP adapter ports
- prompts/cartridge-05-boj-server-cartridges-removal.adoc — remove cartridges/ from boj-server post burn-in
- prompts/cartridge-06-standards-200-followthrough.adoc — SHA-pin canonical schema in mirrors
- prompts/cartridge-07-boj-server-158-followthrough.adoc — tray remote-fetch + catalog reload
- prompts/earlier-01-duplicate-reconciliation.adoc — resume suspended decisions 4-11
- prompts/earlier-02-cloudflare-token-rotation.adoc — confirm rotation + complete history rewrite
- prompts/earlier-03-hypatia-scorecard-polystack-ref.adoc — fix dangling polystack reference

Each prompt is self-contained: goal, context, concrete steps, acceptance
criteria, pitfalls, references. A fresh agent (or future-you) can pick one
up cold.

Total: ~1039 lines across 12 files. ~52 hours of estimated work
spread across 10 prompts (the cartridge-04 LSP-adapter pattern is
22h alone, since it templates the work for 11 cartridges).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@hyperpolymath
hyperpolymath merged commit 7211596 into main May 26, 2026
@hyperpolymath
hyperpolymath deleted the feat/fleet-mcp-adr-redesign branch May 26, 2026 16:46
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant