Skip to content

feat: plan alternatives and MCP capability editing (preview) - #696

Merged
aryamthecodebreaker merged 1 commit into
mainfrom
claude/nervous-gauss-9dd9ec
Nov 23, 2026
Merged

aryamthecodebreaker merged 1 commit into
mainfrom
claude/nervous-gauss-9dd9ec

Conversation

@aryamthecodebreaker

Copy link
Copy Markdown
Owner

Two v0.10.0 ledger gaps on the CLI/MCP side. Both surfaces are labelled preview.

Alternative-plan comparison

Ledger row: "Report adapters, Markdown/CLI/MCP rendering ... remain". This PR adds:

  • CLI: fixmap alternatives --input <alternatives.json> [--format markdown|json] [--output <file>] (packages/cli/src/alternatives-command.ts). The input is { "alternativesInputVersion": 1, "alternatives": [PlanAlternative...] }. Core's comparePlanAlternatives still does all validation: 2-20 plans, one exact graph fingerprint, bounded fields.
  • Report adapter: --report a.json --report b.json --graph-fingerprint <value> turns each saved Plan report into an alternative. It can be mixed with --input. A saved Plan records no graph state, so the caller has to state it (for example the commit SHA). FixMap refuses to guess. The mapping only uses what the report says:
    • edits = impact seeds, or the ranked context files when there are no seeds
    • impacts = impact files
    • breaking contracts = breaking-contract policy findings
    • policy = policy findings
    • tests = test routes, whose coverage counts only edits linked by test-route/imported-by impact evidence
    • uncertainties = risks, a vague task, and unresolved identifiers
    • reversibility = partial, with the reason that the report records nothing beyond the source edits
  • Markdown: one side-by-side table with each axis's direction ("lower is better"). For each pair it lists which plan is better on which axes, with values shown from that plan's side. It names the plans that no other plan beats on every axis, and it gives per-plan evidence. The output says FixMap does not pick a winner, and nothing is folded into a score.
  • MCP: read-only fixmap_alternatives (readOnlyHint: true) takes input (an object or a path), reports, graphFingerprint and format. It runs through the same compareAlternativesFromSources as the CLI.
  • Catalogued as the preview "Plan alternatives" in feature-catalog.ts. It is also listed in CLI help and the CLI README.

Evidence (packages/cli/test/alternatives-command.test.ts, mcp.test.ts):

  • comparison from an input, in JSON and Markdown, checking the trade-off lines and that no recommendation wording appears
  • comparison from two saved reports, checking the metrics derived from impact, policy and risks, plus the adapter's contract and reversibility mapping
  • reports without a graph fingerprint are rejected
  • mismatched graph fingerprints are rejected for input-only and for input mixed with reports
  • --output cannot overwrite an input, and unknown options are rejected
  • MCP: input object, mismatch rejection, and saved plans produced by fixmap_plan

Product capability editing over MCP

Ledger row: "MCP mutation ... remain". This PR adds:

  • fixmap_capability accepts action: "create" | "update" | "remove" along with name, touch, add, direction, depth, maxNodes, workspace and repository. MCP only type-checks the arguments and rejects ones that don't apply to the action. It then passes them as separate CLI tokens to runCapabilityCommand, so the containment check, stale lock, atomic replace, symlink/hard-link refusal, validation and error text are exactly the CLI's.
  • Tool annotations are now readOnlyHint: false and destructiveHint: true. The description says to use an action only when the user asks for the change. Without action, list/show/diff behave as before.

Evidence (mcp.test.ts):

  • create, update and remove round-trip against .fixmap/capabilities.json
  • duplicate create gives the CLI's error, and remove with anchors is refused
  • active lock refused, with no store written
  • ../outside.ts anchor refused as traversal
  • .fixmap junction/symlink pointing outside the repo refused, with nothing written outside

Local checks

npm run typecheck, npm run lint, Core tests (900 passed, 1 skipped), CLI tests (377 passed) and npm run check:action-bundle (matches) all pass. Core only changed feature-catalog.ts, so the action bundle did not change. The ledger, CHANGELOG, versions and the website changelog were not touched.

🤖 Generated with Claude Code

Add preview fixmap alternatives (--input, or --report with an explicit
--graph-fingerprint), a saved-report adapter, side-by-side Markdown
trade-offs without a winner, and the read-only fixmap_alternatives MCP tool.
fixmap_capability gains action create|update|remove routed through the CLI
write path (lock, atomic replace, containment, link refusal).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fixmap Ready Ready Preview Nov 23, 2026 2:19pm UTC

@aryamthecodebreaker
aryamthecodebreaker merged commit 3594377 into main Nov 23, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 62175bad Deployed Nov 23, 2026 by vercel[bot]
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.

1 participant