@soleur/opencode 3.354.3 → 3.354.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/opencode/INSTRUCTIONS.md
CHANGED
|
@@ -120,11 +120,13 @@ harness shares with the guard scripts' own input contract.
|
|
|
120
120
|
`--apply` consumes, and no OpenCode surface can both rewrite the command and ask in the same
|
|
121
121
|
decision (ADR-264). So `plugins/soleur/scripts/lib/operator-script.sh`'s `soleur_op_stage_gate`
|
|
122
122
|
finds no receipt and exits **75** (`SOLEUR_BOOTSTRAP_APPROVAL_REQUIRED`). The typed-`yes`
|
|
123
|
-
fallback is gated on `-t 0`/`-t 1` **and**
|
|
124
|
-
`CLAUDECODE`/`CLAUDE_CODE_ENTRYPOINT`
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
fallback is gated on `-t 0`/`-t 1` **and** `! soleur_op_in_agent_harness`, which recognises
|
|
124
|
+
`OPENCODE` (alongside `CLAUDECODE`/`CLAUDE_CODE_ENTRYPOINT`), so that arm is closed here too:
|
|
125
|
+
direct `shell` calls have no tty (`fd 0/1/2` are pipes, measured on OpenCode 2.1.2), and even if
|
|
126
|
+
a child allocates a pseudo-terminal (`script`, `python pty`), `OPENCODE` keeps the fallback
|
|
127
|
+
refused because a terminal inside an agent harness is not evidence of a person. **No receipt can
|
|
128
|
+
be minted on this harness**, so a staged `--apply` refuses rather than approving. Nothing is
|
|
129
|
+
approved silently.
|
|
128
130
|
|
|
129
131
|
A degraded hook decision — a shell call whose `workdir` could not be correlated, or a runtime
|
|
130
132
|
with no `tool.execute.before` surface — is announced on stderr **and** written to the event log
|
package/package.json
CHANGED
|
@@ -703,12 +703,13 @@ soleur_op_barrier() {
|
|
|
703
703
|
|
|
704
704
|
# soleur_op_in_agent_harness
|
|
705
705
|
# True when this process runs under an agent harness (Claude Code sets CLAUDECODE
|
|
706
|
-
# and CLAUDE_CODE_ENTRYPOINT in every tool call's
|
|
707
|
-
# pseudo-terminal is accepted only when this is
|
|
708
|
-
# deliberately unsets these names and opens a
|
|
709
|
-
# hijacked-agent case the receipt threshold already
|
|
706
|
+
# and CLAUDE_CODE_ENTRYPOINT, and OpenCode sets OPENCODE, in every tool call's
|
|
707
|
+
# environment). A typed `yes` on a pseudo-terminal is accepted only when this is
|
|
708
|
+
# false. HONEST LIMIT: an agent that deliberately unsets these names and opens a
|
|
709
|
+
# pty defeats it; that is the hijacked-agent case the receipt threshold already
|
|
710
|
+
# excludes (ADR-264).
|
|
710
711
|
soleur_op_in_agent_harness() {
|
|
711
|
-
[[ -n "${CLAUDECODE:-}" || -n "${CLAUDE_CODE_ENTRYPOINT:-}" ]]
|
|
712
|
+
[[ -n "${CLAUDECODE:-}" || -n "${CLAUDE_CODE_ENTRYPOINT:-}" || -n "${OPENCODE:-}" ]]
|
|
712
713
|
}
|
|
713
714
|
|
|
714
715
|
# soleur_op_ack_or_die <prompt> [class 2]
|
|
@@ -307,11 +307,13 @@ function instructions(): string {
|
|
|
307
307
|
"`--apply` consumes, and no OpenCode surface can both rewrite the command and ask in the same",
|
|
308
308
|
"decision (ADR-264). So `plugins/soleur/scripts/lib/operator-script.sh`'s `soleur_op_stage_gate`",
|
|
309
309
|
"finds no receipt and exits **75** (`SOLEUR_BOOTSTRAP_APPROVAL_REQUIRED`). The typed-`yes`",
|
|
310
|
-
"fallback is gated on `-t 0`/`-t 1` **and**
|
|
311
|
-
"`CLAUDECODE`/`CLAUDE_CODE_ENTRYPOINT`
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"
|
|
310
|
+
"fallback is gated on `-t 0`/`-t 1` **and** `! soleur_op_in_agent_harness`, which recognises",
|
|
311
|
+
"`OPENCODE` (alongside `CLAUDECODE`/`CLAUDE_CODE_ENTRYPOINT`), so that arm is closed here too:",
|
|
312
|
+
"direct `shell` calls have no tty (`fd 0/1/2` are pipes, measured on OpenCode 2.1.2), and even if",
|
|
313
|
+
"a child allocates a pseudo-terminal (`script`, `python pty`), `OPENCODE` keeps the fallback",
|
|
314
|
+
"refused because a terminal inside an agent harness is not evidence of a person. **No receipt can",
|
|
315
|
+
"be minted on this harness**, so a staged `--apply` refuses rather than approving. Nothing is",
|
|
316
|
+
"approved silently.",
|
|
315
317
|
"",
|
|
316
318
|
"A degraded hook decision — a shell call whose `workdir` could not be correlated, or a runtime",
|
|
317
319
|
"with no `tool.execute.before` surface — is announced on stderr **and** written to the event log",
|
|
@@ -64,11 +64,13 @@ bash SCRIPT --stage NAME --apply --plan-digest D [--rotate-token] the approved
|
|
|
64
64
|
- `--apply --plan-digest D` performs the write. The script **recomputes** the plan and compares the
|
|
65
65
|
digest, so what runs is what was shown; a mismatch exits 75 `SOLEUR_BOOTSTRAP_PLAN_DRIFT` with
|
|
66
66
|
nothing written.
|
|
67
|
-
- The **receipt
|
|
68
|
-
a one-time record when the harness shows
|
|
69
|
-
|
|
70
|
-
environment variable or a flag set by the agent is
|
|
71
|
-
|
|
67
|
+
- The **receipt** (Claude Code interactive only): a plugin PreToolUse hook
|
|
68
|
+
(`plugins/soleur/hooks/operator-stage-approval.sh`) mints a one-time record when the harness shows
|
|
69
|
+
the person the exact command, and rewrites the command to carry `SOLEUR_APPROVAL_NONCE`. The script
|
|
70
|
+
consumes the record before its first write. An environment variable or a flag set by the agent is
|
|
71
|
+
never an approval. On harnesses without that hook (OpenCode, Codex, Devin cloud, Grok) and on the
|
|
72
|
+
web app, no receipt can be minted: `--apply` exits 75 (`SOLEUR_BOOTSTRAP_APPROVAL_REQUIRED`) with
|
|
73
|
+
nothing written (see **Surfaces** below).
|
|
72
74
|
- **Keep the `.env` beside the script.** "Satisfied" and `verify` read the recorded slugs there (it is
|
|
73
75
|
gitignored). A fresh checkout without it turns a satisfied stage into a rotation plan and makes
|
|
74
76
|
`verify` report a healthy vendor state as failed: run `verify` from the checkout that ran the stages.
|
|
@@ -244,7 +246,7 @@ state `SOLEUR_BOOTSTRAP_APPROVAL_PENDING stage=<s>` in your reply (headless only
|
|
|
244
246
|
and approves at the prompt. There is no variable, setting or file that approves it; never suggest one.
|
|
245
247
|
`bypassPermissions`, `dontAsk` and auto modes: the hook denies. The script itself accepts a typed `yes`
|
|
246
248
|
only from a person at their own terminal with no agent harness around it, so never allocate a
|
|
247
|
-
pseudo-terminal to answer it. Harnesses without the hook (Codex,
|
|
249
|
+
pseudo-terminal to answer it. Harnesses without the hook (OpenCode, Codex,
|
|
248
250
|
Devin cloud, Grok) and the web app: the script exits 75 and writes nothing; say "this surface cannot
|
|
249
251
|
make production changes yet" and **never** tell the person to open a terminal (the web approval
|
|
250
252
|
adapter is #9388; per-harness adapters are #9389).
|