Repository navigation
Commit cd21d0c
committed
fix(plugin,scripts): apply council audit post-ship follow-up fixes
Four follow-up findings from the v0.18.0 pre-release council audit. None
were release-blocking on their own; bundled here to reach a fully-clean
audit state before v0.18.0 publishes.
Finding #2 — TUI keymap.registerLayer try-catch (tui/index.tsx)
When OpenCode TUI 1.14.42-1.14.43 exposes `keymap.registerLayer` as a
function but throws at call time, the unguarded call previously made
the legacy `command.register` fallback (~20 lines down) unreachable.
Wrap the call in try-catch, log a debug line, and fall through to the
legacy path so older command.register-only flows still get the
Magic Context palette entries.
Finding #7 — ctx_memory getAllowedActions fail-closed default (tools.ts)
Previously when a caller omitted `allowedActions`, the helper defaulted
to the dreamer-permissive set (all 6 actions). Production wiring in
tool-registry.ts always passes `["write", "delete"]` explicitly, but
a future caller forgetting the field would have inadvertently let
primary agents run `list/update/merge/archive`. Change the default to
`["write", "delete"]` — dreamer child sessions are still allowed full
access via the runtime `toolContext.agent === DREAMER_AGENT` gate,
which bypasses `allowedActions` entirely.
The 4 ctx-memory tests that exercised `list/update/merge/archive` in
the default test setup are updated to use `DREAMER_AGENT` as their
`toolContext.agent`, which is the realistic production shape (only
dreamer calls those actions).
Finding #9 — release-dashboard.sh non-tty guard (scripts)
The non-main-branch confirmation prompt at the top of the script used
`read -rp` without a TTY guard, which would hang forever in CI or
background invocations. Add an explicit `have_tty` check that refuses
the release with a clear error message when no controlling terminal
is available. Use `< /dev/tty` on the actual read for consistency
with other prompts in the script.
Finding #10 — historian-editor fallback policy documentation
(compartment-runner-historian.ts) The two-pass editor path
deliberately does NOT receive `fallbackModels` from the caller — if
the editor model fails, falling back to the already-validated draft
is cheaper and safer than iterating multiple fallback models for a
pure polish step. Behavior is correct; just add a docblock to make
the design choice explicit.
Skipped (false positives on close inspection):
- Finding #3 (defer-pass byte-equality test mutation): already covered
by adjacent test 4 which proves snapshot isolation by mutating
last_todo_state between cache-bust T0 and defer T1.
- Finding #4 (ctx_memory schema enum narrowing): the existing code
comment at tools.ts:185-188 explicitly documents that the full
action enum is intentional for the shared tool-definition model;
dreamer child sessions need the full enum and runtime gating is
correct. Narrowing per-deps would require duplicate tool definitions.1 parent e2353d3 commit cd21d0c
5 files changed
Lines changed: 72 additions & 28 deletions
File tree
- packages/plugin/src
- hooks/magic-context
- tools/ctx-memory
- tui
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
152 | 161 | | |
153 | 162 | | |
154 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
234 | | - | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | | - | |
| 259 | + | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| |||
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
285 | | - | |
| 286 | + | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| |||
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | | - | |
| 312 | + | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
47 | | - | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
497 | 508 | | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
506 | 517 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
512 | 529 | | |
513 | 530 | | |
514 | 531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
| |||
0 commit comments