Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

[Spec] Stage authority & in-app MCP server #23

Closed

Description

@64ix

Part of the wayfinder map. Decisions: #6, #7, #10.

Blocked by: #21, #22.

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.
  • shipped is 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

  1. As an agent, I want to declare idea/exploring/spec/implementing/review for a task through MCP tools, so that I can move the card without asking.
  2. As an agent, I want my shipped attempts refused with a clear steering message, so that I understand shipped comes from a merged PR or the human.
  3. As an agent, I want the same stage declarations through a CLI command, so that SSH/remote sessions can move stages too.
  4. As an agent, I want to exit triage by re-declaring a working stage, so that I can recover a feature from the problem bin.
  5. 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.
  6. As a user, I want to place any stage from the UI, including shipped and de-shipping, so that the human stays the boss.
  7. As an operator, I want the guard enforced in the tool handler before any write, so that a refusal can never corrupt state.
  8. As an agent, I want MCP tools auto-approved and surfaced on intent, so that I discover them without a manual setup.
  9. 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. shipped refused 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

  • review is 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions