Skip to content

docs(specs): Spec 117: review-bound approvals, durable baselines and ordered tool inventories (#1565-#1567) - #1580

Closed
Dumbris wants to merge 19 commits into
mainfrom
117-review-bound-approvals
Closed

Dumbris wants to merge 19 commits into
mainfrom
117-review-bound-approvals

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Design only (speckit, specs/117-review-bound-approvals/). It covers three follow-ups to the UX-02 per-server approval lock (#1571):

I reproduced two of them live on main (ee7834e71) with an isolated harness on a high port:

PR split (each is a separate, self-contained PR; unbound clients keep working)

PR-1 and PR-3 have no dependencies. PR-2 is cut after PR-1 merges, because its empty-review guarantee needs the durable marker.

Order PR Issue Scope
1 durable baseline #1567 A tool_baseline_decisions bucket. serverHasBaseline = marker OR approved/changed record. Trusted discovery and every server-approval commit set the marker. It is cleared only with the server's records. Blind-approval copy changes in Web and CLI
2 review binding #1566 A review fingerprint current_hash (approval-hashed definition plus the 4 safety hints, rv1- opaque). expected_hashes on security/approve and tools/approve (tools and approve_all). A mismatch returns 409 "out of date" and writes nothing. A server approval runs as one locked section: validate → mark → integrity baseline + blocks → promote the reviewed pending tools → storage unquarantine. There is no promote-all after the unquarantine. Web and CLI send the binding
3 capture order #1565 The ListTools leader stamps a process-global capture seq into an immutable per-flight result. The inventory apply (records, deletes, eviction, index, last-good snapshot) runs in one section under the per-server lock and writes nothing when the capture is older than the applied one. The StateView publish is gated per server. Every ineligibility writer (quarantine and disable: toggle, bulk, PATCH, config reload, restart persist) stores and purges under the lock. Replaced clients are retired outside manager.mu. A capture whose record writes fail is uncommitted: the server becomes review-dirty, and every reachability transition (approve, enable, baseline promotion) is refused until a newer full capture

Key decisions

  • The wire contract is the one PR fix(tray): per-server review sheet, click-time approval decisions, review-bound approvals (#1569) #1572 (tray) already sends:
    • the field is named current_hash, but it carries the review fingerprint, not the storage hash;
    • all reviewed tools are bound and extra names are ignored;
    • {} binds an empty or blind review;
    • the request is unbound only when no reviewed tool has a hash;
    • the 409 text contains "out of date" and never "dangerous".
  • The rug-pull hash policy is unchanged. The fingerprint is separate and catches annotation-only changes between review and approve.
  • The storage unquarantine happens inside the approval's locked section. This removes the commit-to-unquarantine window instead of revalidating later.
  • Unbound legacy server approvals stay accepted, but tools filed after the commit stay pending.
  • The baseline marker is a separate bucket OR-ed with today's inference, so no migration is needed and downgrade is safe.
  • The capture sequence is taken where tools/list actually runs, not before the call.

Open questions (the design proceeds with these defaults)

  • O1: blind approvals hold later tools for review (safer). The tray copy needs a follow-up on native/.
  • O2: the 409 lists tool names only, not the old and new fingerprints.
  • O3: the Tools page bulk approve, mcpproxy security approve and the MCP quarantine_security approve operations stay unbound for now. Binding them is a follow-up that needs a golden update.
  • O4: merge order PR-1 → PR-2 → PR-3. PR-2 requires PR-1.
  • O5: between PR-2 and PR-3, a storage write failure during a capture can leave an older stored definition approvable. This is pre-existing on main and closed by FR-018 in PR-3.

Review

I ran a cross-model design review with opencode gpt-6.1-sol. All 10 rounds allowed by the round cap were used, and each one returned FINDINGS. Every finding was verified against the code, and all were accepted and resolved. Each round's resolutions are logged in research.md.

  • Rounds 1-5 found an import cycle, lock-order inversions, the PR-2 → PR-1 dependency, the CLI binding to an unseen fetch, other quarantine writers, coalesced-waiter result races, and frozen changed records.
  • Rounds 6-10 found the disable writers, saved-review server identity, lenient-empty fences, marker-failure snapshot restore, failed-capture fencing and the enable bypass.

Sol confirmed in rounds 6, 8 and 10 that the wire contract matches #1572.

Not re-reviewed: the round-10 resolutions (the dirty guard now covers enable and synthesized approvals; the changed → changed-again fault variant became a composition test). Under the cap there is no round 11. They are small, but the first implementation PR's review must cover them.

Live reproductions are recorded outside the repo (docs/qa/0.70.0-ux-2026-10-10/remediation/evidence/s117-design/EVIDENCE.md).

🤖 Generated with Claude Code

…ordered tool inventories (#1565-#1567)

Design for three independently mergeable PRs:
- PR-1 (#1567): durable per-server tool baseline marker.
- PR-2 (#1566): review fingerprint (current_hash) and expected_hashes on
  security/approve and tools/approve, 409 'out of date', one-section
  server approval; matches the macOS client in #1572.
- PR-3 (#1565): capture sequence stamped by the ListTools leader; ordered,
  locked inventory apply and gated StateView publish.

Related #1565
Related #1566
Related #1567
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4c4ce94
Status: ✅  Deploy successful!
Preview URL: https://fbc8e2a4.mcpproxy-docs.pages.dev
Branch Preview URL: https://117-review-bound-approvals.mcpproxy-docs.pages.dev

View logs

Leaf package for shared error/decision types (no storage/scanner cycle),
invert the quarantined-capture lock order, PR-2 requires PR-1, full capture
identity for last-good snapshots, fix T104 and reclassify regression checks.

Related #1565
Related #1566
Related #1567
CLI binds to the reviewed snapshot (--from-review), lock-free helpers in the
widened apply section, config-driven quarantine under the lock, per-flight
ListTools results, reclassified composition tests.

Related #1565
Related #1566
Related #1567
Route every quarantined-record writer (PATCH, restart persist, reload,
toggle) through one locked save+purge; split T104 dispatch check into
internal/server; executable T306(2) interleaving; scope and dedupe fixes.

Related #1565
Related #1566
Related #1567
Changed records track the live definition (FR-017), marker-write failures
abort the destructive half of an apply (FR-027), executable T306(2m).

Related #1565
Related #1566
Related #1567
FR-017 also refreshes changed records on hint-only changes; T306(2m)
runs the approval asynchronously.

Related #1565
Related #1566
Disable writers serialize with inventory apply; saved CLI reviews must
match the server and fingerprints cover the server name.

Related #1565
Related #1566
All disable writers serialize with apply, lenient empty captures advance
the order fence, marker failures restore the published snapshot.

Related #1565
Related #1567
Retire outside manager.mu and forbid lookups under epochMu; uncommitted
captures mark the server review-dirty; definitions fence lets operator
reconciliation reuse the retained snapshot.

Related #1565
Related #1566
Fenced review-dirty state in PR-3 with a common-path approval guard,
supervisor drops retained tools of ineligible servers, test
classification fix.

Related #1565
Related #1566
Dirty guard covers enable and synthesized approvals; changed-again fault
variant is a PR-2 composition test.

Related #1565
…while review-dirty, lenient-empty never clears dirty)
…ty refusal on the direct surface, PR-3 declared scope)
…ed before record writes; marker abort is an incomplete capture under FR-018)
…rs only after StateView publish; output-schema backfill refreshes safety hints)
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: 117-review-bound-approvals

Available Artifacts

  • archive-darwin-amd64 (31 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (19 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (27 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (27 MB)
  • installer-dmg-darwin-arm64 (24 MB)
  • smart-mcp-proxymcpproxy-goZC4H1Z.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 38150789964 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

…s against approval records; snapshot, stamp and definitions staged until StateView publication is accepted)
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dumbris

Dumbris commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Superseded: the Spec 117 design ships inside #1604 (PR-1), merged.

@Dumbris Dumbris closed this Oct 12, 2026
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.

2 participants