This repository was archived by the owner on Sep 2, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 2, 2026. It is now read-only.
[Spec] Stage authority & in-app MCP server #23
Copy link
Copy link
Closed
Labels
ready-for-agentready-for-agent
Description
Part of the wayfinder map. Decisions: #6, #7, #10.
Problem Statement
Agents must be able to declare working stages without a human babysitting every move — but shipped is a claim that must stay human-or-fact. Today Orca has no agent-facing surface for stages and no enforcement boundary. The fork's agents (TUI-first, no ACP) need a channel that works from a terminal on any host.
Solution
An in-app MCP server (Orca's first) exposing stage tools, plus CLI parity, both behind one pure authority guard:
- Agent-declarable:
idea,exploring,spec,implementing,review, and triage exit. shippedis refused fail-closed with a steering message — human (UI) or merged PR only.- The human can place any stage from the UI, including de-shipping.
User Stories
- As an agent, I want to declare
idea/exploring/spec/implementing/reviewfor a task through MCP tools, so that I can move the card without asking. - As an agent, I want my
shippedattempts refused with a clear steering message, so that I understand shipped comes from a merged PR or the human. - As an agent, I want the same stage declarations through a CLI command, so that SSH/remote sessions can move stages too.
- As an agent, I want to exit
triageby re-declaring a working stage, so that I can recover a feature from the problem bin. - As a user, I want the board to block drops onto fact-governed stages with an explanation, so that I understand why a drop did nothing.
- As a user, I want to place any stage from the UI, including
shippedand de-shipping, so that the human stays the boss. - As an operator, I want the guard enforced in the tool handler before any write, so that a refusal can never corrupt state.
- As an agent, I want MCP tools auto-approved and surfaced on intent, so that I discover them without a manual setup.
- As an operator, I want a per-launch bearer token scoping the MCP server, so that only my session can call it.
Implementation Decisions
- One pure authority guard: (caller kind, requested stage, governing facts) → allowed/refused + explanation. Shared by MCP tools, CLI/RPC validation, and the board's drop gating.
- In-app MCP server: HTTP server in the Electron main process, per-launch bearer token, workspace-scoped session identity, auto-approved tools with deferred load (Nimbalyst architecture as reference). Orca's first MCP server.
- Tool surface (agent): declare stage, link issue, read board/list tasks.
shippedrefused fail-closed with the steering message: "shipped is set by a merged PR or by you in the board UI." - CLI parity:
orca worktree set --stage <id>on the existing worktree RPC with the same guard; works from SSH/remote runtimes. - Human UI: full placement; de-ship allowed (the derivation engine's consumed-merge guard prevents re-push).
- No new OSC/hook payload fields for stages.
Testing Decisions
- Test external behavior: guard matrix (every stage × agent/human × governing facts) and the steering messages; MCP handler refusal happens before any write; CLI/RPC parity uses the same guard.
- Seams: the pure authority guard, the MCP tool-handler boundary, the CLI/RPC validation layer.
- Prior art: Nimbalyst's tracker review guard tests (fail-closed before DB touch); Orca's orchestration gate tests for the enforcement style.
Out of Scope
- The derivation engine that computes facts (spec 2).
- Board rendering and DnD mechanics (spec 4) — this spec only supplies the guard they consume.
- Remote/SSH MCP transport (sync/remote story stays with spec 9; CLI/RPC covers agents today).
Further Notes
reviewis declarable by agents per the ticket decision, but an open PR fact still overrides it.- The MCP server is a new component: keep it local-first, single-process, no external dependencies beyond the standard library HTTP server.
Metadata
Metadata
Assignees
Labels
ready-for-agentready-for-agent
Activity