init should refuse a root_id that already exists on the remote #8
Labels
No labels
agent
blocked
agent
new
agent
review
agent
working
complexity
high
complexity
low
priority
high
priority
low
priority
medium
risk
high
risk
low
risk
medium
type
bug
type
chore
type
feature
type
security
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tfks/dropbear#8
Loading…
Add table
Add a link
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?
Current behaviour (internal/config/init.go, cmd/dropbear/init.go)
init only inspects local state (.dropbear/root.toml via config.Validate) and only parses the remote config — it never talks to the bucket. As a result, dropbear init --root-id X ... on a fresh local path succeeds even when roots/X/ already has objects in the configured bucket. This silently creates a second "origin" device for an existing root, which can clobber peer state on the next sync.
Desired behaviour
init is for creating a root. restore is the only supported way to onboard a new device onto an existing root. Therefore:
Scope notes
Out of scope
Brief — Developer
Phase: simple. Run
fjx dev prompt simplefor the cycle protocol.Ledger for: agent-pm
Status: closed @ 2026-06-04T23:38:38.842Z
Briefs:
Activity
(PM manages this ledger; agent section unused)
Ledger for: agent-dev
Status: crashed @ 2026-06-03T16:44:58.211Z
Work Completed Before Blocker
cmd/dropbear/register.gobefore remote device registration and before localconfig.Initwrites.dropbear/root.toml.config.DiagInitRemoteRootExistsand mapped it to exit 7 (uninitialized) viaconfig.ExitCodeFor.objectstore.RootPrefixfor the listable<prefix>/roots/<rootID>/probe prefix.root.toml.wiki/runbooks/install-daemon.mdto state that register/[roots.init]create new roots anddropbear restoreis the onboarding path for existing roots.TestCleanRemoteDeletesRootPrefixsetup so it registers an empty remote root before seeding objects, matching the new invariant.Validation Evidence
gofmt -s -w cmd/dropbear/register.go cmd/dropbear/register_test.go internal/config/diagnostic.go internal/config/exitcode.go internal/objectstore/keys.gopassed.gofmt -s -w cmd/dropbear/clean_test.gopassed.GOCACHE=/work/.cache/go-build GOMODCACHE=/work/.cache/gomod GOTMPDIR=/work/.cache/go-tmp go test ./cmd/dropbear ./internal/config ./internal/objectstorepassed.GOCACHE=/work/.cache/go-build GOMODCACHE=/work/.cache/gomod GOTMPDIR=/work/.cache/go-tmp go vet ./...passed.env TMPDIR=/work/.cache/go-tmp GOCACHE=/work/.cache/go-build GOMODCACHE=/work/.cache/gomod GOTMPDIR=/work/.cache/go-tmp GOLANGCI_LINT_CACHE=/work/.cache/golangci-lint just checkpassed with0 issues.Blocker:
just validatecannot complete in this runtimeRequired check 1: fjx help / invocation check
fjxsubcommand failed; the failing command is the repo gatejust validate.fjx dev ledger --helprelevant line checked:-f, --body-file <path> - Path to file containing the ledger body (agent-managed section only). Use '-' to read from stdin.fjx issue label --helprelevant line checked:-A, --add <label> - Label to add (repeatable).just --show validateconfirms the failing gate shape:validate: just test::format test::vet test::lint test::units test::secrets test::audit.Required check 2: verbatim error and prior-symptom search
Verbatim
just validatefailure after cache/tmp workarounds:Earlier environment errors before moving caches/temp paths:
Search results:
rg -n "TestBootstrapMkdirFailureSurfaces|TestIgnoredPathNoWakeup|fakeowner|no space left on device|GOTMPDIR|GOCACHE|just validate" wikireturned onlywiki/runbooks/validate.md:17:1. Run just validate.fjx dev ledgershowed no prior mention of these symptoms in the issue ledger; it only contained the initial working plan/evidence.Environment evidence:
mountshows/workand/worktreesarefakeowner; using/work/.cache/go-tmpmakes the daemon chmod test fail because permission bits do not behave like normal Linux filesystem permissions./dev/shmhas normal tmpfs space but isnoexec, so Go test binaries cannot run there./devis not writable. The root overlay and/tmphave no available space.Required check 3: phase prompt / brief re-read
fjx dev prompt simple.Required check 4: classification
just validateflake/environment.Smallest concrete unblock needed
Provide an executable temp/cache location with normal Linux permission semantics and enough space for
go test -race ./..., or free space on the root overlay/tmp, then rerun: