Commit 4dc17c4
committed
refactor(plugin-security): type HeldScope as what resolveHeldScopes builds
`resolveHeldScopes` already normalises every adminScope flag to a boolean
(`!== false` / `=== true`) and the allowlist to a `string[]`, so `HeldScope.scope`
is the PARSED shape and now says so. The previous commit had reached for
`?? true` / `?? false` at the report boundary instead — correct output, but dead
code that reads like a default being applied where none is needed.
The authored scope, which really does arrive as raw JSON with any subset of the
flags stated, keeps the bare `AdminScope` at the two `parseMaybeJson` sites. Both
containment paths there already read it with `!== false` / `=== true`, so the
author state was the honest type for them all along — the flip is what made the
two shapes distinguishable enough to say which is which.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015bLZKxxUUk4mahNfn3g3Ed1 parent 9d2da7f commit 4dc17c4
1 file changed
Lines changed: 13 additions & 11 deletions
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
125 | 132 | | |
126 | 133 | | |
127 | 134 | | |
| |||
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | 368 | | |
367 | 369 | | |
368 | 370 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
| |||
0 commit comments