v0.2 slice 5: status reporting #5
No reviewers
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tfks/dropbear!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "v02-slice5-status"
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
Extend
dropbear statusfrom identity-only validation to a five-section health report. With v0.2 slices 1–4 in place, this slice is the observational surface that lets you ask "what is the state of this root right now?" without rerunningsyncor greppingstate.sqlite.What the command now reports
StatusConflictrow, with the.conflict-*sibling copies discovered on disk and the peer device id + timestamp parsed from the basenameupdated_at; plus a skipped countDrift on its own does not change the exit code —
statusis observational. Exit code matches the identity check (0 when online, the existing config exit codes otherwise).New supporting helpers
state.CountByStatus(ctx, status) (int, error)— single-SQL COUNT helper, used by file_countsupload.ParseConflictBasename(name)— inverse ofConflictFilename, used by conflict listing to recover peer + timestampdownload.FetchPeerHead— head-only fetch, factored out ofFetchPeer; no behavior change for syncobjectstore.BlobPrefix— convenience forList-based blob enumerationcmd/dropbear/db.go—openOrCreateStateDBmoved here fromsync.goso both commands share itJSON envelope
Follows the same
schema_version=1, snake_case, optional-pointer convention as the existingsync --jsonenvelope. Sections that don't apply (offline root, no peers, no conflicts) are omitted entirely.Docs
New page at
doc/use-cases/status.mdcovers the human output, the five drift issue kinds, and when to run the command. Wired intodoc/use-cases/index.mdand surfaced inwiki/PROJECT.mdrecent changes.Test plan
just validategreen (format / vet / lint / tests / secrets / vulns)state.CountByStatus(table-driven, 6 statuses);ParseConflictBasename(round-trip across 6 names + 3 reject cases)cmd/dropbear/status_test.go:🤖 Generated with Claude Code