Skip to content

docs(#992): opencode skill-load spike — verdict GO, recorded NDJSON fixture - #1005

Merged
admarble merged 6 commits into
mainfrom
feature/992-spike-opencode-does-opencode-run-command-phase-loa
Sep 8, 2026
Merged

admarble merged 6 commits into
mainfrom
feature/992-spike-opencode-does-opencode-run-command-phase-loa

Conversation

@admarble

@admarble admarble commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Spike #992 concluded: opencode run --command qa DOES load the sequant skill. Verdict GO, posted to #862 (verdict, correction).

No src/ TypeScript changed. Diff is exactly the two may-touch paths.

Headline result

Risk 1 ("the model never loads the skill") is refuted — but replaced by a larger one: the skill tool truncates the body. It delivered 51,144 of 174,981 chars in-band with truncated: true. The run only succeeded because the model noticed and issued five follow-up read calls. A weaker model that accepts the 51 KB gets ~29% of the qa skill. #862 AC-4's skill-not-loaded should become skill-truncated, asserted on part.state.metadata.truncated.

The canary (planted at char 150,308, absent from the wrapper) was recognised as a prompt injection and refused, citing the qa skill's own §6f Trust-Boundary Check — a second-order proof the model read that deep and applied a rule from elsewhere in the file.

Cost

$1.1281 across 6 runs, against a $5 cap. Decisive run: openrouter/anthropic/claude-sonnet-5, 408 s, $1.1198.

QA round 2 — three defects found and fixed

A first QA pass returned AC_NOT_MET. All findings are fixed in a81693d9 and 1a1857f0:

# Defect Fix
1 Doc named part.metadata.truncated; real path is part.state.metadata.truncated (part.metadata holds provider reasoning_details). A guard on the stated path reads undefined → falsy → silently never fires Corrected at all 3 sites + explicit ⚠️ warning and a jq verification one-liner
2 Doc claimed the permission.bash deny rules "worked". Fixture shows 28/28 calls completed, zero denials; gh was simply unauthenticated Claim retracted; deny rules recorded as untested. Also found webfetch: "deny" does not stop curl (6 calls to api.github.com)
3 Longest-line and in-band-char figures were pre-scrub values Corrected to measured values (100,031/96,556/69,752; 51,144)

AC verification

AC Status Evidence (Verify command run verbatim, I-9)
AC-0 ✅ opencode --version → 1.18.27; model id + $ recorded
AC-1 ✅ grep -cE 'SEQUANT_QA_VERDICT|### Verdict' … → 5, plus 2 corroborating signals (AC-6)
AC-2 ✅ jq -r '.type' … | sort -u → 4 types, pasted, each with a payload description — now accurate about state.metadata vs metadata
AC-3 ⚠️ Partial All three rows carry mitigation + command. Only process-group kill was reproduced; see below
AC-4 ✅ gh api …/862/comments | grep -c 'Spike verdict: GO|KILL' → 1
AC-5 ✅ Per-run $ + wall time; total $1.1281 < $5
AC-6/7 ✅ Three signals recorded; config hermeticity per run

AC-3 remains partial — and the negative results are the point

I spent a further ~$0.007 trying to reproduce the two unreproduced traps. Neither reproduced, and both failures are more useful to #862 than a green check:

  • /tmp permission kill — refuted. /tmp is not blocked on 1.18.27 even with external_directory: {"*":"deny"} and no allow rule. permission.external_directory does not govern the --dir tree at all.
  • 32K step clamp — not reproduced in three controls. One completed normally at 7,321 output tokens (payload too small to reach the cap); one opened 3 steps, closed none, and was killed at 420 s — consistent with the symptom but inconclusive, since no step_finish carried a token count. The ~32K figure is not measured here.

AC-3 as written asks for "the command that reproduced it" on all three rows; that is true for one. Reported as partial rather than argued away.

Cost-accounting corollary for #862: the hung control burned 420 s of real tokens but sums to $0.00 under the step_finish method, because no step_finish was emitted. Budgeting purely from step_finish.cost under-reports exactly the runs that hang.

Test plan

  • npm run build — passes
  • npm run lint — passes (0 warnings)
  • npm test — 5788 passed, 3 pre-existing failures
  • Pre-existing failures settled against base in the same worktree

The 3 failures (prompt-wait, batch-executor, relay-hook) reproduce identically at base 20e2a867 (v2.13.1). Unrelated to this diff, which adds only a Markdown doc and an .ndjson fixture no test references.

Mutation-verified: N/A — this node ships no gate tests. All ACs are manual/command-output (/spec recorded verificationMethod: manual for all five, hence no testgen phase). The fixture is recorded evidence, not an assertion.

CHANGELOG: intentionally omitted — nothing user-facing ships (internal investigation doc + test fixture). §7's regex counts docs: commits as user-facing, which is a false positive here; flagging rather than padding the changelog.

Scope

Scratch worktrees and branches deleted before this PR. Traps anonymized — behaviour recorded, third-party source not named.

Closes #992

…aths scrubbed)

Entire-Checkpoint: 5365ae49db89
…ost, and truncation finding

Entire-Checkpoint: 31f54740999f
…n opencode 1.18.27

Entire-Checkpoint: d57e0b25f533
… claim, record webfetch bypass

Entire-Checkpoint: 41af19997975
…step_finish cost-accounting caveat

Entire-Checkpoint: ceca3e63ff5f
…ap1-noclamp row)

Entire-Checkpoint: b12c7760ebc1
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.

spike(opencode): does opencode run --command <phase> load the sequant skill? (#862 P0 precondition, resolves OQ-8/OQ-9)

1 participant