This document defines the JSON output schemas returned by grite when --json
is provided. Schemas are versioned independently of the WAL schema.
All JSON responses use a common envelope:
{
"schema_version": 1,
"ok": true,
"data": { }
}Errors are returned as:
{
"schema_version": 1,
"ok": false,
"error": {
"code": "not_found",
"message": "issue not found",
"details": { }
}
}invalid_args: CLI usage error or invalid flag valuenot_found: issue/actor/ref not foundconflict: lock conflict or concurrent WAL updatedb_busy: data dir owned by another process or daemonio_error: filesystem errorgit_error: git command or ref failurewal_error: malformed WAL data or hash mismatchipc_error: daemon IPC failureinternal_error: unexpected error
0: success (ok: true)2: invalid arguments3: not found4: conflict or lock violation5: environment error (not a git repo, missing config, db busy)1: any other failure
All IDs are lowercase hex without 0x:
actor_id: 16-byte hexissue_id: 16-byte hexevent_id: 32-byte hex
Times are ts_unix_ms (milliseconds since Unix epoch).
For event objects:
actoris anactor_idparentis anevent_idornull
{
"issue_id": "...",
"title": "...",
"state": "open",
"labels": ["bug", "p0"],
"assignees": ["alice"],
"updated_ts": 1700000000000,
"comment_count": 3
}{
"event_id": "...",
"issue_id": "...",
"actor": "...",
"ts_unix_ms": 1700000000000,
"parent": null,
"kind": { "IssueCreated": { "title": "...", "body": "...", "labels": ["bug"] } }
}- Issue lists are sorted by
issue_id(lexicographic). - Event lists are sorted by
(issue_id, ts_unix_ms, actor, event_id).
The JSON blocks below describe the data payload inside the envelope.
{
"actor_id": "...",
"data_dir": ".git/grite/actors/<actor_id>",
"repo_config": ".git/grite/config.toml"
}{
"actor_id": "...",
"label": "work-laptop",
"data_dir": ".git/grite/actors/<actor_id>"
}{ "actors": [ { "actor_id": "...", "label": "...", "data_dir": "..." } ] }{ "actor": { "actor_id": "...", "label": "...", "created_ts": 1700000000000 } }{ "actor_id": "...", "data_dir": "...", "source": "repo_default|env|flag|auto" }{ "default_actor": "...", "repo_config": ".git/grite/config.toml" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "state": "closed", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "state": "open", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{ "issue_id": "...", "event_id": "...", "wal_head": "<git-commit-hash>" }{
"event_id": "...",
"issue_id": "...",
"target": "...",
"dep_type": "blocks",
"action": "added"
}{
"event_id": "...",
"issue_id": "...",
"target": "...",
"dep_type": "blocks",
"action": "removed"
}{
"issue_id": "...",
"direction": "dependencies|dependents",
"deps": [
{ "issue_id": "...", "dep_type": "blocks", "title": "..." }
]
}{
"issues": [
{ "issue_id": "...", "title": "...", "state": "open", "labels": ["..."] }
],
"order": "topological"
}{ "issues": [ { "...": "IssueSummary" } ], "total": 12 }{
"issue": { "...": "IssueSummary" },
"events": [ { "...": "Event" } ]
}{
"pulled": true,
"pushed": true,
"wal_head": "<git-commit-hash>",
"remote_wal_head": "<git-commit-hash>"
}{
"checks": [
{ "id": "wal_ref", "status": "ok|warn|error", "message": "...", "plan": ["..."] }
],
"applied": [ "rebuild", "fetch" ]
}{
"wal_head": "<git-commit-hash>",
"event_count": 1234,
"from_snapshot": "refs/grite/snapshots/1700000000000"
}{
"path": ".git/grite/actors/<actor_id>/sled",
"size_bytes": 1234567,
"event_count": 1234,
"issue_count": 12,
"last_rebuild_ts": 1700000000000,
"events_since_rebuild": 42,
"days_since_rebuild": 3,
"rebuild_recommended": false
}{
"events_checked": 1234,
"events_valid": 1234,
"corrupt_count": 0,
"errors": []
}{
"events_checked": 1234,
"signatures_checked": 1000,
"signatures_valid": 1000,
"error_count": 0,
"errors": []
}{
"format": "json|md",
"output_path": ".grite/export.json",
"wal_head": "<git-commit-hash>",
"event_count": 1234
}{
"snapshot_ref": "refs/grite/snapshots/1700000000000",
"wal_head": "<git-commit-hash>",
"event_count": 1234
}{ "deleted": ["refs/grite/snapshots/1690000000000"] }{
"lock": {
"resource": "path:docs/cli.md",
"owner": "<actor_id>",
"nonce": "<random>",
"expires_unix_ms": 1700000000000
}
}{
"locks": [ { "...": "lock" } ],
"conflicts": [ { "resource": "...", "owner": "...", "expires_unix_ms": 1700000000000 } ]
}{ "expired_pruned": 3 }{
"daemon": {
"running": true,
"pid": 12345,
"endpoint": "/tmp/grite-daemon.sock",
"workers": [
{ "repo_root": "/path/to/repo", "actor_id": "...", "data_dir": "..." }
]
}
}{ "stopped": true }{
"indexed": 42,
"skipped": 15,
"total_files": 57
}{
"query": "Config",
"matches": [
{ "symbol": "Config", "path": "src/config.rs" }
],
"count": 1
}{
"path": "src/main.rs",
"language": "rust",
"summary": "rust file with 2 functions: main, setup",
"content_hash": "a1b2c3d4...",
"symbols": [
{ "name": "main", "kind": "function", "line_start": 1, "line_end": 10 }
],
"symbol_count": 1
}{
"entries": [
{ "key": "api_version", "value": "v2" }
],
"count": 1
}{
"key": "api_version",
"value": "v2"
}{
"key": "api_version",
"value": "v2",
"action": "set"
}