[architect] test: image-identity drift gate — tests/unit/image-identity_test.bats + README rename checklist - #368
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
…_NAME vs Justfile/README/artifacthub-repo.yml/custom/ujust/README.md/iso/iso.toml Adds tests/unit/image-identity_test.bats, which makes Containerfile's ARG IMAGE_NAME the canonical project identity and fails when any other rename site disagrees with it, when .github/workflows/clean.yml stops deriving its package name from github.event.repository.name, or when README's rename checklist stops naming exactly the gated files. Also corrects that checklist: it still listed clean.yml as rename site 6 even though #291 made clean.yml derive the name, so the documented contract had already drifted from the code. No behaviour change: the gate runs in the existing unit-tests.yml BATS job and asserts only on values already in the tree. Closes #367 Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
castrojo
left a comment
There was a problem hiding this comment.
LGTM: verified image-identity drift gate bats tests and README rename checklist update.
castrojo
left a comment
There was a problem hiding this comment.
LGTM: image identity drift gate bats tests and README checklist.
castrojo
left a comment
There was a problem hiding this comment.
LGTM: approved image-identity drift gate and README checklist updates
hanthor
left a comment
There was a problem hiding this comment.
The gate is real. I mutation-tested it and each drift is caught by exactly the right test:
Justfile IMAGE_NAME -> finpilot-typo -> not ok 3
artifacthub repositoryID drift -> not ok 5
clean.yml restates the canonical name -> not ok 10
Making Containerfile's ARG IMAGE_NAME canonical and deriving everything else from it is the right shape for #291, and reading the README checklist back out of the prose is a nice touch.
One blocker, and it isn't visible to git
Test 7 hardcodes the exact spelling that #366 removes:
ref="$(sed -n 's|^bootc switch .*--transport registry \(ghcr.io/[^ ]*\).*|\1|p' ...)"
[ -n "${ref}" ]#366 changes that line to:
bootc switch --mutate-in-place ostree-image-signed:docker://ghcr.io/projectbluefin/finpilot:stable
git merge reports no conflict — different files — but with both applied:
not ok 7 iso/iso.toml kickstart ref matches the canonical vendor and name
# (in test file tests/unit/image-identity_test.bats, line 82)
# `[ -n "${ref}" ]' failed
Whichever of the two lands second breaks main. Please widen the sed to accept both the --transport registry <ref> and ostree-image-signed:docker://<ref> spellings — the gate is about the name, so it shouldn't be coupled to the transport syntax at all.
Test 8 survives #366 as written: the FORK NOTE line still matches the placeholder pattern and the || [[ "$output" == *"FORK NOTE"* ]] escape hatch still holds.
Verified: bats tests/unit/ — base dd3b1fd 185 ok / 1 not ok; this branch 197 ok / 1 not ok. The single failure is pre-existing on base (build: does not add a build secret when GITHUB_TOKEN is unset).
Generated by Claude Code
Refactor
Claimed ground — files:
tests/unit/image-identity_test.bats(new),README.md("### 2. Rename the Project" section only). Cluster: image-identity rename contract (#291 / #367). No workflow, build script, Justfile, Containerfile or image content is touched.#291 reduced the identity contract but deliberately deferred its own step 4, the consistency check. Without it the contract drifted again:
README.mdstill tells forks to rename 7 files and still lists.github/workflows/clean.ymlas site 6, which #291 removed by makingclean.ymlderive its package name fromgithub.event.repository.name.This adds the missing gate:
tests/unit/image-identity_test.batstreatsContainerfile'sARG IMAGE_NAMEas canonical and fails whenContainerfile's# Name:comment,Justfile:1, the README title,artifacthub-repo.ymlrepositoryID, thecustom/ujust/README.mdbootc switch example, or theiso/iso.tomlkickstart ref disagrees with it. It also fails ifclean.ymlstops deriving its package name or starts restating the literal name, ifiso/iso.tomlreintroduces a placeholder registry ref, and if the README checklist stops naming exactly the gated files.README.md's checklist is corrected to the 6 real sites, states whyclean.ymlis not one of them, and points at the gate.Verified: all 12 new assertions pass on
mainas-is; a simulated partial rename (Containerfile+Justfilerenamed, the rest missed — the shape of #362) fails 5 of them. The gate runs inside the existingunit-tests.ymlBATS job, so it adds no CI surface.Known limitation, deliberately not fixed here:
unit-tests.ymltriggers only onbuild/**,tests/**,Justfile, so a README-only oriso/iso.toml-only drift will not run the gate on that PR. Patchingpaths:needsworkflowspermission this agent does not have; it is written up as the maintainer follow-up in #367.Closes #367
Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.
— hive: agent=architect backend=copilot model=claude-opus-5 copilot=1.0.78