Skip to content

Expose agent planning over MCP with out-of-band approval and remainder replan (Decision 136) #1896

Closed

Description

@enricopiovesan

Problem

reference-apps#288 needs an AI agent, connected over MCP, to submit a structured goal target, read candidate plans, and have a human approve one out of band (Decision 136). Today traverse-mcp's stdio server exposes only search/describe/validate/execute entrypoint commands. The tested planning and proposal functions (crates/traverse-mcp/src/tools/workflow_plan.rs, tools/proposals.rs) are not wired in, and no spec defines a host-minted out-of-band approval token or a trace-bound remainder replan.

Scope

  1. Spec 109 amendment: approval is minted by a host-run out-of-band surface (local page or CLI prompt) as a single-use token bound to the proposal digest; no MCP command approves.
  2. Spec 113 amendment: a remainder replan takes completed steps' outputs, bound to their trace digests, as starting facts, and excludes the failed capability version.
  3. traverse-mcp stdio: expose target submission, planning, proposal read, and token-gated execution; no approve command.
  4. Host approval surface: a minimal local approval page or CLI prompt that shows the proposal and mints the token.

Definition of Done

  • Spec 109 and Spec 113 amended and approved per Decision 136 (rules 3 and 4).
  • traverse-mcp stdio commands for target submission, planning, proposal read, and execution with an approval token; an MCP client has no way to obtain or mint a token.
  • Out-of-band approval surface mints a single-use token bound to the proposal digest; reuse, a digest mismatch, and a missing token each fail closed with a stable error.
  • Remainder replan: completed outputs enter as trace-bound starting facts; a tampered or unbound fact is rejected; the failed capability version is excluded.
  • Tests for each fail-closed path; 100% coverage gate holds for traverse-mcp.
  • Docs: MCP command reference and the approval flow.

Governing specs

  • 109-runtime-workflow-proposals
  • 113-declarative-workflow-planning
  • 108-governed-runtime-workflow-composition

Blocks traverse-framework/reference-apps#288. Decision 136.

Activity

  1. added
    enhancement
    needs-spec
    on Nov 17, 2026
  2. enricopiovesan commented on Nov 19, 2026

    @enricopiovesan
    CollaboratorAuthor

    Blocked from implementation by its recorded needs-spec prerequisite: the required amendments to Specs 109 and 113 and the approval-token/remainder-replan contract have not been approved. Per the operating model, no implementation ticket is claimed until those governing artifacts are complete.

  3. enricopiovesan commented on Nov 20, 2026

    @enricopiovesan
    CollaboratorAuthor

    Decision record

    Decision: The first out-of-band approval surface is a host-owned local CLI prompt. A local page is deferred as a later adapter and must use the same host-minted token contract.

    Rationale: A CLI prompt is portable across supported hosts, keeps approval outside the MCP client and agent, and avoids introducing a browser/UI dependency into a governed runtime capability.

    Options considered:

    1. CLI prompt: chosen.
    2. Local page: deferred; useful UX but adds a host/UI surface before the core contract is proven.
    3. Both now: rejected; duplicates sensitive approval behavior.

    Consequences: MCP exposes no approval command. The host renders the proposal and mints the token only after a human confirms it; future UI adapters consume the same contract.

  4. enricopiovesan commented on Nov 20, 2026

    @enricopiovesan
    CollaboratorAuthor

    Decision record

    Decision: Approval uses a signed, single-use token plus a host-side replay ledger. The token is bound to the proposal and snapshot digests, issuer/key identity, approver principal/role, workspace scope, permitted effects/connectors, expiry, and one-use nonce.

    Rationale: Signed claims support portable verification and audit; host-side consumption before execution prevents replay. The authority remains outside MCP and cannot be minted by an agent or MCP client.

    Options considered:

    1. Signed token plus replay ledger: chosen.
    2. Opaque in-memory nonce: rejected because it is not independently verifiable and fails across restarts.
    3. MCP-issued token: rejected because it would grant the agent/client approval authority.

    Consequences: Missing, expired, scope-mismatched, digest-mismatched, revoked, or consumed tokens fail closed with a stable error before side effects. Key custody follows host-owned trust rules.

  5. enricopiovesan commented on Nov 20, 2026

    @enricopiovesan
    CollaboratorAuthor

    Decision record

    Decision: A remainder replan receives only bounded, schema-validated output references bound to completed-step trace digests. The host resolves authorized values locally; raw secrets, credentials, and unrestricted prior outputs do not enter MCP or the planner.

    Rationale: This preserves the Decision 136 remainder-only behavior while maintaining least disclosure, bounded evidence, and deterministic validation.

    Options considered:

    1. Trace-bound host-resolved references: chosen.
    2. Raw completed outputs to the planner: rejected because it weakens data boundaries and makes limits/evidence harder to enforce.
    3. Replan from the original goal: rejected because it can repeat completed side effects.

    Consequences: A missing, tampered, expired, unbound, or schema-invalid reference fails closed. The failed capability version is excluded and every replan needs new out-of-band approval.

  6. added
    agent:codex
    and removed
    needs-spec
    on Nov 20, 2026
  7. added a commit that references this issue on Nov 20, 2026
  8. enricopiovesan commented on Nov 23, 2026

    @enricopiovesan
    CollaboratorAuthor

    Completed by merged PR #1930: approved Spec 109/113 and ADR-0043 amendments for host-only approval and trace-bound remainder replanning.

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

    agent:codexenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions