Skip to content

Gate the OS update test seam on a build flag, not a file in $PWD #4208

Closed

Description

@pithead-architect

What's the problem

Parent pithead#4146: the OS update verbs carry a test seam that production builds ship. os_update_test_base (lib/pithead/47-os-update-helpers.sh:27) accepts a file named os-update-test-base in the working directory owned by the running user and switches the release lookup (47-os-update-helpers.sh:45) and the bundle download (48-os-update-verbs.sh:146) to a plain curl with no Tor. A planted file in a writable cwd turns the OS update path into a clearnet one. The reviewer ruling recorded in the parent: the fix is gating the seam, not deleting the direct branch.

What it impacts

Appliance owners: a planted file sends the OS bundle fetch and release lookup to the home IP and an unauthenticated base URL. Smaller risk than the env cases (needs a planted file), but it must not exist in a shipped image.

How I found it

Split of pithead#4146, whose code read located the seam; the KVM battery's use of it is visible in tests/os/phases/update.sh, update-healthgate-leg.sh, update-dashboard.sh, update-wedged-tor-legs.sh, tests/os/image-upgrade-certificate-leg.sh (all write /data/pithead/os-update-test-base in the guest) and tests/stack/appliance/test-appliance-os-update-verbs.sh:414.

How important is it

High for 2.0.5 as part of the Tor-only egress step; bounded blast radius, so it can land independently of the dashboard children.

Acceptance criteria

  • The seam is honoured only when a build-time flag/marker that is written solely into KVM test images is present; in a production-built image, with os-update-test-base planted, os-check and os-download still go over Tor.
  • A shell test shows that with the flag off and an empty socks value the verbs exit non-zero with no connection.
  • The KVM battery's seam legs stay green on test builds: tier4-kvm phases update and image-upgrade.
  • If pithead#4139 has landed by execution time, lib/pithead/47a-os-update-channel.sh also calls os_update_test_base and its call is gated by the same flag (runner note on the parent).
  • Regenerate the shipped CLI with scripts/build-pithead.sh and commit both slices and pithead.

Possible solutions

Parent's option: a build flag/compile-time marker written only into KVM test images (e.g. a marker the image build plants and the appliance rootfs lacks); drop the file-in-$PWD lookup in production entirely if the battery can read the flag instead.

Parent: #4146

Worker brief: Test tier: tier-1 tests/stack + shell gates locally, then tier4-kvm phases update and image-upgrade on the head (submit each phase separately via bench-submit with --base develop).

Child of pithead#4146. Independent of the dashboard children. Gate os_update_test_base (lib/pithead/47-os-update-helpers.sh:27, call sites :45 and lib/pithead/48-os-update-verbs.sh:146) behind a build marker that only KVM test images carry; a production-built image must ignore a planted os-update-test-base file and keep using Tor. Check whether pithead#4139 landed; if lib/pithead/47a-os-update-channel.sh exists, gate its call too.

The battery legs that seed the seam (tests/os/phases/update.sh, update-healthgate-leg.sh, update-dashboard.sh, update-wedged-tor-legs.sh, tests/os/image-upgrade-certificate-leg.sh, tests/stack/appliance/test-appliance-os-update-verbs.sh) must stay green — adapt seeding to the marker where the guest image cannot carry it, keeping the tests' intent. Add a tier-1 shell test: flag off + empty socks value => non-zero exit, no connection.

Run scripts/build-pithead.sh and commit the generated pithead alongside the slices. Homebrew bash/GNU grep/sed on PATH for the shell gates; shellcheck changed files. Never run docker or the KVM battery on the Mac; tier-4 only via bench-ci. No comments/docstrings in edited hunks.

Activity

  1. added this to the v2.0.5 milestone on Nov 17, 2026
  2. added
    dashboard
    security
    appliance
    needs-triage
    size:M
    on Nov 17, 2026
  3. pithead-developer commented on Nov 20, 2026

    @pithead-developer
    Contributor

    Blocked on #4118. Blocked on pithead#4120 for the last acceptance item. Finished on head 0ff0b82: gate + tests + docs complete, GitHub tiers 1-3 green on the head, and tier4-kvm phase update PASSED — job 4266@0ff0b8212753496042c85ee76b9e926b9e467b5b, conclusion success, 221 pass / 0 fail, the battery's seam legs ran over the gated seam; its unedited evidence block is in the PR body (pithead#4258, draft, base develop-v2.0.5). The second required phase image-upgrade was refused by bench admission before executing (job 4267, 10 s, 0 pass / 1 fail: "this commit's KVM battery predates pithead#4118 ... node phases stay refused until the branch includes pithead#4120 (merge develop once it lands there), then resubmit") — not a leg failure of this diff and not a bench failure, so no bench-ci issue; the refusal is the bench's own documented payout-admission policy and applies to every current head. Unblocks when pithead#4120 merges to develop and is forwarded into develop-v2.0.5: then merge the base into agent/4208-gate-the-os-update-test-seam-on-a-build-, resubmit both phases (update for head-fresh evidence) via bench-submit --base develop-v2.0.5, paste both evidence blocks unedited, and report done. Blocker explained in PR#4258's latest comment; PR body carries both evidence blocks and the resubmit plan.

    The runner resumes this issue when that one closes.

  4. added
    blocked
    on Nov 20, 2026
  5. removed
    blocked
    on Nov 20, 2026
  6. pithead-developer commented on Nov 20, 2026

    @pithead-developer
    Contributor

    Blocked on #4303. The remaining acceptance proof, the tier4-kvm image-upgrade phase, can't run yet. #4118 and #4120 are closed, but #4120 (e40f58a) is only on develop, not on this PR's base develop-v2.0.5. The bench therefore still refuses node phases on this line. Backport issue #4303 tracks it. The seam gate, tests and docs are done, and the update phase passed earlier (job 4266, on head 0ff0b82; GitHub tiers 1-3 were green on that head). I merged the base into the branch cleanly and pushed head aa7277a. make lint-file-budget and make lint-pithead-build pass on it. I did not wait for GitHub tiers 1-3 on the new head and did not submit a bench job on it. Once #4303 lands, merge the base in, confirm tiers 1-3 are green, submit image-upgrade and paste its unedited evidence into the PR. I posted this explanation on PR #4258.

    The runner resumes this issue when that one closes.

  7. added
    blocked
    on Nov 20, 2026
  8. removed
    blocked
    on Nov 21, 2026
  9. pithead-developer commented on Nov 22, 2026

    @pithead-developer
    Contributor

    Merged in #4258.

  10. added a commit that references this issue on Nov 22, 2026
    b1b4ce8
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

    appliancedashboardneeds-triagesecuritysize:M

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions