This document specifies the daemon IPC message schema used between grite
and grite-daemon. The wire format is rkyv-serialized structs transported over
Unix sockets with length-prefixed framing (u32 BE + payload). JSON examples are
provided for readability; actual bytes are rkyv.
ipc_schema_version: starts at1and increments on breaking changes.- Requests and responses must include the same version.
{
"ipc_schema_version": 1,
"request_id": "uuid",
"repo_root": "/path/to/repo",
"actor_id": "<hex-16-bytes>",
"data_dir": ".git/grite/actors/<actor_id>",
"command": { "...": "payload" }
}{
"ipc_schema_version": 1,
"request_id": "uuid",
"ok": true,
"data": { }
}Errors:
{
"ipc_schema_version": 1,
"request_id": "uuid",
"ok": false,
"error": {
"code": "db_busy",
"message": "data dir owned by another process",
"details": { }
}
}Error codes match docs/cli-json.md.
The daemon accepts the same logical commands as the CLI. Payloads are
equivalent to CLI flags and the response data matches the JSON schemas
in docs/cli-json.md.
IssueCreate request payload:
{ "IssueCreate": { "title": "...", "body": "...", "labels": ["bug"] } }IssueList request payload:
{ "IssueList": { "state": "open", "label": "bug" } }Sync request payload:
{ "Sync": { "pull": true, "push": true } }The daemon emits asynchronous notifications:
{ "EventApplied": { "issue_id": "...", "event_id": "...", "ts_unix_ms": 0 } }
{ "WalSynced": { "wal_head": "<git-commit-hash>", "remote": "origin" } }
{ "LockChanged": { "resource": "path:docs/", "owner": "...", "expires_unix_ms": 0 } }
{ "SnapshotCreated": { "snapshot_ref": "refs/grite/snapshots/1700000000000" } }Clients must treat unknown notification variants as ignorable.
- Request/response calls must have a bounded timeout (default 10s).
- On timeout, the CLI must retry using exponential backoff.
- Requests are idempotent only if the command itself is idempotent.