mycodaemon-intent-file-protocollisted
Install: claude install-skill goondocks-co/myco
# Daemon Intent File Protocol — Four Correctness Gaps
Myco's daemon uses an intent-file protocol for inter-process communication: a CLI or background job writes a TOML file signaling desired state; the SELF_RECONCILE job picks it up and acts. The protocol sounds simple but has four seams where failures are **silent** — the daemon appears healthy while actually doing nothing or doing the wrong thing.
## Prerequisites
- SELF_RECONCILE runs in `['active', 'idle', 'sleep']` — **`deep_sleep` is explicitly excluded**. This shapes Gaps 3 and 4.
- Current intent file paths are type-specific (post-split architecture): `intent.restart.toml` and `intent.update.toml`. The old shared `intent.toml` no longer exists.
- Key files:
- `packages/myco/src/daemon/update-installer.ts` — update intent authoring and `spawnUpdateScript`
- `packages/myco/src/cli/restart.ts` — restart path (CLI command)
- `packages/myco/src/daemon/self-reconcile.ts` — intent consumer, handler dispatch, and `skipIntent` usage
- `packages/myco/src/daemon/intent.ts` — intent file constants and type definitions
---
## Gap 1 — Concurrent Writers Silently Drop Each Other's Intent
**Category:** Write race — shared file + merge logic → last-writer-wins.
When a single `intent.toml` was shared across all intent types, `mergeIntent()` performed a read-modify-write cycle:
1. Read the shared file
2. Merge in the new intent section
3. Write the file back
When a CLI `myco restart` and the SELF_RECONCILE background jo