Skip to content

fix: the v0.48.0 review findings (shebang length, rename fail-open, key-on-disk shapes, override reinstall) - #383

Open
avrabe wants to merge 3 commits into
mainfrom
fix/v0.48.0-review
Open

avrabe wants to merge 3 commits into
mainfrom
fix/v0.48.0-review

Conversation

@avrabe

@avrabe avrabe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Fixes the findings of the v0.48.0 clean-room review that the maintainer put in scope for v0.48.0 (2026-11-19). The fork-guard finding is fixed separately in #377. #378, #379, #380 and #381 are v0.49.0.

Fixes

  • run --with shebang length. The wrappers are #!<tmpdir>/.v/varve --varve-with-shim scripts. Linux kernels before 5.1 (RHEL 8: 4.18) read 128 bytes of a shebang and truncate silently, so a long TMPDIR could cut the interpreter path to a name another user can create in a sticky /tmp. varve now refuses a first line over 127 bytes on Linux, before anything is created. macOS keeps 255: it reads 512 bytes, and its default TMPDIR resolves to about 56 bytes, which 127 would refuse for every user. Documented in cmd-run.md.
  • detect-changes.sh renames. It now uses --no-renames, so code moved to a .md path outside crates/ no longer classifies as docs-only.
  • no-key-on-disk.sh now catches four more ways of writing a secret to a file: a quoted env binding, >file with no space, a secret piped through another command into a file, and secrets['X']. The PR-workflow reader scan also catches secrets[/vars[, and covers gate-probe.yml.
  • Override reinstall. install of an override layer already in the store now checks the high-water mark, as verify did. It used to accept what verify refused.

Guards (pass on main by design):

  • the release DSSE step fails without a key;
  • an override naming another layer of the same line is refused;
  • the seed first-contact refusal names the root layer's line.

Limits stated for v0.48.0: cmd-status.md and DD-043 name #381 (yanked override layer not reported) and #378.

Gate. CI is the first run, on the maintainer's call. The first head (20e73e47) carries only the tests, and these are predicted red:

  • a_shebang_longer_than_an_old_kernel_reads_is_refused_naming_the_limit and a_wrapper_is_one_shebang_line_naming_varve_and_nothing_a_shell_reads (Linux job);
  • test_code_moved_to_a_markdown_path_runs_everything (python tool tests);
  • no-key-on-disk.sh --self-test: 9 must-reject cases accepted;
  • the_reader_scan_flags_env_run_and_with_but_not_comments (secrets index) and every_workflow_a_pull_request_runs_is_checked (gate-probe.yml);
  • an_override_layer_already_installed_below_its_lines_mark_is_refused_by_install.

Fixes (4eeb2e99) and docs (5b579abe) follow once these are seen red.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z

avrabe and others added 3 commits November 19, 2026 16:46
Tests only; each red one fails against main for the reason named.

- runwith: a shebang line over 127 bytes is refused (Linux before 5.1
  reads 128 bytes of it and silently cuts the interpreter's path); the
  existing bounds test moves from 255 to 127.
- detect-changes: code moved to a .md path outside crates/ must run
  everything (rename detection listed only the new name).
- no-key-on-disk --self-test: quoted secret bindings, redirects with no
  space, a pipe through another command, and secrets['X'] / secrets["X"]
  must each be rejected; `2>&1` must still be accepted.
- pr_gates: the reader scan must flag secrets['X'] and vars["X"], and
  every workflow a pull request runs must be listed in PR_WORKFLOWS.
- install: an override layer already in the store, below its line's
  high-water mark, must be refused by install as verify refuses it.
- Guards (pass on main by design): the release DSSE step exits 1 with no
  key; an override naming another layer of the same line is refused; the
  seed first-contact refusal names the ROOT layer's line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z
- run --with: a Linux build refuses a wrapper whose first line would
  exceed 127 bytes (Linux before 5.1 reads 128 and silently truncates
  the interpreter path), before anything is created, naming the limit
  and suggesting a shorter TMPDIR. A macOS build keeps the 255 bound:
  macOS reads 512, and its canonical default TMPDIR alone is over 53.
- detect-changes: diff with --no-renames, so a move lists both names
  and code moved to a .md path outside crates/ runs everything.
- no-key-on-disk: catch quoted secret bindings, `>f` / `>>f`, a pipe
  through one command before the redirect, and secrets['X'] /
  secrets["X"]; `>&N` is still not a file write.
- pr_gates: the reader scan sees vars['X'] / secrets['X'], and
  gate-probe.yml (on: pull_request) is in PR_WORKFLOWS.
- install: an override layer already in the store is held to its
  line's high-water mark, as verify holds it.
- docs: cmd-run states the shebang limit; cmd-install the override
  mark check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z
cmd-status.md and DD-043 now say that a yanked override layer is not
reported and status exits on the pinned layer's verdict (varve#381), and
that VARVE_LAYER, the attestation statement and outdated name the pinned
layer only (varve#378). Both are kept for v0.49.0 by the maintainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z
@avrabe

avrabe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Tests-only head 20e73e47 went red as predicted (run on that head), each at its own test:

  • shebang 127 on Linux: a_shebang_longer_than_an_old_kernel_reads_is_refused_naming_the_limit and a_wrapper_is_one_shebang_line… (varve-core lib baseline in the Linux mutation shards);
  • override reinstall: an_override_layer_already_installed_below_its_lines_mark_is_refused_by_install (ubuntu, macOS and coverage);
  • no-key-on-disk.sh --self-test: all 9 new must-reject shapes ACCEPTED;
  • test_code_moved_to_a_markdown_path_runs_everything (rivet validate job's tool tests).

Not observed red: the_reader_scan… (secrets index) and every_workflow_a_pull_request_runs_is_checked. cargo test stopped at the first failing test target (--test override), so varve-producer's pr_gates_cannot_be_switched_off never ran on that head. They go into the v0.48.0 negative-control draft PR, which reverts their fixes on top of this code and expects red.

Real head pushed: 5b579abe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant