Skip to content

Refuse an occupied base path in both Modal hand-off blocks - #1694

Merged
MaxGhenis merged 4 commits into
mainfrom
us-hand-off-refuse-existing-base
Nov 20, 2026
Merged

MaxGhenis merged 4 commits into
mainfrom
us-hand-off-refuse-existing-base

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Both Modal base hand-off blocks now refuse a run directory where anything sits at base-out or base-sup: step 5 of docs/us-route-a-rerun-20261018.md and step 7 of docs/us-modal-stage-runbook.md.

  • The record's guard did not stop the block. It read test ! -e "$RUN/base-out" && test ! -e "$RUN/base-sup". Under set -e, bash does not stop a block when the first command of an && list fails, so with base-out present the block went on. With a directory there, it could copy the Modal base into it and, when the later checks passed, write ACCEPTED. With a file there, mkdir -p stopped it before the copy. A lone base-sup did stop it. The guard dates from 15 October (4010c4b84b), and the review of Copy base-out recursively in the Modal base hand-off blocks #1677 found it.
  • Neither guard saw a dangling link. [ -e path ] reports a dangling symbolic link as absent, so both guards now also test -L.
  • The guards assign no variable. Each block runs as a subshell of the operator's shell and inherits its variables with their attributes, so the guards name each path in their tests.
  • Step 5b has the operator run the rest of the block in one set -euo pipefail subshell that starts with the refusal.

Verification

  • Tests put a directory, a file, a link and a dangling link at base-out, at base-sup and at both, and run the record's guard under set -euo pipefail. Another runs the runbook's whole step 7 against the same four at each path. A third runs each guard inside a shell that declared base as an integer or as readonly.
  • A standard-library replay of those cases ran on main's text and on this branch's. Main's record stops 3 of the 12 occupied cases, and main's runbook stops 9 and lets a dangling link through at either path. This branch stops all 12 in both blocks, with the refusal message, and passes the declared-variable cases.
  • ruff format --check and ruff check pass on the test file, and CI runs pytest (I ran none locally).

Left for #1695

The digest line in step 7, symlinks in verify-receipt --strict, the wording of the gate-shadow comment, and step 5b's restart, which the operator still assembles by hand.

axiom: n/a: docs and tests

🤖 Generated with Claude Code

…-off block

The rerun record's hand-off block guarded with
`test ! -e "$RUN/base-out" && test ! -e "$RUN/base-sup"`. Under `set -e`,
bash does not stop a block when the first command of an `&&` list fails, so
an existing base-out passed the guard and the block went on to copy into it,
verify the copy and write ACCEPTED. The block now uses the runbook's explicit
`if`, and step 5b's restart names the same condition.

A test runs the record's guard for the four combinations of base-out and
base-sup. The review of microcosm#1677 found the guard.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`[ -e path ]` reports a dangling symbolic link as absent, so a link at
base-out or base-sup got past the guard and the block went on until mkdir or
a later write met it. The runbook's step 7 and the 18 October record now also
test -L. Step 5b's restart runs the record's refusal before it goes on from
mkdir.

The tests put a directory, a file, a link and a dangling link at each path,
read the record as UTF-8, and keep BASH_ENV out of the guard's shell.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MaxGhenis MaxGhenis changed the title Refuse an existing base in the 18 October record's Modal hand-off block Refuse an occupied base path in both Modal hand-off blocks Nov 19, 2026
The guards looped over the two paths with `for base in ...`. Each block
runs as a subshell of the operator's shell and inherits its variables with
their attributes: with a readonly or integer `base` there, the loop stopped
a clean run, and an integer `base` could make it test another path. Both
guards now test "$RUN/base-sup" and "$RUN/base-out" directly.

A test runs each guard inside a shell that declared `base` either way.
Step 5b says to run the rest of the block in one `set -euo pipefail`
subshell. The runbook test helper reads the runbook as UTF-8 and keeps
BASH_ENV out of the block's shell.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two points from the third review of the hand-off guards. The comment on the
integer fixture now says what happens in this test: under `set -u` a guard
that assigned the run's path to an integer variable stops on the path's
first name. The occupied case asserts that REACHED is absent from the
output, as the record's occupied test does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 20, 2026 17:39
@MaxGhenis
MaxGhenis merged commit 2f45706 into main Nov 20, 2026
11 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merged as 2f45706fc at head c72a8befc, with 9 checks passing and the two UK jobs skipped by the country selection.

Three independent reviews read it. The first found that the new guard let a dangling link through, and the second found that the loop I then added could misread a variable from the operator's shell. The third approved 7bb5ff554 with two small points on the tests, which the last commit takes. #1695 holds what the reviews left for later.

@MaxGhenis
MaxGhenis deleted the us-hand-off-refuse-existing-base branch November 20, 2026 17:41
MaxGhenis added a commit that referenced this pull request Nov 20, 2026
Brings in #1694, the hand-off guard, which edits the Modal stage runbook
and test_us_modal_stage_puf_support_base.py beside this branch's count
fix. No conflict; the registered-tool count stays seven.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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