allod: read the repository registry through INVENTORY, falling back to the public path #218
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/tools!218
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/registry-honors-inventory"
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?
Nothing changes on any machine until the deployment moves its
allod-toolspin. After that, on a host whereINVENTORYis set (nexus renders it fromnexus.provisioning.inventoryCheckout),allod secretandallod patchread the repository registry from that inventory'sscripts/repositories.json, so a private deployment'ssecretsanddeploycheckouts resolve to where its own registry says they are instead of to the public template paths. WithINVENTORYunset, nothing changes: the registry is still~/work/allod/inventory/scripts/repositories.json. No new variable is introduced; the one pointer the host already declares now reaches every consumer. Proof is five new tests over fixture registries plus the full test suites under every tag set, and one cold review by a model that did not write it. If it is wrong, revert and move the pin back; the symptom would be a checkout resolving somewhere unexpected, and every command names the path it resolved before acting.What changes
cmd/allod/registry.go:registryCheckoutreadsregistryPath(), which is$INVENTORY/scripts/repositories.jsonwhenINVENTORYis set and the old literal path otherwise. It deliberately does not callinventoryCheckout, which falls back to the registry for the inventory alias and would recurse. The trailing-slash and root handling both readers need lives in one helper,trimmedInventory.cmd/allod/secret_common.go:inventoryCheckoutuses that helper instead of its own copy.secretsCheckoutRelativeanddeployCheckoutRelativeare untouched and inherit the fix throughregistryCheckout, as doesallod patch's registry-id resolution.cmd/allod/registry_test.go(new, untagged):INVENTORYwins over a differing registry underWORK_DIR; theWORK_DIRregistry is read whenINVENTORYis unset; anINVENTORYwith no registry behind it yields not-found and theallod/secretsandallod/deployfallbacks rather than a silent read of the public registry; a trailing slash resolves the same;inventoryCheckoutreturns through the registry fallback without recursing; and the trailing-slash test asserts oninventoryCheckout's bare return, which fails if trimming is removed (checked by the worker with the trim disabled).docs/allod-secret.mdanddocs/allod-patch.mdstate where the registry is found.Risk
R2: one file-location decision changed, with the old behaviour preserved when the variable is unset; every consumer goes through the one reader; rollback is a revert. The residual case is an
INVENTORYthat points somewhere without a registry, which now resolves to the conventional fallback names rather than the public registry; the resolved path appears in the command's own refusal.Validation
Run by the overseer in the worktree on the committed tree (
bad432c, two commits):nix develop -c gofmt -l .nix develop -c go vet ./...nix develop -c go test ./...ok forge.anarch.diy/allod/tools/internal/gitremote 0.125snix develop -c go test -tags site ./...ok forge.anarch.diy/allod/tools/internal/gitremote 0.130snix develop -c go test -tags secret ./...ok forge.anarch.diy/allod/tools/internal/gitremote 0.148snix develop -c go test -tags site,secret ./...ok forge.anarch.diy/allod/tools/internal/gitremote 0.119sgit diff --checkOne cold review, per the R2 budget, by
gpt-5.5at effort high through codex reading a.git-free snapshot of the first commit: no blocker, high, or medium; two lows, both verified and fixed in the second commit: the trailing-slash test could not fail becausefilepath.Joinabsorbed the slash, and the docs named~/workwhere the code honorsWORK_DIR. The second commit is a test and two doc sentences, verified by reading and by the suite.Not run: a live
allod secret rotateon the host withINVENTORYset; that is the first thing to run after the pin moves, as--dry-run, and it should name the private checkout in its output.Closes allod/tools#217
Refs allod/nexus#52