Install fleet-diff on the host PATH #38
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/nexus!38
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/fleet-diff-host-path"
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?
Do not merge this yet, and expect nothing to change on the machine until you do. It adds
fleet-diffto the host's installed tools, next toflake-statusandflake-update-cascade, but the script it installs does not exist in the tools repo the host builds from, so merging today would break the next host rebuild. It becomes safe once allod/tools PR 136 merges and allod/archetypes advances itsallod-toolslock; nothing here advances a lock. When that has happened, one host rebuild putsfleet-diffon your PATH and changes nothing else — I built the other four workspace tools before and after and they come out at byte-identical store paths. I did not rebuild the host, because that is a command for a human at the terminal. What proves the wiring is that I builtfleet-diffitself, against a copy of the tools branch that carries the script, and ran the result. If it turns out wrong, revert the single commit and rebuild; nothing else in this repo reads it.What changed
nix/home.nix, one file, 15 insertions and 2 deletions:workspaceToolentry forfleet-diff,path = "flake/fleet-diff",runtimeInputs = [ pkgs.jq pkgs.git ], placed directly afterflake-update-cascadeso the threeflake/tools stay together.nixis deliberately not a runtime input:writeShellApplicationprefixes rather than replacesPATH, andflake-update-cascadealready callsnixfourteen times with the same set.workspaceToolgains auseWorkspaceLibargument, defaulttrue, that controls whetherlib/workspace.shis prepended to the script. This is not cosmetic — see below.Why the helper needed an argument
The issue's sketch, wired verbatim, does not build.
workspaceToolprependslib/workspace.shto every script, andfleet-diffis the first tool that calls none of its four helpers, so shellcheck reportsSC2329("this function is never invoked") four times andwriteShellApplicationfails the build on it. I reproduced that failure before changing anything and have the log. The four existing tools each call at least one helper, which is why the problem has not surfaced until now.useWorkspaceLib = falseforfleet-diffis the narrow fix: the tool genuinely does not need the library, and the alternative — addingSC2329to the sharedexcludeShellChecks— would silence a real check for every tool here. The coupling to watch is that iffleet-difflater starts calling aworkspace_*helper, this flag has to flip back; that fails loudly at build time as an undefined command, not silently.Risk
R2 for the repo, higher for timing. The composition change is additive and touches no existing package, but the shared
workspaceToolhelper is edited, so all five tools are in scope for review rather than just the new one. I measured that directly:flake-status,flake-update-cascade,work-diff, andpull-allproduce the same four.drvpaths before and after the helper change, so the default path throughworkspaceToolis provably unchanged.The real risk is merge order. Merged before allod/tools PR 136 lands and the lock advances, this makes the host un-rebuildable:
builtins.readFileon a missingflake/fleet-diffis an evaluation error, so the failure is immediate and total rather than partial. That is loud, not silent, and reverting one commit restores the previous state.Validation
Everything below ran against a read-only export of
allod/toolsatorigin/agent/fleet-diff(commit1608d3f), extracted withgit archiveinto a scratch directory and passed as theallod-toolsargument. Nexus does not pinallod-toolsitself —allod/archetypesdoes, at9d029a7, and hands it tonexus.homeModules.hostthroughhome-manager.extraSpecialArgs— so this stands in for the lock advance that has not happened.nix-instantiate --parse nix/home.nix— passes.nix/home.nixdirectly as a function, withpkgsfrom this flake's own locked nixpkgs, and listedhome.packages:nexus-provisioning-scripts,forge-0.1.0,work-diff,flake-status,flake-update-cascade,fleet-diff,pull-all,allod-0.1.0. The new entry is present and in the intended position.fleet-diffderivation. Before theuseWorkspaceLibchange it failed with fourSC2329findings onworkspace_is_repo_root,workspace_collect_repos,workspace_collect_worktrees, andworkspace_repo_default_branch. After the change it builds, and the builtbin/fleet-diff --helpexits 0 and prints the usage block.flake-status,flake-update-cascade,work-diff, andpull-allboth before and after the helper change. All four build, and all four.drvpaths are identical across the two runs:ppqh5g5y…-flake-status.drv,3dpfvzj6…-flake-update-cascade.drv,g11k03ib…-work-diff.drv,z1gpkb1d…-pull-all.drv.nix build .#checks.x86_64-linux.no-hardcoded-arch— passes.Not run, and why:
nixos-rebuildof any kind.nexusis the host composition and host commands need a human at the terminal.nix flake check. Its other checks (provisioning-contract,host-provisioning-env) cover scripts and modules this change does not touch, andprovisioning-contractis the expensive one.flake.lockupdate in this repo, by instruction and because this repo has noallod-toolsnode to update.fleet-diffbuild above proves the composed script passes shellcheck and runs; it does not exercise the tool against a real fleet.allod/toolsPR 136 carries that suite (83 assertions).Linking
Refs, notCloses, per the multi-repo rule ingit-workflow.md: this repo cannot put the tool on the PATH by itself, so the issue should close on the step that finishes the chain — theallod-toolslock advance inallod/archetypes— not here.Refs allod/nexus#37
Depends on: allod/tools#136