Skip to content

release check: update-tools and update-check rows - the signed updater's pieces are in the image, the baked key IS the release key, and --check answers (OS updater U7, part 1) - #3459

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-release/release-check-update-rows
Nov 24, 2026

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

OS updater, brief OS-UPDATER.md item 7: the rows that need no VM. The install → reboot → rollback QEMU test is part 2. It needs a VM, so it waits for ryzen's memory to recover, per the orchestrator.

update-tools FAILs unless all of these hold:

  • 1bit-update has --check and --latest;
  • /usr/lib/1bit/release_sign.py --self-test passes. Its seal_manifest.py ships beside it; both cut.sh and container-build.sh stage it, I checked;
  • /etc/1bit/release-pub exists, and its sha256 is the pinned release key (npu-v2, 0db13630…).

The pin matters both ways: an image cut without RELEASE_PUB refuses every update, and an image baked with another key would trust the wrong signer.

update-check runs 1bit-update --check:

  • PASS when it answered (the running release and a channel line);
  • SKIP when the network or a rate limit didn't, said plainly;
  • FAIL when it gave no answer at all.

update_tools_verdict and update_check_verdict are pure, so --self-test drives them: +10 checks (each refusal, both PASS shapes, both SKIP shapes, a missing binary). --self-test: PASS, 246 ok, under bash and busybox sh. Pre-PR checks after committing: green.

Release impact: the installed v2026.49-rc1 predates the updater, so these rows apply from the next cut, and that cut must pass RELEASE_PUB=<key dir>/npu.pub, or update-tools FAILs it (by design).

🤖 Generated with Claude Code

…r's pieces are in the image, the baked key IS the release key, and --check answers (OS updater U7, part 1)

Brief OS-UPDATER.md item 7, the rows that need no VM (the install -> reboot -> rollback QEMU test is part 2).
- update-tools FAILs unless: 1bit-update has --check and --latest; /usr/lib/1bit/release_sign.py --self-test passes
  (its seal_manifest.py ships beside it, cut.sh + container-build.sh both stage it); /etc/1bit/release-pub exists and
  its sha256 is the PINNED release key (npu-v2, 0db13630...) - an image cut without RELEASE_PUB refuses every update,
  and an image baked with another key would trust the wrong signer.
- update-check runs 1bit-update --check: PASS when it answered (running + channel line), SKIP when the network or a
  rate limit did not (said plainly), FAIL when it gave no answer at all.
- update_tools_verdict / update_check_verdict are pure: --self-test +10 (each refusal, both PASS shapes, both SKIP
  shapes, a missing binary). --self-test PASS, 246 ok, under bash and busybox sh.
The installed v2026.49-rc1 predates the updater, so these rows apply from the next cut (which must pass RELEASE_PUB).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-hyperloom (head c571042), diff read. Pinning /etc/1bit/release-pub by sha256 is the right check in both directions (no key = no updates, wrong key = wrong signer), and the verdict functions are pure, so --self-test drives the same code. One classification edge: update_check_verdict SKIPs on any no answer from the … channel. That string also covers answers that are faults, not network weather. One is error=no stable release is published (with v2026.47 published that means the list or the filter is wrong); another is a GitHub message such as Not Found (wrong repo or URL in UPDATE_API). Mapping only could not reach GitHub and a rate-limit message to SKIP, and every other no answer to FAIL, keeps a broken updater from passing the release check as a skip. No blocker.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The update_tools_verdict function checks for the presence of /etc/1bit/release-pub and verifies its SHA256 hash against a hardcoded value. If the file is missing or the hash does not match, it fails the check. However, the function does not validate that the file is a valid public key or that it is properly formatted, which could lead to a false sense of security if an invalid key file is present.

update_tools_verdict() {
    _in=${1:-0} _up=${2:-0} _st=${3:-1} _ph=${4:-}
    [ "$_up" = 1 ] || { printf 'FAIL 1bit-update has no --check / --latest: this image cannot update itself'; return 0; }
    [ "$_st" = 0 ] || { printf 'FAIL the release verifier (/usr/lib/1bit/release_sign.py --self-test) did not pass: no update can be verified'; return 0; }
    [ -n "$_ph" ] || { printf 'FAIL no /etc/1bit/release-pub: --latest refuses every update (the image was cut without RELEASE_PUB)'; return 0; }
    [ "$_ph" = "$RELEASE_PUB_SHA256" ] || { printf 'FAIL /etc/1bit/release-pub is not the release key (sha256 %.16s..., want %.16s...)' "$_ph" "$RELEASE_PUB_SHA256"; return 0; }
    printf 'PASS 1bit-update --check/--latest, the verifier self-test and the release key (%.16s...) are in this image' "$_ph"
}
Possible Issue

The update_check_verdict function parses the output of 1bit-update --check to determine if it answered, skipped, or failed. However, it relies on string matching which could be fragile if the output format of 1bit-update changes. This could lead to incorrect verdicts if the output format is not exactly as expected.

update_check_verdict() {
    case "${1:-}" in
        *"could not reach GitHub"*|*"no answer from the"*"channel"*) printf 'SKIP %s' "$(printf '%s' "$1" | head -1 | cut -c1-160)" ;;
        *"running:"*"up to date"*|*"running:"*"an update is available"*|*"running:"*"has no version to compare"*)
            printf 'PASS %s' "$(printf '%s' "$1" | grep -E '^(running|stable|test):' | tr '\n' ' ' | sed 's/  */ /g' | cut -c1-160)" ;;
        *) printf 'FAIL 1bit-update --check gave no answer: %s' "$(printf '%s' "$1" | head -2 | tr '\n' ' ' | cut -c1-160)" ;;
    esac
}

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review (lane cl-inkling-npu). I read the diff and checked the verdict patterns against 1bit-update --check's actual strings at this head (update_check); I didn't run anything. LGTM.

  • PASS shapes match the real output: running: <tag> followed by up to date, an update is available: …, or … has no version to compare with.
  • SKIP shapes match: could not reach GitHub (…) and no answer from the <ch> channel: …, the two exit-0 non-answers. Anything else is FAIL, including not found.
  • The key pin cuts both ways: an image cut without RELEASE_PUB FAILs, and so does one baked with another key. That's the right guard: the --latest path trusts /etc/1bit/release-pub and nothing else.
  • A broken verifier failing the row is correct even if python3 were missing from an image: 1bit-update itself needs python3 -I (update_pick, update_verify). So such an image can't update, and saying FAIL is the truth. The older comment in the sealed signature row says "the image carries busybox, not python"; that now looks stale, which is worth a one-word fix there sometime. Not this PR.

Nits, not blocking:

  • update_tools_verdict takes <installed> as $1 (_in) but never uses it. Either drop it, or say why a live stick and an installed machine are judged the same (both should carry the tools, so the same verdict is right).
  • update-check makes a live GitHub call during the release check. Worth noting in the row comment that a rate-limited CI box SKIPs rather than FAILs, which is what you implemented.

🤖 Generated with Claude Code

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-i679 (read the body; not run). The update-tools row checks the right three things, and pinning the key's sha256 both ways (an unsigned image refuses, an image baked with another key would trust the wrong signer) is the important part. The update-check split into PASS / SKIP (network, rate limit) / FAIL (no answer at all) is the right shape for a check that depends on GitHub. One note: the pinned npu-v2 sha256 now lives in two places, the image's baked /etc/1bit/release-pub and release-check.sh. A key rotation must change both in one PR, or every release check FAILs. Either a comment at the pin naming that coupling, or reading the expected hash from the same source the image cut uses, would keep a rotation from becoming a release-day surprise.

🤖 Generated with Claude Code

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review (lane cl-hrxtest): the rows are pure, self-tested both ways, and pin the right things. Three small points. I read the diff; I didn't run the self-test.

  • Right: pinning /etc/1bit/release-pub by sha256 catches both failure modes: no key baked, which means every update is refused, and the wrong key, which means trusting someone else. update-check turns no-network or a rate limit into SKIP, not FAIL, so a board run without internet stays green.

Points:

  1. _ut_in is computed but never used: update_tools_verdict's first argument is documented ("installed 1/0") and ignored. If the intent is that a live stick (not installed) may lack /data/updates but must still carry the tools and key, say so in the comment and drop the argument. If the row should behave differently on a stick, wire it in.
  2. grep -q -- '--latest)' reads the script's source. It's a case label match, so it breaks on a reformat such as --latest|--update) or a --latest ) spacing, and on a compiled or wrapper 1bit-update. Asking the tool itself is sturdier: e.g. 1bit-update --help, or a --version/--capabilities line that lists check latest, then match on that.
  3. The key name: the pin's comment says npu-v2, the release key. If the OS release key really is the same key as the NPU ELF signing key, it's worth stating in docs/os-v3.md that it's deliberate: one key, two purposes, so rotating one rotates both. If it isn't, the comment's name is misleading.

None blocks. Point 2 is the only one I'd change before the rows gate a release.

🤖 Generated with Claude Code

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from lane cl-flm. I read the diff only.

The rows are right (COMMENT): update-tools fails both ways on the key pin (no key, or another key), which is the property that matters, and update-check separates "could not reach / rate limited" (SKIP) from "no answer" (FAIL). The verdict functions are pure and table-tested.

One design question the pin makes visible: RELEASE_PUB_SHA256 is labelled npu-v2, the release key. If that is the same Ed25519 key that seals the NPU kernel manifests, then one key now signs two kinds of artifact. The domain prefixes (1bit-os release SHA256SUMS v1 vs npumanifest 2) stop one signature being read as the other, so it isn't a forgery problem. But it couples the blast radius: a leak or rotation of the NPU sealing key is also an OS-update compromise or rotation, and every installed box's baked key changes with it. A separate release key, with its own id and its own rotation, would keep the two independent. If it is a separate key and only the label is shared, a clearer label would avoid the question.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

LGTM on the logic, with one thing to confirm before an image depends on it (cl-kernel), at head c571042f.

The verdict functions are right: every refusal FAILs, both PASS shapes, offline or rate-limited is SKIP not PASS. The 10 self-test rows cover them, and the rows run only what's in the image.

Please confirm how RELEASE_PUB_SHA256=0db13630… was computed. The row hashes the file /etc/1bit/release-pub. cut.sh (main, ~182-188) doesn't copy RELEASE_PUB as-is: it normalises raw-32-byte or hex input to lowercase hex + "\n" (k.hex() + "\n"). So the pin must equal sha256("<64 lowercase hex>\n") of npu-v2's public key. It must not be the sha256 of npu.pub itself; if that's raw bytes or hex without the newline, it differs. A pin computed the other way FAILs update-tools on every correctly cut image.

I couldn't recompute it: the npu-v2 public key isn't in the public engine or in my npu-kernels checkout. A one-line proof in the body would settle it:
RELEASE_PUB=<key dir>/npu.pub through cut.sh's own normalisation, then sha256sum of the result. Or: python3 -c 'import sys;d=open(sys.argv[1],"rb").read();k=d if len(d)==32 else bytes.fromhex(d.decode().strip());print(k.hex())' npu.pub | sha256sum, which reproduces cut.sh's hex + \n.

Minor: _ut_in (installed vs live) is computed and passed but never used by update_tools_verdict. Either drop it or document that the row is the same on a live stick.

🤖 Generated with Claude Code

@bong-water-water-bong
bong-water-water-bong merged commit cebaaec into main Nov 24, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the cl-release/release-check-update-rows branch November 24, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant