credential-profiles: read the credential-store URL rule from allod/secrets #86
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!86
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/credential-url-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?
The framework's credential check stops carrying its own copy of the rule that decides what a valid credential-store URL template is, and reads the one definition allod/secrets now exports instead. On a running machine nothing changes: this touches only a
nix flake checkin this repository, and the activation-time parser inmodules/netrc.nixthat guards the file on disk stays independent on purpose. What changes for a maintainer is that the rule now lives in one place: the check's witnesses are the shared table of 4 accept and 22 reject vectors in allod/secrets, every vector runs through the reallocal_auth_refreshvalidator, and a newcredential-store-url-paritycheck fails if allod/tools' copy of that table ever drifts a byte from the secrets one. If it is wrong, revert this PR; the local definitions come back and nothing downstream depends on the new check. This is stage 3 of allod/secrets#29 and the last public piece: stages 1, 2 and 5 are merged, and stage 4 (allod/nexus#58) is merge-ready with master merged in. Closing the issue leaves one private step, stated at the end.What changes
flake.nix, thecredential-profilescheck: the localisCredentialStoreUrlTemplateandisCredentialStoreUrlSourcedefinitions and the comment claiming they match the other copies are deleted; thelocal_auth_refreshclause callssecrets.lib.isCredentialStoreUrlSource. The three hand-written accept templates and nineteen hand-written mutations are replaced by the table's vectors, each applied onto the registry's real credential (alias and targets kept, onlyvalueandformatreplaced) so a rejection can only come from the predicate; every reject vector must fail on the predicate's own message, and an empty accept or reject list fails the check rather than proving nothing.credential-store-url-parity(new):cmpofcmd/allod/testdata/credential-store-url.jsonfrom the pinnedallod-toolsinput againstcredential-store-url.jsonfrom the pinnedsecretsinput, naming both paths on failure.One limit worth knowing: the reject pin reuses the same error string the clause emits, so it proves the predicate clause fired for each reject vector, not the wording of the message. Master's fixtures had the same shape.
Risk
R2. Check code only, no generated behaviour; the one integration edge is the two flake inputs the check reads, both already pinned past what it needs. Rollback is a revert.
Validation
Run by the integrator at
fe87d7f:nix build .#checks.x86_64-linux.credential-profiles .#checks.x86_64-linux.credential-store-url-parity --rebuildexits 0. The worker showed the parity check failing on a byte-altered copy of the tools file (differ: char 275, line 10, both paths named), then reverted.nix flake check --no-buildexits 0 (worker run, alone).cmp, and the secrets export exposes 26 vectors, all of which the check consumes.grep -rn "character for character\|isCredentialStoreUrlTemplate = \|isCredentialStoreUrlSource = " flake.nix modules/ checks/prints nothing.Cold cross-family review:
gpt-5.6-terraviacodex exec, reasoning efforthigh, read the diff atbcafebd(a Claude-family worker authored it). Two findings, both confirmed and fixed infe87d7f. Blocker: the vectors were applied onto the registry's own refresh entry, so a registry with nolocal_auth_refreshentry would run no vector and still pass; the validator reads generated machine state (the age secret, the netrc activation script, the machine set), so a registry-independent fixture would need a whole fixture machine in a check run already near the box's memory ceiling, and the fix is instead a loud assertion that the pinned registry carries at least one refresh entry, shown firing with the entry stripped. Should-fix: the anti-vacuity guard accepted one accept and one reject, so a table truncated identically in both repositories would pass here and pass parity; the current sizes are now pinned as minimums. The reviewer traced and cleared: vector application keeps the registry alias, targets, secret path and generated age inputs; each reject pin proves the source-predicate clause fired, since its condition calls the export directly; theformat = "raw"reject vector exercises the source guard; parity reads the framework's pinnedallod-toolsinput at the stated path, fails if either file is absent, and has a unique derivation name; no local predicate binding remains and the deployed-file parser stays only inmodules/netrc.nix; the lock is unchanged. No second reading follows the fix round; the fixes are settled by the rebuilt checks and the sabotage runs the worker recorded.Next steps after this lands
Public: bump the deploy lock as usual; the check runs on the framework's own inputs and needs nothing from a deployment. Private, for the deployment that carries its own fork of allod/secrets: the fork must export
lib.credentialStoreUrl(the grammar and vectors as data), which the already-mergedallod secret rotatereads and refuses an older checkout without, andlib.localAuthRefreshSources(the validated refresh projection), which the refresh script in allod/nexus#58 reads and refuses an older checkout without; and it retires its own copy of the predicate by composing itsformatpolicy onlib.isCredentialStoreUrlTemplatefrom the public flake and running the shared table against the result. Those exports are shaped by the public secrets flake; the fork mirrors them or re-exports the publiclib. Verification on the deployment is a refresh that gets past preflight and a rotation that no longer refuses the checkout.Closes allod/secrets#29