Commit graph

9 commits

Author SHA1 Message Date
Snider
716546d0d5 feat(agent): workspace state mirror + ghost reap + sync queue via go-store
- prep.go TrackWorkspace mirrors into queue + concurrency store groups
  (previously only registry); hydrateWorkspaces reaps filesystem ghosts
  (dead PID → failed, persisted back to status.json) so cmdStatus and
  out-of-process consumers see coherent state (RFC §15.3)
- sync.go queue read/write goes through go-store first per RFC §16.5
  ("Queue persists across restarts in db.duckdb"), file remains fallback
  for graceful degradation
- statestore.go stateStoreGet helper for go-store-first reads
- tests/cli/restart — new CLI test for RFC §15.7 "dispatch → kill →
  restart → no ghost agents" dead-PID reap flow
- 4 new statestore tests: queue group mirror, concurrency refresh,
  sync queue persistence, fs ghost reap with disk write-back

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 12:36:44 +01:00
Snider
83364a6080 feat(agent): sync backoff + ledger + auto-flush loop
- sync.go: syncBackoffSchedule (1s/5s/15s/60s/5min) with per-push Attempts
  and NextAttempt honoured on retry (RFC §16.5)
- runSyncFlushLoop: ticks every minute from OnStartup when API key present,
  drains the queue without re-scanning workspaces
- SyncPushInput.QueueOnly: lets flush loop drain without triggering a full
  workspace scan (prevents duplicate pushes)
- Sync ledger at .core/sync/ledger.json: fingerprints keyed by workspace
  name + (updated_at, runs); skips already-synced workspaces until fresh
  activity
- docs/RFC-AGENT.md: synced from plans/code/core/agent/RFC.md with latest
  AgentPlan status enum, complete capability, pr.close/branch.delete,
  indexed_at/org brain fields

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 12:06:04 +01:00
Virgil
8efa9460bd feat(agentic): add fleet node id to sync records
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 04:38:16 +00:00
Virgil
d61c74d7e0 feat(agentic): persist sync history records
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 23:46:08 +00:00
Virgil
51f05bf789 feat(agentic): widen RFC compatibility inputs
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 15:42:44 +00:00
Virgil
bad6d66abf feat(agentic): harden RFC platform sync handling
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 13:19:18 +00:00
Virgil
2a1e13662d fix(agentic): align platform action aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 11:42:02 +00:00
Virgil
073938ca6f fix(agent): harden sync fallback and state model
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 07:54:29 +00:00
Virgil
6c69005aff feat(agent): implement fleet and sync RFC surfaces
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 07:27:15 +00:00