Skip to content

feat(mcp): add set_finding_status — the durable write half of findings triage (#1535) - #2043

Open
sloemo01 wants to merge 5 commits into
repowise-dev:mainfrom
sloemo01:feat/findings-disposition
Open

feat(mcp): add set_finding_status — the durable write half of findings triage (#1535)#2043
sloemo01 wants to merge 5 commits into
repowise-dev:mainfrom
sloemo01:feat/findings-disposition

Conversation

@sloemo01

@sloemo01 sloemo01 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What

Fixes #1535 (track 2 — the disposition lifecycle). A new opt-in specialist MCP tool, set_finding_status (safety: mutating).

Root cause

#1986 (merged Aug 29) already gave refactoring plans a versioned identity and real lifecycle: stable content-derived public_id, the open|acknowledged|resolved|false_positive vocabulary, a finalizer that never re-emits false_positive plans, and update_refactoring_suggestion_status as the single writer. The web UI can PATCH a status. What #1535 still names as missing is the agent-facing write: get_health and the generated task prompts tell agents to flag false positives, but there was nowhere to record that verdict from inside the agent loop.

Changes

  • Resolves a plan by storage id, content public_id, or the display id a deep link carries (same fallback generate_refactoring_code uses).
  • Writes only through update_refactoring_suggestion_status — the single lifecycle owner — so a false_positive recorded here is suppressed by the finalizer on later runs, exactly like the REST PATCH path. No second writer.
  • reason is a free-text note stored on the row for audit.
  • Statuses: open, acknowledged, resolved, false_positive.

Tests

4 tool-layer tests (vocabulary validation, missing-plan error, shared-writer routing with reason, display-id fallback) — 20 pass with the lifecycle suite. All 27 MCP surface/drift guards pass.

Note: test_plugin_content is red on main itself (v0.47.0 release bug, unrelated to this PR).

…s triage (repowise-dev#1535)

The refactoring lifecycle (repowise-dev#1986) already gave plans stable content ids and
an open|acknowledged|resolved|false_positive vocabulary, and the web UI can
PATCH a status. The missing piece named in repowise-dev#1535 was the agent-facing write:
get_health asks agents to flag false positives, but there was nowhere to
record that verdict. This tool closes the loop.

- set_finding_status (opt-in specialist, safety=mutating): resolves a plan
  by storage id, content public_id, or the display id a deep link carries
  (same fallback generate_refactoring_code uses), then writes through
  update_refactoring_suggestion_status — the single lifecycle owner — so a
  false_positive recorded here is suppressed by the finalizer on every
  later run, exactly like the REST PATCH path.
- reason is stored on the row for audit.
- Tool layer tests pin the vocabulary, the shared-writer routing, and the
  display-id fallback; the CRUD lifecycle stays pinned by
  test_refactoring_lifecycle.py (20 pass).
- Docs: MCP_TOOLS.md (18 total / 7 specialists + full section), server
  README count. Drift guards all pass (27).
…dev#1535)

The new specialist tool moved the totals from 17 to 18 (and six to seven
opt-in specialists) in three more artifacts the drift guards pin:
website/mcp-server.md, mcp_cmd.py's docstring, and the INTEGRATIONS.md
surface section (regenerated via scripts/gen_agent_matrix.py).
…v#1535)

- test_tool_findings.py: drop unused ALLOWED_STATUSES import, unused
  matched var, combine nested withs
- READMEs/website: 17→18 tool counts (server, cli, concepts, index)
…epowise-dev#1535)

Main's test_every_registered_tool_declares_a_contract requires every
registered tool to have a contract; set_finding_status fell through.
Small fixed write response — no shed order, all fields protected.
Also records its shape in tool_response_shapes.json.
@sloemo01
sloemo01 force-pushed the feat/findings-disposition branch from 6aff3d2 to 38049ee Compare September 1, 2026 10:39
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.

Findings need a disposition lifecycle: declined suggestions are re-minted as open on every run

1 participant