Commit 7e909a9
test: harden v0.8.3 plan-mode trust-boundary tests + fix nested marker tracking (#899)
Follow-up from the v0.8.3 multi-model code review (GPT 5.4, Gemini 3.1 Pro,
Kimi K2.5, MiniMax M2.7, Claude). All non-blocking; the release is correct.
- processor.ts: remove the nested `// altimate_change` block around the
reworded plan-no-tool warning. `script/upstream/analyze.ts` `findMarkers`
uses a single `openBlock` with no nesting stack, so the inner `start`
clobbered the outer plan-refusal block and dropped it from marker tracking.
The warning text is already inside the outer block, so removing the inner
markers keeps the strict gate green (pure deletion) and restores correct
block tracking. (Gemini, verified against analyze.ts:499-520.)
- plan.txt: revert the start-marker description edit. plan.txt is imported raw
into the LLM prompt, so the added words were model-visible; the prose itself
already documents the trivial-task escape hatch. (Gemini #5.)
- plan-layer-e2e.test.ts / release-v0.8.3-adversarial.test.ts: replace
`session: {} as any` with a structurally valid `{ slug, time: { created } }`
and add an explicit `Flag.OPENCODE_EXPERIMENTAL_PLAN_MODE === false`
precondition, so a future flag flip fails loudly instead of throwing an
opaque TypeError in `Session.plan`. (Consensus; Gemini MAJOR.)
- plan-layer-e2e.test.ts: add an end-to-end SINK test — drive insertReminders'
output through the real `system`-array hoist and `MessageV2.toModelMessages`,
asserting attacker text never reaches `system` and the hoisted reminder is
not duplicated into the user role. (GPT.)
- release-v0.8.3-adversarial.test.ts: make the wording-fix guards
concept/synonym-tolerant (keep the load-bearing negative "too thin to act
on" guard) so legitimate copy improvements don't break the suite. (MiniMax.)
- plan-layer-e2e.test.ts: rename the mislabeled `insertReminders return shape`
test — it asserts the `InsertRemindersResult` type alias, not runtime
behaviour (which is covered by the behavioral describe). (MiniMax.)
Closes #898
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent daa0351 commit 7e909a9
4 files changed
Lines changed: 109 additions & 120 deletions
File tree
- packages/opencode
- src/session
- prompt
- test
- session
- skill
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
402 | 401 | | |
403 | 402 | | |
404 | 403 | | |
405 | 404 | | |
406 | 405 | | |
407 | 406 | | |
408 | 407 | | |
409 | | - | |
410 | 408 | | |
411 | 409 | | |
412 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments