Move the machine-coverage check into the framework so every deployment's gate runs it #148
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
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#148
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?
Move the machine-coverage check from the secrets template into the framework, so every deployment's gate asserts that its inventory machines, host-key table and identities name one set of machines, with no copy of the check in any data repo.
Primary goals:
checks/here, reads the composed data surfaces (machines,secrets.lib.machineHostKeys, the four identity sets) iterated dynamically, and reaches each deployment through thefollowsredirects its deploy flake already applies to this repository's inputs. A deployment forks the data repos and pins this one, so a check committed to a data repo runs only against the template.machine-host-keys.jsonentry; an entry naming no inventory machine; a machine with no identity; an identity naming no machine; an identity under the attrset of another machine's type (a privacy machine underdevVMs, a hypervisor outsidehypervisorIdentities); one name in two attrsets. Type placement replaces the primary-hypervisor rule of the secrets version: which hypervisor is primary is not visible from the identity surface this repository consumes, and the two rules refuse the same mistake.checks/fork-fixture/with all three inputs overridden.allod/secretsdeleteschecks/machine-coverage.nix, its index entry and README row under the deletion rule (testing.md): a cheaper witness, the deploy gate, pins the same property for every deployment instead of one template.Current state and specifics
allod/secretscarries the check aschecks/machine-coverage.nix(landed in allod/secrets#48 for allod/secrets#43). It is correct and green, and it protects only the public template: the secrets repository every deployment builds from is a private fork, and no deployment's gate runs the template's checks. Measured on the dev VM after the merge: the deploy lock bumped to the new secrets commit, and theallod-devsystem derivation was byte-identical before and after, as expected for a check, while the fork that actually builds that machine has no such check.This repository already asserts half of the property at composition (
flake.nix,machineConfigurations:identityNames == machineNames) and throws on a guest without a host key whenvmFactsis forced (nix/vm-facts.nix,requireHostKeys), which the deploy gate does not force. Both surface late, in the wrong repository, and name no file. The moved check names the file to edit on every refusal.Shape here:
checks/machine-coverage.nixwith a diagnostics function over{ machines, machineHostKeys, devIdentities, privacyIdentities, serviceIdentities, hypervisorIdentities }, the real data run plus one healthy fixture and one sabotage fixture per refusal, and arunCommandnamedmachine-coverage-check.checks/default.nixgains the entry;flake.nixpassesprivacyIdentities,serviceIdentities,hypervisorIdentitiesandsecrets.lib.machineHostKeys or nullto the check index, which today receives onlydevIdentitiesand the mergedidentities. A null host-key table (a secrets input predating the export) is a refusal with the messagenix/vm-facts.nixalready uses for it, not a pass.Validation
allod check .in the worktree: every step green, the new check built.nix build .#checks.<system>.machine-coveragewith--override-inputonsecrets,profilesandinventorypointing atchecks/fork-fixture/(thepath:formfork-safety.shuses): green, proving the check names nothing from the template.Scope
In: the check, its wiring, its README line, here. The secrets deletion is a second pull request in
allod/secretsthat refs this issue and closes it. Out: the existingmachineConfigurationsassertion andvm-facts.nixguards, which stay as they are; the private fork's lock bump, which is the owner's.