Skip to content

Modal base hand-off: a failed digest goes unnoticed, and verify-receipt --strict skips symlinks #1695

Open

Description

@MaxGhenis

Two gaps in the Modal base hand-off and one comment to reword, read at cfd5a2a5e. The review of #1677 found all three.

A failed digest does not stop step 7

Step 7 of docs/us-modal-stage-runbook.md writes the base's digest with echo "$(shasum -a 256 "$H5" | cut -c1-64) $H5" > "$RUN/base.sha256" (:1398). The block runs under set -euo pipefail, and bash still goes on when a command substitution inside echo's argument fails: echo succeeds and writes a line with an empty digest. I ran both forms against a missing file. The echo form continued, and the same pipeline assigned to a variable first exited 1. The strict verify-receipt two lines earlier hashes the H5, so the file would have to go missing in between. The 18 October record runs shasum directly (docs/us-route-a-rerun-20261018.md:476).

verify-receipt --strict does not see symlinks

tree_listing in tools/modal_us_stage_plan.py lists regular files and skips symlinks (:2974-2977). The strict check compares that listing with the receipt (:3413-3415), so an extra symlink under base-out draws no "not in receipt" problem. For a path the receipt lists, verify_receipt tests path.is_file() and hashes the path (:3402-3406). Both follow a symlink, so a link to a file with the receipt's bytes passes. On macOS, cp -pR copied a symlink as a link when I ran it, so the hand-off's copy would carry one into the run directory.

The gate-shadow comment

Step 7's comment on the copy says "the base writes its gate-shadow files in base-out/gate_battery_shadow/" (:1391-1392), and the changelog fragment from #1677 says the same. A base writes them when it builds a commit that has #1635 and MICROCOSM_US_GATE_SHADOW stays unset or on (us_runtime/gate_shadow.py:118-125). Step 7's pinned plan builds 4b57d15a2 (28 September), an ancestor of the #1635 merge, so that base writes none and -R copies only files.

Activity

  1. MaxGhenis commented on Nov 20, 2026

    @MaxGhenis
    ContributorAuthor

    One more point for this list, from the reviews of #1694, read at 7ff5a26bc: step 5b of docs/us-route-a-rerun-20261018.md leaves the operator to assemble its restart by hand.

    • After the class check, step 5b says to run the rest of step 5's block from mkdir -p "$RUN/base-out" (:524-527). No block does it, so the operator pastes those lines, and outside a set -e subshell a failed line does not stop the ones after it.
    • The block's last two commands write RESULT.json and ACCEPTED (:486-489). Step 5b asks for a lineage_exception entry in RESULT.json and for ACCEPTED to name the exception, so a restart that runs those lines as written marks the base accepted before the exception evidence exists.
    • mkdir -p (:467, :480) accepts a directory that appeared after the guard's check.

    #1694 fixes the guard and words step 5b to run the rest in one subshell that starts with the refusal. A block for step 5b that writes the exception evidence before ACCEPTED would close all three.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions