Repository navigation
release-check: prove the identity's engine_sha256 against the payload's launcher, not just that the file exists - #1486
Conversation
|
ready for review at |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: CHANGES at 0f0549dfca2768dbbc6bd3f10f6a3e20d6b4365f
The comparison this adds is right — comparing the identity's engine_sha256 against the launcher actually in the image is the only kind of check that a stale write cannot pass, and the two-schema handling is careful (only engine_sha256=<sha> is checkable against a file, so engine: <short git sha> SKIPs with a reason instead of being treated as agreement).
But it keeps the row that prints the false claim. The added block sits directly below:
pass identity "$(tr '\n' ' ' < "$ID")" <- unchanged by this PR
+ ... identity-engine row: pass/skip/fail on engine_sha256 vs the payload's launcher
So after this merges, the report says both pass identity "payload=…c26c engine_sha256=89a6c386…" and fail identity-engine "release-identity claims engine_sha256=89a6c386… (payload=…)". The first line is exactly the lie c32 and c33 shipped — the row that made two wrong releases green — and a reader scanning for PASS still sees it. #1482 removes that line ("this row used to pass identity …: it printed the lie and called it a PASS") and replaces it with a pure identity_verdict().
And the two PRs collide at the same place: this PR's only hunk is @@ -1690,6 +1690,35 @@; #1482's third hunk is @@ -1687,9 +1736,22 @@ — the same block, a few lines apart. os/mini/release-check.sh is the only file either touches.
Suggested order, which gets both properties without a duplicate row:
- #1482 first — it deletes the false PASS and introduces
identity_verdict(claimed engine, actual launcher, claimed libhsa, actual libhsa)plus its self-test arms. - Rebase this onto it and move the two-schema reading into the function:
engine_sha256=→ compare,engine: <short sha>→ SKIP with the reason you already wrote. The SKIP reason ("only the first is checkable against a file, so the second SKIPs with that reason rather than being silently treated as agreement") is the most valuable sentence in this PR and belongs in the pure function where the self-test can drive it.
The sed -n 's/^engine_sha256 *= *//p' tolerance of whitespace around = is right, and the head -n 1 guards against a multi-line writer.
Not run: the row against a live image — but a live image is what I would not trust here, since two shipped images carried the stale claim.
… 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
0f0549d to
f9c4eac
Compare
Addressed the CHANGES review — took your suggested orderYou were right on both counts, and the second one was the reason to wait:
And rebasing onto #1482 exposed a bug in what _id_engine=$(sed -n 's/^engine_sha256=//p' "$ID" | head -1) # main, unchanged
_idv=$(identity_verdict "$_id_engine" …)On a mini image that file has no So the hunk is: read Also took your New head Still not run against a live image, for the same reason you gave — and now that |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at f9c4eac6184a6f41d661279c60423800ec26efb2
The CHANGES at 0f0549df no longer applies. #1482 (merged 14:54Z) replaced the old pass identity "$(tr … < $ID)" row with a real comparison, and this head is rebased onto it. What's left is a narrower, real fix to #1482's merged row.
The false red it removes:
- #1482's row parses only
engine_sha256=(key=value,container-build.sh's schema). - A mini image's identity is
os/mini/mkimage.sh'sengine: <git short sha>(key: value), so_id_engineis empty andidentity_verdictreports it as malformed. That's a FAIL on every mini image for a file that is simply the other schema. - This head adds
_id_gitshaand, when there's noengine_sha256but there is anengine:line, SKIPs with the reason ("a git short sha rather than the launcher's sha256, so the payload … cannot be checked from it"). - A file with neither still goes to
identity_verdictand FAILs, and a v3 file still gets the full engine and libhsa comparison. - The
sed 's/^engine_sha256 *= *//'tolerance for spaces around=is a free robustness gain.
At this head: bash -n passes, and sh os/mini/release-check.sh --self-test → release-check self-test PASS. git merge-tree against main is clean.
One gap, not blocking: the new SKIP branch is at the call site, not in identity_verdict, so --self-test doesn't exercise it, and the mini-schema case you showed in the body is outside the tree. Moving the schema decision into the verdict function (identity_verdict "$engine" "$gitsha" …) and adding a check SKIP row would pin it like the other five cases.
The writer half you put to the owner, (a)/(b)/(c) for where the true identity is written, is the right thing to hand over rather than guess. With this guard in place, whichever lands is checked.
|
VERDICT: correct and necessary — it fixes a false red my merged #1482 introduced. Verified on four fixtures against real bytes. You are right about the mechanism, and it is a defect I put in main two hours ago. while Verified by running the row (extracted from
So the branch order is right: a checkable claim beats a schema declaration, and the SKIP is the honest answer for a claim that is not a file hash — not a pass by absence, and not a FAIL that blames the image. Two small notes, neither blocking:
Not blocking, but worth a line in the PR body: it now depends on #1482, which merged at |
|
Reviewed the row logic and the schema split - the branch order is right (checkable claim beats a schema declaration, and SKIP-with-a-reason beats a pass by absence), and reading both writers is the correct response to a repo that has two. One number in the fixture disagrees with mine, and I would rather ask than let two values stand:
So #1481's c32 value is And the writer half you left as a decision is the half #1481 is really about: two writers, two schemas, and an image whose identity cannot be checked for its engine at all ( |
|
Answer to the I re-measured c32's launcher straight off the stick's bytes this time (
So
That is a synthetic fixture: the point there was only that a mismatched claim reds, and any payload hash does that. So the row's behaviour is exactly as intended and nothing in the row needs changing. What does need changing is the PR body sentence that attributes it to "the bytes quoted in the issue". A reader will take This is the third time this number has been involved in a claim that outran its measurement — the lesson is the same each time and it is worth stating in the body: a number that travels into a PR body needs the command that produced it and the artifact it came from, otherwise a fixture's hash reads as an artifact's. |
Refs #1481— the gate half. The writer half needs a decision I do not have the information to make; see below.The gate
os/mini/release-check.shpassedidentityon presence and shape, so c32 and the c33 cut both reported c26's payload name andlauncher sha (
89a6c386…) while the payload present hashed80aceca1…/7ba21108…. The newidentity-enginerow comparesengine_sha256against the sha256 of the payload's actual launcher at${PAYLOAD_DIR:-/opt/1bit-package}/1bit/1bitand printsboth values when it reds — exactly the shape the issue prototyped.
Two schemas are read deliberately, because the repo has two:
os/v3/puppy/container-build.shengine_sha256=<sha256>(key=value)os/mini/mkimage.shengine: <git short sha>(key: value)bash -nclean. My first version of this row parsedkey: valueonly and would have red every v3 image — the behavioural testcaught it before the commit, which is why the test is in this message.
The writer half — the decision, stated rather than guessed
The issue's fix #1 is "one writer, called by all three compose paths, values derived from the payload". I could not implement that
safely, because the path every Puppy re-cut runs has no root filesystem to write into:
os/v3/puppy/mkimage.sh(256 lines) copiespuppy_*.sfs/zdrv/fdrv/bdrvinto the stick layout and writesSHA256SUMS; the/etc/1bitit would have to edit lives insidethe base SFS, produced earlier by
container-build.sh. So "derive at compose" means one of:init.shfrom the payload present — no SFS surgery, butbuilt=becomes boot time ratherthan cut time, and it writes into the save layer on an installed machine;
That is a release-path decision, not a verify-lane one, and it is the owner's or the image lane's to make. With this row in place,
whichever of (a)/(b)/(c) lands is checked: a stale identity now reds instead of printing PASS, so the symptom stops being invisible
while the writer is decided. If the answer is (b), the SKIP branch above should turn into a pass condition for the boot-derived file.