Repository navigation
Description
Context
The previous issues change the MCP contract in several places: a structured error envelope, operation lifecycle and list_operations, ultrafix progress, publish recovery, submission progress, get_work_overview, optional expectedHead, specific merge preconditions, docs tools, visual preview tools, plan revision causes, refinement validation, trigger access settings and find_setting. The operator guide (docs/mcp.md), the capability matrix (docs/mcp-coverage.md), the operator surface scaffold (docs/mcp-operator-surface.md), the MCP prompts (operator_briefing, check_progress, diagnose_failure in packages/api/mcp/server.ts) and the agent skill (packages/cli/dist/skill/propr/SKILL.md source under packages/cli/skill/propr/) must describe the new behaviour, and one regression test should exercise the combined flow so later refactors cannot silently break it.
Requirements
docs/mcp.md:- New section "Errors": the envelope fields, stage values, retryable semantics (including why mutations may return
OUTCOME_UNKNOWNwith acause), and the table of stable codes introduced by this epic (INVALID_INPUT,GITHUB_*,UPSTREAM_*,DATABASE_BUSY,PLAN_INVALID,PUBLISH_FAILED,PUBLISH_PARTIAL,PULL_REQUEST_ALREADY_MERGED,PULL_REQUEST_CLOSED,PULL_REQUEST_DRAFT,CHECKS_FAILING,CHECKS_PENDING,REVIEW_REQUIRED,CHANGES_REQUESTED,BRANCH_BEHIND_BASE,MERGE_CONFLICT,BRANCH_PROTECTION_BLOCKED,MERGE_STATE_UNKNOWN,MERGE_REJECTED,COMMAND_NOT_PICKED_UP,ULTRAFIX_CYCLE_FAILED,REFINEMENT_OUTPUT_INVALID,DOCS_UNAVAILABLE,DOC_NOT_FOUND,PREVIEW_NOT_FOUND,PREVIEW_NOT_RENDERABLE,PREVIEW_TOO_LARGE,SETTING_ENVIRONMENT_MANAGED,CONFIRMATION_REQUIRED). - New section "Did it actually happen? Following a receipt": lifecycle states, timestamps, artifacts, ultrafix progress and outcomes,
list_operationsexamples ("what did I start in the last hour"). - Update the walkthrough: step 1 can use
get_work_overview; step 4 uses optionalexpectedHead; add "Follow a one-off task" withget_task_submission.progress; add "Look at the result" withlist_visual_previews/get_visual_preview; add "Ask ProPR about itself" withsearch_docs/get_doc/find_setting.
- New section "Errors": the envelope fields, stage values, retryable semantics (including why mutations may return
docs/mcp-coverage.md: add rows for every new tool, update PR command rows (expectedHead optional), plan rows (revision causes, refinement validation, publish resume), and a new dated reconciliation section listing the local validation commands and results.docs/mcp-operator-surface.md: add capability bullets 5–8 (receipts & errors, docs, visual previews, configuration reachability).- MCP prompts in
server.ts:check_progressrecommendsget_work_overviewthenget_operation/list_operations;diagnose_failuretells the model to readerror.code,error.stage,error.retryable,error.causeand relay them;operator_briefingmentionssearch_docsfor product questions. - Agent skill: add a short "Receipts and errors" section and "Asking about ProPR" (use
search_docs) to the skill source. - New regression
packages/api/test/mcpObservableSurface.test.ts(added totest:mcp), using the real catalog with fakes only at GitHub/queue boundaries:create_task→get_task_submission.progress.stage === 'queued'→ seed task running →get_operation.lifecycle.state === 'running'→ seed completed with PR 42 →completed,artifacts.pullRequest.number === 42.get_work_overviewreturns that task joined with PR 42 (one GraphQL call).run_ultrafixwithoutexpectedHead→ receiptresolvedHeadset → seed cycle history →progress.cycle === 2→ seedcycles_exhausted→completedwith the goal-missed summary;list_operations({ tool: 'run_ultrafix' })shows it.merge_pull_requeston a merged PR →failedreceipt withPULL_REQUEST_ALREADY_MERGEDandcurrentState.mergedAt.publish_planwith GitHub 422 on the first issue →PUBLISH_FAILEDwithcause.code === 'GITHUB_REJECTED'; plan released.search_docs('ultrafix')returns a page;find_setting('bot whitelist')returns the bot entry.- An envelope in any failure contains no token-like strings.
Implementation Specification
- Edit
docs/mcp.md,docs/mcp-coverage.md,docs/mcp-operator-surface.md,packages/api/mcp/server.ts(prompt text only), the agent skill source. - New
packages/api/test/mcpObservableSurface.test.ts; register in thetest:mcpscript.
Acceptance Criteria
-
npm run test:mcppasses including the new regression. - The docs site builds;
list_docsshows the updated MCP guide undermcp/guide. - Every tool named in the docs exists in
tools/listfor an admin principal (add a small assertion in the regression that grepsdocs/mcp.mdfor`tool_name`tokens matching^[a-z_]+$and checks the catalog, skipping an explicit allowlist of non-tool words). - No doc still states that
expectedHeadis required on append-only commands.
Created by ProPR AI Planner
Activity
propr-dev commentedon Sep 28, 2026
Suggested Implementation:
Implementation Approach
Documentation is part of this epic's deliverable: the whole point is that an agent can explain outcomes and ProPR's capabilities to the user, and the docs are now served to agents through
get_doc. We therefore update the guides and the prompts in the same PR as a regression test that exercises the combined flow, and we add a cheap consistency check (every tool named indocs/mcp.mdexists) so docs and catalog cannot drift apart unnoticed.File:
docs/mcp.mdWhy this file: The operator/agent guide; also served as
mcp/guidebyget_doc.Walkthrough updates (keep the existing structure):
File:
packages/api/mcp/server.ts(prompt text)Why this file: Prompts steer agents toward the new one-call tools and toward relaying structured errors.
File:
packages/api/test/mcpObservableSurface.test.ts(new file)Why this file: One end-to-end regression over the real catalog tying the epic together.
File:
docs/mcp-coverage.md,docs/mcp-operator-surface.md, agent skillWhy these files: Capability matrix and scaffold are the audit baseline; the skill is what external agents load first.
list_operations,get_work_overview,list_task_submissions,list_docs/get_doc/search_docs/find_setting,list_visual_previews/get_visual_preview,get_trigger_access_configuration/update_trigger_access_configuration.npm run test:mcp,npm run typecheck -w @propr/api,npm run build, docs build) and their results, following the format of the existing reconciliation sections — record real results, do not pre-fill.mcp-operator-surface.md: bullets 5 (receipts, lifecycle and structured errors), 6 (documentation access), 7 (visual previews), 8 (configuration reachability).propr-dev commentedon Sep 30, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol2609/gpt-5.6-sol-document-the-observable-m-20260930-0244-sl12593-epic-mcp-observability-cf6issue-2609-20260930-0244-gpt-5.6-sol-sl1🔍 Track Task Execution
fix(ai): Resolve issue #2609 - Document the observable MCP surface an…