Share the token-ciphertext form test with the Pi provider module #115
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes!115
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/pi-token-form-shared-predicate"
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?
Summary
No running machine changes: all four toplevel derivations and all 18 check outputs are identical to master. The Pi provider module now judges a token ciphertext file by the same rule mkDevVm and the hypervisor credential module already share, so all three seams accept the same spellings and refuse the same leak; before, it accepted only a path literal. That case is unreachable from a deployment today (the secrets library always builds a path), so the visible change is in what the check proves: the module's three assertions were never evaluated by any check, and now the fixture is forced to toplevel and a sabotage with a directory-interpolated token file is shown to trip exactly the form assertion. If the wording or the stricter rule is unwanted, revert the one commit.
What changed
nix/secret-file-form.nixexposes the null-free half of the rule asisRegularSingleFileand its explanation asformExplanation;isAcceptedFormandexplanationare defined in terms of them and are unchanged in meaning, so mkDevVm and host-user-credentials accept exactly what they did.modules/pi-provider-lifecycle.nixusesisRegularSingleFileinbadTokenFiles(a missing or null file stays rejected) and its message borrows the shared explanation.checks/pi-provider-lifecycle.nixforces the fixture'ssystem.build.toplevel(the only way NixOS assertions run, nix.md) and asserts none fail; a second fixture spells one token file as"${fixtureDir}/default-token.age", is read throughconfig.assertionsrather than atryEvalso the failing assertion is named, and must yield exactly one failure containing "unacceptable token ciphertext file". The sabotaged machine is consumed in that one assertion.Risk
R2: a localized change to a guard whose reachable inputs are unchanged, with the new coverage as the main effect. Worst credible failure after the checks pass: the sabotage passing for an unrelated reason; the assertion requires exactly one failing NixOS assertion with the form message, so a broken sabotage machine (zero or several failures) is reported, not accepted.
Validation
./check.shon the branch: all 31 steps passed (18 checks built). Machine drvPaths and all 18 check outputs identical to a master run,pi-provider-lifecycleincluded: the new assertions run at evaluation time and itsrunCommandinputs are unchanged, so the derivation-unchanged witness holds for every check.pi-provider-lifecyclestep: 1182 MiB (master: 1012 to 1016 MiB), from forcing the fixture toplevel and evaluating the sabotaged machine's assertions.isRegularSingleFileforced totruemakes the check fail with "directoryTokenRefusals is not exactly the token-ciphertext form assertion:" and an empty list; restored before commit.readFileTypebefore the assertion, so the message now says "lacks a token ciphertext file". No finding in the vacuity or acceptance-change categories.Closes allod/archetypes#114
Owner request: the two comment blocks added to
checks/pi-provider-lifecycle.nix(overfixtureToplevel/failingAssertionsand over the sabotage fixture) are reasoning essays, not the contract, trap or pointer writing.md allows. Trimming them; the memory-cost and tryEval reasoning stays in this PR body.