M2: flip the profiles seam to source definitions from the profiles input #10
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/archetypes!10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/archetypes-seam-flip"
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?
Part of the archetypes/profiles repo split —
Refs allod/strategy#18. This is M2: the seam flip that makes the framework source machine profile definitions, per-machineprofileData, and thepreferencesmodule solely from the newprofilesinput (locked at the merged M1 rev8e0b9a0), instead of its own in-treehosts/tree plus thesecrets/inventorylayers.Changes:
profilesinput (followsnixpkgs); source definitions/profileData/preferencesonly from it. Every other input rev inflake.lockis untouched, so the parity comparison below is meaningful.or {}residue (stale layouts now fail loud at eval):publicProfileDefinitions, thesecrets.lib.profileDefinitions/inventory.lib.profileDefinitionslayer reads, thesecrets.lib.profileDataread (→profiles.lib.profileData.<name> or {}; theor {}on the machine key stays), and themkDevVmdefaultpreferencesModule ?/mkHypervisorhardcodedsecrets.homeModules.preferences(→ theprofilesmodule).mergeProfileDefinitionLayerswith the exported two-argumentlib.composeProfileDefinitions { base, overlay }(override-collision rule kept; the old secrets-vs-inventory duplicate check retires with the dual sub-layers). Lift the unknown-archetype computation into an injectableunknownArchetypesOfhelper — thesubtractListsdirection is unchanged (reversing it would silently stop rejecting unknown archetypes).profilesSource(top-level) andlib.composedLayerCheck { pkgs, expectedProfiles }— the generic composed-layer canary the deploy template builds at M3 — plus a happy-pathcomposed-layer-smokecheck here.hosts/dev/home-shared.nix(shared dev-archetype behavior, framework not example) tomodules/dev-home-shared.nix; the movedhosts/dev/allod-dev/*and droppedhosts/service/.gitkeepempty thehosts/tree.README.md(name, ownership, exports,--override-inputHistory note).Unchanged surfaces:
vmFacts,nixosConfigurationsnaming, builder semantics beyond the re-homed reads, the archetype set, the installer, and every identity/credential read fromsecrets.Risk
R3 High — the composition path for every machine changes; a wrong merge or default re-homing would silently change composed systems. Mitigated by full-fleet drvPath parity plus the existing check suite, and by removing the old reads entirely (no defaulted fallback to mask a regression). Rollback is a plain
git revert(the PR touched only theprofileslock node additively — no lock surgery needed); the newprofilesrepo goes dormant but stays valid.Validation
Fleet drvPath parity — byte-identical before/after (module content moving between store paths is invisible to the drv; the parity run proves no path leaked into config):
Contract check proven fail-loud: the sabotage sub-cases (overlay/base collision without override; missing selection; unknown archetype) are asserted to fail inside the check. Reversing the
unknownArchetypesOfsubtraction makesnix build .#checks.x86_64-linux.profile-definition-contractsexit 1 withunknownArchetypesOf did not flag the unsupported archetype (subtraction direction wrong?)— the guard's failure path is demonstrable.