Skip to content

refactor(flavors): resolve reproducibility-check image name through flavors.py - #671

Merged
hanthor merged 2 commits into
mainfrom
arch/refactor-flavor-roster-single-source
Oct 12, 2026
Merged

hanthor merged 2 commits into
mainfrom
arch/refactor-flavor-roster-single-source

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Utah's local "is the build reproducible?" check (just check-reproducible <flavor>) built every flavor under the main image's name. For nvidia, gaming and nvidia-gaming that meant it compared two builds of an image CI never publishes: the update reference baked into the image pointed at the main image. This PR makes the check look up the flavor list and image names in the same place the real build does. It also adds a fast test so the desktop contract cannot fall out of step with that list.

Refactor

Files / cluster claimed: scripts/check-reproducible-build.sh (flavor validation + IMAGE_NAME build arg), tests/test_reproducible_build.py, new tests/test_flavor_contract.py. Flavor-roster single-source cluster (#670).

  • scripts/check-reproducible-build.sh: the hard-coded flavor list is replaced. The script checks the flavor against the active list from python3 scripts/flavors.py list (exit 2 unknown flavor: …, also for a retired flavor), then resolves the image name with python3 scripts/flavors.py image "$FLAVOR" and passes it as --build-arg IMAGE_NAME=…, as just build-ghcr does (Justfile:358). Before this change it was hard-coded to IMAGE_NAME=utah. A broken or unreadable flavor config exits 2 with cannot read the flavor roster, not unknown flavor.
  • tests/test_reproducible_build.py: new test that each flavor from flavors.py list builds under its flavors.py image name. It fails 3/4 subtests against the old hard-coded utah.
  • tests/test_flavor_contract.py (new): every active flavor and its ghcr.io/<vendor>/<image> ref must match contracts/bluefin-desktop.toml's image-flavor / image-ref patterns. Dropping gaming from the contract regex makes it fail.
  • docs/skills/flavors.md: lists the script among the callers that ask flavors.py image for the name (does not overlap the section ci: add non-blocking testsuite reporting to post-testing-e2e (#161) #631 edits).

Does not touch config/flavors.json, scripts/flavors.py, or tests/test_flavors.py.

Verification

  • python3 tests/run_suite.py → Ran 1006 tests … OK (skipped=19)
  • python3 scripts/check-script-syntax.py → syntax gate: 116 script(s) checked
  • bash scripts/check-reproducible-build.sh desktop → unknown flavor: desktop (expected one of: ["main", "nvidia", "gaming", "nvidia-gaming"]), exit 2
  • Not verified: reproducibility itself. No real two-build just check-reproducible <flavor> run has been done on this head. This PR only fixes which image name and flavor list the check uses; whether a flavor actually builds reproducibly is out of scope. The podman stub tests cover the argument contract.

Closes #670


Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=architect backend=copilot model=claude-opus-5.5 copilot=1.0.88

…lavors.py

check-reproducible-build.sh restated the flavor roster as a case literal
and built every flavor with IMAGE_NAME=utah, while build-ghcr takes the
per-flavor image name from scripts/flavors.py. Resolve both through
flavors.py, and pin the desktop contract's image-flavor and image-ref
patterns to the flavors.py roster with a host-side test.

Closes #670

Signed-off-by: architect <architect@hive.kubestellar.io>
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 10, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "architect" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

Danathar
Danathar previously approved these changes Oct 11, 2026

@Danathar Danathar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at ec04023. check-reproducible-build.sh now takes the image name from scripts/flavors.py image and exits 2 for an unknown flavor. A read-only helper ran tests.test_flavor_contract and tests.test_reproducible_build (14 OK). CI is green. Not run: a real two-build comparison. Hive's hold is still on, and I've left it for a maintainer.

@Danathar Danathar removed the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 11, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read against the tree at ec04023; this looks correct to me.

  • Justfile:358 / Justfile:472 — build-ghcr already resolves image_name via python3 scripts/flavors.py image and passes it as --build-arg IMAGE_NAME, so the probe now matches the real build's argument contract.
  • scripts/configure-branding.sh:35 — IMAGE_NAME lands in image-info.json's image-ref, which confirms the stated mechanism (kernel flavors previously compared two builds carrying the main image's ref).
  • tests/test_flavor_contract.py pins contracts/bluefin-desktop.toml:61-62 to flavors.py list / image; both new test files pass locally (14 passed, 12 subtests).

One observation, not a defect: flavors.py image (scripts/flavors.py:57-61) checks the static IMAGE map rather than the active roster from config/flavors.json, so a flavor moved to retired would still pass the new guard at check-reproducible-build.sh:55, while the error message lists only the active flavors. Same behaviour as build-ghcr, so consistent — just noting the "expected one of" text slightly overstates the check.

PR body matches the diff; no scope beyond the claimed cluster. Hold-gated per the author's note, so a maintainer still needs to sign off.

Confidence: 5/5 (safe)

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

check-reproducible-build.sh accepted any flavor in flavors.py's static
IMAGE map, so a retired flavor would still be built. Check membership in
`flavors.py list` first, and stop discarding flavors.py stderr so a
missing python3 or malformed config/flavors.json is not reported as an
unknown flavor. List the script among flavors.py image consumers in
docs/skills/flavors.md.

Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <scanner@hive.kubestellar.io>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from correctness, security, intent-alignment, style, docs-currency.

Confidence: 5/5 (safe)

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Request changes pending the promised reproducibility evidence. The earlier maintainer approval was for ec04023; the current head is d8cafd6 and the approval is dismissed. Please run the real two-build comparison on this head and attach the result, or revise the PR description to remove that claim and request a fresh review. The focused unit tests and CI are green, but they do not establish reproducibility.

@castrojo

Copy link
Copy Markdown
Contributor

Updated the description to match head d8cafd6, which takes the second option from hanthor's review. It no longer claims reproducibility was verified: the Verification section now says no real two-build run was done on this head and that this PR only fixes which flavor list and image name the check uses. Also corrected: the script first checks the flavor against flavors.py list (and exits 2 with 'cannot read the flavor roster' on a broken config) before flavors.py image; the diff does edit docs/skills/flavors.md, in a different section from #631; and the Justfile citation is line 358, not 353. No code changes. tests.test_flavor_contract and tests.test_reproducible_build pass at this head.

@Danathar Danathar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at d8cafd6, replacing my earlier approval of ec04023 (dismissed by the new commit).

What changed in d8cafd6: check-reproducible-build.sh now checks the flavor against flavors.py list (the active roster) before looking up its image name, so a retired flavor is refused, and a broken flavor config reports "cannot read the flavor roster" instead of "unknown flavor". The roster and flavor go to Python as arguments, not pasted into code.

Checked at this head: python3 -m unittest tests.test_flavor_contract tests.test_reproducible_build gives 16 tests OK. The membership check accepts main and nvidia-gaming and rejects retired and a malformed name. CI is green.

The description no longer claims a two-build reproducibility run was done, which was the second option in hanthor's review. I haven't run the two-build comparison either.

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The exact current head d8cafd6 has a 5/5 Hive review with no findings and a current approval confirming the fixes; all checks are green. As maintainer, deliberately releasing the ACMM hold for this bounded local architecture refactor and approving.

@hanthor
hanthor merged commit 23f2d13 into main Oct 12, 2026
14 checks passed
@hanthor
hanthor deleted the arch/refactor-flavor-roster-single-source branch October 12, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[architect] flavor roster restated outside flavors.py; reproducibility check builds non-main flavors under the main image name

3 participants