Collapse the duplicate inventory lock node by redirecting the secrets input #48
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#48
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The composition root locks
allod/inventorytwice — once as its own input and once as the copyallod/secretsdeclares — and the two nodes currently hold the same revision only by coincidence. Redirect thesecretsinput the way the other data inputs are already redirected, so one inventory revision defines the fleet's machine facts by construction rather than by luck.Primary goals:
secretsfollows the composition root's inventory instead of resolving its own, the same shape the pull request allod/archetypes#39 applied toallod/vm.secretsand machines built byarchetypesare guaranteed to come from one fleet definition.allod/deploycarries the same duplicate and gets the same one-line redirect, keeping its "nothing else differs" charter enforceable by diff.Current state and specifics
After allod/archetypes#39 the archetypes lock is down to 18 nodes, and two suffixed labels remain:
home-manager/home-manager_2andinventory/inventory_2. Only the second is a duplicate in the sense that matters.Both inventory nodes lock
15ad5528edc18b0bb7443a4f593986526bef3f99, and both resolve to the samenixpkgsnode —inventorythrough the root's nixpkgs andinventory_2throughsecrets/nixpkgs, which itself follows the root's. They are two labels for one source at one revision.The cause is that
flake.nix:11declares thesecretsinput and redirects only its nixpkgs:allod/secretsdeclares aninventoryinput of its own (flake.nix:6) and consumes it narrowly —inventory.lib.supportedPlatformsatflake.nix:87, for its own check platform list. Addinginputs.inventory.follows = "inventory";collapses the node and takes the graph to 17.allod/deployhas the same gap from the other direction. It declaressecrets,profilesandinventoryand redirects all three of the framework's data inputs (flake.nix:19-21), but not the copysecretspulls, so its lock also carriesinventoryandinventory_2at one revision.Why the coincidence is worth removing
Inventory is the sole source of machine facts: platform, type, runtime, MAC and address. Two inventory nodes at different revisions would mean
secretsderiving key material against one fleet definition whilearchetypesbuilds another, with nothing reporting the split. Per-machine encrypted secret filenames are keyed to machine names, so a divergence lands as a machine whose secret does not exist rather than as an evaluation error.That is the same hazard the
allod/vmcollapse in allod/archetypes#39 removed, stated there as: no revision moves, the two copies already happened to agree, and the coincidence is what is being removed.Scope
In:
inputs.secrets.inputs.inventory.follows = "inventory"inallod/archetypes, the same redirect inallod/deploy, and the regenerated locks. Two pull requests, one per repository, since the arc requires each source repo's change to be independently reviewable and revertible.Validation: the regenerated lock loses the
inventory_2label and every remaining locked source record is unchanged; the machine derivations are byte-identical to the pre-change ones.Out:
home-manager/home-manager_2, which is a different situation — those hold different revisions, the extra one is the pinagenixdeclares for its own module, andarchetypesreceives agenix as afollowsrather than a declared input so it cannot redirect it. Collapsing that one would have to land inallod/vmand would be a compatibility assertion about agenix rather than the removal of a duplicate.Part of allod/strategy#20.