Skip to content

feat(cli): add sync status command#38

Merged
mdheller merged 1 commit into
mainfrom
feat/sync-status
Jun 16, 2026
Merged

feat(cli): add sync status command#38
mdheller merged 1 commit into
mainfrom
feat/sync-status

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Summary

  • Adds sourceos-syncd sync status — one-shot operational view of the daemon
  • Output: daemon state (systemctl), current tracked version, last receipt (outcome + age in seconds), total receipt count, healthy bool
  • Exit 0 = healthy, exit 1 = not
  • Accepts --store-root and --compact

Example output

```json
{
"daemon": "active",
"currentVersion": "1.2",
"lastReceipt": {
"issuedAt": "2026-06-16T14:23:01Z",
"outcome": "applied",
"ageSeconds": 2520
},
"storeReceipts": 7,
"healthy": true
}
```

Used by

scripts/doctor.sh in source-os calls this to include daemon health in the full stack health check.

Test plan

  • sourceos-syncd sync status returns JSON with expected fields
  • healthy: false when daemon is inactive
  • --compact flag works
  • 95 existing tests still pass

sourceos-syncd sync status shows daemon and sync health at a glance:
- daemon field: active | inactive | unknown (via systemctl is-active)
- currentVersion: last applied content view version from ReceiptStore
- lastReceipt: issuedAt, outcome, ageSeconds since issuedAt
- storeReceipts: total receipt count
- healthy: true iff daemon==active and last outcome in approved set

Exit 0 if healthy, 1 if not. Accepts --store-root and --compact.
Used by scripts/doctor.sh in source-os for the full health check.
@mdheller mdheller merged commit a576277 into main Jun 16, 2026
4 checks passed
@mdheller mdheller deleted the feat/sync-status branch June 16, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant