Merge branch 'live-open-failures' into main
runner: fix live-gate open failures for pinned Claude and Codex Claude auth-status document framing; Codex 0.165.0 config readback and startup state; skills, memories, goals and plugins disabled; exact allowances for provider-written runtime state; named refusal categories.
44 files changed,
+4,814
−62
docs/superpowers/plans/CODEX-BRIEF-live-open-failures-2.md+44 −0docs/superpowers/plans/CODEX-BRIEF-live-open-failures-3.md+44 −0docs/superpowers/plans/CODEX-BRIEF-live-open-failures-4.md+41 −0docs/superpowers/plans/CODEX-BRIEF-live-open-failures.md+59 −0docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md+631 −0internal/directlive/codex_inventory.go+7 −0internal/directlive/try_inventory_test.go+12 −0internal/release/manifest.json+18 −18internal/runner/capture.go+11 −3internal/runner/capture_framing.go+35 −0internal/runner/capture_test.go+3 −3internal/runner/live_open_test.go+63 −0internal/runner/provider/account_diagnostics_test.go+88 −0internal/runner/provider/accounts.go+19 −14internal/runner/provider/claude/auth_framing.go+19 −0internal/runner/provider/claude/auth_framing_test.go+29 −0internal/runner/provider/claude/launcher.go+9 −3internal/runner/provider/claude/launcher_test.go+11 −2internal/runner/provider/claude/runtime_replay_test.go+245 −0internal/runner/provider/codex/config_readback.go+39 −0internal/runner/provider/codex/launcher.go+9 −7internal/runner/provider/codex/live_config_test.go+64 −0internal/runner/provider/codex/runtime_policy_test.go+77 −0internal/runner/provider/codex/runtime_replay_test.go+189 −0internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json+231 −0internal/runner/provider/codex/testdata/live-config-0.165.0.json+991 −0internal/runner/provider/direct_certification.go+1 −1internal/runner/provider/direct_live_config.go+2 −2internal/runner/provider/login_terminal.go+1 −1internal/runner/provider/runtime_claude.go+72 −0internal/runner/provider/runtime_claude_test.go+147 −0internal/runner/provider/runtime_home.go+124 −7internal/runner/provider/runtime_home_test.go+119 −0internal/runner/provider/runtime_links_test.go+136 −0internal/runner/provider/runtime_startup_test.go+148 −0internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json+115 −0internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json+100 −0internal/runner/provider/testdata/codex-empty-home-0.165.0.json+374 −0internal/runner/provider/types.go+4 −0internal/runner/testdata/claude-auth-status-2.1.312.json+8 −0internal/tryequipo/live_open_test.go+20 −0internal/tryequipo/run.go+1 −0internal/tryequipo/state.go+6 −1scripts/runner-reference-allowlist.json+448 −0
CI failed — run details
landed from live-open-failures
diff --git a/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-2.md b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-2.md| new file mode 100644 |
| index 00000000..59996221 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-2.md |
| @@ -0,0 +1,44 @@ |
| +# Brief: live open round 2 — Codex runtime home (controller decision) |
| + |
| +Same worktree/branch `live-open-failures`, at 07f6984. Read |
| +CONTROLLER-REPORT-live-open-failures.md first. Same HARD RULES as round 1 |
| +(never read account-home contents, never launch providers against Paul's |
| +homes, no live gate, read-only on ~/.local/share/equipo*). |
| + |
| +Problem: in the disposable STAGED runtime home, pinned codex 0.165.0 |
| +app-server creates at startup `.tmp`, `tmp`, `goals_1.sqlite`, |
| +`installation_id`, `memories_1.sqlite`, `queue_1.sqlite`, `skills/.system` |
| +(your empty-home recording). The runtime-home validator refuses `.tmp` and |
| +`skills`, so every Codex specialist open would fail again. |
| + |
| +Controller decision (fixed): |
| +- D1 Skills: first look for a 0.165.0 config/feature switch that stops the |
| + bundled system skills being installed or loaded (check `codex --help`, |
| + `app-server --help`, `-c` keys accepted under `--strict-config`, the |
| + config readback in the recorded `equipo:3` response, the binary's |
| + feature list via `codex features list` if it exists). Verify with the |
| + empty-home probe. If a switch exists, add it to the launcher's argv for |
| + every Codex launch (specialist + coordinator), keep `skills` refused, |
| + and assert the config readback shows it disabled. |
| + If NO switch exists: allow `skills/.system` only when its whole tree |
| + (relative paths, kinds, modes, sizes, sha256 of each file) matches a |
| + recorded manifest captured from the pinned binary in an empty home and |
| + pinned to codex.ExecutableSHA256; anything else under `skills` refused. |
| + Also verify via config/tool readback that no skill-provided tool is |
| + exposed to specialists; if one is, refuse. |
| +- D2 Scratch and state: allow exactly `.tmp`, `tmp` (directories, owned by |
| + the runner uid, no setuid, no symlinks escaping), `installation_id` |
| + (regular file), and the sqlite files `goals_1.sqlite`, |
| + `memories_1.sqlite`, `queue_1.sqlite` plus their `-shm`/`-wal` |
| + siblings (regular files), all in the staged runtime home only, never |
| + the source home. Nothing else new. Memories: if a config key disables |
| + Codex memories, set it too and check the readback. |
| +- D3 Replay: an end-to-end test that runs the real pinned codex app-server |
| + in an empty bwrap home through the production specialist Open path as |
| + far as it can go unauthenticated (it should now fail on the missing |
| + account, not on containment). Same for the coordinator. Skip with a |
| + clear message when the pinned binary is absent (CI), so CI stays green. |
| +- D4 Targeted tests, then ONE full `make -k ci` (rerun at most twice). |
| + Update the controller report with a "Round 2" section. Commit subject |
| + < 80 chars, body `Co-Authored-By: Astra <noreply@openai.com>`, push. |
| + Scratch under $TMPDIR removed. Print a five-line summary. |
diff --git a/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-3.md b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-3.md| new file mode 100644 |
| index 00000000..744d6060 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-3.md |
| @@ -0,0 +1,44 @@ |
| +# Brief: live open round 3 — finish round 2, then Claude runtime home |
| + |
| +Same worktree/branch; round 2 work is UNCOMMITTED in the tree (read the |
| +"Round 2" section of CONTROLLER-REPORT-live-open-failures.md). Same HARD |
| +RULES as round 1. |
| + |
| +Controller decisions: |
| +- E1 (answers your D2 question): YES. Allow, for Codex 0.165.0 only, in |
| + the staged runtime home only, symlinks at exactly |
| + `tmp/arg0-linux/codex-arg0<suffix>/{apply_patch,applypatch,codex-linux-sandbox}` |
| + where `<suffix>` matches the pattern you observed (pin it narrowly), the |
| + link is owned by the runner uid, and its target (read with Readlink, |
| + never followed) is exactly the in-namespace pinned codex path the |
| + launcher mounts (e.g. `/opt/codex`). Also allow the containing |
| + directories. Any other symlink, name, or target stays |
| + `runtime_special_entry`. Tests for each refusal. Make the replay pass |
| + regardless of cancellation timing. |
| +- E2 Claude runtime home (Opus review of 07f6984, Important 1+2): the |
| + Claude preflight runs the full `-p` command and Open then walks the |
| + runtime home; neither has been observed. Using the pinned claude in |
| + ~/.local/share/equipo/try/bin with a fresh EMPTY CLAUDE_CONFIG_DIR under |
| + $TMPDIR inside the launcher's bwrap shape, run the production Claude |
| + preflight/Open path as far as it goes unauthenticated (like |
| + TestCodexEmptyHomeReplay; skip when the binary is absent) and record the |
| + runtime-home tree (names/kinds/modes only). Allow only recorded, |
| + non-policy-bearing scratch/state entries for Claude 2.1.312 with the |
| + same guards as Codex; keep `plugins`, `skills`, `agents`, `commands`, |
| + `hooks`, `settings*.json`, `CLAUDE.md`, MCP config refused. If a |
| + settings switch prevents an entry (e.g. disabling shell snapshots, |
| + session env, IDE, plugins), prefer the switch and assert it. Give |
| + Claude-specific fixed reason categories so an unexpected entry names |
| + its category without echoing agent-controlled names. |
| +- E3 Opus minors: share the auth argv constant between |
| + capture_framing.go:18 and claude/launcher.go:331; check the manifest's |
| + provider version as well as the binding's (capture_framing.go:19); fix |
| + the comment at codex/config_readback.go:21-36 to say the two disabled |
| + flags are not reflected in typed config and the live tool inventory |
| + check (directlive/coordinator_inventory.go) is the real guard. |
| +- E4 Targeted tests, then ONE full `make -k ci` (rerun at most twice). |
| + Add "Round 3" to the controller report. Commit (subject < 80 chars, body |
| + `Co-Authored-By: Astra <noreply@openai.com>`; separate commits for round |
| + 2 and round 3 are fine), push `live-open-failures`. Scratch removed. |
| + If blocked on a decision again, commit nothing, write the question in |
| + the report and print it. Print a five-line summary. |
diff --git a/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-4.md b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-4.md| new file mode 100644 |
| index 00000000..a1b8337f |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures-4.md |
| @@ -0,0 +1,41 @@ |
| +# Brief: live open round 4 — authenticated startup state (Opus review of 2dd2a6d) |
| + |
| +Same worktree/branch at 2dd2a6d. Same HARD RULES as round 1 (never read |
| +account-home contents, never launch providers against Paul's homes, no |
| +live gate). Controller decisions are fixed; do not stop to ask. If a |
| +switch below does not exist in the pinned binary, take the stated |
| +fallback and record it in the report. |
| + |
| +- F1 Codex specialists: disable `goals`, `plugins`, `remote_plugin` and |
| + `tool_suggest` for specialist launches exactly as configureCoordinator |
| + does (codex/launcher.go:135), assert they read back under |
| + --strict-config, and add a live-inventory assertion that no goal or |
| + plugin tools are exposed. This should also stop the curated-plugin sync |
| + (`.tmp/plugins.sha`, `.tmp/plugins/...`); verify the replay no longer |
| + touches it if observable. Fallback: none; refuse. |
| +- F2 Codex: give `.tmp/plugins*` and other known Codex startup paths |
| + their own fixed `runtime_codex_*` categories so a refusal names them. |
| + Fix the stale `runtime_codex_tmp` mention in the report. |
| +- F3 Claude authenticated startup: allow, for 2.1.312 staged homes only, |
| + regular files exactly `policy-limits.json`, `policy-limits.json.signature.json`, |
| + `policy-limits.json.signature-iat.json` (provider-written org limits; |
| + same uid/mode/hardlink guards). Keep `remote-settings.json` REFUSED with |
| + its own fixed category `runtime_claude_remote_settings` (managed |
| + settings would change policy). Also set `plugin-authoring@builtin`: |
| + false in enabledPlugins beside agents-md, and set `autoMemoryEnabled` |
| + and `autoDreamEnabled` false; assert all in the replay/readback. |
| +- F4 Claude Bash state: first look for a 2.1.312 switch that stops |
| + `shell-snapshots` and `session-env` (env vars or settings in the |
| + binary's strings). If one exists, set it and keep both refused. If not: |
| + allow `shell-snapshots/` containing only regular files matching the |
| + binary's exact snapshot name pattern, and `session-env/<uuid>/` with |
| + only the binary's exact file-name pattern, both with the usual guards, |
| + only because agent tools are denied the staged home (cite the deny at |
| + claude/launcher.go:139-149 in a comment). Test BeginTurn on a second |
| + turn with these present. |
| +- F5 Minor: use the provider Version constants instead of literals; make |
| + arg0 names accept only symlinks (not regular files). |
| +- F6 Targeted tests, then ONE full `make -k ci` (rerun at most twice). |
| + "Round 4" in the controller report. Commit (subject < 80 chars, body |
| + `Co-Authored-By: Astra <noreply@openai.com>`), push. Scratch removed. |
| + Print a five-line summary. |
diff --git a/docs/superpowers/plans/CODEX-BRIEF-live-open-failures.md b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures.md| new file mode 100644 |
| index 00000000..ab3955f8 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CODEX-BRIEF-live-open-failures.md |
| @@ -0,0 +1,59 @@ |
| +# Brief: first live gate run failed at open (systematic debugging) |
| + |
| +Branch `live-open-failures` from main cd359d8. Paul ran |
| +scripts/try-equipo.sh for real on docs-t1 (5 Claude + 2 Codex dedicated |
| +homes confirmed; RUN LIVE GATE authorized). Every tuple failed at open in |
| +~42 s, before any model turn. Find the ROOT causes (superpowers |
| +systematic-debugging: evidence first, no guess fixes), fix, test. |
| + |
| +Paul's terminal output (verbatim, abridged): |
| + |
| + claude-Engineering: open: claude_process_failed: exit=-1 signal=9 stderr=: runner.invalid |
| + (same for every Claude specialist; claude-Coordinator: coordinator launcher open: … same) |
| + codex-Engineering: open: provider_account_containment |
| + (same for every Codex specialist) |
| + codex-Coordinator: open: coordinator launcher open: provider_policy_rejected |
| + every */certification.json calibration: provider_policy_rejected |
| + |
| +Evidence (read-only): ~/.local/share/equipo/try/run-2425960409/ |
| +(direct-live.json, evidence/*/{capture,tuple-completed,certification}.json; |
| +codex-Coordinator/capture.json has the app-server frames incl. the config |
| +readback, id equipo:3). Saved setup: ~/.local/share/equipo/try/state.json, |
| +bindings: ~/.local/share/equipo-runner/bindings.json, runner.env beside it. |
| +Leads, unverified: `runner.invalid` is runnerproto.ErrInvalid |
| +(internal/runnerproto/validate.go:17), so something in the Claude open path |
| +validates a runner-protocol value and the process gets SIGKILLed; |
| +provider_account_containment for Codex comes from lease.Validate |
| +(codex/launcher.go:450) — e.g. app-server writing sqlite/log files into the |
| +home, or the coordinator's run changing the home before the specialists; |
| +Codex coordinator policy rejection is probably readConfig vs the observed |
| +0.165.0 config (e.g. allow_login_shell true, approvals_reviewer). |
| + |
| +HARD RULES (Paul's credentials): |
| +- Never read, print, copy or hash the CONTENTS of any file in |
| + ~/.local/share/equipo/accounts/* (auth.json, .credentials.json, |
| + .claude.json, sqlite). Names, sizes, modes and mtimes are fine. |
| +- Never launch claude or codex against those homes and never sign in. |
| + You MAY run the pinned binaries in ~/.local/share/equipo/try/bin with a |
| + fresh EMPTY home under $TMPDIR (inside bwrap like the launcher) to |
| + reproduce process-level failures; that makes no authenticated calls. |
| +- Do not run the live gate. Do not modify ~/.local/share/equipo* except |
| + nothing at all: read-only. |
| +- Network allowed for go modules. No copy-review server. |
| + |
| +Deliver: |
| +- One root cause per symptom, with evidence (file:line, frame, or a |
| + reproduction). If a cause depends on real authenticated behaviour you |
| + cannot observe, say exactly what to capture next and add only safe |
| + diagnostics (no secrets in errors: the Claude stderr is already "", |
| + make sure the real cause is reported instead of runner.invalid). |
| +- Fixes that keep the policy strict: tolerate only observed, documented |
| + 0.165.0 / 2.1.312 behaviour, refuse everything else, tests with recorded |
| + frames. |
| +- Error text for the guide: the `forge` phase label is shown when |
| + privateDir(~/.local/share/equipo-runner) fails; name the real path. |
| +- Targeted tests, then ONE full `make -k ci`; fix and rerun at most twice. |
| + Commit subject < 80 chars, body `Co-Authored-By: Astra <noreply@openai.com>`, |
| + push `live-open-failures`. Go caches at defaults, scratch under $TMPDIR |
| + removed. Write CONTROLLER-REPORT-live-open-failures.md with causes, |
| + fixes and confidence per symptom. Print a five-line summary. |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md b/docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md| new file mode 100644 |
| index 00000000..0aca0e08 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md |
| @@ -0,0 +1,631 @@ |
| +# Live open failures |
| + |
| +The four rounds fix auth framing, config readback and the runtime-home |
| +conflicts reproduced with the pinned providers. Both providers now pass |
| +unauthenticated runtime replays for the specialist and coordinator. The |
| +branch is not live-certified; authenticated behavior remains unobserved. |
| + |
| +## Causes and confidence |
| + |
| +| Symptom | Cause and evidence | Confidence and result | |
| +| --- | --- | --- | |
| +| Claude open ends with SIGKILL and `runner.invalid` | Claude 2.1.312 `auth status --json` writes one indented JSON document. The production capture loop treated its first line, `{`, as a complete frame. `AppendFrame` rejected it and capture called `Contain`, producing signal 9. See `internal/runner/capture.go:241`, `:318`, and the recorded empty-home output in `internal/runner/testdata/claude-auth-status-2.1.312.json`. | High for the framing defect and kill mechanism. The real authenticated output was not inspected. The production-capture regression reproduced the failure before the fix. | |
| +| Codex coordinator rejects config | Saved `codex-Coordinator/capture.json`, response `equipo:3`, retains `tools.update_plan.enabled=false` and `tools.experimental_request_user_input.enabled=false` in `sessionFlags`, but effective `config.tools` is exactly `{"web_search":null}`. Recursive subset comparison rejected those two absent fields. The proposed `allow_login_shell` and `approvals_reviewer` leads were not the mismatch: the former is an expanded default; the latter matches `user`. | High. The saved response fails on the base and passes with the narrow exception. | |
| +| Codex specialists report containment | The saved specialist captures are null, so they do not identify the failing check. A pinned 0.165.0 app-server in an empty, network-isolated home creates `.tmp`, `goals_1.sqlite`, `installation_id`, `memories_1.sqlite`, `queue_1.sqlite`, `skills/.system`, and `tmp`. The existing runtime-home validator rejects `.tmp` first, and independently forbids `skills`. Replaying the recorded names reproduces containment. | High for the startup-layout conflict; insufficient evidence to assign that exact cause to the authenticated failures. No speculative permission change. Added diagnostics identify lease, probe, or post-preflight runtime-policy failure. | |
| +| Every calibration reports policy rejection | All opens failed, so every saved certification has null usage. `internal/directlive/driver.go:117` pools those empty samples and still invokes calibration at `:131`; `internal/directlive/probes.go:149` calls `DirectReservations`, which rejects absent samples (`internal/runner/provider/direct_certification.go:77`). | High. Consequence of failed opens, not a second provider config failure. Unknown usage remains unknown; calibration is unchanged. | |
| +| Guide reports `forge` for a private-directory failure | `Wizard.Run` retained its last configuration-field phase while creating runner directories and writing bindings. `privateDir` omitted the offending path from policy errors. | High. The phase now names the runner root, and the directory error includes the actual path. | |
| + |
| +The saved evidence was read only from |
| +`~/.local/share/equipo/try/run-2425960409/`. Files under |
| +`~/.local/share/equipo/accounts/` were only listed and statted. No account |
| +file contents were read, copied, printed, or hashed. No existing Equipo |
| +state was changed. No sign-in, live gate, authenticated CLI call, merge, |
| +default-branch push, deployment, or copy-review server was run. |
| + |
| +The coordinator cannot explain the earlier specialist failures by running first: |
| +`runRoles` schedules it last (`internal/directlive/driver.go:54`), and each |
| +exercise opens a fresh lease. Source-home SQLite files are not copied by |
| +`AccountLease.stage`; the runtime guard inspects the staged home, not the |
| +source account directory. These details rule out those two proposed paths, |
| +but do not identify the exact failed authenticated check. |
| + |
| +## Fix boundaries |
| + |
| +`internal/runner/capture_framing.go:16` selects document framing only for the |
| +exact launcher-generated auth command, Claude 2.1.312, and a matching |
| +manifest hash. It reads at most 1 MiB plus one byte, requires one JSON object, |
| +and rejects duplicate keys or trailing documents. Agent streams keep their |
| +existing line framing. Invalid output gets a fixed `stdout_invalid_json` |
| +reason without echoing output bytes. |
| + |
| +`internal/runner/provider/codex/config_readback.go:9` accepts only the recorded |
| +omission, only for a hashed coordinator manifest at 0.165.0. Both requested |
| +tools must be exactly disabled, and effective tools must be exactly the |
| +recorded `{"web_search":null}` object. The original settings are still |
| +checked against the full command-line layer. Other configured fields, |
| +approvals, config layers, origins, and the MCP server inventory remain checked. |
| +Live certification must still verify the available tools before a release. |
| +The fixture preserves response `equipo:3`; `/home/paulca` was replaced with |
| +`/home/fixture`. It contains no account response or credentials. |
| + |
| +`internal/runner/provider/accounts.go` and `runtime_home.go` now attach fixed |
| +reason codes to containment failures. They never include file contents, |
| +arbitrary filenames, or underlying filesystem errors. Known Codex startup |
| +artifacts get fixed categories, such as `runtime_codex_dot_tmp`. This does not |
| +allow those artifacts or bypass identity, permissions, refresh, or policy |
| +checks. In particular, bundled skills are still rejected. |
| + |
| +`internal/tryequipo/run.go:90` sets the phase to the runner directory. |
| +`internal/tryequipo/state.go:72` adds the actual failing directory to the |
| +existing error. For the reported case it names |
| +`/home/paulca/.local/share/equipo-runner`. Existing reviewed guide wording is |
| +reused; no new app copy or README prose was added. |
| + |
| +## Reproductions and verification |
| + |
| +Both binary probes used the pinned executables under |
| +`~/.local/share/equipo/try/bin`, with separate fresh empty homes under the |
| +on-disk `$TMPDIR`. SHA-256 checks matched both adapter pins: |
| +Claude `4f4178ce41d83e23341ebfbaecdbcf8ea6bf7baea0690025abe49eeec3a5d01d` |
| +and Codex `c06a67fd8ac76508dc78bd99ce20c9f317b8d568beda59485f3f4134df9962d5`. |
| +Bubblewrap used `--unshare-all --die-with-parent |
| +--new-session`, read-only `/usr` and binary mounts, `/proc`, `/dev`, a private |
| +`/tmp`, and only the new home and workspace as writable mounts. The environment |
| +was cleared, with `HOME` and the provider home set to `/home/runner`. |
| + |
| +- Claude command: `/opt/claude --setting-sources '' auth status --json`, |
| + with updater and nonessential traffic disabled. Exit 1, empty stderr, |
| + indented JSON with `loggedIn:false`. The stdout fixture is byte-for-byte. |
| +- Codex command: `/opt/codex app-server --strict-config --listen stdio:// -c |
| + features.remote_control=false`. Sent `initialize` with experimental API, |
| + `initialized`, then `account/read` with `refreshToken:false`. Account was |
| + null. No thread or turn was started. Only path names and file kinds were |
| + retained in `internal/runner/provider/testdata/codex-empty-home-0.165.0.json`. |
| + This minimal startup probe was not the full specialist policy. |
| + |
| +All Go commands used `CGO_ENABLED=0 GOTOOLCHAIN=go1.26.10`, with default Go |
| +caches. Tests were written before implementation: |
| + |
| +```sh |
| +go test ./internal/runner ./internal/runner/provider/codex ./internal/tryequipo \ |
| + -run 'TestDirectClaudeAuthDocument|TestDirectFrameDiagnosticNoContents|TestCodexLiveConfig|TestPrivateDirectoryFailureNamesPath' -count=1 |
| +go test ./internal/runner/provider -run '^TestAccountContainmentDiagnostics$' -count=1 |
| +go test ./internal/runner/provider -run '^TestAccountRecordedCodexRuntimeRefused$' -count=1 |
| +``` |
| + |
| +The first command failed on auth framing, opaque frame errors, the saved |
| +Codex config, and the missing directory path. All five diagnostic subtests |
| +in the second command failed before their fixes. The inventory replay in |
| +the third failed to identify the startup directory before the diagnostic |
| +change. All pass after implementation. |
| + |
| +Guard mutations were applied separately and restored immediately. Each |
| +command below failed by assertion, not by a compile error: |
| + |
| +| Temporary break | Command after `go test` | |
| +| --- | --- | |
| +| Accept any nonempty Claude version for document framing | `./internal/runner -run '^TestDirectClaudeAuthDocument/other-version$' -count=1` | |
| +| Remove the exact auth argv comparison | `./internal/runner -run '^TestDirectClaudeAuthDocument/(stream\|extra-arg)$' -count=1` | |
| +| Bypass config validation | `./internal/runner/provider/codex -run '^TestCodexLiveConfigStrict$' -count=1` | |
| +| Bypass runtime entry checks | `./internal/runner/provider -run '^TestAccount(ContainmentDiagnostics\|RecordedCodexRuntimeRefused)$' -count=1` | |
| +| Drop the failing path from the guide error | `./internal/tryequipo -run '^TestPrivateDirectoryFailureNamesPath$' -count=1` | |
| + |
| +After restoring all guards, the targeted suite was run with: |
| + |
| +```sh |
| +go test ./internal/runner ./internal/runner/provider/... ./internal/tryequipo \ |
| + -run 'TestAccountContainmentDiagnostics|TestAccountRecordedCodexRuntimeRefused|TestDirectClaudeAuthDocument|TestDirectFrameDiagnosticNoContents|TestCodexLiveConfig|TestPrivateDirectoryFailureNamesPath|TestDirectJournalFailureContains|TestCodexRecorded|TestPlanWorkflowProviderPoliciesLauncher|TestCoordinatorOnlyMCPServer|TestAccount' \ |
| + -count=1 |
| +``` |
| + |
| +The first `make -k ci` completed with two causes of failure: the supplied |
| +brief lacked two reference-inventory entries, and the runner test package |
| +was 14 lines over its existing limit. The inventory issue also failed |
| +`TestDirectDeadReferencesRepository`. All other checks passed. The runner |
| +package took 350.106 seconds against its 330-second local advisory budget; |
| +the budget was not raised. |
| + |
| +The frame diagnostic assertion now shares the existing malformed-frame |
| +case in `TestDirectJournalFailureContains`, preserving all coverage and |
| +bringing the runner tests to exactly 8,800 lines. The reference inventory |
| +includes exact, reasoned entries for the supplied brief and new artifacts. |
| + |
| +The first full rerun of `make -k ci` passed (exit 0): reference inventory, |
| +build, vet, formatting, staticcheck, govulncheck, gitleaks, size budgets, |
| +all tests, adapter checks, namespace checks, migration check, and performance. |
| +The main suite ran 27 packages with no cached results and no failures. |
| +The runner package took 299.643 seconds, within its 330-second limit. |
| +The performance lane passed, including a 101 ms median cold boot against |
| +500 ms. There were two full gate runs total, with no second rerun needed. |
| +`EQUIPO_LIVE_DIRECT` and `EQUIPO_LIVE_CONFIG` were unset. |
| + |
| +The standalone frame-diagnostic test named in the initial failing command |
| +was consolidated into `TestDirectJournalFailureContains/malformed` for the |
| +size gate. After consolidation, `go test ./internal/runner -run |
| +'TestDirectClaudeAuthDocument|TestDirectJournalFailureContains' -count=1` |
| +also passed. Temporary guard mutations were all restored before either |
| +full gate. |
| + |
| +## Next authenticated observation |
| + |
| +Only Paul may authorize and run a new live trial. Retain its |
| +`tuple-completed.json`, `capture.json`, and `certification.json`. The new |
| +Codex error prefix separates these cases: |
| + |
| +- `codex_preflight_lease`: source or runtime identity/credential validation |
| + failed before the probe. The fixed suffix identifies which check. |
| +- `codex_preflight_probe`: process/identity/config readback or post-probe |
| + account validation failed. |
| +- `codex_open_runtime_policy` with `runtime_codex_plugins` or |
| + `runtime_policy_entry`: the CLI created startup files that conflict with |
| + the strict runtime policy. |
| + |
| +If an unexpected entry remains, capture only its path, type, mode, owner, |
| +link count, size, and mtime before the disposable runtime home is removed. |
| +Do not capture credential, SQLite, or skill contents. Any policy adjustment |
| +needs evidence that the particular files cannot introduce tools or settings; |
| +the empty-home observation alone does not establish that. No claim is made |
| +that the next authenticated run will pass. |
| + |
| +## Round 2 |
| + |
| +The pinned 0.165.0 binary supports `skills.bundled.enabled=false`. Both |
| +specialist and coordinator policies now pass that setting and |
| +`features.memories=false` through their hashed settings, argv and thread |
| +policy. Config readback must retain both values. The runtime validator |
| +still refuses `skills`, including `skills/.system`. |
| + |
| +### Switch evidence |
| + |
| +The probes used only new credential-free homes under the on-disk |
| +`$TMPDIR`, with `bwrap --unshare-all --die-with-parent --new-session`, an |
| +empty environment, and the verified pinned binary. There was no egress |
| +relay, account-home mount, sign-in, thread, turn or live gate. |
| + |
| +`codex --help` and `codex app-server --help` describe `-c`, `--disable` and |
| +`--strict-config`, but no dedicated bundled-skills option. The recorded |
| +round-one `equipo:3` response has `skills:null` and `memories:null`; its |
| +coordinator feature map already has `memories:false`. |
| + |
| +`codex features list` includes `memories` and |
| +`skip_host_skill_discovery`. A probe with the latter enabled still |
| +installed and listed all five bundled skills. That flag is insufficient. |
| +The pinned binary's config type names include `SkillsConfig`, `bundled` |
| +and `BundledSkillsConfig`, which led to the successful strict-config |
| +probe: |
| + |
| +```sh |
| +/opt/codex app-server --strict-config --listen stdio:// \ |
| + -c features.remote_control=false \ |
| + -c skills.bundled.enabled=false -c features.memories=false |
| +``` |
| + |
| +The effective config and session layer both retain the requested values. |
| +`skills/list` with `forceReload:true` returns one workspace with empty |
| +skills and errors arrays. No `skills` directory is created. Direct |
| +responses from `initialize`, `account/read`, `config/read` and |
| +`skills/list` are recorded in |
| +`internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json`. |
| +The account is null. Installation-specific notifications were omitted. |
| +The manifest fallback in D1 is therefore unnecessary. |
| + |
| +### Runtime state |
| + |
| +For Codex 0.165.0 only, the staged-home validator now permits `.tmp` and |
| +`tmp` directories, `installation_id`, and the three named SQLite files |
| +with their `-shm` and `-wal` siblings. Entries must belong to the runner |
| +uid, with no setuid or setgid bits. State entries must be regular files; |
| +regular files with multiple hard links are refused. Nested scratch |
| +entries retain the policy-name and special-file checks. Other versions, |
| +providers and new top-level names do not gain these allowances. |
| +`AccountLease.stage` is unchanged and copies none of these source-home |
| +artifacts. A regression checks that source scratch and state stay out of |
| +the staged home. |
| + |
| +### Replay and remaining decision |
| + |
| +`TestCodexEmptyHomeReplay` invokes the production `Launcher.Open` for |
| +`implement` and `coordinate` with the real pinned executable and code |
| +mode helper. Its test transport uses a network-isolated bubblewrap home |
| +and the existing frame-capture fixture. It skips clearly when the pinned |
| +installation is absent. The source is newly created, with an |
| +`auth_mode:apikey` marker and no key or other credential. An empty JSON |
| +object is unsuitable: Codex interprets it as incomplete ChatGPT auth and |
| +returns a protocol error requiring a plan type. |
| + |
| +Both real opens now return `codex_preflight_probe: |
| +provider_identity_mismatch` from the missing account. Since this occurs |
| +before config readback, a second unauthenticated process checks the same |
| +policy through production `readConfig`. Only after every process exits |
| +does the test mark its synthetic lease ready, solely to run |
| +`ValidatePolicy` against the actual startup tree. No real process runs |
| +with that synthetic identity. |
| + |
| +That final check found another artifact not retained by the graceful |
| +round-one probe: `tmp/arg0-linux/codex-arg0*/apply_patch`, `applypatch` |
| +and `codex-linux-sandbox` are symlinks to `/opt/codex`. They remain after |
| +the launcher's cancellation path. The current validator refuses them |
| +with `runtime_special_entry`. D2 says no escaping symlinks; these leave |
| +the runtime home but target the pinned binary inside the namespace. |
| +Permission to allow only those verified links is pending. The replay |
| +still fails its final runtime check, so this round is not complete. |
| + |
| +### Verification so far |
| + |
| +All Go commands use `CGO_ENABLED=0 GOTOOLCHAIN=go1.26.10` and default caches. |
| +Before implementation, this command failed for all twelve allowed state |
| +entries and for the missing disable settings in both roles: |
| + |
| +```sh |
| +go test ./internal/runner/provider ./internal/runner/provider/codex \ |
| + -run 'TestAccountCodexRuntimeState|TestCodexRuntimeSettings' -count=1 |
| +``` |
| + |
| +Those tests now pass. The complete provider and Codex packages pass with |
| +the unresolved real replay excluded (11.135 seconds and 20.380 seconds): |
| + |
| +```sh |
| +go test ./internal/runner/provider ./internal/runner/provider/codex \ |
| + -skip '^TestCodexEmptyHomeReplay$' -count=1 |
| +``` |
| + |
| +Each guard below was temporarily broken, observed failing by assertion, |
| +and restored before continuing. Commands use `go test`, the package |
| +shown, `-run` with the pattern shown, and `-count=1`. |
| + |
| +| Temporary break | Package and test pattern | |
| +| --- | --- | |
| +| Ignore uid | `./internal/runner/provider -run '^TestAccountCodexRuntimeOwner'` | |
| +| Ignore setuid/setgid | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/(nested-setuid\|setgid)$'` | |
| +| Accept wrong entry kinds | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/(scratch-file\|state-directory)$'` | |
| +| Accept hard links | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/hardlink$'` | |
| +| Remove version restriction | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/other-version$'` | |
| +| Remove provider restriction | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/other-provider$'` | |
| +| Allow an unrecorded database name | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/other-state$'` | |
| +| Accept policy-bearing names | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/(skills\|nested-policy)$'` | |
| +| Accept special entries | `./internal/runner/provider -run '^TestAccountCodexRuntimeStateGuards/(symlink\|fifo)$'` | |
| +| Ignore effective config mismatch | `./internal/runner/provider/codex -run '^TestCodexRuntimeSettings$'` | |
| +| Enable memories in policy | `./internal/runner/provider/codex -run '^TestCodexRuntimeSettings$'` | |
| +| Enable bundled skills | `./internal/runner/provider/codex -run '^TestCodexEmptyHomeReplay/implement$'` | |
| + |
| +The last mutation made the real replay fail specifically because bundled |
| +skills were installed. Size budgets pass unchanged. The reference |
| +inventory includes the two null JS-path fields in the new config fixture. |
| +The expanded targeted checks also passed for the runner and all provider |
| +packages, selecting the account, Codex, workflow-policy and coordinator |
| +MCP tests, with only the unresolved replay excluded. |
| + |
| +After adding the production `TMPDIR` and `LANG` environment values to the |
| +replay transport, the specialist still failed on the leftover symlinks; |
| +the coordinator passed that run. Their survival depends on cancellation |
| +timing. The full `make -k ci` has not yet run in round 2. Nothing has been |
| +committed or pushed for this round. All temporary mutations are restored, |
| +and this session's scratch and processes have been removed. |
| + |
| +## Round 3 |
| + |
| +E1 resolves round 2's pending decision. Codex 0.165.0 may leave exactly |
| +`tmp/arg0-linux/codex-arg0[A-Za-z0-9]{6}/apply_patch`, `applypatch`, and |
| +`codex-linux-sandbox` as links to `/opt/codex`. This round observed suffixes |
| +`gpkiVb` and `5Tf46c` in the failing specialist and coordinator replays. |
| +The validator uses `Readlink`, never resolves the target, and checks the |
| +link's uid and mode. The containing directories retain the round 2 |
| +metadata guards. The launcher independently verifies the pinned executable |
| +and its namespace mount. Other names, suffix lengths, characters, parents, |
| +targets, owners, providers and versions are refused. Source-home links are |
| +not staged. Both real Codex Opens now reach the missing-account error, and |
| +the resulting runtime trees pass whether cancellation leaves the links or |
| +removes them. |
| + |
| +### Claude observations and fix |
| + |
| +`TestClaudeEmptyHomeReplay` checks the pinned 2.1.312 binary's SHA-256 and |
| +uses the production specialist and coordinator policy, Open, lease and |
| +no-input preflight probe. The test transport runs bubblewrap without any |
| +network or egress relay. It mounts only fresh test homes, a fresh workspace, |
| +read-only runtime files and generated policy. Its capture decodes JSON; |
| +the existing runner capture tests separately exercise production framing. |
| +The tool-proxy mount is an inert fixture: this is not a tool-call test. |
| + |
| +Real Open stops at unauthenticated auth status, with exit 1 and no signal. |
| +It does not reach the full `-p` dependency probe. The replay therefore also |
| +invokes that exact production probe inside the lease's checking callback, |
| +with stdin closed and no prompt. It first substitutes a completely empty |
| +`CLAUDE_CONFIG_DIR`, then runs against the newly staged credential-free |
| +fixture. The full probe exits successfully in both roles. Only after every |
| +real process exits does a synthetic identity callback enable the final |
| +`ValidatePolicy` check. No provider process uses that synthetic identity. |
| + |
| +The baseline probe created `plugins/store/cc-plugin-agents-md_builtin-*.json` |
| +despite `disableAllHooks=true`, an empty `enabledPlugins` object, and |
| +`--disable-slash-commands`. It also created `.cache`, `.claude`, `.config`, |
| +`.npm`, `dev-mods` and `seed-admin`, which were outside the runtime allowlist. |
| +These are reproduced startup conflicts, not guesses about authenticated |
| +sessions. |
| + |
| +The pinned binary contains the `enabledPlugins` setting and the |
| +`agents-md@builtin` alias. Setting that entry to `false` prevents the plugin |
| +directory in both roles. The launcher now sets it, and the replay asserts |
| +the setting and the absence of plugins, skills, agents, commands, shell |
| +snapshots and session env scripts. `--bare` was considered and rejected: |
| +its embedded help says it disables OAuth reads. `--safe-mode` disables MCP |
| +servers while retaining built-in plugins, so it is also unsuitable. |
| + |
| +Names, kinds and modes from the empty-home probes are recorded in |
| +`internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json` |
| +and `claude-empty-home-disabled-2.1.312.json`. No runtime file contents were |
| +retained. The new 2.1.312 allowances are limited to: |
| + |
| +- The exact cache directories through |
| + `.cache/claude-cli-nodejs/-workspace/mcp-logs-equipo`, and timestamped |
| + JSONL log files there. |
| +- `.npm`, `.npm/_logs`, its recorded timestamped debug-log names, and the |
| + regular `_update-notifier-last-checked` marker. |
| +- The empty directories `.claude`, `.claude/ssh`, `.config`, |
| + `.config/anthropic`, `dev-mods` and `seed-admin`. No files or further |
| + directories under these paths are allowed. |
| + |
| +Claude entries must belong to the runner uid, have no setuid/setgid bits, |
| +and be directories or regular files with one hard link. Symlinks and other |
| +special files remain refused. The new allowances do not apply to source |
| +homes, other providers or other versions. Policy names are refused at any |
| +depth, including `plugins`, `skills`, `agents`, `commands`, `hooks`, |
| +`settings*.json`, `CLAUDE.md`, MCP config, `shell-snapshots` and `session-env`. |
| +Fixed `runtime_claude_*` categories identify cache, config, npm, mod, seed, |
| +metadata, kind, policy, special-file and unexpected-entry failures without |
| +echoing arbitrary names or contents. The baseline fixture remains refused |
| +at its plugin directory; the disabled-plugin fixture passes. |
| + |
| +### Minor fixes and verification |
| + |
| +Auth argv now comes from `claude.AuthStatusArgs`, which returns a fresh |
| +slice. The shared framing selector lives beside it in the Claude adapter |
| +and is called by runner capture. It checks both the binding and manifest |
| +provider versions, along with the existing manifest hash and exact argv. |
| +The manifest-version test covers a wrong version and an absent version. |
| +The Codex readback comment now identifies the live coordinator tool |
| +inventory as the real guard for the two flags missing from typed config. |
| + |
| +All Go commands use `CGO_ENABLED=0 GOTOOLCHAIN=go1.26.10` and default Go |
| +caches. New tests were run before their implementation: |
| + |
| +```sh |
| +go test ./internal/runner ./internal/runner/provider/codex \ |
| + -run 'TestDirectClaudeAuthDocument|TestCodexEmptyHomeReplay' -count=1 -v |
| +go test ./internal/runner/provider -run '^TestAccountCodexRuntimeLinks$' -count=1 |
| +go test ./internal/runner/provider/claude -run '^TestClaudeEmptyHomeReplay$' -count=1 -v |
| +go test ./internal/runner/provider -run '^TestAccountClaude' -count=1 |
| +``` |
| + |
| +The first run failed on missing/wrong manifest versions and both Codex |
| +runtime trees. The link test rejected the three authorized links. The |
| +corrected Claude replay reached the full no-input probe and failed runtime |
| +validation; adding the plugin-setting assertion also failed before its |
| +implementation. Claude inventory and refusal tests failed before their |
| +runtime changes. The manifest-version cases now live in |
| +`TestClaudeAuthManifestVersion`, keeping the runner's existing 8,800-line |
| +test ceiling without removing coverage or raising budgets. |
| + |
| +Each new guard was temporarily broken and restored. Every row below failed |
| +by assertion. Two initial mutation attempts had unused-variable compile |
| +errors; those were corrected and rerun before counting the guard as tested. |
| +Commands use `go test`, the package and `-run` pattern shown, and `-count=1`. |
| + |
| +| Temporary break | Package and test pattern | |
| +| --- | --- | |
| +| Ignore the Codex link path pattern | `./internal/runner/provider -run '^TestAccountCodexRuntimeLinks$'` | |
| +| Accept any nonempty link target | `./internal/runner/provider -run '^TestAccountCodexRuntimeLinks$'` | |
| +| Ignore link uid | `./internal/runner/provider -run '^TestAccountCodexLinkOwner$'` | |
| +| Ignore the link's provider version | `./internal/runner/provider -run '^TestAccountCodexLinkScope/version$'` | |
| +| Ignore the link's provider | `./internal/runner/provider -run '^TestAccountCodexLinkScope/provider$'` | |
| +| Accept unrecorded Claude paths | `./internal/runner/provider -run '^TestAccountClaudeRuntimeGuards$'` | |
| +| Ignore the Claude version pin | `./internal/runner/provider -run '^TestAccountClaudeRuntimeGuards/.cache/version$'` | |
| +| Apply Claude allowances to other providers | `./internal/runner/provider -run '^TestAccountClaudeRuntimeGuards/.cache/provider$'` | |
| +| Skip Claude metadata checks | `./internal/runner/provider -run '^TestAccountClaudeRuntimeGuards$'` | |
| +| Accept the wrong Claude entry kind | `./internal/runner/provider -run '^TestAccountClaudeRuntimeGuards/.cache/file$'` | |
| +| Skip policy-name checks | `./internal/runner/provider -run '^TestAccountClaudeRuntimeGuards$'` | |
| +| Ignore the auth manifest version | `./internal/runner/provider/claude -run '^TestClaudeAuthManifestVersion$'` | |
| +| Remove the built-in plugin disable setting | `./internal/runner/provider/claude -run '^TestClaudeEmptyHomeReplay/Engineering$'` | |
| + |
| +The complete provider, Claude and Codex suites passed before the final |
| +consolidated targeted run. With all mutations restored, that run is: |
| + |
| +```sh |
| +go test ./internal/runner ./internal/runner/provider/... ./internal/tryequipo \ |
| + -run 'TestAccount|TestCodex|TestClaude|TestDirectClaudeAuthDocument|TestDirectJournalFailureContains|TestPlanWorkflowProviderPoliciesLauncher|TestCoordinatorOnlyMCPServer|TestPrivateDirectoryFailureNamesPath' \ |
| + -count=1 |
| +``` |
| + |
| +Size budgets and the exact reference inventory pass without raising any |
| +limits. Full CI and final cleanup results follow below. |
| + |
| +The first full `make -k ci` finished with two failing inventory tests: |
| +`TestMergedPlanPolicyInventory` and `TestPlanWorkflowReleasePolicyInventory`. |
| +All 18 pending constructor hashes were stale after the changed Claude and |
| +Codex settings. `internal/release/manifest.json` now contains the hashes |
| +reported by those tests. Every status remains `uncertified`; no certificate, |
| +live evidence or execution authority was added. Both tests and |
| +`TestPlanWorkflowReleaseRejectsOldCertificate` pass after that update. |
| + |
| +All other first-run gates passed. The main suite ran 25 packages without |
| +cached results; only the two inventory packages failed. Local advisory time |
| +limits were exceeded by the runner (375.642 seconds against 330), provider |
| +(16.352 against 15), Claude (47.680 against 45) and Codex (39.659 against 35). |
| +No limit was raised. The performance lane passed with a 116 ms median cold |
| +boot against 500 ms. The first full rerun follows the inventory correction. |
| + |
| +The first full rerun of `make -k ci` passed, exit 0. There were two full |
| +gate runs in this round; no second rerun was needed. All 27 test packages |
| +ran without cached results or failures. The adapter, namespace, migration |
| +and performance lanes also passed. Median cold boot was 132 ms against |
| +500 ms. |
| + |
| +The successful local gate still reported advisory timing overruns: |
| +application integration 341.948 seconds against 300, runner 524.230 against |
| +330, provider 17.414 against 15, Claude 54.636 against 45, and Codex 41.347 |
| +against 35. These timing limits are enforced when the CI environment is |
| +set; this local success does not establish that those limits will pass |
| +there. No budget was relaxed and no additional full suite was run. |
| + |
| +There are no pending controller decisions for this round. Account-home |
| +contents and existing Equipo state were untouched. No sign-in, |
| +authenticated model call, live gate, merge, default-branch push, deployment |
| +or copy-review server was run. Both live-test environment flags were |
| +unset. Test processes have exited; session scratch is removed at handoff. |
| + |
| +## Round 4 |
| + |
| +Specialists now disable Codex goals, plugins, remote plugins and tool |
| +suggestions, using the same feature flags as the coordinator. Both real |
| +0.165.0 empty-home replays pass the production `config/read` comparison |
| +under `--strict-config`. Tests also change each effective flag to true |
| +and require refusal. The specialist live inventory rejects goal, plugin |
| +and suggestion tools, including functions inside the `functions` |
| +namespace. This assertion is tested with synthetic catalog frames; no |
| +live gate or authenticated turn was run. |
| + |
| +Neither real replay leaves `.tmp/plugins.sha` or `.tmp/plugins` in its |
| +staged home. That observation is limited to network-isolated startup; |
| +it cannot prove what an authenticated startup would attempt. The runtime |
| +validator now refuses `.tmp/plugins*` outright. Known paths have fixed |
| +categories: `runtime_codex_plugins`, `runtime_codex_dot_tmp`, |
| +`runtime_codex_tmp`, `runtime_codex_arg0`, `runtime_codex_skills`, |
| +`runtime_codex_installation_id`, `runtime_codex_goals`, |
| +`runtime_codex_memories` and `runtime_codex_queue`. Unknown names and file |
| +contents never appear in these diagnostics. The earlier references to the |
| +category for `.tmp` have been corrected. |
| + |
| +For Claude 2.1.312, only these three root-level policy-limit files are |
| +newly accepted: `policy-limits.json`, `policy-limits.json.signature.json` |
| +and `policy-limits.json.signature-iat.json`. They must be regular files |
| +with the runner uid, no setuid/setgid bits and one hard link. |
| +`remote-settings.json` remains refused, with |
| +`runtime_claude_remote_settings`. Tests cover wrong kinds, links, mode, |
| +provider and version, plus source-home exclusion and a second BeginTurn. |
| + |
| +Claude settings disable both `agents-md@builtin` and |
| +`plugin-authoring@builtin`, and set `autoMemoryEnabled` and |
| +`autoDreamEnabled` false. Both role replays assert the constructed settings |
| +and read back the actual settings mount before starting the pinned CLI. |
| +The production no-input startup probe still requires an empty plugin |
| +inventory. Claude does not provide the Codex effective-config RPC here; |
| +the settings-file readback is not a claim of such an RPC. Separate policy |
| +refusal tests reject attempts to enable each new setting. |
| + |
| +### Bash state fallback and binary evidence |
| + |
| +The pinned Claude executable was inspected directly, without executing it |
| +against an account home. Its embedded source has no compatible setting or |
| +environment switch that disables both shell snapshots and session env |
| +files. `CLAUDE_CODE_DONT_INHERIT_ENV` changes the snapshot subprocess |
| +environment; it does not suppress the files. The snapshot function's |
| +`Kv()` check refuses program starts in diskless sessions, so it is not a |
| +switch for this Bash-capable launcher. The brief's fallback applies. |
| + |
| +The embedded snapshot constructor, `ikn`, chooses `bash`, `zsh` or `sh`, |
| +then builds `snapshot-${shell}-${Date.now()}-${random}.sh`. Random text is |
| +`Math.random().toString(36).substring(2,8)`, at most six lowercase base-36 |
| +characters, possibly empty for zero. Its optional session suffix calls |
| +`k_n`, whose guard `d_n()` is hardcoded false in this binary. The accepted |
| +pattern therefore has a 13-digit millisecond timestamp, zero to six |
| +base-36 characters and no session suffix. Other shells, uppercase text, |
| +long random text, suffixes and nested directories are refused. |
| + |
| +The embedded `YNt` constructor writes a lowercased hook name and index. |
| +Its reader's exact `vG` pattern is |
| +`^(setup|sessionstart|cwdchanged|filechanged)-hook-(\d+)\.sh$`. |
| +These regular files are accepted only directly under |
| +`session-env/<uuid>/`. The UUID directory and both root directories must |
| +be directories. Unrecognized names, extra depth, special files, hard |
| +links, foreign owners and unsafe modes remain refused. |
| + |
| +This exception relies on the staged home being denied to native file |
| +operations and Bash. The comment in `runtime_claude.go` cites the deny |
| +construction at `claude/launcher.go:139-149`; existing launch-policy tests |
| +check those paths. Synthetic provider-written state survives EndTurn and |
| +passes the next BeginTurn. The unauthenticated replay does not exercise |
| +an authenticated Bash call, so the filename evidence is the pinned |
| +binary and the second-turn evidence is the account-lease regression. |
| + |
| +The provider version strings now have shared constants, with the adapter |
| +`Version` constants referring to them. This avoids an import cycle |
| +between account validation and its adapters. Codex arg0 shim paths accept |
| +only the already-authorized symlinks; regular files and directories at |
| +those paths are refused. Seventeen changed constructor hashes were |
| +refreshed in the release manifest. All 18 policies remain `uncertified`; |
| +the Codex coordinator's hash did not change. |
| + |
| +### Verification |
| + |
| +All Go commands use `CGO_ENABLED=0 GOTOOLCHAIN=go1.26.10`, default Go caches |
| +and on-disk `$TMPDIR`. New assertions were added before implementation: |
| + |
| +```sh |
| +go test ./internal/runner/provider ./internal/runner/provider/codex \ |
| + ./internal/runner/provider/claude ./internal/directlive \ |
| + -run 'TestAccountClaudeAuthenticatedState|TestAccountStartupRefusals|TestAccountCodexRuntimeLinks|TestCodexRuntimeSettings|TestClaudeEmptyHomeReplay|TestSpecialistNoGoalOrPluginTools' \ |
| + -count=1 |
| +``` |
| + |
| +The first command had a missing test brace in the provider package; that |
| +was corrected and the provider subset rerun before implementation. The |
| +assertions failed for missing specialist flags, missing Claude settings, |
| +exposed goal/plugin tools, accepted regular arg0 shims, rejected startup |
| +files on a second turn and missing fixed refusal categories. An initial |
| +hardlink fixture linked the credential itself, causing EndTurn to refuse |
| +it before the runtime check; the fixture now links a separate test file. |
| + |
| +After implementation, one old recording expected a skills refusal, but |
| +its curated-plugin cache is now refused first. Its assertion now names |
| +that observed failure. The two policy-inventory tests identified the 17 |
| +changed hashes before the manifest update. The targeted run then passed: |
| + |
| +```sh |
| +go test ./internal/runner/provider ./internal/runner/provider/codex \ |
| + ./internal/runner/provider/claude ./internal/directlive ./internal/release \ |
| + -run 'TestAccount|TestCodexRuntime|TestCodexEmptyHomeReplay|TestClaudeEmptyHomeReplay|TestClaudeLaunchPolicy|TestClaudePolicyRefusals|TestSpecialist|TestMergedPlanPolicyInventory|TestPlanWorkflowReleasePolicyInventory|TestPlanWorkflowReleaseRejectsOldCertificate' \ |
| + -count=1 |
| +``` |
| + |
| +Every mutation below failed by assertion and was restored immediately. |
| +Commands are `go test <package> -run '<pattern>' -count=1`. |
| + |
| +| Temporary break | Package | Pattern | |
| +| --- | --- | --- | |
| +| Enable each of goals, plugins, remote_plugin and tool_suggest separately | `./internal/runner/provider/codex` | `^TestCodexRuntimeSettings/implement$` | |
| +| Accept effective config without comparison | `./internal/runner/provider/codex` | `^TestCodexRuntimeSettings/implement$` | |
| +| Enable plugin-authoring, memory or dreaming separately | `./internal/runner/provider/claude` | `^TestClaudeLaunchPolicy/Engineering$` | |
| +| Accept goal/plugin/suggestion tools | `./internal/directlive` | `^TestSpecialistNoGoalOrPluginTools$` | |
| +| Permit the curated plugin cache | `./internal/runner/provider` | `^TestAccountStartupRefusals/codex/.tmp/plugins.sha$` | |
| +| Accept regular arg0 files or directories | `./internal/runner/provider` | `^TestAccountCodexRuntimeLinks/(regular\|directory)$` | |
| +| Accept remote settings | `./internal/runner/provider` | `^TestAccountStartupRefusals/claude/remote-settings.json$` | |
| +| Ignore Claude version | `./internal/runner/provider` | `^TestAccountClaudeAuthenticatedState/policy-limits.json/version$` | |
| +| Apply Claude allowances to other providers | `./internal/runner/provider` | `^TestAccountClaudeAuthenticatedState/policy-limits.json/provider$` | |
| +| Ignore uid | `./internal/runner/provider` | `^TestAccountCodexRuntimeOwner$` | |
| +| Ignore setuid/setgid | `./internal/runner/provider` | `^TestAccountClaudeAuthenticatedState/policy-limits.json/(setuid\|setgid)$` | |
| +| Ignore hardlink count | `./internal/runner/provider` | `^TestAccountClaudeAuthenticatedState/policy-limits.json/hardlink$` | |
| +| Permit symlinks and FIFOs | `./internal/runner/provider` | `^TestAccountClaudeAuthenticatedState/policy-limits.json/(link\|fifo)$` | |
| +| Ignore file kind | `./internal/runner/provider` | `^TestAccountClaudeAuthenticatedState/policy-limits.json/directory$` | |
| +| Ignore snapshot filename pattern | `./internal/runner/provider` | `^TestAccountStartupRefusals/claude/shell-snapshots/evil.sh$` | |
| +| Ignore session-env filename pattern | `./internal/runner/provider` | `^TestAccountStartupRefusals/claude/session-env/12345678-1234-4123-8123-123456789abc/evil.sh$` | |
| +| Drop fixed Codex categories | `./internal/runner/provider` | `^TestAccountStartupRefusals/codex$` | |
| + |
| +With all 22 mutations restored, the targeted command above passed again. |
| +The exact reference inventory and size budgets passed without raising any |
| +limits. One full `make -k ci` then passed, exit 0; no rerun was needed. |
| +All 27 main-suite test packages ran without cached results or failures. |
| +Build, vet, formatting, staticcheck, govulncheck, gitleaks, adapter, |
| +namespace, migration and performance checks passed. Median cold boot was |
| +103 ms against the 500 ms limit. |
| + |
| +The local gate reported two advisory timing overruns: provider tests took |
| +20.195 seconds against 15, and Codex tests took 37.638 seconds against 35. |
| +These limits become failures in the CI environment, so this local result |
| +does not establish that CI timing will pass. No budget was changed. |
| +The runner took 326.395 seconds, within its 330-second limit. |
| + |
| +Account-home contents and existing Equipo state were untouched. No |
| +sign-in, authenticated provider call, live gate, merge, default-branch |
| +push, deployment or copy-review server was run. Both live-test flags |
| +were unset for the full gate. Test subprocesses exited and session |
| +scratch was removed before commit and branch push. |
diff --git a/internal/directlive/codex_inventory.go b/internal/directlive/codex_inventory.go| index 131cd0fc..2f33c4fd 100644 |
| --- a/internal/directlive/codex_inventory.go |
| +++ b/internal/directlive/codex_inventory.go |
| @@ -4,6 +4,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/provider" |
| "encoding/json" |
| "slices" |
| + "strings" |
| ) |
| // Read the pinned CLI's raw catalog, never a model-authored tool list. |
| @@ -33,6 +34,12 @@ func codexInventory(session string, frames []json.RawMessage) ([]string, error) |
| if !ok { |
| return nil, provider.ErrPolicy |
| } |
| + for _, name := range got { |
| + // Disabled features must also be absent from the live tool catalog. |
| + if strings.Contains(name, "goal") || strings.Contains(name, "plugin") || name == "suggest_tools" { |
| + return nil, provider.ErrPolicy |
| + } |
| + } |
| names = append(names, got...) |
| } |
| slices.Sort(names) |
diff --git a/internal/directlive/try_inventory_test.go b/internal/directlive/try_inventory_test.go| index 1f9623c8..54908084 100644 |
| --- a/internal/directlive/try_inventory_test.go |
| +++ b/internal/directlive/try_inventory_test.go |
| @@ -2,6 +2,7 @@ package directlive |
| import ( |
| "encoding/json" |
| + "strings" |
| "testing" |
| ) |
| @@ -18,3 +19,14 @@ func TestSpecialistObservedCatalog(t *testing.T) { |
| t.Fatal("missing catalog accepted") |
| } |
| } |
| + |
| +func TestSpecialistNoGoalOrPluginTools(t *testing.T) { |
| + for _, tool := range []string{"create_goal", "get_goal", "update_goal", "request_plugin_install", "list_plugins", "suggest_tools"} { |
| + t.Run(tool, func(t *testing.T) { |
| + raw := json.RawMessage(strings.ReplaceAll(`{"method":"rawResponseItem/completed","params":{"threadId":"session","item":{"type":"additional_tools","role":"developer","tools":[{"type":"namespace","name":"functions","tools":[{"type":"function","name":"TOOL"}]}]}}}`, "TOOL", tool)) |
| + if _, err := codexInventory("session", []json.RawMessage{raw}); err == nil { |
| + t.Fatal("forbidden capability accepted") |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/release/manifest.json b/internal/release/manifest.json| index 8eb4883a..b76c9476 100644 |
| --- a/internal/release/manifest.json |
| +++ b/internal/release/manifest.json |
| @@ -18,109 +18,109 @@ |
| { |
| "provider": "claude", |
| "action": "reproduce", |
| - "inventory_hash": "7889c12f50aadf831269750d4b2d4eef74444fd3e6f2e0a9a63aab53b82b51cd", |
| + "inventory_hash": "4461a88e42061669b15f4f17ac4c9647dd2535d97aa9ef658cbd23e99a196c71", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "scope", |
| - "inventory_hash": "599d2e62cc3aa4be8d43ca635b15edd6ebc96478d2dfbba34d8d9747b4174e06", |
| + "inventory_hash": "605d30bb8933d655a71812e4ba3538e5e71aa7931ddf8553360d2537a15f1f4a", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "recommend", |
| - "inventory_hash": "965816cb740193dbe8240c247617399ad683ad469ac04f5c82e95ac81f46253f", |
| + "inventory_hash": "88378e2c3272a0e5c33ac096e391135e7763997b56bd9938aef5912892f0cd68", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "investigate", |
| - "inventory_hash": "e72252a0af684addc8f65c457270fd3677f1e38e103e8006d7b50b93201c5a84", |
| + "inventory_hash": "9e71893e8f6df2140754ed383507c2af9e823cf53f57038ff1bb94c9f303eb2d", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "implement", |
| - "inventory_hash": "65c7bb12b1a3d9e8f04adbce9f0884c8d5a923928b0704a8a58f2180909bb5cd", |
| + "inventory_hash": "ad14842ae5a456b5feba849f0266a9b0aec539d5febddbb795198c7833e2eab7", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "copy", |
| - "inventory_hash": "0ec0b2990309688cadc7886c99ef88c45386645a28dc74bd5062b4f71b1ff2a8", |
| + "inventory_hash": "93cf1c3b5892015875b539c0cbc0cec6386cad7a820452f6b417bb2a6c9b1859", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "design", |
| - "inventory_hash": "05121532dbc36f6a272be458ae9ea67db0b4541659d42918c628c348c2117999", |
| + "inventory_hash": "9245b82ba234223254ece2e42be2068da0accb6a3010c9ac2d5e0a6e8bcd43a6", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "review", |
| - "inventory_hash": "b3e9ece30e71857b1b5e91519ebb35659cdf99f472e930b42216ab27137d7951", |
| + "inventory_hash": "24dedbe7e36ec4bddcfaa036add9c8413fd8518a242e230dd33bf6af93f204a1", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "reproduce", |
| - "inventory_hash": "2e4ca8baffdf32c0eee8506ac551936ae6a89b4a6f2b50118a5f781f2ee16d37", |
| + "inventory_hash": "fcccaa4a16a4610b336d952a40fb39a38bf475a0534e8635d681fd4bf61f2e59", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "scope", |
| - "inventory_hash": "fa2a7c8bc318a50977a9af60eb95d7a37fa1f15b631cde4e4cd1869bfd5ad2cb", |
| + "inventory_hash": "6c4c841c3a982197fd4ddd96b09accfb95bb9bcac8ea033cad74e29fc678b401", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "recommend", |
| - "inventory_hash": "c0e5a0b12cf4f53ee641b2f0dd61507f73526cf7d3310afefd1bce273e2ad034", |
| + "inventory_hash": "adeaf002bbe057c8cdff6f936e88736c36515ce0e355c4bd6e54d63a573553b1", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "investigate", |
| - "inventory_hash": "f339de414600e504e7e2f8cd6fa0c2cbacff30ff5fe1afe193b3de405ef54c22", |
| + "inventory_hash": "364020e8babe87c13b852afe97ca464b3cf232931c7c9fbe207f6a38d05ef939", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "implement", |
| - "inventory_hash": "a47a468f09575940f82096b39836468ccfa7b77db4d9ecdbef92b60b5033c4bc", |
| + "inventory_hash": "a1f288e532bb1a05e0c3609a70420dd6e7b5349f15c2cdf4110c93caa3c19ffa", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "copy", |
| - "inventory_hash": "197d0fd3074e1c5ab1483bf6c8b64ed99aa60d32f73a5b7777e34fb66ce9402b", |
| + "inventory_hash": "ef5c28d89cf4ef559c9e8bfd20b999354b82adcca8ff3d5f1583b7e30e012d95", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "design", |
| - "inventory_hash": "7177a83262fdb00b3b89c3f5e0439a8100ca87b67e9ba550db870ed27081e37a", |
| + "inventory_hash": "dbcbec44e32f70af2b3d1d5e0f9bc67d2dabb0bbe6169de64a9f7f452985b291", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "review", |
| - "inventory_hash": "2609f5f2c114bb133753de19b6f952f17b765e0975f5788b4c44e353e8de4eeb", |
| + "inventory_hash": "aee076046a446421909429f32973146fe5eb58c89543056d39853f454845ded7", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "claude", |
| "action": "coordinate", |
| - "inventory_hash": "3289121ba15a78e4ab32bb85828b3518631214be4649de85de46e3d31354de62", |
| + "inventory_hash": "f8bca395f5b11b7ab92bc3e99088d25c47f542383687f0a47a47d16caf69739f", |
| "status": "uncertified" |
| }, |
| { |
| "provider": "codex", |
| "action": "coordinate", |
| - "inventory_hash": "57d95c9e08193d417a63e3e3e045965759d6a0ae27e3a4d7ffeebc65893cde80", |
| + "inventory_hash": "3d39700c840ac70165dbc94ec9438cf68503f382321c3ab2ac68206a96c36045", |
| "status": "uncertified" |
| } |
| ] |
diff --git a/internal/runner/capture.go b/internal/runner/capture.go| index 8e4b75a3..ba95e67d 100644 |
| --- a/internal/runner/capture.go |
| +++ b/internal/runner/capture.go |
| @@ -7,6 +7,7 @@ import ( |
| "database/sql" |
| "encoding/json" |
| "errors" |
| + "fmt" |
| "io" |
| "strings" |
| "sync" |
| @@ -14,6 +15,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/containment" |
| "amadan.net/oficina/equipo/internal/runner/provider" |
| + "amadan.net/oficina/equipo/internal/runner/provider/claude" |
| "amadan.net/oficina/equipo/internal/runnerproto" |
| ) |
| @@ -237,10 +239,10 @@ func (f *captureFactory) Open(ctx context.Context, p provider.Process, l provide |
| } |
| diagnostics <- e |
| }() |
| - reader := bufio.NewReaderSize(stdout, MaxFrameBytes+2) |
| + reader := stdoutFrames{reader: bufio.NewReaderSize(stdout, MaxFrameBytes+2), document: claude.AuthStatusDocument(l)} |
| var seq int64 |
| for { |
| - raw, e := reader.ReadSlice('\n') |
| + raw, e := reader.read() |
| if e == io.EOF && len(raw) == 0 { |
| break |
| } |
| @@ -308,9 +310,15 @@ func (f *captureFactory) Open(ctx context.Context, p provider.Process, l provide |
| return &provider.Capture{Input: ci, Frames: frames, Done: done, Diagnostics: func() string { diagnosticMu.Lock(); defer diagnosticMu.Unlock(); return diagnosticText }}, nil |
| } |
| func (j *Journal) AppendFrame(ctx context.Context, attempt, stream string, seq int64, frame []byte) error { |
| - if attempt == "" || stream == "" || seq <= 0 || len(frame) > MaxFrameBytes || !uniqueFrame(frame) { |
| + if attempt == "" || stream == "" || seq <= 0 { |
| return runnerproto.ErrInvalid |
| } |
| + if len(frame) > MaxFrameBytes { |
| + return fmt.Errorf("stdout_frame_too_large: %w", runnerproto.ErrInvalid) |
| + } |
| + if !uniqueFrame(frame) { |
| + return fmt.Errorf("stdout_invalid_json: %w", runnerproto.ErrInvalid) |
| + } |
| body := redactFrame(frame) |
| if len(body) > MaxFrameBytes { |
| return runnerproto.ErrInvalid |
diff --git a/internal/runner/capture_framing.go b/internal/runner/capture_framing.go| new file mode 100644 |
| index 00000000..9fbdb424 |
| --- /dev/null |
| +++ b/internal/runner/capture_framing.go |
| @@ -0,0 +1,35 @@ |
| +package runner |
| + |
| +import ( |
| + "bufio" |
| + "fmt" |
| + "io" |
| + |
| + "amadan.net/oficina/equipo/internal/runnerproto" |
| +) |
| + |
| +type stdoutFrames struct { |
| + reader *bufio.Reader |
| + document, consumed bool |
| +} |
| + |
| +func (r *stdoutFrames) read() ([]byte, error) { |
| + if !r.document { |
| + return r.reader.ReadSlice('\n') |
| + } |
| + if r.consumed { |
| + return nil, io.EOF |
| + } |
| + r.consumed = true |
| + raw, err := io.ReadAll(io.LimitReader(r.reader, MaxFrameBytes+1)) |
| + if err != nil { |
| + return nil, err |
| + } |
| + if len(raw) > MaxFrameBytes { |
| + return nil, fmt.Errorf("stdout_document_too_large: %w", runnerproto.ErrInvalid) |
| + } |
| + if !uniqueFrame(raw) { |
| + return nil, fmt.Errorf("stdout_invalid_json: %w", runnerproto.ErrInvalid) |
| + } |
| + return raw, nil |
| +} |
diff --git a/internal/runner/capture_test.go b/internal/runner/capture_test.go| index e47c8f0f..6ff2ccad 100644 |
| --- a/internal/runner/capture_test.go |
| +++ b/internal/runner/capture_test.go |
| @@ -126,7 +126,7 @@ func TestDirectJournalFailureContains(t *testing.T) { |
| case "unterminated": |
| raw = `{"type":"system"}` |
| case "malformed": |
| - raw = "nope\n" |
| + raw = "secret-sentinel\n" |
| case "duplicate-key": |
| raw = "{\"type\":1,\"type\":2}\n" |
| case "oversized": |
| @@ -184,8 +184,8 @@ func TestDirectJournalFailureContains(t *testing.T) { |
| case <-time.After(2 * time.Second): |
| t.Fatal("capture blocked") |
| } |
| - if err = <-cap.Done; err == nil || !p.stopped.Load() { |
| - t.Fatalf("not contained: %v", err) |
| + if err = <-cap.Done; err == nil || !p.stopped.Load() || (kind == "malformed" && (!strings.Contains(err.Error(), "stdout_invalid_json") || strings.Contains(err.Error(), "secret-sentinel"))) { |
| + t.Fatalf("not contained or unsafe diagnostic: %v", err) |
| } |
| }) |
| } |
diff --git a/internal/runner/live_open_test.go b/internal/runner/live_open_test.go| new file mode 100644 |
| index 00000000..e4fbcc1b |
| --- /dev/null |
| +++ b/internal/runner/live_open_test.go |
| @@ -0,0 +1,63 @@ |
| +package runner |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "io" |
| + "os" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +func TestDirectClaudeAuthDocument(t *testing.T) { |
| + recorded, err := os.ReadFile("testdata/claude-auth-status-2.1.312.json") |
| + mustJournal(t, err) |
| + for _, mode := range []string{"auth", "stream", "other-version", "extra-arg", "tampered-manifest", "other-provider", "duplicate", "trailing", "oversized"} { |
| + t.Run(mode, func(t *testing.T) { |
| + j, l, _, p := directFixture(t, "claude") |
| + args := []string{"/opt/claude", "--setting-sources", "", "--settings", provider.SettingsPath, "--strict-mcp-config", "--mcp-config", provider.MCPPath, "--disable-slash-commands", "auth", "status", "--json"} |
| + raw := string(recorded) |
| + switch mode { |
| + case "stream": |
| + args = []string{"/opt/claude", "-p", "--output-format", "stream-json"} |
| + case "other-version": |
| + l.Binding.Expected.ProviderVersion = "other" |
| + case "other-provider": |
| + l.Selection.Provider = "codex" |
| + case "extra-arg": |
| + args = append(args, "--unknown") |
| + case "duplicate": |
| + raw = "{\n\"loggedIn\":false,\n\"loggedIn\":true\n}\n" |
| + case "trailing": |
| + raw += "{}\n" |
| + case "oversized": |
| + raw = "{\"secret\":\"" + strings.Repeat("x", MaxFrameBytes) + "\"}\n" |
| + } |
| + l.Policy.Manifest, _ = json.Marshal(map[string]any{"Argv": args, "ProviderVersion": "2.1.312"}) |
| + l.Policy.ManifestHash = provider.DigestDirectEvidence(l.Policy.Manifest) |
| + if mode == "tampered-manifest" { |
| + l.Policy.ManifestHash = "wrong" |
| + } |
| + // Replace the fixture's pre-recorded launch before opening capture. |
| + _, err = j.db.Exec("DELETE FROM direct_attempts") |
| + mustJournal(t, err) |
| + p.out = io.NopCloser(strings.NewReader(raw)) |
| + cap, err := NewCaptureFactory(j).Open(context.Background(), p, l) |
| + mustJournal(t, err) |
| + var frames []provider.Frame |
| + for frame := range cap.Frames { |
| + frames = append(frames, frame) |
| + } |
| + err = <-cap.Done |
| + if mode == "auth" { |
| + if err != nil || len(frames) != 1 || !json.Valid(frames[0].Bytes) || p.stopped.Load() { |
| + t.Fatalf("auth document: frames=%d stopped=%v error=%v", len(frames), p.stopped.Load(), err) |
| + } |
| + } else if err == nil || !p.stopped.Load() || len(frames) != 0 { |
| + t.Fatalf("unsafe framing accepted: %v, %d", err, len(frames)) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/provider/account_diagnostics_test.go b/internal/runner/provider/account_diagnostics_test.go| new file mode 100644 |
| index 00000000..1cf4f98c |
| --- /dev/null |
| +++ b/internal/runner/provider/account_diagnostics_test.go |
| @@ -0,0 +1,88 @@ |
| +package provider |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +func TestAccountContainmentDiagnostics(t *testing.T) { |
| + for _, kind := range []string{"runtime-credential", "source-identity", "runtime-directory", "runtime-policy", "runtime-entry"} { |
| + t.Run(kind, func(t *testing.T) { |
| + b, r := accountFixture(t) |
| + l := openFixture(t, b, r) |
| + preflightFixture(t, l) |
| + want := "" |
| + switch kind { |
| + case "runtime-credential": |
| + if err := os.Chmod(filepath.Join(l.runtime, "auth.json"), 0644); err != nil { |
| + t.Fatal(err) |
| + } |
| + want = "runtime_credential" |
| + case "source-identity": |
| + if err := os.Chmod(filepath.Join(b.Home, IdentityFile), 0644); err != nil { |
| + t.Fatal(err) |
| + } |
| + want = "source_identity_file" |
| + case "runtime-directory": |
| + if err := os.Chmod(l.runtime, 0755); err != nil { |
| + t.Fatal(err) |
| + } |
| + defer os.Chmod(l.runtime, 0700) |
| + want = "runtime_directory" |
| + case "runtime-policy": |
| + if err := os.Mkdir(filepath.Join(l.runtime, "skills"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + want = "runtime_codex_skills" |
| + case "runtime-entry": |
| + writeFake(t, filepath.Join(l.runtime, "secret-sentinel"), "secret-sentinel") |
| + want = "runtime_unexpected_entry" |
| + } |
| + err := l.ValidatePolicy(context.Background()) |
| + if !errors.Is(err, ErrContainment) || !strings.Contains(err.Error(), want) || strings.Contains(err.Error(), "secret-sentinel") { |
| + t.Fatalf("opaque or unsafe diagnostic: %v", err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// Replay only names and file kinds from the empty-home probe. No bundled |
| +// skill text or SQLite contents are needed to exercise the guard. |
| +func TestAccountRecordedCodexRuntimeRefused(t *testing.T) { |
| + raw, err := os.ReadFile("testdata/codex-empty-home-0.165.0.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var inventory struct { |
| + Entries []struct { |
| + Path string |
| + Directory bool |
| + } |
| + } |
| + if err = json.Unmarshal(raw, &inventory); err != nil { |
| + t.Fatal(err) |
| + } |
| + b, r := accountFixture(t) |
| + l := openFixture(t, b, r) |
| + preflightFixture(t, l) |
| + for _, entry := range inventory.Entries { |
| + path := filepath.Join(l.runtime, entry.Path) |
| + if entry.Directory { |
| + err = os.MkdirAll(path, 0700) |
| + } else { |
| + err = os.WriteFile(path, []byte("fixture"), 0600) |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + err = l.ValidatePolicy(context.Background()) |
| + if !errors.Is(err, ErrContainment) || !strings.Contains(err.Error(), "runtime_codex_plugins") { |
| + t.Fatalf("curated plugins not refused: %v", err) |
| + } |
| +} |
diff --git a/internal/runner/provider/accounts.go b/internal/runner/provider/accounts.go| index f05c0b92..a0f45039 100644 |
| --- a/internal/runner/provider/accounts.go |
| +++ b/internal/runner/provider/accounts.go |
| @@ -8,6 +8,7 @@ import ( |
| "encoding/hex" |
| "encoding/json" |
| "errors" |
| + "fmt" |
| "io" |
| "os" |
| "os/user" |
| @@ -268,11 +269,11 @@ func (l *AccountLease) sourceUnchanged() bool { |
| func (l *AccountLease) snapshot() ([]byte, [32]byte, error) { |
| var zero [32]byte |
| if !l.sourceUnchanged() { |
| - return nil, zero, ErrContainment |
| + return nil, zero, accountContainment("source_directory") |
| } |
| metadata, e := readPrivate(l.dir, IdentityFile) |
| if e != nil { |
| - return nil, zero, ErrContainment |
| + return nil, zero, accountContainment("source_identity_file") |
| } |
| metadata, e = canonical(metadata) |
| if e != nil { |
| @@ -286,7 +287,7 @@ func (l *AccountLease) snapshot() ([]byte, [32]byte, error) { |
| } |
| raw, e := readPrivate(l.dir, credentialName(l.source.Provider)) |
| if e != nil { |
| - return nil, zero, ErrContainment |
| + return nil, zero, accountContainment("source_credential") |
| } |
| if credentialsExpired(raw, time.Now()) { |
| return nil, zero, ErrAccountMaintenance |
| @@ -314,12 +315,12 @@ func (l *AccountLease) snapshot() ([]byte, [32]byte, error) { |
| func (l *AccountLease) runtimeDir() (*os.File, error) { |
| f, e := pinDirectory(l.runtime) |
| if e != nil { |
| - return nil, ErrContainment |
| + return nil, accountContainment("runtime_directory") |
| } |
| info, e := f.Stat() |
| if e != nil || !os.SameFile(info, l.runtimeInfo) || !privateDirectory(f) { |
| f.Close() |
| - return nil, ErrContainment |
| + return nil, accountContainment("runtime_directory") |
| } |
| return f, nil |
| } |
| @@ -406,22 +407,22 @@ func (l *AccountLease) runtimeSnapshot() ([]byte, error) { |
| defer dir.Close() |
| metadata, e := readPrivate(dir, IdentityFile) |
| if e != nil { |
| - return nil, ErrContainment |
| + return nil, accountContainment("runtime_identity_file") |
| } |
| metadata, e = canonical(metadata) |
| var id Identity |
| if e != nil || json.Unmarshal(metadata, &id) != nil || id != l.source.Expected { |
| - return nil, ErrContainment |
| + return nil, accountContainment("runtime_identity_changed") |
| } |
| if l.source.Provider == "claude" { |
| native, e := claudeAccountMetadata(dir) |
| if e != nil || !bytes.Equal(native, l.claudeIdentity) { |
| - return nil, ErrContainment |
| + return nil, accountContainment("runtime_claude_identity") |
| } |
| } |
| raw, e := readPrivate(dir, credentialName(l.source.Provider)) |
| if e != nil { |
| - return nil, ErrContainment |
| + return nil, accountContainment("runtime_credential") |
| } |
| return raw, nil |
| } |
| @@ -452,7 +453,7 @@ func (l *AccountLease) latch(err error) { |
| func (l *AccountLease) validate(ctx context.Context) (err error) { |
| defer func() { l.latch(err) }() |
| if l.contained { |
| - return ErrContainment |
| + return accountContainment("latched") |
| } |
| if e := ctx.Err(); e != nil { |
| return e |
| @@ -464,18 +465,18 @@ func (l *AccountLease) validate(ctx context.Context) (err error) { |
| if e != nil { |
| l.ready = false |
| if l.active { |
| - return ErrContainment |
| + return accountContainment("active_source_snapshot") |
| } |
| return e |
| } |
| if generation != l.generation && l.active { |
| l.ready = false |
| - return ErrContainment |
| + return accountContainment("active_source_changed") |
| } |
| runtimeRaw, runtimeErr := l.runtimeSnapshot() |
| if runtimeErr != nil { |
| l.ready = false |
| - return ErrContainment |
| + return runtimeErr |
| } |
| if sha256.Sum256(runtimeRaw) != l.runtimeGeneration { |
| l.ready = false |
| @@ -534,7 +535,7 @@ func (l *AccountLease) check(ctx context.Context, probe func(context.Context, Bi |
| if runtimeErr != nil { |
| l.contained = true |
| l.mu.Unlock() |
| - return ErrContainment |
| + return runtimeErr |
| } |
| if !refresh && sha256.Sum256(runtimeCurrent) != l.runtimeGeneration { |
| l.mu.Unlock() |
| @@ -806,3 +807,7 @@ func (l *AccountLease) PreflightFingerprint(ctx context.Context) (string, error) |
| sum := sha256.Sum256(raw) |
| return hex.EncodeToString(sum[:]), nil |
| } |
| + |
| +func accountContainment(reason string) error { |
| + return fmt.Errorf("%w: %s", ErrContainment, reason) |
| +} |
diff --git a/internal/runner/provider/claude/auth_framing.go b/internal/runner/provider/claude/auth_framing.go| new file mode 100644 |
| index 00000000..1b274283 |
| --- /dev/null |
| +++ b/internal/runner/provider/claude/auth_framing.go |
| @@ -0,0 +1,19 @@ |
| +package claude |
| + |
| +import ( |
| + "encoding/json" |
| + "slices" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +// AuthStatusDocument selects the pinned auth command, which writes one |
| +// indented document. Agent sessions still require one JSON object per line. |
| +func AuthStatusDocument(l provider.Launch) bool { |
| + var m struct { |
| + Argv []string |
| + ProviderVersion string |
| + } |
| + want := AuthStatusArgs() |
| + return l.Selection.Provider == "claude" && l.Binding.Expected.ProviderVersion == Version && l.Policy.ManifestHash == provider.DigestDirectEvidence(l.Policy.Manifest) && json.Unmarshal(l.Policy.Manifest, &m) == nil && m.ProviderVersion == Version && slices.Equal(m.Argv, want) |
| +} |
diff --git a/internal/runner/provider/claude/auth_framing_test.go b/internal/runner/provider/claude/auth_framing_test.go| new file mode 100644 |
| index 00000000..eb5f84b3 |
| --- /dev/null |
| +++ b/internal/runner/provider/claude/auth_framing_test.go |
| @@ -0,0 +1,29 @@ |
| +package claude |
| + |
| +import ( |
| + "encoding/json" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +func TestClaudeAuthManifestVersion(t *testing.T) { |
| + for _, version := range []string{Version, "other", ""} { |
| + t.Run(version, func(t *testing.T) { |
| + manifest := map[string]any{"Argv": AuthStatusArgs()} |
| + if version != "" { |
| + manifest["ProviderVersion"] = version |
| + } |
| + raw, _ := json.Marshal(manifest) |
| + l := provider.Launch{Selection: provider.Selection{Provider: "claude"}, Binding: provider.Binding{Expected: provider.Identity{ProviderVersion: Version}}, Policy: provider.Policy{Manifest: raw, ManifestHash: provider.DigestDirectEvidence(raw)}} |
| + if AuthStatusDocument(l) != (version == Version) { |
| + t.Fatal("manifest version was not checked") |
| + } |
| + }) |
| + } |
| + args := AuthStatusArgs() |
| + args[0] = "mutated" |
| + if AuthStatusArgs()[0] != "/opt/claude" { |
| + t.Fatal("auth command is mutable") |
| + } |
| +} |
diff --git a/internal/runner/provider/claude/launcher.go b/internal/runner/provider/claude/launcher.go| index cb8b08f9..99447b26 100644 |
| --- a/internal/runner/provider/claude/launcher.go |
| +++ b/internal/runner/provider/claude/launcher.go |
| @@ -18,7 +18,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/provider" |
| ) |
| -const Version = "2.1.312" |
| +const Version = provider.ClaudeVersion |
| const ExecutableSHA256 = "4f4178ce41d83e23341ebfbaecdbcf8ea6bf7baea0690025abe49eeec3a5d01d" |
| const errNotReady provider.Error = "claude_not_ready" |
| const errUncertain provider.Error = "claude_turn_uncertain" |
| @@ -94,6 +94,12 @@ func missing(v any) bool { |
| } |
| return false |
| } |
| + |
| +// AuthStatusArgs returns a fresh copy of the exact document-framed auth command. |
| +func AuthStatusArgs() []string { |
| + return []string{"/opt/claude", "--setting-sources", "", "--settings", provider.SettingsPath, "--strict-mcp-config", "--mcp-config", provider.MCPPath, "--disable-slash-commands", "auth", "status", "--json"} |
| +} |
| + |
| func baseArgs(model, tools string) []string { |
| return []string{"/opt/claude", "-p", "--verbose", "--input-format", "stream-json", "--output-format", "stream-json", "--model", model, "--setting-sources", "", "--disable-slash-commands", "--strict-mcp-config", "--mcp-config", provider.MCPPath, "--settings", provider.SettingsPath, "--permission-mode", "manual", "--permission-prompt-tool", "mcp__equipo__permission", "--tools", tools} |
| } |
| @@ -149,7 +155,7 @@ func PolicyInputs(b provider.Binding, in provider.PolicyInputs, specialist, mode |
| } |
| } |
| settings := map[string]any{ |
| - "disableAllHooks": true, "enabledPlugins": map[string]any{}, |
| + "disableAllHooks": true, "enabledPlugins": map[string]any{"agents-md@builtin": false, "plugin-authoring@builtin": false}, "autoMemoryEnabled": false, "autoDreamEnabled": false, |
| "sandbox": map[string]any{"enabled": true, "failIfUnavailable": true, "allowUnsandboxedCommands": false, "autoAllowBashIfSandboxed": true, "excludedCommands": []string{}, "filesystem": map[string]any{"denyRead": denied, "denyWrite": denied}, "network": map[string]any{"allowUnixSockets": []string{}}}, |
| "permissions": map[string]any{"deny": nativeDenies, "allow": allow}, |
| } |
| @@ -328,7 +334,7 @@ func (l *Launcher) preflight(ctx context.Context, b provider.Binding, lease *pro |
| return observed, e |
| } |
| func (l *Launcher) probeIdentity(ctx context.Context, b provider.Binding, in provider.PolicyInputs) (provider.Identity, error) { |
| - frames, e := l.probe(ctx, b, in, []string{"/opt/claude", "--setting-sources", "", "--settings", provider.SettingsPath, "--strict-mcp-config", "--mcp-config", provider.MCPPath, "--disable-slash-commands", "auth", "status", "--json"}) |
| + frames, e := l.probe(ctx, b, in, AuthStatusArgs()) |
| if e != nil { |
| return provider.Identity{}, e |
| } |
diff --git a/internal/runner/provider/claude/launcher_test.go b/internal/runner/provider/claude/launcher_test.go| index 97fd3f66..c10766f0 100644 |
| --- a/internal/runner/provider/claude/launcher_test.go |
| +++ b/internal/runner/provider/claude/launcher_test.go |
| @@ -327,7 +327,7 @@ func TestClaudeLaunchPolicy(t *testing.T) { |
| } |
| var settings map[string]any |
| json.Unmarshal(f.inputs.Settings, &settings) |
| - if settings["disableAllHooks"] != true || len(settings["enabledPlugins"].(map[string]any)) != 0 { |
| + if settings["disableAllHooks"] != true || !reflect.DeepEqual(settings["enabledPlugins"], map[string]any{"agents-md@builtin": false, "plugin-authoring@builtin": false}) || settings["autoMemoryEnabled"] != false || settings["autoDreamEnabled"] != false { |
| t.Fatal("hooks/plugins enabled") |
| } |
| if !sameJSON(f.inputs.MCP, []byte(`{"mcpServers":{"equipo":{"type":"stdio","command":"/opt/equipo-tool-proxy","args":["--socket","/tool/equipo.sock"]}}}`)) { |
| @@ -579,11 +579,20 @@ func TestClaudeObservedIdentity(t *testing.T) { |
| } |
| } |
| func TestClaudePolicyRefusals(t *testing.T) { |
| - for _, field := range []string{"settings", "mcp", "tools", "argv", "env", "version", "helper", "managed", "managed_instruction", "hash"} { |
| + for _, field := range []string{"settings", "autoMemoryEnabled", "autoDreamEnabled", "plugin-authoring@builtin", "mcp", "tools", "argv", "env", "version", "helper", "managed", "managed_instruction", "hash"} { |
| t.Run(field, func(t *testing.T) { |
| f := fixtureFor(t, "Engineering") |
| in := f.inputs |
| switch field { |
| + case "autoMemoryEnabled", "autoDreamEnabled", "plugin-authoring@builtin": |
| + var v map[string]any |
| + json.Unmarshal(in.Settings, &v) |
| + if field == "plugin-authoring@builtin" { |
| + v["enabledPlugins"].(map[string]any)[field] = true |
| + } else { |
| + v[field] = true |
| + } |
| + in.Settings, _ = json.Marshal(v) |
| case "settings": |
| var v map[string]any |
| json.Unmarshal(in.Settings, &v) |
diff --git a/internal/runner/provider/claude/runtime_replay_test.go b/internal/runner/provider/claude/runtime_replay_test.go| new file mode 100644 |
| index 00000000..9660592d |
| --- /dev/null |
| +++ b/internal/runner/provider/claude/runtime_replay_test.go |
| @@ -0,0 +1,245 @@ |
| +package claude |
| + |
| +import ( |
| + "context" |
| + "crypto/sha256" |
| + "encoding/hex" |
| + "encoding/json" |
| + "errors" |
| + "io" |
| + "io/fs" |
| + "os" |
| + "os/exec" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +// Only the transport and capture are test code; policy, Open and the |
| +// no-input dependency probe use the production launcher. There is no egress. |
| +type offlineClaudeHost struct { |
| + t *testing.T |
| + home string |
| +} |
| + |
| +func (h *offlineClaudeHost) Start(ctx context.Context, l provider.Launch, argv []string) (provider.Process, error) { |
| + if _, err := provider.AttestLaunch(l, argv); err != nil { |
| + return nil, err |
| + } |
| + home := l.Binding.Home |
| + if h.home != "" { |
| + home = h.home |
| + } |
| + args := []string{"--unshare-all", "--die-with-parent", "--new-session", "--ro-bind", "/usr", "/usr", "--symlink", "usr/bin", "/bin", "--symlink", "usr/lib", "/lib", "--symlink", "usr/lib64", "/lib64", "--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", "--bind", home, "/home/runner", "--bind", l.Workspace, "/workspace"} |
| + for _, m := range l.Policy.Mounts { |
| + if m.Target == provider.SettingsPath { |
| + raw, e := os.ReadFile(m.Source) |
| + if e != nil || !sameJSON(raw, l.Policy.Settings) { |
| + h.t.Fatal("mounted settings differ from policy", e) |
| + } |
| + var settings map[string]any |
| + if json.Unmarshal(raw, &settings) != nil { |
| + h.t.Fatal("invalid mounted settings") |
| + } |
| + plugins, ok := settings["enabledPlugins"].(map[string]any) |
| + if !ok || plugins["agents-md@builtin"] != false || plugins["plugin-authoring@builtin"] != false || settings["autoMemoryEnabled"] != false || settings["autoDreamEnabled"] != false { |
| + h.t.Fatal("startup settings readback failed") |
| + } |
| + } |
| + args = append(args, "--ro-bind", m.Source, m.Target) |
| + } |
| + args = append(args, "--chdir", "/workspace", "--clearenv", "--setenv", "PATH", "/usr/bin:/bin:/opt", "--setenv", "HOME", "/home/runner", "--setenv", "TMPDIR", "/tmp") |
| + for k, v := range l.Policy.Env { |
| + args = append(args, "--setenv", k, v) |
| + } |
| + args = append(args, argv...) |
| + cmd := exec.CommandContext(ctx, "bwrap", args...) |
| + in, err := cmd.StdinPipe() |
| + if err != nil { |
| + return nil, err |
| + } |
| + out, outWrite, err := os.Pipe() |
| + if err != nil { |
| + in.Close() |
| + return nil, err |
| + } |
| + cmd.Stdout = outWrite |
| + p := &fakeProcess{cmd: cmd, in: in, out: out, err: io.NopCloser(strings.NewReader("")), done: make(chan struct{})} |
| + if err = cmd.Start(); err != nil { |
| + in.Close() |
| + out.Close() |
| + outWrite.Close() |
| + return nil, err |
| + } |
| + go func() { _ = cmd.Wait(); outWrite.Close(); p.exit.Code = cmd.ProcessState.ExitCode(); close(p.done) }() |
| + h.t.Cleanup(func() { _ = cmd.Process.Kill(); <-p.done; in.Close(); out.Close() }) |
| + return p, nil |
| +} |
| + |
| +type offlineClaudeCapture struct{ loggedOut bool } |
| + |
| +func (c *offlineClaudeCapture) Open(ctx context.Context, p provider.Process, _ provider.Launch) (*provider.Capture, error) { |
| + frames, done := make(chan provider.Frame), make(chan error, 1) |
| + go func() { |
| + defer close(done) |
| + defer close(frames) |
| + decoder := json.NewDecoder(io.LimitReader(p.Stdout(), MaxFrameBytes+1)) |
| + for seq := int64(1); ; seq++ { |
| + var raw json.RawMessage |
| + err := decoder.Decode(&raw) |
| + if err == io.EOF { |
| + done <- nil |
| + return |
| + } |
| + if err != nil { |
| + done <- err |
| + return |
| + } |
| + var status struct { |
| + LoggedIn *bool `json:"loggedIn"` |
| + } |
| + if json.Unmarshal(raw, &status) == nil && status.LoggedIn != nil && !*status.LoggedIn { |
| + c.loggedOut = true |
| + } |
| + select { |
| + case frames <- provider.Frame{Sequence: seq, Bytes: raw}: |
| + case <-ctx.Done(): |
| + done <- ctx.Err() |
| + return |
| + } |
| + } |
| + }() |
| + return &provider.Capture{Input: p.Stdin(), Frames: frames, Done: done}, nil |
| +} |
| + |
| +func TestClaudeEmptyHomeReplay(t *testing.T) { |
| + home, err := os.UserHomeDir() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + binary := filepath.Join(home, ".local/share/equipo/try/bin/claude") |
| + file, err := os.Open(binary) |
| + if os.IsNotExist(err) { |
| + t.Skip("pinned Claude 2.1.312 binary absent; empty-home replay requires the local pinned installation") |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + sum := sha256.New() |
| + _, err = io.Copy(sum, file) |
| + file.Close() |
| + if err != nil || hex.EncodeToString(sum.Sum(nil)) != ExecutableSHA256 { |
| + t.Fatal("pinned Claude digest differs") |
| + } |
| + for _, role := range []string{"Engineering", "Coordinator"} { |
| + t.Run(role, func(t *testing.T) { |
| + f := fixtureFor(t, role) |
| + var settings map[string]any |
| + json.Unmarshal(f.inputs.Settings, &settings) |
| + if settings["enabledPlugins"].(map[string]any)["agents-md@builtin"] != false || settings["enabledPlugins"].(map[string]any)["plugin-authoring@builtin"] != false || settings["autoMemoryEnabled"] != false || settings["autoDreamEnabled"] != false { |
| + t.Error("plugins, memory or dreaming not disabled") |
| + } |
| + source := filepath.Join(filepath.Dir(f.interactive), "dedicated") |
| + for _, name := range []string{".credentials.json", ".claude.json"} { |
| + if err = os.WriteFile(filepath.Join(source, name), []byte(`{}`), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + f.lease.Close() |
| + id := f.lease.Identity() |
| + f.lease, err = provider.OpenAccount(context.Background(), provider.Binding{ID: "binding", Home: source, AccountID: id.AccountID, Provider: "claude", Expected: id, RuntimeRoot: filepath.Join(filepath.Dir(source), "empty-homes")}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + t.Cleanup(func() { f.lease.Close() }) |
| + f.launch.Binding = f.lease.Binding() |
| + in := f.inputs |
| + in.RuntimeFiles[0].Source = binary |
| + in.DeniedPaths = []string{"/private/state", "/alias/login"} |
| + in.Action = "implement" |
| + if role == "Coordinator" { |
| + in.Action = "coordinate" |
| + } |
| + profile, _ := provider.Profile(in.Action) |
| + in.Tools = profile.MCPTools() |
| + in, err = PolicyInputs(f.lease.Binding(), in, role, f.launch.Selection.Model) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + f.launch.Policy, err = provider.BuildPolicy(f.lease.Binding(), in) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + host := &offlineClaudeHost{t: t} |
| + capture := &offlineClaudeCapture{} |
| + launcher, err := New(host, capture) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + ctx, cancel := context.WithTimeout(context.Background(), 40*time.Second) |
| + defer cancel() |
| + _, err = launcher.Open(ctx, f.launch) |
| + if !errors.Is(err, errFailed) || errors.Is(err, provider.ErrContainment) || !capture.loggedOut { |
| + t.Fatalf("expected unauthenticated auth exit from Open, got %v", err) |
| + } |
| + t.Logf("real Open: %v", err) |
| + // Auth exits before the no-input -p probe. Exercise that exact probe |
| + // separately, first with a completely empty config directory. |
| + for _, empty := range []bool{true, false} { |
| + root := f.lease.Binding().Home |
| + if empty { |
| + root = t.TempDir() |
| + host.home = root |
| + } else { |
| + host.home = "" |
| + } |
| + var probeErr error |
| + err = f.lease.Preflight(ctx, func(ctx context.Context, b provider.Binding) (provider.Identity, error) { |
| + _, probeErr = launcher.probe(ctx, b, in, append(append([]string{}, in.Argv...), "--session-id", uuid())) |
| + return provider.Identity{}, provider.ErrIdentity |
| + }) |
| + if !errors.Is(err, provider.ErrIdentity) { |
| + t.Fatal(err) |
| + } |
| + err = probeErr |
| + t.Logf("full preflight empty=%v: %v", empty, err) |
| + if err != nil { |
| + t.Fatalf("probe did not complete: %v", err) |
| + } |
| + for _, name := range []string{"plugins", "skills", "agents", "commands", "shell-snapshots", "session-env"} { |
| + if _, e := os.Lstat(filepath.Join(root, name)); !os.IsNotExist(e) { |
| + t.Fatalf("policy entry created: %s: %v", name, e) |
| + } |
| + } |
| + if err = filepath.WalkDir(root, func(path string, d fs.DirEntry, e error) error { |
| + if e != nil { |
| + return e |
| + } |
| + if path == root { |
| + return nil |
| + } |
| + info, e := d.Info() |
| + if e != nil { |
| + return e |
| + } |
| + rel, _ := filepath.Rel(root, path) |
| + t.Logf("runtime empty=%v: %s %s %04o", empty, rel, info.Mode().Type(), info.Mode().Perm()) |
| + return nil |
| + }); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + // No real CLI runs with this synthetic identity. It only enables the |
| + // final runtime-policy check after every subprocess has exited. |
| + if err = f.lease.Preflight(ctx, func(context.Context, provider.Binding) (provider.Identity, error) { return f.lease.Identity(), nil }); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err = f.lease.ValidatePolicy(ctx); err != nil { |
| + t.Fatalf("real runtime tree rejected: %v", err) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/provider/codex/config_readback.go b/internal/runner/provider/codex/config_readback.go| new file mode 100644 |
| index 00000000..bd2aace3 |
| --- /dev/null |
| +++ b/internal/runner/provider/codex/config_readback.go |
| @@ -0,0 +1,39 @@ |
| +package codex |
| + |
| +import ( |
| + "encoding/json" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +func effectiveConfigMatches(p provider.Policy, got map[string]json.RawMessage) bool { |
| + if configSubset(p.Settings, marshal(got)) { |
| + return true |
| + } |
| + var m struct{ ProviderVersion string } |
| + if !p.Coordinator() || json.Unmarshal(p.Manifest, &m) != nil || m.ProviderVersion != Version { |
| + return false |
| + } |
| + var want map[string]json.RawMessage |
| + if json.Unmarshal(p.Settings, &want) != nil { |
| + return false |
| + } |
| + // 0.165.0 keeps these two disabled flags in the session layer but omits |
| + // them from typed effective config; this is not proof they are disabled. |
| + // The live tool inventory check in directlive/coordinator_inventory.go is |
| + // the real guard. The unmodified command-line layer is checked below. |
| + var tools, effective map[string]json.RawMessage |
| + if json.Unmarshal(want["tools"], &tools) != nil || len(tools) != 2 || json.Unmarshal(got["tools"], &effective) != nil { |
| + return false |
| + } |
| + if len(effective) != 1 || !sameJSON(effective["web_search"], []byte(`null`)) { |
| + return false |
| + } |
| + for _, key := range []string{"update_plan", "experimental_request_user_input"} { |
| + if !sameJSON(tools[key], []byte(`{"enabled":false}`)) { |
| + return false |
| + } |
| + } |
| + delete(want, "tools") |
| + return configSubset(marshal(want), marshal(got)) |
| +} |
diff --git a/internal/runner/provider/codex/launcher.go b/internal/runner/provider/codex/launcher.go| index a5ce2d9f..f2a36e8a 100644 |
| --- a/internal/runner/provider/codex/launcher.go |
| +++ b/internal/runner/provider/codex/launcher.go |
| @@ -7,6 +7,7 @@ import ( |
| "encoding/hex" |
| "encoding/json" |
| "errors" |
| + "fmt" |
| "io" |
| "path/filepath" |
| "reflect" |
| @@ -19,7 +20,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/provider" |
| ) |
| -const Version = "0.165.0" |
| +const Version = provider.CodexVersion |
| const ExecutableSHA256 = "c06a67fd8ac76508dc78bd99ce20c9f317b8d568beda59485f3f4134df9962d5" |
| const CodeModeHostSHA256 = "522935d4392ec9674fab60b239b5495992c6a93e4deb65113a216b6f5451ccd4" |
| const errNotReady provider.Error = "codex_not_ready" |
| @@ -128,9 +129,10 @@ func PolicyInputs(b provider.Binding, in provider.PolicyInputs, model string) (p |
| fs[path] = "deny" |
| } |
| settings := map[string]any{ |
| - "model": model, "model_provider": "openai", "approval_policy": "on-request", "approvals_reviewer": "user", "default_permissions": "equipo", |
| + "skills": map[string]any{"bundled": map[string]any{"enabled": false}}, |
| + "model": model, "model_provider": "openai", "approval_policy": "on-request", "approvals_reviewer": "user", "default_permissions": "equipo", |
| "permissions": map[string]any{"equipo": map[string]any{"filesystem": fs, "network": map[string]any{"enabled": false}}}, |
| - "features": map[string]any{"incremental_tools": true, "apps": false, "multi_agent": false, "remote_control": false, "tool_call_mcp_elicitation": true}, "mcp_servers": map[string]any{"equipo": map[string]any{"command": "/opt/equipo-tool-proxy", "args": []string{"--socket", "/tool/equipo.sock"}}}, |
| + "features": map[string]any{"incremental_tools": true, "apps": false, "multi_agent": false, "remote_control": false, "memories": false, "goals": false, "plugins": false, "remote_plugin": false, "tool_suggest": false, "tool_call_mcp_elicitation": true}, "mcp_servers": map[string]any{"equipo": map[string]any{"command": "/opt/equipo-tool-proxy", "args": []string{"--socket", "/tool/equipo.sock"}}}, |
| } |
| if in.Action == "coordinate" { |
| configureCoordinator(settings, model) |
| @@ -349,7 +351,7 @@ func validateConfig(raw []byte, p provider.Policy) error { |
| var want map[string]json.RawMessage |
| json.Unmarshal(p.Settings, &want) |
| // The pinned binary expands defaults; configured values must still match. |
| - if !configSubset(p.Settings, marshal(v.Config)) { |
| + if !effectiveConfigMatches(p, v.Config) { |
| return provider.ErrPolicy |
| } |
| var expectedMCP, effectiveMCP map[string]json.RawMessage |
| @@ -449,13 +451,13 @@ func (l *Launcher) preflight(ctx context.Context, b provider.Binding, lease *pro |
| } |
| e := lease.Validate(ctx) |
| if errors.Is(e, provider.ErrContainment) { |
| - return observed, e |
| + return observed, fmt.Errorf("codex_preflight_lease: %w", e) |
| } |
| if errors.Is(e, provider.ErrRefreshPending) { |
| return observed, provider.ErrAccountMaintenance |
| } |
| if e = lease.Preflight(ctx, probe); e != nil { |
| - return observed, e |
| + return observed, fmt.Errorf("codex_preflight_probe: %w", e) |
| } |
| _, e = provider.BuildPolicy(b, in) |
| return observed, e |
| @@ -499,7 +501,7 @@ func (l *Launcher) Open(ctx context.Context, launch provider.Launch) (provider.S |
| return provider.Session{}, e |
| } |
| if e = lease.ValidatePolicy(ctx); e != nil { |
| - return provider.Session{}, e |
| + return provider.Session{}, fmt.Errorf("codex_open_runtime_policy: %w", e) |
| } |
| attempt, cancel := context.WithCancel(ctx) |
| s := &sessionState{launch: launch, lease: lease, ctx: attempt, cancel: cancel, events: make(chan provider.Event, 128), done: make(chan struct{}), used: map[string]bool{}} |
diff --git a/internal/runner/provider/codex/live_config_test.go b/internal/runner/provider/codex/live_config_test.go| new file mode 100644 |
| index 00000000..0e05f9fb |
| --- /dev/null |
| +++ b/internal/runner/provider/codex/live_config_test.go |
| @@ -0,0 +1,64 @@ |
| +package codex |
| + |
| +import ( |
| + "encoding/json" |
| + "os" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +func liveConfig(t *testing.T) (map[string]any, provider.Policy) { |
| + t.Helper() |
| + raw, err := os.ReadFile("testdata/live-config-0.165.0.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var frame struct{ Result map[string]any } |
| + if err = json.Unmarshal(raw, &frame); err != nil { |
| + t.Fatal(err) |
| + } |
| + settings := marshal(frame.Result["layers"].([]any)[0].(map[string]any)["config"]) |
| + manifest := marshal(map[string]any{"Action": "coordinate", "ProviderVersion": Version}) |
| + return frame.Result, provider.Policy{Settings: settings, Manifest: manifest, ManifestHash: provider.DigestDirectEvidence(manifest)} |
| +} |
| +func TestCodexLiveConfigReadback(t *testing.T) { |
| + v, p := liveConfig(t) |
| + if err := validateConfig(marshal(v), p); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| +func TestCodexLiveConfigStrict(t *testing.T) { |
| + for _, mode := range []string{"enabled-tool", "unknown-tool", "missing-feature", "changed-approval", "changed-layer", "extra-server", "other-action", "other-version"} { |
| + t.Run(mode, func(t *testing.T) { |
| + v, p := liveConfig(t) |
| + cfg := v["config"].(map[string]any) |
| + switch mode { |
| + case "enabled-tool": |
| + cfg["tools"].(map[string]any)["update_plan"] = map[string]any{"enabled": true} |
| + case "unknown-tool": |
| + cfg["tools"].(map[string]any)["unknown"] = map[string]any{"enabled": false} |
| + case "missing-feature": |
| + delete(cfg["features"].(map[string]any), "shell_tool") |
| + case "changed-approval": |
| + cfg["approvals_reviewer"] = "auto_review" |
| + case "changed-layer": |
| + v["layers"].([]any)[0].(map[string]any)["config"].(map[string]any)["tools"].(map[string]any)["update_plan"] = map[string]any{"enabled": true} |
| + case "extra-server": |
| + cfg["mcp_servers"].(map[string]any)["other"] = map[string]any{} |
| + case "other-action", "other-version": |
| + m := map[string]any{"Action": "coordinate", "ProviderVersion": Version} |
| + if mode == "other-action" { |
| + m["Action"] = "implement" |
| + } else { |
| + m["ProviderVersion"] = "other" |
| + } |
| + p.Manifest = marshal(m) |
| + p.ManifestHash = provider.DigestDirectEvidence(p.Manifest) |
| + } |
| + if validateConfig(marshal(v), p) == nil { |
| + t.Fatal("unsafe readback accepted") |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/provider/codex/runtime_policy_test.go b/internal/runner/provider/codex/runtime_policy_test.go| new file mode 100644 |
| index 00000000..18193eaf |
| --- /dev/null |
| +++ b/internal/runner/provider/codex/runtime_policy_test.go |
| @@ -0,0 +1,77 @@ |
| +package codex |
| + |
| +import ( |
| + "encoding/json" |
| + "os" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +func TestCodexRuntimeSettings(t *testing.T) { |
| + for _, action := range []string{"implement", "coordinate"} { |
| + t.Run(action, func(t *testing.T) { |
| + f := fixtureFor(t) |
| + in := f.inputs |
| + in.Action = action |
| + profile, _ := provider.Profile(action) |
| + in.Tools = profile.MCPTools() |
| + in, err := PolicyInputs(f.lease.Binding(), in, f.launch.Selection.Model) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if !configSubset([]byte(`{"skills":{"bundled":{"enabled":false}},"features":{"memories":false,"goals":false,"plugins":false,"remote_plugin":false,"tool_suggest":false}}`), in.Settings) { |
| + t.Fatal("skills or memories not disabled") |
| + } |
| + if !strings.Contains(strings.Join(in.Argv, " "), `skills={"bundled"={"enabled"=false}}`) { |
| + t.Fatal("skills missing from argv") |
| + } |
| + p, err := provider.BuildPolicy(f.lease.Binding(), in) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, key := range []string{"skills", "memories", "goals", "plugins", "remote_plugin", "tool_suggest"} { |
| + t.Run(key, func(t *testing.T) { |
| + var got map[string]any |
| + json.Unmarshal(in.Settings, &got) |
| + if key == "skills" { |
| + got[key].(map[string]any)["bundled"].(map[string]any)["enabled"] = true |
| + } else { |
| + got["features"].(map[string]any)[key] = true |
| + } |
| + readback := marshal(map[string]any{"config": got, "origins": map[string]any{}, "layers": []any{map[string]any{"name": map[string]any{"type": "sessionFlags"}, "version": "fixture", "config": json.RawMessage(in.Settings)}}}) |
| + if validateConfig(readback, p) == nil { |
| + t.Fatal("enabled capability accepted") |
| + } |
| + }) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestCodexRecordedDisabledRuntime(t *testing.T) { |
| + raw, err := os.ReadFile("testdata/disabled-skills-0.165.0.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var frames []struct { |
| + ID int |
| + Result json.RawMessage |
| + } |
| + if err = json.Unmarshal(raw, &frames); err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(frames) != 4 { |
| + t.Fatal("incomplete recording") |
| + } |
| + if !configSubset([]byte(`{"account":null,"requiresOpenaiAuth":true}`), frames[1].Result) { |
| + t.Fatal("recording is not unauthenticated") |
| + } |
| + if !configSubset([]byte(`{"config":{"skills":{"bundled":{"enabled":false}},"features":{"memories":false}}}`), frames[2].Result) { |
| + t.Fatal("disabled config not recorded") |
| + } |
| + if !sameJSON(frames[3].Result, []byte(`{"data":[{"cwd":"/workspace","skills":[],"errors":[]}]}`)) { |
| + t.Fatal("skills exposed") |
| + } |
| +} |
diff --git a/internal/runner/provider/codex/runtime_replay_test.go b/internal/runner/provider/codex/runtime_replay_test.go| new file mode 100644 |
| index 00000000..15c5fc61 |
| --- /dev/null |
| +++ b/internal/runner/provider/codex/runtime_replay_test.go |
| @@ -0,0 +1,189 @@ |
| +package codex |
| + |
| +import ( |
| + "context" |
| + "crypto/sha256" |
| + "encoding/hex" |
| + "errors" |
| + "io" |
| + "io/fs" |
| + "os" |
| + "os/exec" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| +) |
| + |
| +// The transport runs the real CLI without an egress relay. Open, policy |
| +// attestation, account staging and RPC handling are the production code. |
| +type offlineCodexHost struct{ t *testing.T } |
| +type offlineCodexProcess struct { |
| + in io.WriteCloser |
| + out io.ReadCloser |
| + done chan struct{} |
| + exit provider.Exit |
| +} |
| + |
| +func (p *offlineCodexProcess) ID() string { return "offline-replay" } |
| +func (p *offlineCodexProcess) Stdin() io.WriteCloser { return p.in } |
| +func (p *offlineCodexProcess) Stdout() io.ReadCloser { return p.out } |
| +func (p *offlineCodexProcess) Stderr() io.ReadCloser { return io.NopCloser(strings.NewReader("")) } |
| +func (p *offlineCodexProcess) Wait(ctx context.Context) (provider.Exit, error) { |
| + select { |
| + case <-p.done: |
| + return p.exit, nil |
| + case <-ctx.Done(): |
| + return provider.Exit{}, ctx.Err() |
| + } |
| +} |
| + |
| +func (h offlineCodexHost) Start(ctx context.Context, l provider.Launch, argv []string) (provider.Process, error) { |
| + if _, err := provider.AttestLaunch(l, argv); err != nil { |
| + return nil, err |
| + } |
| + args := []string{"--unshare-all", "--die-with-parent", "--new-session", "--ro-bind", "/usr", "/usr", "--symlink", "usr/bin", "/bin", "--symlink", "usr/lib", "/lib", "--symlink", "usr/lib64", "/lib64", "--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", "--bind", l.Binding.Home, "/home/runner", "--bind", l.Workspace, "/workspace"} |
| + for _, m := range l.Policy.Mounts { |
| + args = append(args, "--ro-bind", m.Source, m.Target) |
| + } |
| + args = append(args, "--chdir", "/workspace", "--clearenv", "--setenv", "PATH", "/usr/bin:/bin:/opt", "--setenv", "HOME", "/home/runner", "--setenv", "CODEX_HOME", "/home/runner", "--setenv", "TMPDIR", "/tmp", "--setenv", "LANG", "C.UTF-8") |
| + args = append(args, argv...) |
| + cmd := exec.CommandContext(ctx, "bwrap", args...) |
| + p := &offlineCodexProcess{done: make(chan struct{})} |
| + var err error |
| + if p.in, err = cmd.StdinPipe(); err != nil { |
| + return nil, err |
| + } |
| + if p.out, err = cmd.StdoutPipe(); err != nil { |
| + p.in.Close() |
| + return nil, err |
| + } |
| + if err = cmd.Start(); err != nil { |
| + p.in.Close() |
| + p.out.Close() |
| + return nil, err |
| + } |
| + go func() { _ = cmd.Wait(); p.exit.Code = cmd.ProcessState.ExitCode(); close(p.done) }() |
| + h.t.Cleanup(func() { _ = cmd.Process.Kill(); <-p.done; p.in.Close(); p.out.Close() }) |
| + return p, nil |
| +} |
| + |
| +func TestCodexEmptyHomeReplay(t *testing.T) { |
| + home, err := os.UserHomeDir() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + bin := filepath.Join(home, ".local/share/equipo/try/bin") |
| + for name, want := range map[string]string{"codex": ExecutableSHA256, "codex-code-mode-host": CodeModeHostSHA256} { |
| + f, err := os.Open(filepath.Join(bin, name)) |
| + if os.IsNotExist(err) { |
| + t.Skip("pinned Codex 0.165.0 binaries absent; empty-home replay requires the local pinned installation") |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + sum := sha256.New() |
| + _, err = io.Copy(sum, f) |
| + f.Close() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if hex.EncodeToString(sum.Sum(nil)) != want { |
| + t.Fatalf("pinned %s digest differs", name) |
| + } |
| + } |
| + for _, action := range []string{"implement", "coordinate"} { |
| + t.Run(action, func(t *testing.T) { |
| + f := fixtureFor(t) |
| + // This source is a newly-created test fixture, containing no login. |
| + source := filepath.Join(filepath.Dir(f.interactive), "dedicated", "auth.json") |
| + if err := os.WriteFile(source, []byte(`{"auth_mode":"apikey"}`), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + in := f.inputs |
| + in.Action = action |
| + profile, _ := provider.Profile(action) |
| + in.Tools = profile.MCPTools() |
| + for i := range in.RuntimeFiles { |
| + if in.RuntimeFiles[i].Target != "/opt/equipo-tool-proxy" { |
| + in.RuntimeFiles[i].Source = filepath.Join(bin, filepath.Base(in.RuntimeFiles[i].Target)) |
| + } |
| + } |
| + // No thread starts, so the tool proxy is never invoked. |
| + in, err = PolicyInputs(f.lease.Binding(), in, f.launch.Selection.Model) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + f.launch.Policy, err = provider.BuildPolicy(f.lease.Binding(), in) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + f.l, err = New(offlineCodexHost{t}, fakeCapture{}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
| + defer cancel() |
| + _, err = f.l.Open(ctx, f.launch) |
| + if !errors.Is(err, provider.ErrIdentity) || errors.Is(err, provider.ErrContainment) { |
| + t.Fatalf("expected missing account from real Open, got %v", err) |
| + } |
| + t.Logf("real %s Open: %v", action, err) |
| + // Missing account returns before config/read in Open. Check the same |
| + // production policy on a second unauthenticated process, without a turn. |
| + err = f.lease.Preflight(ctx, func(ctx context.Context, b provider.Binding) (provider.Identity, error) { |
| + probeCtx, stop := context.WithCancel(ctx) |
| + defer stop() |
| + launch := f.launch |
| + launch.Binding = b |
| + proc, _, rpc, e := f.l.start(probeCtx, launch, func(provider.Frame) error { return nil }) |
| + defer func() { |
| + if rpc != nil { |
| + rpc.close() |
| + } |
| + stop() |
| + waitProcess(proc) |
| + if rpc != nil { |
| + <-rpc.done |
| + } |
| + }() |
| + if e != nil { |
| + return provider.Identity{}, e |
| + } |
| + if e = initialize(probeCtx, rpc); e != nil { |
| + return provider.Identity{}, e |
| + } |
| + if e = readConfig(probeCtx, rpc, launch.Policy); e != nil { |
| + return provider.Identity{}, e |
| + } |
| + return readIdentity(probeCtx, rpc) |
| + }) |
| + if !errors.Is(err, provider.ErrIdentity) { |
| + t.Fatalf("readback probe: %v", err) |
| + } |
| + for _, name := range []string{"skills", ".tmp/plugins.sha", ".tmp/plugins"} { |
| + if _, err = os.Lstat(filepath.Join(f.lease.Binding().Home, name)); !os.IsNotExist(err) { |
| + t.Fatalf("disabled startup artifact %s: %v", name, err) |
| + } |
| + } |
| + // Only make the fixture ready after all real processes have exited, so |
| + // ValidatePolicy can check their actual startup files. No CLI uses this |
| + // synthetic identity and no credentials or successful Open are fabricated. |
| + if err = f.lease.Preflight(ctx, func(context.Context, provider.Binding) (provider.Identity, error) { return f.lease.Identity(), nil }); err != nil { |
| + t.Fatal(err) |
| + } |
| + filepath.WalkDir(f.lease.Binding().Home, func(path string, d fs.DirEntry, e error) error { |
| + if e == nil && strings.Contains(path, "arg0") { |
| + r, _ := filepath.Rel(f.lease.Binding().Home, path) |
| + t.Logf("runtime: %s %s", r, d.Type()) |
| + } |
| + return e |
| + }) |
| + if err = f.lease.ValidatePolicy(ctx); err != nil { |
| + t.Fatalf("real runtime tree rejected: %v", err) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json b/internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json| new file mode 100644 |
| index 00000000..b892b1d9 |
| --- /dev/null |
| +++ b/internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json |
| @@ -0,0 +1,231 @@ |
| +[ |
| + { |
| + "id": 1, |
| + "result": { |
| + "userAgent": "equipo/0.165.0 (Debian 13.0.0; x86_64) unknown (equipo; 2)", |
| + "codexHome": "/home/runner", |
| + "platformFamily": "unix", |
| + "platformOs": "linux" |
| + } |
| + }, |
| + { |
| + "id": 2, |
| + "result": { |
| + "account": null, |
| + "requiresOpenaiAuth": true, |
| + "workspaceRouting": null |
| + } |
| + }, |
| + { |
| + "id": 3, |
| + "result": { |
| + "config": { |
| + "model": null, |
| + "review_model": null, |
| + "model_context_window": null, |
| + "model_auto_compact_token_limit": null, |
| + "model_auto_compact_token_limit_scope": null, |
| + "model_provider": null, |
| + "approval_policy": null, |
| + "approvals_reviewer": null, |
| + "sandbox_mode": null, |
| + "sandbox_workspace_write": null, |
| + "forced_chatgpt_workspace_id": null, |
| + "forced_login_method": null, |
| + "web_search": null, |
| + "tools": null, |
| + "instructions": null, |
| + "developer_instructions": null, |
| + "compact_prompt": null, |
| + "model_reasoning_effort": null, |
| + "model_reasoning_summary": null, |
| + "model_verbosity": null, |
| + "service_tier": null, |
| + "analytics": null, |
| + "apps": null, |
| + "browser_use": null, |
| + "computer_use": null, |
| + "desktop": null, |
| + "model_providers": {}, |
| + "project_doc_fallback_filenames": [], |
| + "experimental_realtime_ws_startup_context": null, |
| + "experimental_realtime_ws_base_url": null, |
| + "js_repl_node_path": null, |
| + "model_instructions_file": null, |
| + "include_environment_context_time": true, |
| + "experimental_realtime_ws_model": null, |
| + "experimental_thread_store_endpoint": null, |
| + "apps_mcp_product_sku": null, |
| + "mcp_oauth_callback_url": null, |
| + "chatgpt_base_url": "https://chatgpt.com/backend-api/", |
| + "shell_environment_policy": { |
| + "inherit": null, |
| + "ignore_default_excludes": null, |
| + "exclude": null, |
| + "set": null, |
| + "include_only": null, |
| + "filters": null, |
| + "experimental_use_profile": null |
| + }, |
| + "permissions": null, |
| + "include_collaboration_mode_instructions": true, |
| + "sqlite_home": null, |
| + "hide_agent_reasoning": false, |
| + "disable_paste_burst": null, |
| + "orchestrator": null, |
| + "feedback": null, |
| + "js_repl_node_module_dirs": null, |
| + "profile": null, |
| + "marketplaces": {}, |
| + "project_root_markers": [ |
| + ".git" |
| + ], |
| + "background_terminal_max_timeout": 300000, |
| + "plan_mode_reasoning_effort": null, |
| + "features": { |
| + "network_proxy": null, |
| + "memories": false, |
| + "remote_control": false, |
| + "api_key_cyber_access_programs": true, |
| + "api_key_model_discovery": true, |
| + "auth_elicitation": true, |
| + "background_paginated_rollout_migration": false, |
| + "codex_apps_mcp_2026_07_28": false, |
| + "mcp_2026_07_28": false, |
| + "mentions_v2": true, |
| + "remote_plugin": true, |
| + "tool_suggest": true, |
| + "windows_sandbox_service": false |
| + }, |
| + "experimental_use_unified_exec_tool": null, |
| + "log_dir": null, |
| + "show_raw_agent_reasoning": null, |
| + "notify": null, |
| + "include_environment_context": true, |
| + "oss_provider": null, |
| + "file_opener": "vscode", |
| + "model_catalog_json": null, |
| + "personality": null, |
| + "audio": null, |
| + "cli_auth_credentials_store": "file", |
| + "check_for_update_on_startup": null, |
| + "history": { |
| + "persistence": "save-all", |
| + "max_bytes": null |
| + }, |
| + "mcp_oauth_credentials_store": "auto", |
| + "ghost_snapshot": null, |
| + "experimental_realtime_ws_backend_prompt": null, |
| + "experimental_compact_prompt_file": null, |
| + "mcp_oauth_callback_port": null, |
| + "otel": null, |
| + "mcp_servers": {}, |
| + "goals": null, |
| + "allow_login_shell": true, |
| + "projects": null, |
| + "daybreak": null, |
| + "auto_review": null, |
| + "include_permissions_instructions": true, |
| + "mcp_enterprise_managed_auth": null, |
| + "project_doc_max_bytes": 32768, |
| + "skills": { |
| + "bundled": { |
| + "enabled": false |
| + } |
| + }, |
| + "plugins": {}, |
| + "suppress_unstable_features_warning": null, |
| + "memories": null, |
| + "model_post_turn_compact_threshold_percent": null, |
| + "windows": null, |
| + "profiles": {}, |
| + "mcp_optional_startup_grace_ms": null, |
| + "tool_output_token_limit": null, |
| + "experimental_realtime_start_instructions": null, |
| + "tool_suggest": null, |
| + "experimental_realtime_webrtc_call_base_url": null, |
| + "hooks": null, |
| + "allow_symlinked_codex_home": null, |
| + "agents": null, |
| + "notice": null, |
| + "cloud": null, |
| + "openai_base_url": null, |
| + "default_permissions": null, |
| + "include_apps_instructions": true, |
| + "tui": null, |
| + "thread_unload_delay_secs": null, |
| + "realtime": null, |
| + "responses_api_metadata": null, |
| + "experimental_thread_store": null |
| + }, |
| + "origins": { |
| + "features.remote_control": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:8c48aefcf518f89757c7b3bde7de76a791dd0eeb3ed3ffe1efc12d1ed0a917c1" |
| + }, |
| + "skills.bundled.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:8c48aefcf518f89757c7b3bde7de76a791dd0eeb3ed3ffe1efc12d1ed0a917c1" |
| + }, |
| + "features.memories": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:8c48aefcf518f89757c7b3bde7de76a791dd0eeb3ed3ffe1efc12d1ed0a917c1" |
| + } |
| + }, |
| + "layers": [ |
| + { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:8c48aefcf518f89757c7b3bde7de76a791dd0eeb3ed3ffe1efc12d1ed0a917c1", |
| + "config": { |
| + "features": { |
| + "remote_control": false, |
| + "memories": false |
| + }, |
| + "skills": { |
| + "bundled": { |
| + "enabled": false |
| + } |
| + } |
| + } |
| + }, |
| + { |
| + "name": { |
| + "type": "user", |
| + "file": "/home/runner/config.toml", |
| + "profile": null |
| + }, |
| + "version": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", |
| + "config": {} |
| + }, |
| + { |
| + "name": { |
| + "type": "system", |
| + "file": "/etc/codex/config.toml" |
| + }, |
| + "version": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", |
| + "config": {} |
| + } |
| + ] |
| + } |
| + }, |
| + { |
| + "id": 4, |
| + "result": { |
| + "data": [ |
| + { |
| + "cwd": "/workspace", |
| + "skills": [], |
| + "errors": [] |
| + } |
| + ] |
| + } |
| + } |
| +] |
diff --git a/internal/runner/provider/codex/testdata/live-config-0.165.0.json b/internal/runner/provider/codex/testdata/live-config-0.165.0.json| new file mode 100644 |
| index 00000000..d5c6ed6f |
| --- /dev/null |
| +++ b/internal/runner/provider/codex/testdata/live-config-0.165.0.json |
| @@ -0,0 +1,991 @@ |
| +{ |
| + "id": "equipo:3", |
| + "result": { |
| + "config": { |
| + "agents": null, |
| + "allow_login_shell": true, |
| + "allow_symlinked_codex_home": null, |
| + "analytics": null, |
| + "approval_policy": "on-request", |
| + "approvals_reviewer": "user", |
| + "apps": null, |
| + "apps_mcp_product_sku": null, |
| + "audio": null, |
| + "auto_review": null, |
| + "background_terminal_max_timeout": 300000, |
| + "browser_use": null, |
| + "chatgpt_base_url": "https://chatgpt.com/backend-api/", |
| + "check_for_update_on_startup": null, |
| + "cli_auth_credentials_store": "file", |
| + "cloud": null, |
| + "compact_prompt": null, |
| + "computer_use": null, |
| + "daybreak": null, |
| + "default_permissions": "equipo", |
| + "desktop": null, |
| + "developer_instructions": null, |
| + "disable_paste_burst": null, |
| + "experimental_compact_prompt_file": null, |
| + "experimental_realtime_start_instructions": null, |
| + "experimental_realtime_webrtc_call_base_url": null, |
| + "experimental_realtime_ws_backend_prompt": null, |
| + "experimental_realtime_ws_base_url": null, |
| + "experimental_realtime_ws_model": null, |
| + "experimental_realtime_ws_startup_context": null, |
| + "experimental_thread_store": null, |
| + "experimental_thread_store_endpoint": null, |
| + "experimental_use_unified_exec_tool": null, |
| + "features": { |
| + "agent_message_board": false, |
| + "api_key_cyber_access_programs": true, |
| + "api_key_model_discovery": true, |
| + "apply_patch_freeform": false, |
| + "apps": false, |
| + "auth_elicitation": true, |
| + "background_paginated_rollout_migration": false, |
| + "browser_use": false, |
| + "browser_use_external": false, |
| + "code_mode": false, |
| + "code_mode_host": false, |
| + "code_mode_only": false, |
| + "code_mode_tool_search": false, |
| + "codex_apps_mcp_2026_07_28": false, |
| + "collaboration_modes": false, |
| + "computer_use": false, |
| + "context_management": false, |
| + "current_time_reminder": false, |
| + "default_mode_request_user_input": false, |
| + "deferred_executor": false, |
| + "goals": false, |
| + "image_generation": false, |
| + "imagegenext": false, |
| + "incremental_tools": true, |
| + "js_repl": false, |
| + "mcp_2026_07_28": false, |
| + "memories": false, |
| + "memory_tool": false, |
| + "mentions_v2": true, |
| + "multi_agent": false, |
| + "multi_agent_mode": false, |
| + "multi_agent_v2": false, |
| + "multi_agent_v2_dynamic_tools": false, |
| + "multi_env_copy_file": false, |
| + "network_proxy": null, |
| + "plugins": false, |
| + "remote_control": false, |
| + "remote_plugin": false, |
| + "request_permissions_tool": false, |
| + "runtime_agent_instances": false, |
| + "search_tool": false, |
| + "send_message_to_user_async": false, |
| + "shell_tool": false, |
| + "skill_search": false, |
| + "sleep_tool": false, |
| + "standalone_web_search": false, |
| + "token_budget": false, |
| + "tool_call_mcp_elicitation": true, |
| + "tool_search": false, |
| + "tool_suggest": false, |
| + "unified_exec": false, |
| + "view_image": false, |
| + "web_search": false, |
| + "web_search_cached": false, |
| + "web_search_request": false, |
| + "windows_sandbox_service": false |
| + }, |
| + "feedback": null, |
| + "file_opener": "vscode", |
| + "forced_chatgpt_workspace_id": null, |
| + "forced_login_method": null, |
| + "ghost_snapshot": null, |
| + "goals": null, |
| + "hide_agent_reasoning": false, |
| + "history": { |
| + "max_bytes": null, |
| + "persistence": "save-all" |
| + }, |
| + "hooks": null, |
| + "include_apps_instructions": true, |
| + "include_collaboration_mode_instructions": true, |
| + "include_environment_context": true, |
| + "include_environment_context_time": true, |
| + "include_permissions_instructions": true, |
| + "instructions": null, |
| + "js_repl_node_module_dirs": null, |
| + "js_repl_node_path": null, |
| + "log_dir": null, |
| + "marketplaces": {}, |
| + "mcp_enterprise_managed_auth": null, |
| + "mcp_oauth_callback_port": null, |
| + "mcp_oauth_callback_url": null, |
| + "mcp_oauth_credentials_store": "auto", |
| + "mcp_optional_startup_grace_ms": null, |
| + "mcp_servers": { |
| + "equipo": { |
| + "args": [ |
| + "--socket", |
| + "/tool/equipo.sock" |
| + ], |
| + "command": "/opt/equipo-tool-proxy", |
| + "enabled": true, |
| + "enabled_tools": [ |
| + "read_project", |
| + "read_task", |
| + "propose_plan", |
| + "ask_person", |
| + "route_to_task", |
| + "post_message", |
| + "suggest_preference", |
| + "suggest_specialist", |
| + "suggest_playbook" |
| + ], |
| + "environment_id": "local", |
| + "tool_timeout_sec": null |
| + } |
| + }, |
| + "memories": null, |
| + "model": "gpt-6-astra", |
| + "model_auto_compact_token_limit": null, |
| + "model_auto_compact_token_limit_scope": null, |
| + "model_catalog_json": "/config/equipo-coordinator-models.json", |
| + "model_context_window": null, |
| + "model_instructions_file": null, |
| + "model_post_turn_compact_threshold_percent": null, |
| + "model_provider": "openai", |
| + "model_providers": {}, |
| + "model_reasoning_effort": null, |
| + "model_reasoning_summary": null, |
| + "model_verbosity": null, |
| + "notice": null, |
| + "notify": null, |
| + "openai_base_url": null, |
| + "orchestrator": null, |
| + "oss_provider": null, |
| + "otel": null, |
| + "permissions": { |
| + "equipo": { |
| + "description": null, |
| + "extends": null, |
| + "filesystem": { |
| + "/config": "deny", |
| + "/dev/fd": "deny", |
| + "/egress": "deny", |
| + "/home/fixture/.claude": "deny", |
| + "/home/fixture/.codex": "deny", |
| + "/home/fixture/.local/share/equipo-runner/amadan.json": "deny", |
| + "/home/fixture/.local/share/equipo-runner/bindings.json": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state/credentials.json": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state/journal.db": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state/private": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-1004981892": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-240644064": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-2598223264": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-281608613": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-314091796": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-3713324690": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-411082886": "deny", |
| + "/home/fixture/.local/share/equipo/scratch/homes/account-363415812": "deny", |
| + "/home/fixture/.paseo": "deny", |
| + "/home/fixture/.ssh": "deny", |
| + "/home/runner": "deny", |
| + "/proc": "deny", |
| + "/tmp": "write", |
| + "/tool": "deny", |
| + "/tool/equipo.sock": "deny", |
| + "/workspace": "read", |
| + ":root": "read", |
| + "glob_scan_max_depth": null |
| + }, |
| + "network": { |
| + "allow_local_binding": null, |
| + "allow_upstream_proxy": null, |
| + "dangerously_allow_all_unix_sockets": null, |
| + "dangerously_allow_non_loopback_proxy": null, |
| + "domains": null, |
| + "enable_socks5": null, |
| + "enable_socks5_udp": null, |
| + "enabled": false, |
| + "mitm": null, |
| + "mode": null, |
| + "proxy_url": null, |
| + "socks_url": null, |
| + "unix_sockets": null |
| + }, |
| + "workspace_roots": null |
| + } |
| + }, |
| + "personality": null, |
| + "plan_mode_reasoning_effort": null, |
| + "plugins": {}, |
| + "profile": null, |
| + "profiles": {}, |
| + "project_doc_fallback_filenames": [], |
| + "project_doc_max_bytes": 32768, |
| + "project_root_markers": [ |
| + ".git" |
| + ], |
| + "projects": null, |
| + "realtime": null, |
| + "responses_api_metadata": null, |
| + "review_model": null, |
| + "sandbox_mode": null, |
| + "sandbox_workspace_write": null, |
| + "service_tier": null, |
| + "shell_environment_policy": { |
| + "exclude": null, |
| + "experimental_use_profile": null, |
| + "filters": null, |
| + "ignore_default_excludes": null, |
| + "include_only": null, |
| + "inherit": null, |
| + "set": null |
| + }, |
| + "show_raw_agent_reasoning": null, |
| + "skills": null, |
| + "sqlite_home": null, |
| + "suppress_unstable_features_warning": null, |
| + "thread_unload_delay_secs": null, |
| + "tool_output_token_limit": null, |
| + "tool_suggest": null, |
| + "tools": { |
| + "web_search": null |
| + }, |
| + "tui": null, |
| + "web_search": "disabled", |
| + "windows": null |
| + }, |
| + "layers": [ |
| + { |
| + "config": { |
| + "approval_policy": "on-request", |
| + "approvals_reviewer": "user", |
| + "default_permissions": "equipo", |
| + "features": { |
| + "agent_message_board": false, |
| + "apply_patch_freeform": false, |
| + "apps": false, |
| + "browser_use": false, |
| + "browser_use_external": false, |
| + "code_mode": false, |
| + "code_mode_host": false, |
| + "code_mode_only": false, |
| + "code_mode_tool_search": false, |
| + "collaboration_modes": false, |
| + "computer_use": false, |
| + "context_management": false, |
| + "current_time_reminder": false, |
| + "default_mode_request_user_input": false, |
| + "deferred_executor": false, |
| + "goals": false, |
| + "image_generation": false, |
| + "imagegenext": false, |
| + "incremental_tools": true, |
| + "js_repl": false, |
| + "memories": false, |
| + "memory_tool": false, |
| + "multi_agent": false, |
| + "multi_agent_mode": false, |
| + "multi_agent_v2": false, |
| + "multi_agent_v2_dynamic_tools": false, |
| + "multi_env_copy_file": false, |
| + "plugins": false, |
| + "remote_control": false, |
| + "remote_plugin": false, |
| + "request_permissions_tool": false, |
| + "runtime_agent_instances": false, |
| + "search_tool": false, |
| + "send_message_to_user_async": false, |
| + "shell_tool": false, |
| + "skill_search": false, |
| + "sleep_tool": false, |
| + "standalone_web_search": false, |
| + "token_budget": false, |
| + "tool_call_mcp_elicitation": true, |
| + "tool_search": false, |
| + "tool_suggest": false, |
| + "unified_exec": false, |
| + "view_image": false, |
| + "web_search": false, |
| + "web_search_cached": false, |
| + "web_search_request": false |
| + }, |
| + "mcp_servers": { |
| + "equipo": { |
| + "args": [ |
| + "--socket", |
| + "/tool/equipo.sock" |
| + ], |
| + "command": "/opt/equipo-tool-proxy", |
| + "enabled_tools": [ |
| + "read_project", |
| + "read_task", |
| + "propose_plan", |
| + "ask_person", |
| + "route_to_task", |
| + "post_message", |
| + "suggest_preference", |
| + "suggest_specialist", |
| + "suggest_playbook" |
| + ] |
| + } |
| + }, |
| + "model": "gpt-6-astra", |
| + "model_catalog_json": "/config/equipo-coordinator-models.json", |
| + "model_provider": "openai", |
| + "permissions": { |
| + "equipo": { |
| + "filesystem": { |
| + "/config": "deny", |
| + "/dev/fd": "deny", |
| + "/egress": "deny", |
| + "/home/fixture/.claude": "deny", |
| + "/home/fixture/.codex": "deny", |
| + "/home/fixture/.local/share/equipo-runner/amadan.json": "deny", |
| + "/home/fixture/.local/share/equipo-runner/bindings.json": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state/credentials.json": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state/journal.db": "deny", |
| + "/home/fixture/.local/share/equipo-runner/state/private": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-1004981892": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-240644064": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-2598223264": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-281608613": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-314091796": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-3713324690": "deny", |
| + "/home/fixture/.local/share/equipo/accounts/account-411082886": "deny", |
| + "/home/fixture/.local/share/equipo/scratch/homes/account-363415812": "deny", |
| + "/home/fixture/.paseo": "deny", |
| + "/home/fixture/.ssh": "deny", |
| + "/home/runner": "deny", |
| + "/proc": "deny", |
| + "/tmp": "write", |
| + "/tool": "deny", |
| + "/tool/equipo.sock": "deny", |
| + "/workspace": "read", |
| + ":root": "read" |
| + }, |
| + "network": { |
| + "enabled": false |
| + } |
| + } |
| + }, |
| + "tools": { |
| + "experimental_request_user_input": { |
| + "enabled": false |
| + }, |
| + "update_plan": { |
| + "enabled": false |
| + } |
| + }, |
| + "web_search": "disabled" |
| + }, |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + { |
| + "config": {}, |
| + "name": { |
| + "file": "/home/runner/config.toml", |
| + "profile": null, |
| + "type": "user" |
| + }, |
| + "version": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" |
| + }, |
| + { |
| + "config": {}, |
| + "name": { |
| + "file": "/etc/codex/config.toml", |
| + "type": "system" |
| + }, |
| + "version": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" |
| + } |
| + ], |
| + "origins": { |
| + "approval_policy": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "approvals_reviewer": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "default_permissions": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.agent_message_board": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.apply_patch_freeform": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.apps": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.browser_use": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.browser_use_external": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.code_mode.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.code_mode_host": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.code_mode_only": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.code_mode_tool_search": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.collaboration_modes": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.computer_use": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.context_management": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.current_time_reminder": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.default_mode_request_user_input": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.deferred_executor": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.goals": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.image_generation": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.imagegenext": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.incremental_tools": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.js_repl": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.memories": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.memory_tool": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.multi_agent": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.multi_agent_mode": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.multi_agent_v2.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.multi_agent_v2_dynamic_tools": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.multi_env_copy_file": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.plugins": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.remote_control": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.remote_plugin": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.request_permissions_tool": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.runtime_agent_instances.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.search_tool": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.send_message_to_user_async": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.shell_tool": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.skill_search": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.sleep_tool.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.standalone_web_search": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.token_budget": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.tool_call_mcp_elicitation": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.tool_search": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.tool_suggest": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.unified_exec": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.view_image": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.web_search": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.web_search_cached": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "features.web_search_request": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.args.0": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.args.1": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.command": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.0": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.1": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.2": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.3": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.4": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.5": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.6": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.7": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "mcp_servers.equipo.enabled_tools.8": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "model": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "model_catalog_json": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "model_provider": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./config": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./dev/fd": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./egress": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.claude": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.codex": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo-runner/amadan.json": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo-runner/bindings.json": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo-runner/state": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo-runner/state/credentials.json": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo-runner/state/journal.db": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo-runner/state/private": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-1004981892": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-240644064": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-2598223264": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-281608613": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-314091796": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-3713324690": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/accounts/account-411082886": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.local/share/equipo/scratch/homes/account-363415812": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.paseo": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/fixture/.ssh": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./home/runner": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./proc": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./tmp": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./tool": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./tool/equipo.sock": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem./workspace": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.filesystem.:root": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "permissions.equipo.network.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "tools.experimental_request_user_input.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "tools.update_plan.enabled": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + }, |
| + "web_search": { |
| + "name": { |
| + "type": "sessionFlags" |
| + }, |
| + "version": "sha256:fb627c3ee35661bcc9a7f69cc65aca80ae8b482e569ccc04169d3bd4759742ba" |
| + } |
| + } |
| + } |
| +} |
diff --git a/internal/runner/provider/direct_certification.go b/internal/runner/provider/direct_certification.go| index e68d2c5a..9998403b 100644 |
| --- a/internal/runner/provider/direct_certification.go |
| +++ b/internal/runner/provider/direct_certification.go |
| @@ -149,7 +149,7 @@ func (e DirectEvidence) ValidateGroup(root, group string) error { |
| if len(required) == 0 || e.Schema != 1 || e.Source != "direct-live" || e.RunID == "" || e.LauncherVersion != LauncherVersion || e.BwrapVersion != "0.11.0" || e.PolicyVersion != PolicyVersion || !liveDigest(e.PolicyHash) || !liveDigest(e.ConfigSHA256) || e.AccountID == "" || e.HomeID == "" || e.Model == "" || e.AuthHost != "" { |
| return ErrPolicy |
| } |
| - version := map[string]string{"claude": "2.1.312", "codex": "0.165.0"}[e.Provider] |
| + version := map[string]string{"claude": ClaudeVersion, "codex": CodexVersion}[e.Provider] |
| if version == "" || version != e.ProviderVersion { |
| return ErrPolicy |
| } |
diff --git a/internal/runner/provider/direct_live_config.go b/internal/runner/provider/direct_live_config.go| index 0c86fcb4..a652dd0d 100644 |
| --- a/internal/runner/provider/direct_live_config.go |
| +++ b/internal/runner/provider/direct_live_config.go |
| @@ -89,7 +89,7 @@ func (c DirectLiveConfig) Validate(enabled string) error { |
| rules := DefaultHomeRules() |
| for _, entry := range c.Bindings { |
| b := entry.Binding |
| - version := map[string]string{"claude": "2.1.312", "codex": "0.165.0"}[b.Provider] |
| + version := map[string]string{"claude": ClaudeVersion, "codex": CodexVersion}[b.Provider] |
| if version == "" || seen[b.Provider] || b.ID == "" || b.AccountID == "" || b.Expected.AccountID != b.AccountID || b.Expected.HomeID == "" || b.Expected.ProviderVersion != version || entry.Model == "" || entry.AuthHost != "" || (b.Provider == "claude" && !entry.ClaudeTOFUConfirmed) { |
| return ErrIdentity |
| } |
| @@ -120,7 +120,7 @@ func (c DirectLiveConfig) Validate(enabled string) error { |
| changes["claude"] = *c.AccountChange |
| } |
| for family, b := range changes { |
| - version := map[string]string{"claude": "2.1.312", "codex": "0.165.0"}[family] |
| + version := map[string]string{"claude": ClaudeVersion, "codex": CodexVersion}[family] |
| if version == "" || b.Provider != family || b.ID == "" || b.AccountID == "" || b.Expected.AccountID != b.AccountID || b.Expected.HomeID == "" || b.Expected.ProviderVersion != version { |
| return ErrIdentity |
| } |
diff --git a/internal/runner/provider/login_terminal.go b/internal/runner/provider/login_terminal.go| index e4a10c5c..72a562cb 100644 |
| --- a/internal/runner/provider/login_terminal.go |
| +++ b/internal/runner/provider/login_terminal.go |
| @@ -37,7 +37,7 @@ func NewLoginDriver(options ...LoginOptions) LoginDriver { |
| } |
| func LoginVersion(name string) string { |
| - return map[string]string{"claude": "2.1.312", "codex": "0.165.0"}[name] |
| + return map[string]string{"claude": ClaudeVersion, "codex": CodexVersion}[name] |
| } |
| func (d *terminalLoginDriver) binary(name string) string { |
| if name == "claude" { |
diff --git a/internal/runner/provider/runtime_claude.go b/internal/runner/provider/runtime_claude.go| new file mode 100644 |
| index 00000000..921deb63 |
| --- /dev/null |
| +++ b/internal/runner/provider/runtime_claude.go |
| @@ -0,0 +1,72 @@ |
| +package provider |
| + |
| +import ( |
| + "os" |
| + "regexp" |
| + "strings" |
| +) |
| + |
| +var claudeRuntimeLog = regexp.MustCompile(`^\.cache/claude-cli-nodejs/-workspace/mcp-logs-equipo/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{3}Z\.jsonl$`) |
| +var claudeNPMLog = regexp.MustCompile(`^\.npm/_logs/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}_[0-9]{2}_[0-9]{2}_[0-9]{3}Z-debug-0\.log$`) |
| + |
| +// 2.1.312 uses Date.now() and Math.random().toString(36).substring(2,8). |
| +// Its session suffix helper is disabled in this binary. |
| +var claudeShellSnapshot = regexp.MustCompile(`^shell-snapshots/snapshot-(bash|zsh|sh)-[0-9]{13}-[a-z0-9]{0,6}\.sh$`) |
| +var claudeSessionDir = regexp.MustCompile(`^session-env/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`) |
| +var claudeSessionFile = regexp.MustCompile(`^session-env/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/(setup|sessionstart|cwdchanged|filechanged)-hook-[0-9]+\.sh$`) |
| + |
| +// Only pinned startup paths are runtime state. Empty support directories |
| +// do not authorize SSH, config, mod or seed files. |
| +func (l *AccountLease) claudeRuntimeEntry(rel string, info os.FileInfo) (bool, error) { |
| + top := strings.SplitN(rel, "/", 2)[0] |
| + category := "" |
| + switch top { |
| + case ".cache": |
| + category = "cache" |
| + case ".config", ".claude": |
| + category = "config" |
| + case ".npm": |
| + category = "npm" |
| + case "dev-mods": |
| + category = "dev_mods" |
| + case "seed-admin": |
| + category = "seed_admin" |
| + case "policy-limits.json", "policy-limits.json.signature.json", "policy-limits.json.signature-iat.json": |
| + category = "policy_limits" |
| + case "shell-snapshots": |
| + category = "shell_snapshots" |
| + case "session-env": |
| + category = "session_env" |
| + default: |
| + return false, nil |
| + } |
| + if l.source.Expected.ProviderVersion != ClaudeVersion { |
| + return true, accountContainment("runtime_claude_" + category) |
| + } |
| + directory := false |
| + switch rel { |
| + case ".cache", ".cache/claude-cli-nodejs", ".cache/claude-cli-nodejs/-workspace", ".cache/claude-cli-nodejs/-workspace/mcp-logs-equipo", ".config", ".config/anthropic", ".claude", ".claude/ssh", ".npm", ".npm/_logs", "dev-mods", "seed-admin", "shell-snapshots", "session-env": |
| + directory = true |
| + case "policy-limits.json", "policy-limits.json.signature.json", "policy-limits.json.signature-iat.json": |
| + default: |
| + // These scripts are safe only while agent tools cannot access the staged |
| + // home: claude/launcher.go:139-149 builds native and Bash sandbox denies. |
| + directory = claudeSessionDir.MatchString(rel) |
| + if !directory && !claudeShellSnapshot.MatchString(rel) && !claudeSessionFile.MatchString(rel) && rel != ".npm/_update-notifier-last-checked" && !claudeRuntimeLog.MatchString(rel) && !claudeNPMLog.MatchString(rel) { |
| + return true, accountContainment("runtime_claude_" + category) |
| + } |
| + } |
| + if (directory && !info.IsDir()) || (!directory && !info.Mode().IsRegular()) { |
| + return true, accountContainment("runtime_claude_kind") |
| + } |
| + return true, nil |
| +} |
| + |
| +func runtimePolicyEntry(name string) bool { |
| + name = strings.ToLower(name) |
| + switch name { |
| + case "config.toml", "agents.md", "claude.md", "hooks", "plugins", "skills", "agents", "commands", ".mcp.json", "mcp.json", "mcp-config.json", "shell-snapshots", "session-env": |
| + return true |
| + } |
| + return strings.HasPrefix(name, "settings") && strings.HasSuffix(name, ".json") |
| +} |
diff --git a/internal/runner/provider/runtime_claude_test.go b/internal/runner/provider/runtime_claude_test.go| new file mode 100644 |
| index 00000000..f1408b7b |
| --- /dev/null |
| +++ b/internal/runner/provider/runtime_claude_test.go |
| @@ -0,0 +1,147 @@ |
| +package provider |
| + |
| +import ( |
| + "encoding/json" |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "strconv" |
| + "strings" |
| + "testing" |
| + |
| + "golang.org/x/sys/unix" |
| +) |
| + |
| +func claudeRuntimeFixture(t *testing.T) *AccountLease { |
| + t.Helper() |
| + b, r := accountFixture(t) |
| + b.Provider = "claude" |
| + b.Expected.ProviderVersion = "2.1.312" |
| + writeMetadata(t, b.Home, b.Expected) |
| + writeFake(t, filepath.Join(b.Home, ".credentials.json"), `{}`) |
| + l := openFixture(t, b, r) |
| + return l |
| +} |
| +func TestAccountClaudeRecordedRuntime(t *testing.T) { |
| + for _, stage := range []string{"before", "disabled"} { |
| + t.Run(stage, func(t *testing.T) { |
| + l := claudeRuntimeFixture(t) |
| + raw, err := os.ReadFile("testdata/claude-empty-home-" + stage + "-2.1.312.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var tree struct { |
| + Entries []struct { |
| + Path string |
| + Directory bool |
| + Mode string |
| + } |
| + } |
| + if err = json.Unmarshal(raw, &tree); err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, e := range tree.Entries { |
| + p := filepath.Join(l.runtime, e.Path) |
| + if e.Directory { |
| + err = os.MkdirAll(p, 0700) |
| + } else { |
| + err = os.WriteFile(p, []byte("fixture"), 0600) |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + mode, e2 := strconv.ParseUint(e.Mode, 8, 32) |
| + if e2 != nil { |
| + t.Fatal(e2) |
| + } |
| + if err = os.Chmod(p, os.FileMode(mode)); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + err = l.validateRuntimeEntries() |
| + if stage == "disabled" { |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } else if err == nil || !strings.Contains(err.Error(), "runtime_claude_policy_entry") { |
| + t.Fatalf("plugin tree not refused: %v", err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAccountClaudeRuntimeGuards(t *testing.T) { |
| + for _, tc := range []struct{ path, kind, reason string }{ |
| + {".cache/evil", "file", "cache"}, {".config/evil", "file", "config"}, {".claude/ssh/key", "file", "config"}, |
| + {".npm/_logs/evil", "file", "npm"}, {"dev-mods/payload", "file", "dev_mods"}, {"seed-admin/config", "file", "seed_admin"}, |
| + {"plugins", "dir", "policy_entry"}, {"skills", "dir", "policy_entry"}, {"agents", "dir", "policy_entry"}, {"commands", "dir", "policy_entry"}, |
| + {"hooks", "dir", "policy_entry"}, {"settings.extra.json", "file", "policy_entry"}, {"CLAUDE.md", "file", "policy_entry"}, |
| + {".mcp.json", "file", "policy_entry"}, {"mcp.json", "file", "policy_entry"}, {".cache/settings.local.json", "file", "policy_entry"}, |
| + {".cache/agents", "dir", "policy_entry"}, {"shell-snapshots/evil", "dir", "shell_snapshots"}, {"session-env/evil", "dir", "session_env"}, |
| + {"secret-sentinel", "file", "unexpected_entry"}, {".cache", "file", "kind"}, |
| + {".cache", "setgid", "metadata"}, {".cache", "setuid", "metadata"}, |
| + {".cache/claude-cli-nodejs", "link", "special_entry"}, {".cache/pipe", "fifo", "special_entry"}, |
| + {".npm/_update-notifier-last-checked", "hardlink", "metadata"}, |
| + {".cache", "version", "cache"}, {".cache", "provider", "unexpected_entry"}, |
| + } { |
| + t.Run(tc.path+"/"+tc.kind, func(t *testing.T) { |
| + l := claudeRuntimeFixture(t) |
| + path := filepath.Join(l.runtime, tc.path) |
| + must := func(err error) { |
| + t.Helper() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + must(os.MkdirAll(filepath.Dir(path), 0700)) |
| + switch tc.kind { |
| + case "dir", "version", "provider", "setuid", "setgid": |
| + must(os.MkdirAll(path, 0700)) |
| + case "link": |
| + must(os.Symlink("/opt/claude", path)) |
| + case "fifo": |
| + must(unix.Mkfifo(path, 0600)) |
| + case "hardlink": |
| + must(os.Link(filepath.Join(l.runtime, ".credentials.json"), path)) |
| + default: |
| + writeFake(t, path, "fixture") |
| + } |
| + if tc.kind == "setuid" { |
| + must(os.Chmod(path, 0700|os.ModeSetuid)) |
| + } |
| + if tc.kind == "setgid" { |
| + must(os.Chmod(path, 0700|os.ModeSetgid)) |
| + } |
| + if tc.kind == "version" { |
| + l.source.Expected.ProviderVersion = "other" |
| + } |
| + if tc.kind == "provider" { |
| + l.source.Provider = "other" |
| + must(os.Remove(filepath.Join(l.runtime, ".credentials.json"))) |
| + } |
| + err := l.validateRuntimeEntries() |
| + want := "runtime_claude_" + tc.reason |
| + if tc.kind == "provider" { |
| + want = "runtime_unexpected_entry" |
| + } |
| + if !errors.Is(err, ErrContainment) || !strings.Contains(err.Error(), want) || strings.Contains(err.Error(), "secret-sentinel") { |
| + t.Fatalf("guard %s: %v", want, err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAccountClaudeRuntimeNotStaged(t *testing.T) { |
| + l := claudeRuntimeFixture(t) |
| + for _, name := range []string{".cache", ".config", ".claude", ".npm", "dev-mods", "seed-admin"} { |
| + if err := os.Mkdir(filepath.Join(l.source.Home, name), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + preflightFixture(t, l) |
| + for _, name := range []string{".cache", ".config", ".claude", ".npm", "dev-mods", "seed-admin"} { |
| + if _, err := os.Lstat(filepath.Join(l.runtime, name)); !os.IsNotExist(err) { |
| + t.Fatalf("source state staged: %s: %v", name, err) |
| + } |
| + } |
| +} |
diff --git a/internal/runner/provider/runtime_home.go b/internal/runner/provider/runtime_home.go| index be50b86a..59212160 100644 |
| --- a/internal/runner/provider/runtime_home.go |
| +++ b/internal/runner/provider/runtime_home.go |
| @@ -4,29 +4,146 @@ import ( |
| "io/fs" |
| "os" |
| "path/filepath" |
| + "regexp" |
| "strings" |
| + "syscall" |
| ) |
| func (l *AccountLease) validateRuntimeEntries() error { |
| + reason := func(category string) error { |
| + if l.source.Provider == "claude" { |
| + return accountContainment("runtime_claude_" + category) |
| + } |
| + return accountContainment("runtime_" + category) |
| + } |
| allowed := map[string]bool{IdentityFile: true, credentialName(l.source.Provider): true, ".claude.json": true, "history.jsonl": true, "sessions": true, "archived_sessions": true, "session_index.jsonl": true, "shell_snapshots": true, "log": true, "logs": true, "debug": true, "projects": true, "todos": true, "tasks": true, "plans": true, "backups": true, "file-history": true, "telemetry": true, "statsig": true, "paste-cache": true, "downloads": true, "stats-cache.json": true, "models_cache.json": true, "version.json": true, ".last_migration": true, ".codex-global-state.json": true, "equipo-read-sentinel": true} |
| return filepath.WalkDir(l.runtime, func(path string, d fs.DirEntry, err error) error { |
| if err != nil { |
| - return ErrContainment |
| + return reason("walk") |
| } |
| if path == l.runtime { |
| return nil |
| } |
| name := d.Name() |
| - if d.Type()&os.ModeSymlink != 0 || d.Type()&(os.ModeSocket|os.ModeDevice|os.ModeNamedPipe) != 0 { |
| - return ErrContainment |
| + rel, err := filepath.Rel(l.runtime, path) |
| + if err != nil { |
| + return reason("walk") |
| + } |
| + entryReason := reason |
| + if l.source.Provider == "codex" { |
| + entryReason = func(category string) error { |
| + if known := codexRuntimeCategory(rel); known != "" { |
| + return accountContainment("runtime_codex_" + known) |
| + } |
| + return reason(category) |
| + } |
| + if strings.HasPrefix(rel, ".tmp/plugins") { |
| + return entryReason("policy_entry") |
| + } |
| + if codexArg0Link.MatchString(rel) && d.Type()&os.ModeSymlink == 0 { |
| + return entryReason("special_entry") |
| + } |
| + } |
| + if l.source.Provider == "claude" && name == "remote-settings.json" { |
| + return accountContainment("runtime_claude_remote_settings") |
| + } |
| + if d.Type()&os.ModeSymlink != 0 { |
| + info, statErr := d.Info() |
| + if statErr == nil && l.codexRuntimeLink(path, rel, info) { |
| + return nil |
| + } |
| + return entryReason("special_entry") |
| } |
| - switch strings.ToLower(name) { |
| - case "config.toml", "agents.md", "claude.md", "settings.json", "settings.local.json", "hooks", "plugins", "skills", ".mcp.json": |
| - return ErrContainment |
| + if d.Type()&(os.ModeSocket|os.ModeDevice|os.ModeNamedPipe) != 0 { |
| + return entryReason("special_entry") |
| + } |
| + claudeShell := l.source.Provider == "claude" && l.source.Expected.ProviderVersion == ClaudeVersion && (rel == "shell-snapshots" || rel == "session-env") |
| + if runtimePolicyEntry(name) && !claudeShell { |
| + return entryReason("policy_entry") |
| + } |
| + top := strings.SplitN(rel, string(filepath.Separator), 2)[0] |
| + if l.source.Provider == "claude" { |
| + info, e := d.Info() |
| + if e != nil || !runtimeEntryMetadata(info) { |
| + return reason("metadata") |
| + } |
| + if handled, e := l.claudeRuntimeEntry(rel, info); handled { |
| + return e |
| + } |
| + } |
| + if l.source.Provider == "codex" && l.source.Expected.ProviderVersion == CodexVersion { |
| + scratch := top == ".tmp" || top == "tmp" |
| + if scratch || codexRuntimeState(top) { |
| + info, err := d.Info() |
| + if err != nil || !runtimeEntryMetadata(info) { |
| + return entryReason("metadata") |
| + } |
| + if (scratch && rel == top && !info.IsDir()) || (!scratch && !info.Mode().IsRegular()) { |
| + return entryReason("kind") |
| + } |
| + return nil |
| + } |
| } |
| if filepath.Dir(path) == l.runtime && !allowed[name] && !strings.HasPrefix(name, "state_") && !strings.HasPrefix(name, "logs_") { |
| - return ErrContainment |
| + return entryReason("unexpected_entry") |
| } |
| return nil |
| }) |
| } |
| + |
| +// These are startup state in the staged home, never source-home inputs. |
| +func codexRuntimeState(name string) bool { |
| + switch name { |
| + case "installation_id", "goals_1.sqlite", "goals_1.sqlite-shm", "goals_1.sqlite-wal", |
| + "memories_1.sqlite", "memories_1.sqlite-shm", "memories_1.sqlite-wal", |
| + "queue_1.sqlite", "queue_1.sqlite-shm", "queue_1.sqlite-wal": |
| + return true |
| + } |
| + return false |
| +} |
| + |
| +func runtimeEntryMetadata(info os.FileInfo) bool { |
| + stat, ok := info.Sys().(*syscall.Stat_t) |
| + return ok && stat.Uid == uint32(os.Getuid()) && info.Mode()&(os.ModeSetuid|os.ModeSetgid) == 0 && |
| + (info.IsDir() || (info.Mode().IsRegular() && stat.Nlink == 1)) |
| +} |
| + |
| +// The CLI points these launch shims at its pinned mount inside the namespace. |
| +// Readlink compares the text only; the host must never resolve /opt/codex. |
| +var codexArg0Link = regexp.MustCompile(`^tmp/arg0-linux/codex-arg0[A-Za-z0-9]{6}/(apply_patch|applypatch|codex-linux-sandbox)$`) |
| + |
| +func (l *AccountLease) codexRuntimeLink(path, rel string, info os.FileInfo) bool { |
| + if l.source.Provider != "codex" || l.source.Expected.ProviderVersion != CodexVersion || !codexArg0Link.MatchString(rel) { |
| + return false |
| + } |
| + stat, ok := info.Sys().(*syscall.Stat_t) |
| + if !ok || stat.Uid != uint32(os.Getuid()) || info.Mode()&os.ModeSymlink == 0 || info.Mode()&(os.ModeSetuid|os.ModeSetgid) != 0 { |
| + return false |
| + } |
| + target, err := os.Readlink(path) |
| + return err == nil && target == "/opt/codex" |
| +} |
| + |
| +func codexRuntimeCategory(rel string) string { |
| + if strings.HasPrefix(rel, ".tmp/plugins") { |
| + return "plugins" |
| + } |
| + if strings.HasPrefix(rel, "tmp/arg0-linux") { |
| + return "arg0" |
| + } |
| + top := strings.SplitN(rel, "/", 2)[0] |
| + switch top { |
| + case ".tmp": |
| + return "dot_tmp" |
| + case "tmp": |
| + return "tmp" |
| + case "skills", "plugins", "installation_id": |
| + return top |
| + } |
| + for _, state := range []string{"goals", "memories", "queue"} { |
| + if strings.HasPrefix(top, state+"_") { |
| + return state |
| + } |
| + } |
| + return "" |
| +} |
diff --git a/internal/runner/provider/runtime_home_test.go b/internal/runner/provider/runtime_home_test.go| new file mode 100644 |
| index 00000000..cb9b0c11 |
| --- /dev/null |
| +++ b/internal/runner/provider/runtime_home_test.go |
| @@ -0,0 +1,119 @@ |
| +package provider |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "syscall" |
| + "testing" |
| + |
| + "golang.org/x/sys/unix" |
| +) |
| + |
| +func TestAccountCodexRuntimeState(t *testing.T) { |
| + for _, name := range []string{".tmp", "tmp", "installation_id", "goals_1.sqlite", "goals_1.sqlite-shm", "goals_1.sqlite-wal", "memories_1.sqlite", "memories_1.sqlite-shm", "memories_1.sqlite-wal", "queue_1.sqlite", "queue_1.sqlite-shm", "queue_1.sqlite-wal"} { |
| + t.Run(name, func(t *testing.T) { |
| + b, r := accountFixture(t) |
| + l := openFixture(t, b, r) |
| + preflightFixture(t, l) |
| + path := filepath.Join(l.runtime, name) |
| + if name == ".tmp" || name == "tmp" { |
| + if err := os.MkdirAll(filepath.Join(path, "nested"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + writeFake(t, filepath.Join(path, "nested", "lock"), "fixture") |
| + } else { |
| + writeFake(t, path, "fixture") |
| + } |
| + if err := l.ValidatePolicy(context.Background()); err != nil { |
| + t.Fatal(err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAccountCodexRuntimeStateGuards(t *testing.T) { |
| + for _, mode := range []string{"scratch-file", "state-directory", "nested-setuid", "setgid", "symlink", "fifo", "hardlink", "skills", "nested-policy", "other-state", "other-version", "other-provider", "source-not-staged"} { |
| + t.Run(mode, func(t *testing.T) { |
| + b, r := accountFixture(t) |
| + if mode == "other-version" { |
| + b.Expected.ProviderVersion = "other" |
| + writeMetadata(t, b.Home, b.Expected) |
| + } |
| + l := openFixture(t, b, r) |
| + preflightFixture(t, l) |
| + path := filepath.Join(l.runtime, "tmp") |
| + if mode == "source-not-staged" { |
| + if err := os.Mkdir(filepath.Join(b.Home, "tmp"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + writeFake(t, filepath.Join(b.Home, "installation_id"), "source sentinel") |
| + preflightFixture(t, l) |
| + for _, name := range []string{"tmp", "installation_id"} { |
| + if _, err := os.Lstat(filepath.Join(l.runtime, name)); !os.IsNotExist(err) { |
| + t.Fatalf("source artifact staged: %s: %v", name, err) |
| + } |
| + } |
| + return |
| + } |
| + if mode == "scratch-file" { |
| + writeFake(t, path, "fixture") |
| + } else { |
| + if err := os.Mkdir(path, 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + must := func(err error) { |
| + t.Helper() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + switch mode { |
| + case "state-directory": |
| + must(os.Mkdir(filepath.Join(l.runtime, "installation_id"), 0700)) |
| + case "nested-setuid": |
| + nested := filepath.Join(path, "nested") |
| + must(os.Mkdir(nested, 0700)) |
| + must(os.Chmod(nested, 0700|os.ModeSetuid)) |
| + case "setgid": |
| + must(os.Chmod(path, 0700|os.ModeSetgid)) |
| + case "symlink": |
| + must(os.Symlink(b.Home, filepath.Join(path, "escape"))) |
| + case "fifo": |
| + must(unix.Mkfifo(filepath.Join(path, "pipe"), 0600)) |
| + case "hardlink": |
| + must(os.Link(filepath.Join(b.Home, "auth.json"), filepath.Join(path, "linked"))) |
| + case "skills": |
| + must(os.MkdirAll(filepath.Join(l.runtime, "skills", ".system"), 0700)) |
| + case "nested-policy": |
| + writeFake(t, filepath.Join(path, "config.toml"), "fixture") |
| + case "other-state": |
| + writeFake(t, filepath.Join(l.runtime, "memories_2.sqlite"), "fixture") |
| + case "other-provider": |
| + l.source.Provider = "claude" |
| + must(os.Remove(filepath.Join(l.runtime, "auth.json"))) |
| + } |
| + if err := l.validateRuntimeEntries(); !errors.Is(err, ErrContainment) { |
| + t.Fatalf("unsafe runtime accepted: %v", err) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAccountCodexRuntimeOwner(t *testing.T) { |
| + path := filepath.Join(t.TempDir(), "state") |
| + writeFake(t, path, "fixture") |
| + info, err := os.Lstat(path) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if !runtimeEntryMetadata(info) { |
| + t.Fatal("runner-owned regular file rejected") |
| + } |
| + info.Sys().(*syscall.Stat_t).Uid++ |
| + if runtimeEntryMetadata(info) { |
| + t.Fatal("foreign owner accepted") |
| + } |
| +} |
diff --git a/internal/runner/provider/runtime_links_test.go b/internal/runner/provider/runtime_links_test.go| new file mode 100644 |
| index 00000000..06cfc98c |
| --- /dev/null |
| +++ b/internal/runner/provider/runtime_links_test.go |
| @@ -0,0 +1,136 @@ |
| +package provider |
| + |
| +import ( |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "syscall" |
| + "testing" |
| +) |
| + |
| +func TestAccountCodexRuntimeLinks(t *testing.T) { |
| + const dir = "tmp/arg0-linux/codex-arg0aB12z9/" |
| + for _, tc := range []struct { |
| + name, path, target string |
| + accept bool |
| + }{ |
| + {"apply_patch", dir + "apply_patch", "/opt/codex", true}, |
| + {"applypatch", dir + "applypatch", "/opt/codex", true}, |
| + {"sandbox", dir + "codex-linux-sandbox", "/opt/codex", true}, |
| + {"regular", dir + "apply_patch", "", false}, |
| + {"directory", dir + "applypatch", "", false}, |
| + {"other-name", dir + "codex", "/opt/codex", false}, |
| + {"short", "tmp/arg0-linux/codex-arg0abcde/apply_patch", "/opt/codex", false}, |
| + {"long", "tmp/arg0-linux/codex-arg0abcdefg/apply_patch", "/opt/codex", false}, |
| + {"suffix-punctuation", "tmp/arg0-linux/codex-arg0abc_de/apply_patch", "/opt/codex", false}, |
| + {"other-parent", "tmp/arg0/codex-arg0abc123/apply_patch", "/opt/codex", false}, |
| + {"other-top", ".tmp/arg0-linux/codex-arg0abc123/apply_patch", "/opt/codex", false}, |
| + {"nested", dir + "nested/apply_patch", "/opt/codex", false}, |
| + {"relative", dir + "apply_patch", "../../../opt/codex", false}, |
| + {"normalized-target", dir + "apply_patch", "/opt/./codex", false}, |
| + {"other-target", dir + "apply_patch", "/opt/evil", false}, |
| + {"other-version", dir + "apply_patch", "/opt/codex", false}, |
| + {"other-provider", dir + "apply_patch", "/opt/codex", false}, |
| + {"source-not-staged", dir + "apply_patch", "/opt/codex", true}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + b, r := accountFixture(t) |
| + l := openFixture(t, b, r) |
| + root := l.runtime |
| + if tc.name == "source-not-staged" { |
| + root = b.Home |
| + } |
| + path := filepath.Join(root, tc.path) |
| + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + var createErr error |
| + if tc.name == "regular" { |
| + createErr = os.WriteFile(path, []byte("fixture"), 0600) |
| + } else if tc.name == "directory" { |
| + createErr = os.Mkdir(path, 0700) |
| + } else { |
| + createErr = os.Symlink(tc.target, path) |
| + } |
| + if err := createErr; err != nil { |
| + t.Fatal(err) |
| + } |
| + if tc.name == "other-version" { |
| + l.source.Expected.ProviderVersion = "other" |
| + } |
| + if tc.name == "other-provider" { |
| + l.source.Provider = "claude" |
| + } |
| + err := l.validateRuntimeEntries() |
| + if tc.accept { |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } else if !errors.Is(err, ErrContainment) || (tc.name != "other-version" && tc.name != "other-provider" && !strings.Contains(err.Error(), "runtime_special_entry") && !strings.Contains(err.Error(), "runtime_codex_")) { |
| + t.Fatalf("unsafe link accepted or wrong reason: %v", err) |
| + } |
| + if tc.name == "source-not-staged" { |
| + preflightFixture(t, l) |
| + if _, err = os.Lstat(filepath.Join(l.runtime, tc.path)); !os.IsNotExist(err) { |
| + t.Fatal("source link staged") |
| + } |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAccountCodexLinkOwner(t *testing.T) { |
| + b, r := accountFixture(t) |
| + l := openFixture(t, b, r) |
| + rel := "tmp/arg0-linux/codex-arg0aB12z9/apply_patch" |
| + path := filepath.Join(l.runtime, rel) |
| + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Symlink("/opt/codex", path); err != nil { |
| + t.Fatal(err) |
| + } |
| + info, err := os.Lstat(path) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if !l.codexRuntimeLink(path, rel, info) { |
| + t.Fatal("runner link rejected") |
| + } |
| + info.Sys().(*syscall.Stat_t).Uid++ |
| + if l.codexRuntimeLink(path, rel, info) { |
| + t.Fatal("foreign link accepted") |
| + } |
| +} |
| + |
| +func TestAccountCodexLinkScope(t *testing.T) { |
| + b, r := accountFixture(t) |
| + l := openFixture(t, b, r) |
| + rel := "tmp/arg0-linux/codex-arg0aB12z9/apply_patch" |
| + path := filepath.Join(l.runtime, rel) |
| + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Symlink("/opt/codex", path); err != nil { |
| + t.Fatal(err) |
| + } |
| + info, err := os.Lstat(path) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, scope := range []string{"provider", "version"} { |
| + t.Run(scope, func(t *testing.T) { |
| + l.source.Provider = "codex" |
| + l.source.Expected.ProviderVersion = "0.165.0" |
| + if scope == "provider" { |
| + l.source.Provider = "claude" |
| + } else { |
| + l.source.Expected.ProviderVersion = "other" |
| + } |
| + if l.codexRuntimeLink(path, rel, info) { |
| + t.Fatal("link accepted outside pinned Codex runtime") |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/provider/runtime_startup_test.go b/internal/runner/provider/runtime_startup_test.go| new file mode 100644 |
| index 00000000..f6133ab2 |
| --- /dev/null |
| +++ b/internal/runner/provider/runtime_startup_test.go |
| @@ -0,0 +1,148 @@ |
| +package provider |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "golang.org/x/sys/unix" |
| +) |
| + |
| +const sessionEnvFixture = "session-env/12345678-1234-4123-8123-123456789abc/" |
| + |
| +func TestAccountClaudeAuthenticatedState(t *testing.T) { |
| + for _, name := range []string{"policy-limits.json", "policy-limits.json.signature.json", "policy-limits.json.signature-iat.json", "shell-snapshots/snapshot-bash-1793880000000-abc123.sh", "shell-snapshots/snapshot-zsh-1793880000000-0.sh", "shell-snapshots/snapshot-sh-1793880000000-.sh", sessionEnvFixture + "setup-hook-0.sh", sessionEnvFixture + "sessionstart-hook-123.sh", sessionEnvFixture + "cwdchanged-hook-1.sh", sessionEnvFixture + "filechanged-hook-9.sh"} { |
| + t.Run(name, func(t *testing.T) { |
| + for _, kind := range []string{"file", "directory", "link", "hardlink", "fifo", "setuid", "setgid", "version", "provider", "source"} { |
| + t.Run(kind, func(t *testing.T) { |
| + fullTurn := kind == "file" || kind == "source" |
| + l := &AccountLease{source: Binding{Provider: "claude", Expected: Identity{ProviderVersion: ClaudeVersion}}, runtime: t.TempDir()} |
| + ctx := context.Background() |
| + if fullTurn { |
| + l = claudeRuntimeFixture(t) |
| + preflightFixture(t, l) |
| + if err := l.BeginTurn(ctx); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + root := l.runtime |
| + if kind == "source" { |
| + root = l.source.Home |
| + } |
| + path := filepath.Join(root, name) |
| + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + var err error |
| + switch kind { |
| + case "directory": |
| + err = os.Mkdir(path, 0700) |
| + case "link": |
| + err = os.Symlink("/opt/claude", path) |
| + case "hardlink": |
| + target := filepath.Join(t.TempDir(), "state") |
| + writeFake(t, target, "fixture") |
| + err = os.Link(target, path) |
| + case "fifo": |
| + err = unix.Mkfifo(path, 0600) |
| + default: |
| + err = os.WriteFile(path, []byte("fixture"), 0600) |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if kind == "setuid" { |
| + err = os.Chmod(path, 0600|os.ModeSetuid) |
| + } |
| + if kind == "setgid" { |
| + err = os.Chmod(path, 0600|os.ModeSetgid) |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if fullTurn { |
| + if err = l.EndTurn(ctx); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + if kind == "source" { |
| + preflightFixture(t, l) |
| + if _, err = os.Lstat(filepath.Join(l.runtime, name)); !os.IsNotExist(err) { |
| + t.Fatal("source runtime state staged") |
| + } |
| + } |
| + if kind == "version" { |
| + l.source.Expected.ProviderVersion = "other" |
| + } |
| + if kind == "provider" { |
| + l.source.Provider = "other" |
| + } |
| + if !fullTurn { |
| + err = l.validateRuntimeEntries() |
| + } else { |
| + err = l.BeginTurn(ctx) |
| + } |
| + if kind == "file" || kind == "source" { |
| + if err != nil { |
| + t.Fatalf("second turn: %v", err) |
| + } |
| + } else if !errors.Is(err, ErrContainment) { |
| + t.Fatalf("unsafe %s accepted: %v", kind, err) |
| + } |
| + }) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestAccountStartupRefusals(t *testing.T) { |
| + for _, tc := range []struct{ family, path, category string }{ |
| + {"claude", "remote-settings.json", "runtime_claude_remote_settings"}, |
| + {"claude", "policy-limits.json.extra", "runtime_claude_unexpected_entry"}, |
| + {"claude", "shell-snapshots/evil.sh", "runtime_claude_shell_snapshots"}, |
| + {"claude", "shell-snapshots/snapshot-fish-1793880000000-abc123.sh", "runtime_claude_shell_snapshots"}, |
| + {"claude", "shell-snapshots/snapshot-bash-1793880000000-abcdefg.sh", "runtime_claude_shell_snapshots"}, |
| + {"claude", "shell-snapshots/snapshot-bash-1793880000000-ABC123.sh", "runtime_claude_shell_snapshots"}, |
| + {"claude", "shell-snapshots/snapshot-bash-1793880000000-abc123-session.sh", "runtime_claude_shell_snapshots"}, |
| + {"claude", "shell-snapshots/nested/evil.sh", "runtime_claude_shell_snapshots"}, |
| + {"claude", "session-env/not-a-uuid/setup-hook-1.sh", "runtime_claude_session_env"}, |
| + {"claude", sessionEnvFixture + "evil.sh", "runtime_claude_session_env"}, |
| + {"claude", sessionEnvFixture + "setup-hook-x.sh", "runtime_claude_session_env"}, |
| + {"claude", sessionEnvFixture + "stop-hook-1.sh", "runtime_claude_session_env"}, |
| + {"claude", sessionEnvFixture + "nested/setup-hook-1.sh", "runtime_claude_session_env"}, |
| + {"claude", "logs/shell-snapshots/evil.sh", "runtime_claude_policy_entry"}, |
| + {"codex", ".tmp/plugins.sha", "runtime_codex_plugins"}, |
| + {"codex", ".tmp/plugins/cache", "runtime_codex_plugins"}, |
| + {"codex", ".tmp/plugins-other", "runtime_codex_plugins"}, |
| + {"codex", "tmp/config.toml", "runtime_codex_tmp"}, |
| + {"codex", ".tmp/config.toml", "runtime_codex_dot_tmp"}, |
| + {"codex", "skills/.system/evil", "runtime_codex_skills"}, |
| + {"codex", "installation_id/evil", "runtime_codex_installation_id"}, |
| + {"codex", "goals_1.sqlite/evil", "runtime_codex_goals"}, |
| + {"codex", "memories_1.sqlite/evil", "runtime_codex_memories"}, |
| + {"codex", "queue_1.sqlite/evil", "runtime_codex_queue"}, |
| + {"codex", "tmp/arg0-linux/codex-arg0abc123/apply_patch", "runtime_codex_arg0"}, |
| + } { |
| + t.Run(tc.family+"/"+tc.path, func(t *testing.T) { |
| + var l *AccountLease |
| + if tc.family == "claude" { |
| + l = claudeRuntimeFixture(t) |
| + } else { |
| + b, r := accountFixture(t) |
| + l = openFixture(t, b, r) |
| + } |
| + path := filepath.Join(l.runtime, tc.path) |
| + if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + writeFake(t, path, "secret-sentinel") |
| + err := l.validateRuntimeEntries() |
| + if !errors.Is(err, ErrContainment) || !strings.Contains(err.Error(), tc.category) || strings.Contains(err.Error(), "secret-sentinel") { |
| + t.Fatalf("want %s: %v", tc.category, err) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json b/internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json| new file mode 100644 |
| index 00000000..97978f82 |
| --- /dev/null |
| +++ b/internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json |
| @@ -0,0 +1,115 @@ |
| +{ |
| + "version": "2.1.312", |
| + "entries": [ |
| + { |
| + "path": ".cache", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs/-workspace", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs/-workspace/mcp-logs-equipo", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs/-workspace/mcp-logs-equipo/2026-11-05T00-07-05-744Z.jsonl", |
| + "directory": false, |
| + "mode": "0664" |
| + }, |
| + { |
| + "path": ".claude", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".claude/ssh", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".claude.json", |
| + "directory": false, |
| + "mode": "0600" |
| + }, |
| + { |
| + "path": ".config", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".config/anthropic", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".npm", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".npm/_logs", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".npm/_logs/2026-11-05T00_07_06_140Z-debug-0.log", |
| + "directory": false, |
| + "mode": "0664" |
| + }, |
| + { |
| + "path": ".npm/_update-notifier-last-checked", |
| + "directory": false, |
| + "mode": "0664" |
| + }, |
| + { |
| + "path": "backups", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": "backups/.claude.json.backup.1793837225577", |
| + "directory": false, |
| + "mode": "0600" |
| + }, |
| + { |
| + "path": "dev-mods", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": "plugins", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": "plugins/store", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": "plugins/store/cc-plugin-agents-md_builtin-b049b47b3618.json", |
| + "directory": false, |
| + "mode": "0600" |
| + }, |
| + { |
| + "path": "seed-admin", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": "sessions", |
| + "directory": true, |
| + "mode": "0700" |
| + } |
| + ] |
| +} |
diff --git a/internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json b/internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json| new file mode 100644 |
| index 00000000..07a91b58 |
| --- /dev/null |
| +++ b/internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json |
| @@ -0,0 +1,100 @@ |
| +{ |
| + "version": "2.1.312", |
| + "entries": [ |
| + { |
| + "path": ".cache", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs/-workspace", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs/-workspace/mcp-logs-equipo", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".cache/claude-cli-nodejs/-workspace/mcp-logs-equipo/2026-11-05T00-08-17-158Z.jsonl", |
| + "directory": false, |
| + "mode": "0664" |
| + }, |
| + { |
| + "path": ".claude", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".claude/ssh", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".claude.json", |
| + "directory": false, |
| + "mode": "0600" |
| + }, |
| + { |
| + "path": ".config", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".config/anthropic", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": ".npm", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".npm/_logs", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": ".npm/_logs/2026-11-05T00_08_17_364Z-debug-0.log", |
| + "directory": false, |
| + "mode": "0664" |
| + }, |
| + { |
| + "path": ".npm/_update-notifier-last-checked", |
| + "directory": false, |
| + "mode": "0664" |
| + }, |
| + { |
| + "path": "backups", |
| + "directory": true, |
| + "mode": "0775" |
| + }, |
| + { |
| + "path": "backups/.claude.json.backup.1793837297033", |
| + "directory": false, |
| + "mode": "0600" |
| + }, |
| + { |
| + "path": "dev-mods", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": "seed-admin", |
| + "directory": true, |
| + "mode": "0700" |
| + }, |
| + { |
| + "path": "sessions", |
| + "directory": true, |
| + "mode": "0700" |
| + } |
| + ] |
| +} |
diff --git a/internal/runner/provider/testdata/codex-empty-home-0.165.0.json b/internal/runner/provider/testdata/codex-empty-home-0.165.0.json| new file mode 100644 |
| index 00000000..f500534e |
| --- /dev/null |
| +++ b/internal/runner/provider/testdata/codex-empty-home-0.165.0.json |
| @@ -0,0 +1,374 @@ |
| +{ |
| + "provider_version": "0.165.0", |
| + "authenticated": false, |
| + "entries": [ |
| + { |
| + "path": ".tmp", |
| + "directory": true |
| + }, |
| + { |
| + "path": ".tmp/plugins.sync.lock", |
| + "directory": false |
| + }, |
| + { |
| + "path": "goals_1.sqlite", |
| + "directory": false |
| + }, |
| + { |
| + "path": "goals_1.sqlite-shm", |
| + "directory": false |
| + }, |
| + { |
| + "path": "goals_1.sqlite-wal", |
| + "directory": false |
| + }, |
| + { |
| + "path": "installation_id", |
| + "directory": false |
| + }, |
| + { |
| + "path": "logs_2.sqlite", |
| + "directory": false |
| + }, |
| + { |
| + "path": "logs_2.sqlite-shm", |
| + "directory": false |
| + }, |
| + { |
| + "path": "logs_2.sqlite-wal", |
| + "directory": false |
| + }, |
| + { |
| + "path": "memories_1.sqlite", |
| + "directory": false |
| + }, |
| + { |
| + "path": "memories_1.sqlite-shm", |
| + "directory": false |
| + }, |
| + { |
| + "path": "memories_1.sqlite-wal", |
| + "directory": false |
| + }, |
| + { |
| + "path": "queue_1.sqlite", |
| + "directory": false |
| + }, |
| + { |
| + "path": "queue_1.sqlite-shm", |
| + "directory": false |
| + }, |
| + { |
| + "path": "queue_1.sqlite-wal", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/.codex-system-skills.marker", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/LICENSE.txt", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/SKILL.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/agents", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/agents/openai.yaml", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/assets", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/assets/imagegen-small.svg", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/assets/imagegen.png", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/references", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/references/cli.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/references/codex-network.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/references/image-api.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/references/prompting.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/references/sample-prompts.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/scripts", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/scripts/image_gen.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/imagegen/scripts/remove_chroma_key.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/LICENSE.txt", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/SKILL.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/agents", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/agents/openai.yaml", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/assets", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/assets/openai-small.svg", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/assets/openai.png", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/codex-self-knowledge.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/latest-model.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/mcp-diagnostics.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/model-migration.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/model-selection.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/official-docs.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/prompting-guide.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/upgrade-guide.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/references/upgrading-to-gpt-6-astra.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/scripts", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/scripts/fetch-codex-manual.mjs", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/scripts/resolve-latest-model-info", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/openai-docs/scripts/resolve-latest-model-info.cjs", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/review-agent", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/review-agent/SKILL.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/review-agent/agents", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/review-agent/agents/openai.yaml", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/SKILL.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/agents", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/agents/openai.yaml", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/assets", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/assets/skill-creator-small.svg", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/assets/skill-creator.png", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/license.txt", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/references", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/references/openai_yaml.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/scripts", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/scripts/generate_openai_yaml.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/scripts/init_skill.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-creator/scripts/quick_validate.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/LICENSE.txt", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/SKILL.md", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/agents", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/agents/openai.yaml", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/assets", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/assets/skill-installer-small.svg", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/assets/skill-installer.png", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/scripts", |
| + "directory": true |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/scripts/github_utils.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/scripts/install-skill-from-github.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "skills/.system/skill-installer/scripts/list-skills.py", |
| + "directory": false |
| + }, |
| + { |
| + "path": "state_5.sqlite", |
| + "directory": false |
| + }, |
| + { |
| + "path": "state_5.sqlite-shm", |
| + "directory": false |
| + }, |
| + { |
| + "path": "state_5.sqlite-wal", |
| + "directory": false |
| + }, |
| + { |
| + "path": "tmp", |
| + "directory": true |
| + }, |
| + { |
| + "path": "tmp/arg0-linux", |
| + "directory": true |
| + } |
| + ] |
| +} |
diff --git a/internal/runner/provider/types.go b/internal/runner/provider/types.go| index 19cbfde4..3683c139 100644 |
| --- a/internal/runner/provider/types.go |
| +++ b/internal/runner/provider/types.go |
| @@ -10,6 +10,10 @@ import ( |
| const Version = 2 |
| +// Provider pins are shared by launchers and staged-home validation. |
| +const ClaudeVersion = "2.1.312" |
| +const CodexVersion = "0.165.0" |
| + |
| type Selection struct { |
| ConnectionID, Provider, Family, Model, AccountID string |
| } |
diff --git a/internal/runner/testdata/claude-auth-status-2.1.312.json b/internal/runner/testdata/claude-auth-status-2.1.312.json| new file mode 100644 |
| index 00000000..ec68a876 |
| --- /dev/null |
| +++ b/internal/runner/testdata/claude-auth-status-2.1.312.json |
| @@ -0,0 +1,8 @@ |
| +{ |
| + "loggedIn": false, |
| + "authMethod": "none", |
| + "apiProvider": "firstParty", |
| + "analyticsDisabled": true, |
| + "projectsDirectory": "/home/runner/projects", |
| + "configDirectory": "/home/runner" |
| +} |
diff --git a/internal/tryequipo/live_open_test.go b/internal/tryequipo/live_open_test.go| new file mode 100644 |
| index 00000000..debecff6 |
| --- /dev/null |
| +++ b/internal/tryequipo/live_open_test.go |
| @@ -0,0 +1,20 @@ |
| +package tryequipo |
| + |
| +import ( |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +func TestPrivateDirectoryFailureNamesPath(t *testing.T) { |
| + root := t.TempDir() |
| + path := filepath.Join(root, "equipo-runner") |
| + if err := os.Mkdir(path, 0755); err != nil { |
| + t.Fatal(err) |
| + } |
| + err := privateDir(path) |
| + if err == nil || !strings.Contains(err.Error(), path) { |
| + t.Fatalf("missing failing path: %v", err) |
| + } |
| +} |
diff --git a/internal/tryequipo/run.go b/internal/tryequipo/run.go| index bc0677c7..54ca8ef4 100644 |
| --- a/internal/tryequipo/run.go |
| +++ b/internal/tryequipo/run.go |
| @@ -87,6 +87,7 @@ func (w *Wizard) Run(ctx context.Context) (err error) { |
| return err |
| } |
| runnerRoot := filepath.Join(home, ".local/share/equipo-runner") |
| + w.phase = runnerRoot |
| for key, path := range map[string]string{ |
| "EQUIPO_RUNNER_STATE_DIR": filepath.Join(runnerRoot, "state"), |
| "EQUIPO_WORKSPACE_ROOT": filepath.Join(home, ".local/share/equipo/workspaces"), |
diff --git a/internal/tryequipo/state.go b/internal/tryequipo/state.go| index 39201c67..e554650d 100644 |
| --- a/internal/tryequipo/state.go |
| +++ b/internal/tryequipo/state.go |
| @@ -69,7 +69,12 @@ func writeJSON(path string, v any) error { |
| } |
| return privateWrite(path, append(raw, '\n')) |
| } |
| -func privateDir(path string) error { |
| +func privateDir(path string) (err error) { |
| + defer func() { |
| + if err != nil { |
| + err = fmt.Errorf("%s: %w", path, err) |
| + } |
| + }() |
| if !filepath.IsAbs(path) || filepath.Clean(path) != path { |
| return refusal("private-directory", provider.ErrPolicy) |
| } |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index 6ad11c03..10da52e9 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -7215,5 +7215,453 @@ |
| "match": "paseo", |
| "count": 1, |
| "reason": "Regression fixture verifies rejection of ZeroSub credential-home sources and copy destinations." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md", |
| + "line_sha256": "feb572ce8902aa6cc7933e2d071d96ee457410fd999db797fc7147d481ebc294", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Live-open debugging brief or controller evidence: retained runner path or explicitly human-authorized future trial, not legacy execution." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md", |
| + "line_sha256": "953ae051dd7f5a9726e322b2afd9752898ba4fa7cb91ecf584ecbac61361c5ef", |
| + "match": "trial", |
| + "count": 1, |
| + "reason": "Live-open debugging brief or controller evidence: retained runner path or explicitly human-authorized future trial, not legacy execution." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "b0603ea4cac37a23f1e561220e4297cd6cd8cc1cc7ecba2530c3f2d24f267ca4", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "4b5f337b2c5a4e7cf38e9ab5b2d76daabff73d12babe521ffa7d15b4511900fa", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "f6c039be0fb749533c1a2a92023036b8ad3b6efa70a4a844315939eb193f06df", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "59520be8b29cb3f2de456808c7ed2f8d51d92972415f41356dc4a24e49c5a3b4", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "946aeb1b5bf865931599adafe6b5fd247cd919ca47b61e0d38cf8677297dcc22", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "1a5fe5244050bf60ea6acd3ec35143933cbd47c8e9ab089d4f7d2d727c1e215c", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "9a95c4cf27c8dd4b47963153bf5ef3b9c6c13d347f4f52f9059f819eae0d8fd5", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "56c37d89dd2d09385db693b4a3e0158adfcddb9e0e3b079e29a8de7ec457a564", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "b56b45c60b4fb5503d67de1fac55f761fc4cb2ce6d0495c1b58498badbff36c2", |
| + "match": "paseo", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "3e68ff602deba6a989070ee0e6bffc8e322ea3e317e1f56e86abb644d1d4e0ac", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "4880b98322b4c065921a94093a9e1577750d53fc0549be3452f1597269e5a48e", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "498341a9d5b06387e7595cab619647d37e362d98a420e6b2fcb852b13e5421a4", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "a7e5871074ec1cffb12d074cd08405b36c2134d89301a95bab486e99faea4c54", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "f27b544bc2273494945258538035ffe6229a1d1fdbb23297e51a95e62be32c65", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "c5312f56177660838149e4f407ccdee48c34731306d8b407823dcce023869793", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "c70c137d310b3ea4576fc62d2a40cb0147d189551a7dd7ad9b7c30e6f1042879", |
| + "match": "paseo", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "b185ca22d1345f2e4fc0d4b696c0fe5d4552ac10bedfe900fba3b8a891ad4ff6", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "394edfb5f0a357608fce2836840d11b38762c6016fef34bb0ec742f357c47aa4", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "d7e6d1961f891150e8bf2a51982d2b91e5e0ce6e39edcd71df0cf09521e246bd", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "9d2a7460580f376851f2829421927806d932fac399843557929f2c80cbd26300", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "2d65cc621feb09ed2e20c69a2d8ec27e99c345928d0c3cc4ac67d9cac78f20dd", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "ba1b59714c5fbf7457cd0c434a79eca13a367212f49adcdb7dd260838435f6de", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/live-config-0.165.0.json", |
| + "line_sha256": "0898bcad9b05430864c6db22bdd8531e5daa037ad9814126523965cd45421f87", |
| + "match": "paseo", |
| + "count": 1, |
| + "reason": "Recorded pinned Codex config response: disabled/default provider fields and denied host paths, not an enabled legacy runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/codex-empty-home-0.165.0.json", |
| + "line_sha256": "0fafbb03994aac97a1f8ce7aa222bdfdb007dcbed60bae7dacbcac65af900a67", |
| + "match": ".mjs", |
| + "count": 1, |
| + "reason": "Names-only empty-home Codex startup inventory used to prove strict containment refusal, not executable skill content." |
| + }, |
| + { |
| + "path": "internal/tryequipo/live_open_test.go", |
| + "line_sha256": "8a0f283a726b9d1f7c9556f978f97f4aa7657af6b1228ec8262de1608b169a58", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Current runner directory path or private-directory regression fixture; retained direct runner setup, not legacy execution." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CODEX-BRIEF-live-open-failures.md", |
| + "line_sha256": "fbf6092a9a12600c39d955bd6cbf381198ae0aea8db25a6c2b82c9e4016e9393", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Live-open debugging brief or controller evidence: retained runner path or explicitly human-authorized future trial, not legacy execution." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CODEX-BRIEF-live-open-failures.md", |
| + "line_sha256": "e8dfae0c9b85d543c7531f89e98ad707895454941abb50e60966b8f7c00dd1a8", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Live-open debugging brief or controller evidence: retained runner path or explicitly human-authorized future trial, not legacy execution." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json", |
| + "line_sha256": "137c00a888886f9e8189748c665f0deb07b02a6f2f85a1d4cfe2cdfe68b1a7a5", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Pinned Codex config readback records a null JS runtime path; this fixture does not launch a JS runtime." |
| + }, |
| + { |
| + "path": "internal/runner/provider/codex/testdata/disabled-skills-0.165.0.json", |
| + "line_sha256": "3235b5c43714a459786c835b982827eef0956c3692bd97bad4b0b96063f8f980", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Pinned Codex config readback records a null JS runtime path; this fixture does not launch a JS runtime." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md", |
| + "line_sha256": "101e8020b6eede9693732d759c147f284a12351c6b3a581abf1a3e63e28bf74d", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md", |
| + "line_sha256": "43e6319890c5e748ac7e4b2725a6d39540010346db171f05a4c94ce0c83de594", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md", |
| + "line_sha256": "99109bf11cf75388aacd05598b98499705978c6196d7e77b4e37fc9160d3be67", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/CONTROLLER-REPORT-live-open-failures.md", |
| + "line_sha256": "bd90228946d74196641aebb5e8a5de1080a7c593cb7738d855831b161a793b8d", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "4d622d0399570908b04ae3fa4bfc5a36a59c803a058d3a0630218f3e4b8a6e2e", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "276c62167a118388f0df01c258454d4e49a8b7018743dbc4b6bbb0f747669ac9", |
| + "match": "NPM", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "276c62167a118388f0df01c258454d4e49a8b7018743dbc4b6bbb0f747669ac9", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "e7dd3b60bc9d86996273ec1235adbcfbef570080d983f055b4d453fd8ba2d1c6", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "cbdb91496e3c8252ed5a9f77e4cd970ebd067fb2b1f3a711223c08d06438dac3", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "04f646f29e45ec7d48258e933c2b1b17dae3a32ee06dbee129eeeef9e208fcd6", |
| + "match": "node", |
| + "count": 3, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "04f646f29e45ec7d48258e933c2b1b17dae3a32ee06dbee129eeeef9e208fcd6", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "afe728150ad11996748ee1318be2a51fb94edc004bd6566a41362be4b7f03320", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude.go", |
| + "line_sha256": "afe728150ad11996748ee1318be2a51fb94edc004bd6566a41362be4b7f03320", |
| + "match": "NPM", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude_test.go", |
| + "line_sha256": "34abcd4c85ee4232bc52b820c5e4544236d7222f550fd1a91d28d281b8a9f380", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude_test.go", |
| + "line_sha256": "89d70a479b881b38e7436654ed339a2001240f8d08f6b6452ccff0fd35aa35b3", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude_test.go", |
| + "line_sha256": "306c7517001dc01ee85d5b912a8dfa6ac1ebfce46225c54748a7a44192529eae", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/runtime_claude_test.go", |
| + "line_sha256": "1b5c9e7c5b4118b33bedbf96faa16847f109f1a1eaf3905788eea86dd87bcf23", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "139141aa55da266877c65ff2d0b24cb06ae5ffd216b537dfd3e30cb50be6fcd2", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "82656d44e6930d7b803847ce48b97e9b4988efd5e79c4a7431467487108ef428", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "0054baee9a79123f49995e483077db058a51c0aedfa2b050e7217352e57aeb97", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "c3268e2bcda1d03e5f01407202123e1370c600774890b6212259090348279770", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "418e1ec6adb665ba7a1e8f8470412a0b8d0286b69c1e8a5fdf51ccf7268d7a80", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "6eac7446badce1e5bd03450f01fde96b051b868acddfa793246d910c92a766a0", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "c5139528cdd57a58bcdfa0e8162e9d89adf467e2a5207251cc2c64ce8f8eba4d", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-before-2.1.312.json", |
| + "line_sha256": "94f021996d8e8ff814ebc5749c3dc98e8aadb60304dc9513c4388ac75a55287b", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "139141aa55da266877c65ff2d0b24cb06ae5ffd216b537dfd3e30cb50be6fcd2", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "82656d44e6930d7b803847ce48b97e9b4988efd5e79c4a7431467487108ef428", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "0054baee9a79123f49995e483077db058a51c0aedfa2b050e7217352e57aeb97", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "362dcd1c45b992e8d7db6f6ac8662b0b2c26bf82b9c7e2fbc556bbf05fa06fa6", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "418e1ec6adb665ba7a1e8f8470412a0b8d0286b69c1e8a5fdf51ccf7268d7a80", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "6eac7446badce1e5bd03450f01fde96b051b868acddfa793246d910c92a766a0", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "39709d5b923430f7bcfe58a7276a63684ff0ef715aab45641db76ebfbce47fb9", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| + }, |
| + { |
| + "path": "internal/runner/provider/testdata/claude-empty-home-disabled-2.1.312.json", |
| + "line_sha256": "94f021996d8e8ff814ebc5749c3dc98e8aadb60304dc9513c4388ac75a55287b", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Recorded Claude 2.1.312 runtime cache and log paths, with exact allowances and refusal coverage; no executable dependency is introduced." |
| } |
| ] |