Repository navigation
Commit 335477e
authored
fix(review): review screen starts fail-closed with exact-count approve (Spec fix-review-defaults) (#1481)
## What changes for users
The review screen used to start every "Allow this tool" checkbox
checked, including write and destructive tools whose definitions were
never verified. It now fails closed.
- **Core / REST**: every tool in `GET /api/v1/servers/{id}/review`
carries `default_allowed` (always present). It is true for an approved,
enabled tool, and for a pending or changed read tool whose scan verdict
is clean and that is not held. Write, destructive, unannotated, unknown,
not-scanned, warnings, dangerous and held tools are false. An older core
has no field, which every surface reads as false.
- **Web**: only the core-selected tools start checked. A hint explains
why. The approve button names the exact count ("Approve server (5 of 14
tools)", or "Approve without seeing tools" when nothing is captured). A
separate "Approve all (14 tools)" button approves everything. A reload
keeps the user's explicit choices (an explicit check is dropped if the
tool's definition, verdict or tier changed underneath it). The forced
retry after a dangerous finding re-sends the block list of the attempt
that triggered it.
- **macOS**: the review sheet has the same defaults, hint, labels,
Approve All button, reload behaviour and force retry.
- **CLI**: `mcpproxy review approve <server>` on a quarantined server
blocks every tool outside the default selection. `--all` allows every
tool, `--tools a,b` (now valid on a quarantined server) allows exactly
those, `--except` subtracts, and `--all` with `--tools` or an unknown
tool name is an error before any write. The prompt now follows the
review read and names the count and the blocked tools. Table output
prints one summary line first; JSON and YAML stay the bare REST object.
Behaviour change: `review approve <server> --yes` used to allow every
tool; add `--all` for that. The command has not shipped in a release.
- **MCP**: no semantic change. `inspect_quarantined` carries
`default_allowed` (captured tools from the composer, live tools
`false`); `inspect_tools` does not. No `quarantine_security` operation
approves a server.
## Findings and spec
Codex user test F-02 (medium, security default). Spec:
`specs/109-ux-navigation-consistency` (FR-021, FR-023, US2-2; research
D41; tasks T199 to T210; contracts, data model, quickstart recipe,
acceptance index and parity matrix row 6 updated). Docs updated:
`docs/features/security-quarantine.md`, `docs/cli/review-commands.md`,
`docs/cli/command-reference.md`, `docs/api/rest-api.md`.
Accepted residual: a server that declares `readOnlyHint` dishonestly
still gets its read tools pre-checked once the scan is clean, because
annotations are self-declared and the scan checks descriptions. The tier
stays visible and the tool can be blocked later.
## Tests added
- Go: `TestReviewDefaultAllowed` (tier by status by verdict by disabled
by held table), coverage-driven composer cases, JSON key present when
false, MCP captured and live parity, CLI default selection, `--all`,
`--tools`, prompt count, JSON output, `reviewApproveSelection` table,
three goldens.
- Web: `review-screen-default-selection.spec.ts` (helpers and
component); three assertions in `review-screen.spec.ts` re-baselined on
purpose because they pinned the old all-checked default.
- macOS: `ReviewPresentationTests` (selection, merge, labels, hint
parity with the Web sentence) and `ReviewPayloadTests` decode cases.1 parent 8e5ccd3 commit 335477e
38 files changed
Lines changed: 1355 additions & 84 deletions
File tree
- cmd/mcpproxy
- testdata/cli109
- docs
- api
- cli
- features
- frontend
- src
- components
- types
- utils
- views
- tests/unit
- internal
- runtime
- server
- native/macos/MCPProxy
- MCPProxyTests
- MCPProxy
- API
- Views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
1039 | | - | |
| 1039 | + | |
1040 | 1040 | | |
1041 | 1041 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
48 | 43 | | |
49 | | - | |
| 44 | + | |
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
53 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | | - | |
| 60 | + | |
56 | 61 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
60 | 74 | | |
61 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
62 | 79 | | |
63 | | - | |
64 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
65 | 85 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 86 | + | |
| 87 | + | |
69 | 88 | | |
70 | | - | |
| 89 | + | |
71 | 90 | | |
72 | | - | |
| 91 | + | |
| 92 | + | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
| |||
147 | 167 | | |
148 | 168 | | |
149 | 169 | | |
150 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
151 | 196 | | |
152 | 197 | | |
153 | | - | |
| 198 | + | |
154 | 199 | | |
155 | 200 | | |
156 | 201 | | |
157 | 202 | | |
158 | 203 | | |
159 | | - | |
| 204 | + | |
160 | 205 | | |
161 | 206 | | |
162 | 207 | | |
163 | 208 | | |
164 | | - | |
| 209 | + | |
165 | 210 | | |
166 | 211 | | |
167 | | - | |
| 212 | + | |
168 | 213 | | |
169 | 214 | | |
170 | 215 | | |
171 | 216 | | |
172 | 217 | | |
173 | 218 | | |
| 219 | + | |
174 | 220 | | |
175 | 221 | | |
176 | 222 | | |
177 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
178 | 290 | | |
179 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
180 | 294 | | |
181 | 295 | | |
182 | 296 | | |
| |||
0 commit comments