test: split the packaging tier and parameterize its installed binary (task 0036) #45
Reference in New Issue
Block a user
Delete Branch "task-0036-parameterized-installed-binary-tier"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0036-parameterized-installed-binary-tier.mdFirst of the seven tasks implementing
.claude/spec/nix-flake-packaging.md.What was built
test/packaging/packaging.test.tssplit into two facets, with the sharednpm pack/ extract / global-install mechanics factored intotest/packaging/npm-artifact.ts:tarball.test.ts— the shape of the packed tarball and its manifest. Npm-specific by nature; no other distribution method produces a tarball.installed-binary.test.ts— what any installed gitea-axi must do, whatever installed it: run, render the dashboard against a fixture Gitea, and install its bundled Agent Skill.The second facet takes the binary it drives from
GITEA_AXI_INSTALLED_BIN. When that names an existing binary it drives it and skips pack-and-install entirely; unset (or empty) it packs and installs exactly as before, so the default developer experience is unchanged. A path that does not exist fails inbeforeAllwith an explanatory message rather than an opaque spawnENOENT.That makes one seam with two callers — the npm distribution path today, the Nix installation path in task 0038 — so the two cannot drift apart in what they guarantee. Nothing in the facet asserts on how the binary came to exist.
The runner configuration is untouched apart from its comments: its
includeglob already matched the whole directory.Verification
Full tier run three ways, all green (7 tests), plus the fast suite (410 tests) and
tsc --noEmit:prepackbuildDeviations
Both minor and deliberate, and recorded in the task file's Implementation Notes:
itdriving the installed binary became three (usage, render, Skill installation). The assertions do not change in character; this splits one case into the three behaviours the spec itself names, so a failure says which broke.PUBLISHING.md's "Verifying the packed artifact" section was rewritten to describe the two facets and document the variable. Not an acceptance criterion, but the section described the tier as one undifferentiated thing and this change would have left it stale.Consequence worth flagging for task 0038: the two facets now each run
npm pack, sonpm run test:packbuilds twice. Invisible to the Nix build, which will run onlyinstalled-binary.test.tsagainst its own output rather than the full tier.Review
Overall: LOW
test/packaging/plus its config andPUBLISHING.md; nosrc/or shipped artifact touched.git revertrestores the prior file exactly.npm test, run viatest:pack.Three review findings were fixed in the diff: a factually wrong comment claiming fixture-server port collisions (the server binds port 0, so the real reason for
fileParallelism: falseis the shareddist/thatprepackwrites), the empty-string env var being treated as provided, andPUBLISHING.md's stale singular framing.Findings left unaddressed:
projectRootis exported fromnpm-artifact.tsbuttarball.test.tsuses it to locatePUBLISHING.md, an unrelated concern. Left as is: pre-existing coupling carried over unchanged, and worth addressing with the point below rather than alone.tarball.test.ts's last case asserts both packed-manifest fields and thatPUBLISHING.mdmentionsnpm publish. Pre-existing, carried over verbatim; out of scope for a task about the installed-binary split.extractTarballhas one caller, so unlikepackTarballit did not need extracting. Left as is: it keeps the three npm-artifact mechanics described in one place at negligible cost.