Repository navigation
fix(skills): remove a refused launch's new evidence dirs and the proof's init evidence - #372
Conversation
…f's init evidence `vcn.sh launch` checks the evidence dir again after `mkdir -p`. When that check refused, the dirs `mkdir -p` had just made stayed behind. A default ACL triggers it with no race: under umask 077, `mkdir` still makes a 770 dir. Launch now records the dirs that `mkdir -p` will make and removes them with `rmdir` when it refuses. `rmdir` removes only empty dirs, and a dir that existed before is never on the list. `proof-launch-refusals.sh` now fails a refused case that adds or removes a path under its temp dir. Two new cases, out-made-unsafe and parent-made-unsafe, use a default ACL to reach the check after mkdir. They print SKIP when setfacl cannot set one. The init case's `mktemp -d` evidence dir is deleted when every case passes. When the init case fails, the proof keeps it and prints its path. SKILL.md says that out-dash and init need Playwright Chromium for the user who runs the proof, that the ACL cases need setfacl, and how the init evidence is cleaned up. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Re-recorded on the merge with main (#373, #367, #372). The facts and the model are unchanged by the merge, and check.sh passes. The only covered file main changed outside the record is selection.lua, which cannot reach diff state. Part of #363 _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
…x stale docs (coder#380) ## Why The operator goal is to clear the open follow-up issues in this repository (coder#362, coder#363 and coder#374 now) with small reviewed PRs. This PR fixes three verifier notes from coder#372 and coder#377. None of them has its own issue item. 1. **`fixtures/issue-238/init.lua`.** coder#377 corrected the fixture README, but the `init.lua` usage comment still showed `vv issue-238 example/target.txt`. That path does not exist, because `vv` runs nvim from `fixtures/`. The comment also showed a relative `XDG_CONFIG_HOME`. 2. **The `rmdir` cleanup wording.** The `vcn.sh` comment said the refusal cleanup "never deletes anything another process put there". That is not quite true. `rmdir` never deletes a file or a non-empty dir, but it does remove an empty dir that another process made at one of the recorded paths in the meantime. SKILL.md overstated it in the same way. 3. **Evidence files under a default ACL.** SKILL.md says that `$OUT` is `0700` and its files are `0600`. A default ACL on the evidence dir overrides the umask, and `chmod` leaves a default ACL in place. So a `0700` `VERIFY_OUT` with a default ACL passed both safety checks, and six evidence files came out `660`. The same happens when the default parent dir is `0700` with a default ACL that the new `$OUT` inherits. ## What changed - `fixtures/issue-238/init.lua`: the usage comment now shows the same commands as the README, including the `-u` form for Neovim 0.8. - `vcn.sh launch`: - After the second safety check, launch removes any ACL from the evidence dir with `setfacl -b -k` when `setfacl` exists, and then makes the dir `0700`. A `0500` `VERIFY_OUT` is safe but not writable, so `chmod` must run before the next step. - It then creates `ws-in.jsonl` and checks its mode. If the mode is not `600`, launch refuses the dir, removes what it made and exits 1. This happens, for example, under a default ACL with no working `setfacl`. - The `rmdir` comment now states the true guarantee. - `proof-launch-refusals.sh`, two new cases, which `SKIP` without default-ACL support like the existing ACL cases: - `out-acl-unremovable`: a `0700` `VERIFY_OUT` with a default ACL and a `setfacl` that fails. Launch must refuse it and leave nothing behind. - `out-acl`: the same dir at mode `0500`, with a working `setfacl`. After launch and cleanup, the dir must be `0700` and every evidence file must be `0600`. - `SKILL.md`: the `VERIFY_OUT` entry, the Evidence section and the proof bullets. ## Scope The `verify-claudecode-nvim` skill and one fixture comment. No plugin code changes. ## Blast Radius People and agents who run `vcn.sh`. A `VERIFY_OUT` with ACLs now loses them, so the evidence stays private. A dir where a new file still is not `0600` is refused. ## Verification Every proof run used a fresh private `TMPDIR`. | Run | `vcn.sh` | Result | | -------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | By hand: `0700` `VERIFY_OUT` with default ACL `g::rwx` | main | launch exits 0. `ws-in.jsonl`, `ws-out.jsonl`, `ws-client.log`, `agent-tty-doctor.json`, `final.screen.txt` and `messages.txt` are `660` | | New proof (red) | main | `FAIL: out-acl-unremovable: launch exited 0, wanted 1` | | New proof without `out-acl-unremovable` (red) | main | `FAIL: out-acl: evidence files that are not 0600: 660 final.screen.txt, 660 ws-out.jsonl, …` | | `out-acl` with a `0500` dir (red, Codex round 1 finding) | d1e111e | `FAIL: out-acl: launch failed: … ws-in.jsonl: Permission denied`, and the state dir is left in /tmp | | New proof (green) | this PR | 18 of 18 cases pass in 46 s, and `TMPDIR` and `/tmp` are clean afterwards. `out-acl`: "launch made the 0500 … a 0700 dir without its default ACL, and all 9 evidence files are 0600". `out-acl-unremovable`: "a new file in … gets mode 660, not 600" | | New proof with a `setfacl` that fails everywhere | this PR | 14 PASS, `SKIP` for the four ACL cases, exit 0 | | By hand: default parent dir `0700` with a default ACL | this PR | `$OUT` is `700` with no default ACL entries, and all 9 evidence files are `600` | `shellcheck --exclude=SC1091,SC2016` and `shfmt -i 2 -d` report nothing on both scripts. `stylua --check` passes on `init.lua`. `prettier --check` (3.8.4) passes on SKILL.md. `treefmt --ci` reports 0 changes. `mise run check` reports 0 warnings, and `mise run test` reports 835 successes and 0 failures. Part of coder#374. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `xhigh`_
Why
The operator goal is to clear the open follow-up issues in this repository (#362 and #363 now) with small reviewed PRs. This PR covers items 8 and 9 of #363. Both are about the
verify-claudecode-nvimskill.vcn.sh launchchecks the evidence dir again aftermkdir -p. When that check refused, the dirs thatmkdir -phad just made stayed on disk. The harness runs withumask 077, but a default ACL on a parent dir still makesmkdircreate a 770 dir. Such a parent triggers the refusal on every run, with no race. In the default layout, the leftover group-writableverify-claudecode-nvimdir also blocks every later run at the first check.initcase's evidence in/tmp.proof-launch-refusals.shgives theinitcase a freshmktemp -devidence dir and never deletes it. SKILL.md does not say to delete it. It also does not say that the cases that start a real run need Playwright Chromium for the user who runs the proof.What changed
vcn.sh: beforemkdir -p, launch records the dirs that are missing on the evidence dir's path, deepest first. When the check aftermkdirrefuses, launch removes those dirs withrmdir, then exits 1 as before.rmdirremoves only empty dirs, and a dir that existed before launch is never on the list.proof-launch-refusals.sh:setfacl -d -m u::rwx,g::rwx,o::---) to reach the check aftermkdir.out-made-unsafeuses a newVERIFY_OUT.parent-made-unsafeuses the default parent under an existingXUM_SCRATCH_DIR, which must survive. Both printSKIPwhensetfaclcannot set a default ACL.initcase's evidence dir is deleted on exit when every case passes. When theinitcase fails, the proof keeps the dir and printsinit evidence kept in <dir>.SKILL.md: theVERIFY_OUTentry says that a refusal aftermkdirremoves the empty dirs thatmkdirmade. The proof entry says thatout-dashandinitneed Playwright Chromium for the user who runs the proof, that the ACL cases needsetfacl, and how theinitevidence is cleaned up.Scope
The
verify-claudecode-nvimskill only: one harness function, the proof script and SKILL.md. No plugin code, no tests and no CI change.Blast Radius
Agents and people who run the skill. A launch that passes both checks behaves as before. A refused launch now removes only the empty dirs it made. A passing proof run no longer leaves a dir in
/tmp.Verification
I ran every case below for real on this host (Neovim 0.12.3, agent-tty 0.5.0, Node 26). Each proof run used a fresh private
TMPDIR, so leftovers were easy to see and other agents' runs could not interfere.vcn.shVERIFY_OUTnew under a default-ACL dir770 $R/acl/outXUM_SCRATCH_DIR= a default-ACL dirverify-claudecode-nvimandverify-claudecode-nvim/<time>-<id>, both 770initevidence dir (session.webm,final.png,ws-*.jsonl, ...) inTMPDIRFAIL: out-made-unsafe: launch changed ... > .../acl/outout-made-unsafe(red)FAIL: parent-made-unsafe: launch changed ... > .../acl/verify-claudecode-nvim > .../acl/verify-claudecode-nvim/<time>-<id>TMPDIRempty afterwardsinitcheck edited to want-32601FAIL: init: ...,init evidence kept in <dir>, exit 1, only that dir leftsetfaclthat failsSKIP out-made-unsafe, parent-made-unsafe, exit 0PLAYWRIGHT_BROWSERS_PATH= an empty dirFAIL: out-dash: launch failed: vcn: agent-tty doctor failed: browser_cache_accessible .... A copy withoutout-dashfailsinitat the same doctor step.shellcheck --exclude=SC1091,SC2016andshfmt -i 2 -d(the options intreefmt.toml) report nothing on both scripts.treefmt --cireports 0 changes,prettier --checkpasses on SKILL.md,mise run checkreports 0 warnings, andmise run testreports 810 successes and 0 failures.Part of #363.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh