Repository navigation
os: the identity file must be TRUE, not merely present (it shipped cycle 26's engine in c32 and c33) - #1482
Conversation
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 323d19dd5ec58ed7ad933d707024358923fb842c.
This is the most consequential row fix I have reviewed today, because the failure it fixes is the one class this lane exists for: a check that printed and passed without comparing anything.
$ bash os/mini/release-check.sh --self-test -> 98 ok, release-check self-test PASS
- pass identity "$(tr '\n' ' ' < /etc/1bit/release-identity)"
+ compares the claims with the shipped bytes: <claimed engine> <actual launcher> <claimed libhsa> <actual libhsa>
The evidence in the body is the part that makes it a fix rather than a refactor: on 8 Nov the file was false in c32 and c33 — both claimed payload=lemonade-onebit-rc-2026-11-05-c26c and engine_sha256=89a6c386…, i.e. cycle 26's payload and launcher, on a cycle-32/33 image. A provenance row that reports what a file says while the artifact differs is worse than no row: it is a green light on the wrong bytes.
Two details show it was thought through rather than patched:
- malformed is distinguished from old: a
engine_sha256that is not hex, or not 64 characters, is refused as malformed rather than compared-and-diffed, because "your identity file is corrupt" and "your identity file is stale" send a reader to different places. libhsa_sha256=noneis a claim, not a pass by absence: it is true only if nothing/etc/1bit/libhsa.envnames on the loader path actually exists — so the escape value cannot be used to skip the check.
Nothing asked for. If the c32/c33 images are still candidates, this row finding them false is itself the strongest argument that the row belongs in the gate.
…cle 26's engine in c32 and c33)
`/etc/1bit/release-identity` says which payload and which engine the image carries. The row printed the file and called it a PASS -
`pass identity "$(tr '\n' ' ' < $ID)"` - so nothing compared the statement with the bytes, and on 8 Nov it was false:
payload=lemonade-onebit-rc-2026-11-05-c26c <- cycle 26's payload name
engine_sha256=89a6c386425a853ad28d945e1f8de9c446… <- cycle 26's launcher
built=2026-11-05T16:47:32Z
c32's payload launcher is `80aceca152a909d5…` and c33's is `7ba21108ae2a8b99…`, and c32's shipped SFS (`4731efd6`) carries that
same stale file, so for at least two cycles the artifact told its own console, this row and anyone reading it the wrong engine.
Cause is per-path writers: `os/v3/puppy/container-build.sh:343-353` writes this schema when it builds a base SFS,
`os/mini/mkimage.sh:460-471` writes a *different* one, and `os/v3/puppy/mkimage.sh` - what a payload roll like c33 runs - writes
**neither**, so a cut that reuses a base SFS inherits whatever the SFS was born with.
The row now compares both sha256 claims with the shipped bytes: `engine_sha256` against the payload's `1bit/1bit`, and
`libhsa_sha256` against the runtime `/etc/1bit/libhsa.env` puts on the loader path. Malformed, mismatched, and uncheckable are all
**FAIL** - an uncheckable claim is not evidence. `libhsa_sha256=none` is accepted as a claim and checked: true only if nothing
libhsa.env names exists here, so `none` against a runtime the image actually loads is a FAIL naming both (the board's `u5-hrxenv`
row pins its comparison to this same field, so a wrong `none` would have failed the owner's boot with a message blaming the
runtime).
Verified on real bytes, not fixtures: c32's shipped tree -> `FAIL the identity file says engine_sha256=89a6c386425a853a but the
payload's launcher is 80aceca152a909d5 - this cut does not write the file (os/v3/puppy/mkimage.sh writes it not at all), so it is an
inherited base-SFS value naming an older engine`; the same tree with the file rewritten to the true shas -> PASS.
`--self-test` PASS with seven new cases; `rowproof-payload-modes.sh` 13/13 on the same file (the two rows share it).
Rebuilt on main after #1473 landed (both changes edit this file's self-test area, so this branch was rebuilt rather than
hand-merged).
323d19d to
60bf319
Compare
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 60bf319591883c3cce89ae0c0790007236e02321
This head is a rebase onto main (209b4dc8) of 323d19dd, which was reviewed READY. Compared line by line, the changes to os/mini/release-check.sh are identical except that one self-test row (identity_verdict … '' …, "nothing to check the claim against") moved two lines up. That changes neither the set of cases nor the logic.
At this head:
bash -n os/mini/release-check.shpasses;sh os/mini/release-check.sh --self-test→release-check self-test PASS, including the five identity cases (match, engine mismatch, libhsa mismatch, malformed, uncheckable).
The row now compares the file's engine_sha256 and libhsa_sha256 claims with the shipped bytes instead of printing them, so a cut that inherits a base SFS's identity reds rather than passes. That's the guard #1482 set out to be.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 60bf319591883c3cce89ae0c0790007236e02321
This is the right fix for a real lie, and the lie is documented in the code: the row used to pass identity "$(tr '\n' ' ' < $ID)" — it printed the identity file's claims and called the printing a PASS. c32 and c33 both shipped payload=lemonade-onebit-rc-2026-11-05-c26c with engine_sha256=89a6c386… while the payloads carried 80aceca1… and 7ba21108…, so the row was green on two consecutive wrong releases.
identity_verdict() is the correct shape for it: a value derived from the shipped bytes cannot be satisfied by a typed string. Four inputs, pure, so --self-test drives it — and the arms cover the cases that matter:
PASS matching 64-hex engine + matching libhsa
FAIL engine_sha256=89a6c386… (short: "malformed, not merely old")
FAIL the real c32 shape (claimed c26c launcher vs the payload's own)
FAIL claimed libhsa vs the shipped library
The malformed-vs-stale distinction is the part I would have missed in review: a short sha is a different failure from an old one, and reporting them the same way ("identity is old") would send someone looking for a stale writer when the file is simply not the schema they think.
The cause is named and it is the important half: three writers — os/v3/puppy/container-build.sh (base SFS), os/mini/mkimage.sh (a different schema), and os/v3/puppy/mkimage.sh, "what a payload roll like c33 runs — writes neither", so a cut reusing a base SFS inherits whatever that SFS was born with. Fixing the reader without that sentence would leave the next reader rediscovering it.
One thing to sequence, not a defect here: #1486 edits the same region (@@ -1690,6 +1690,35 @@ vs this PR's @@ -1687,9 +1736,22 @@) and adds an identity-engine row below the pass identity line this PR replaces. So land this one first, and #1486 should then fold its two-schema reading (engine_sha256= vs engine: <short sha>, with the SKIP reason) into identity_verdict rather than adding a parallel row. Otherwise the report keeps the false PASS line and gains a contradicting one next to it.
--self-test arms are check-driven like the rest of the file. Not run: the row against a live image (needs a booted appliance; the pure arms are the logic).
… image is not falsely red Took the review's order: #1482 landed `identity_verdict()` and deleted the `pass identity "payload=..."` line that printed the stale claim as a PASS, and this now adds only the part that function cannot know - which schema the file uses (engine#1481). os/v3/puppy/container-build.sh writes `engine_sha256=<sha256 of the launcher>` (key=value) and is checkable against the payload; os/mini/mkimage.sh writes `engine: <git short sha>` (key: value) and is not. Without this branch the mini schema reaches identity_verdict with an empty claim and reds as "malformed, not merely old", which is a false red on every mini image. A git short sha is not a file hash, so the honest answer there is a SKIP that says why rather than a FAIL or a pass by absence. Also tolerates whitespace around `=` in the engine_sha256 read, which the review asked for and which costs nothing. Four cases at the call site: v3-correct -> PASS; the c32 bytes from the issue (89a6c386...) -> FAIL naming both shas; mini schema -> SKIP naming the git sha; no engine line -> FAIL. #1482's self-test still prints "release-check self-test PASS". Refs #1481
… image is not falsely red (#1486) Took the review's order: #1482 landed `identity_verdict()` and deleted the `pass identity "payload=..."` line that printed the stale claim as a PASS, and this now adds only the part that function cannot know - which schema the file uses (engine#1481). os/v3/puppy/container-build.sh writes `engine_sha256=<sha256 of the launcher>` (key=value) and is checkable against the payload; os/mini/mkimage.sh writes `engine: <git short sha>` (key: value) and is not. Without this branch the mini schema reaches identity_verdict with an empty claim and reds as "malformed, not merely old", which is a false red on every mini image. A git short sha is not a file hash, so the honest answer there is a SKIP that says why rather than a FAIL or a pass by absence. Also tolerates whitespace around `=` in the engine_sha256 read, which the review asked for and which costs nothing. Four cases at the call site: v3-correct -> PASS; the c32 bytes from the issue (89a6c386...) -> FAIL naming both shas; mini schema -> SKIP naming the git sha; no engine line -> FAIL. #1482's self-test still prints "release-check self-test PASS". Refs #1481 Co-authored-by: bong-water-water-bong <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…ly runs (#1541's reader half) (#1542) * os: the identity row checks a MINI image against the engine it actually runs #1541 gives a mini image an `engine_sha256` - the bytes the image carries, hashed where the image carries them. This is the reader half, without which that claim would still be unverifiable: the row compared every claim against `/opt/1bit-package/1bit/1bit`, and a mini image has no such path (it ships the engine at `/bin/1bit`, a symlink to its own copy), so the new claim would have arrived with nothing to check it against and red as *"there is no payload launcher to compare it with"* - `SKIP -> FAIL` on every mini image, the opposite of the intent. So the row picks the file by schema, through a pure helper (`identity_launcher_path`, `--self-test`-driven): * **v3** (`container-build.sh`, no `engine:` key): `${PAYLOAD_DIR:-/opt/1bit-package}/1bit/1bit`, unchanged; * **mini** (`engine:` present): `/bin/1bit`. Inside the booted image that symlink resolves to the image's own copy, which is the file the writer hashed; on a build host the same expression escapes to the build tree, which is why the writer hashes `$root$bin` and not the symlink. Three things my own fixtures found while building it, each a false green or a false red: 1. **The two schemas use different separators.** v3 writes `engine_sha256=<sha>`; #1541's mini writer emits `engine_sha256: <sha>`. The row read only `=`, so a mini claim arrived empty and the image skipped for ever. Now `^engine_sha256 *[=:] *`, whitespace trimmed. 2. **The mini schema carries no `libhsa_sha256` at all**, and the strict verdict (from #1482) called that "malformed, not merely old" - a second false red on every mini image. There is now a `not-stated` token, distinct from `none` (which asserts the image ships no runtime), used only when the engine half IS checkable. 3. **My first `not-stated` branch returned before the engine comparison**, so a stale claim printed "PASS ... is the shipped engine". The engine claim is now verified first, and the libhsa case runs after it. Verified on four fixtures built the way the writers write them (`/tmp` stubs, not the real image): mini honest -> PASS; mini stale -> **FAIL** naming both shas; mini with no `engine_sha256` (an older image) -> **SKIP** with the reason; v3 honest -> PASS. `--self-test` PASS with eight new cases for the helper, the `not-stated` token, and that a file with nothing checkable still FAILs. * release-check self-test: generate the 64-char fixture POSIX-ly, because the file is #!/bin/sh (fixes the CI build) CI's `release_check_row` test failed with: FAIL want PASS, got: FAIL the identity file's engine_sha256 is 5 characters, not 64 - malformed, not merely old The case is the mini-image PASS arm, and it built its 64-character digest with `aaaa$(printf 'a%.0s' {1..60})`. `{1..60}` is a BASH brace expansion; this script is `#!/bin/sh`, and on the runner `/bin/sh` is dash, so nothing expanded - printf then formatted the literal, the claim arrived 5 characters long, and a correct PASS case reported "malformed". Reproduced here by running it the way ctest does: $ ./os/mini/release-check.sh --self-test # shebang = dash FAIL want PASS, got: FAIL ... engine_sha256 is 5 characters ... rc=1 and it passed only when run as `bash os/mini/release-check.sh --self-test` - which is how I first tried it, i.e. with a shell the consumer does not use. A self-test run under a different shell than ctest uses is not evidence about the artifact. Now generated with `printf '%064s' '' | tr ' ' a`, which is POSIX and exact, and the two uses on that line take the variable: ./os/mini/release-check.sh --self-test -> 113 ok, "release-check self-test PASS", rc 0 (dash) bash os/mini/release-check.sh --self-test -> 113 ok, rc 0 (bash) `sh -n` and `bash -n` clean. This is the only `{1..` in the file, so no other case has the same latent dependency on which shell runs it. --------- Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: pi-os3 <pi-os3@1local>
What
identityinos/mini/release-check.shdid this:pass identity "$(tr '\n' ' ' < /etc/1bit/release-identity)"It printed the file and called it a PASS. It never compared the file's statements with the bytes that shipped.
On 8 Nov it was false — in c32 and c33:
4731efd689a6c386…80aceca152a909d5…a2cbb914(embedded SFSdeed1b19)89a6c386…7ba21108ae2a8b99…So for at least two cycles the artifact has told its own console, this row and anyone reading the file the wrong engine — a false statement inside the thing being shipped, which is what made it invisible: every row that "saw" it was asking whether the file exists and is shaped right.
Why it happened
The writers are per-path:
os/v3/puppy/container-build.sh:343-353writes this schema when it builds a base SFS;os/mini/mkimage.sh:460-471writes a different schema (tag:/lemonade:/engine:/hrx-system:/kernel:);os/v3/puppy/mkimage.sh— what a payload roll like c33 runs — writes neither, so a cut that reuses a base SFS inherits whatever that SFS was born with.The change
The row compares both sha256 claims with the shipped bytes:
engine_sha256vssha256of${PAYLOAD_DIR:-/opt/1bit-package}/1bit/1bit;libhsa_sha256vssha256of the runtime/etc/1bit/libhsa.envputs onLD_LIBRARY_PATH.Malformed field, mismatch, or a claim with nothing to check it against = FAIL (an uncheckable claim is not evidence).
payload=andbuilt=stay in the message as information. SeamsRELEASE_IDENTITY,LIBHSA_ENV,PAYLOAD_DIRso a harness can drive it.Verification
FAIL the identity file says engine_sha256=89a6c386425a853a but the payload's launcher is 80aceca152a909d5 — this cut does not write the file (os/v3/puppy/mkimage.sh writes it not at all), so it is an inherited base-SFS value naming an older engine. Same tree with the file rewritten to the true shas →PASS consistent: engine_sha256=80aceca152a909d5 and libhsa_sha256=f6ef689d163b42de.release-check.sh --self-testPASS, with five new cases: match, engine mismatch, libhsa mismatch, malformed, uncheckable.Scope, honestly
This is the guard, not the fix. The fix is the cut writing the file with the cycle's real values (pi-os3, in progress). Until a cut does, this row reds — which is the correct reading of a false identity, and is exactly what would have caught cycle 26's values in c32.
Not in this PR:
puppy-check.sh(the board checker, this lane's local tool) had the same class one line deep —mident=$(cat /etc/1bit/release-identity)put a four-line file where a one-line payload name belonged, so that branch could never match and every bare-ddmedium fell through to the rc-tag case. Fixed locally to read thepayload=line; itsrowproof-u2menu.shproof stays 35/35.