Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

feat(#6712 PR 4a): register reconcile_read_incomplete and convergence_read_failed

garrytanfa1544539b69
diff --git a/docs/guides/error-codes.md b/docs/guides/error-codes.md
index f98f13e0b5..86f8250ec1 100644
--- a/docs/guides/error-codes.md
+++ b/docs/guides/error-codes.md
@@ -746,6 +746,16 @@ More: [docs/guides/troubleshooting.md#consumers-without-heartbeat](../../docs/gu
More: [docs/guides/write-refusals.md#content_repair_needs_human](../../docs/guides/write-refusals.md#content_repair_needs_human)
+### convergence_read_failed
+
+<a id="convergence_read_failed"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| The read-only convergence shadow (`gbrain sync --dry-run --json`'s `convergence`, `sync status --detail`, doctor `managed_sync_convergence`) could not read the source's level, so it reports `status: unavailable` instead of counts. | The shadow only predicts what the level-triggered pass would do; the dry run, status and doctor results around it are unaffected and nothing was written. | Read the receipt's message, then rerun the read-only status; report it with gbrain doctor --json if it repeats. Run: gbrain sync status --source '{source_id}' --detail --json | agent | `gbrain doctor --json` | 1 | no |
+
+More: [docs/guides/sync-unblock-runbook.md#dry-run-convergence-classes](../../docs/guides/sync-unblock-runbook.md#dry-run-convergence-classes)
+
### core_budget_exceeded
<a id="core_budget_exceeded"></a>
@@ -2790,6 +2800,16 @@ More: [docs/guides/company-brain-ingestion.md#resume-and-verify](../../docs/guid
More: [docs/guides/company-brain-ingestion.md#agent-and-ci-use](../../docs/guides/company-brain-ingestion.md#agent-and-ci-use)
+### reconcile_read_incomplete
+
+<a id="reconcile_read_incomplete"></a>
+
+| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |
+|---|---|---|---|---|---|---|
+| A Git listing the managed-sync reconcile reads (`ls-tree`, `ls-files`, `diff-tree`) did not finish cleanly: Git exited non-zero, was killed by a signal or its time or size cap, or its output did not end at a record boundary. | A partial listing would make files look deleted or new, so the level is refused rather than classified. In PR 4a only the read-only convergence shadow reads it, and it reports `status: unavailable` with this code. | Check the checkout with git -C <dir> status, then rerun the read-only status; report it with gbrain doctor --json if it repeats. Run: gbrain sync status --source '{source_id}' --detail --json | agent | `gbrain doctor --json` | 1 | no |
+
+More: [docs/guides/sync-unblock-runbook.md#dry-run-convergence-classes](../../docs/guides/sync-unblock-runbook.md#dry-run-convergence-classes)
+
### recovery_required
<a id="recovery_required"></a>
diff --git a/src/core/error-registry.ts b/src/core/error-registry.ts
index a7bea31325..32b51e6949 100644
--- a/src/core/error-registry.ts
+++ b/src/core/error-registry.ts
@@ -172,6 +172,12 @@ export const CODES = {
fix: { argv: ['gbrain', 'sweep', '--retry-failed', '--json'], consent: [], actor: 'agent', requires_exclusive: false, why: 'Read-only: lists the stopped files, their attempt counts and the last error code.' } },
core_budget_exceeded: { class: 'caller', summary: "The write would push always-loaded core memory over its brain-wide character budget or page limit.", why: "Core pages enter every session's prompt in every harness, so their total size is capped on the write path.", docs: 'docs/guides/core-memory.md#budget', fix: { argv: ['gbrain', 'core', 'status', '--json'], consent: [], actor: 'agent', why: "Shows core usage against the budget and the largest core pages, read-only.", requires_exclusive: false } },
core_delete_owner_only: { class: 'consent', summary: "A remote caller tried to delete an always-loaded core page; only the owner can remove pages from core.", docs: 'docs/guides/core-memory.md#owner-only', actor: 'user' },
+ // #6712 PR 4a: the read-only convergence shadow could not read the level (`convergence.code` on an unavailable receipt).
+ convergence_read_failed: { class: 'server', actor: 'agent', summary: "The read-only convergence shadow (`gbrain sync --dry-run --json`'s `convergence`, `sync status --detail`, doctor `managed_sync_convergence`) could not read the source's level, so it reports `status: unavailable` instead of counts.",
+ why: 'The shadow only predicts what the level-triggered pass would do; the dry run, status and doctor results around it are unaffected and nothing was written.',
+ docs: 'docs/guides/sync-unblock-runbook.md#dry-run-convergence-classes',
+ suggestion: "Read the receipt's message, then rerun the read-only status; report it with gbrain doctor --json if it repeats.",
+ fix: { argv: ['gbrain', 'sync', 'status', '--source', '{source_id}', '--detail', '--json'], consent: [], actor: 'agent', requires_exclusive: false, why: 'Re-reads the convergence shadow; writes nothing.' } },
core_mark_owner_only: { class: 'consent', summary: "A remote caller tried to change always_load or core_priority; only the owner designates core pages.", docs: 'docs/guides/core-memory.md#owner-only', actor: 'user' },
core_remote_edit_refused: { class: 'consent', summary: "Remote edits to always-loaded core pages are refused by memory.core.remote_edit.", docs: 'docs/guides/core-memory.md#remote-edits', actor: 'user' },
cost_cap_exceeded: { class: 'server', summary: "The run reached its cost cap before finishing." },
@@ -475,6 +481,12 @@ export const CODES = {
receipt_fence_required: { class: 'host_only', summary: "Ingestion into a managed or bound source needs the worktree owner's fence.", docs: 'docs/guides/company-brain-ingestion.md#resume-and-verify' },
receipt_identity_mismatch: { class: 'caller', summary: "The receipt ID is already bound to different approved ingestion metadata.", docs: 'docs/guides/company-brain-ingestion.md#agent-and-ci-use' },
pat_file_unreadable: { class: 'caller', summary: "The --pat-file token file is missing, empty, holds more than one token, or is readable by other users, so it was not read.", why: "The token is read from a private file so it never appears on a command line or in a process list; a file other users can read would leak it, so the verb refuses before any credential is written.", suggestion: 'Write exactly one token on one line to a file, chmod 600 it, and pass its path with --pat-file.' },
+ // #6712 PR 4a: a Git listing the reconcile reads did not finish cleanly (sync-git-stream.ts).
+ reconcile_read_incomplete: { class: 'server', actor: 'agent', summary: "A Git listing the managed-sync reconcile reads (`ls-tree`, `ls-files`, `diff-tree`) did not finish cleanly: Git exited non-zero, was killed by a signal or its time or size cap, or its output did not end at a record boundary.",
+ why: 'A partial listing would make files look deleted or new, so the level is refused rather than classified. In PR 4a only the read-only convergence shadow reads it, and it reports `status: unavailable` with this code.',
+ docs: 'docs/guides/sync-unblock-runbook.md#dry-run-convergence-classes',
+ suggestion: "Check the checkout with git -C <dir> status, then rerun the read-only status; report it with gbrain doctor --json if it repeats.",
+ fix: { argv: ['gbrain', 'sync', 'status', '--source', '{source_id}', '--detail', '--json'], consent: [], actor: 'agent', requires_exclusive: false, why: 'Re-reads the convergence shadow; writes nothing.' } },
recovery_required: { class: 'host_only', summary: "An earlier write left state that must be inspected and recovered before new writes.", why: "Details name the exit when there is one: physical_root_device_changed (the checkout's filesystem device number changed; re-stamped by itself when ownership verifies) and physical_root_directory_changed (the directory at the recorded path was recreated, or its birth time drifted beyond 1 µs; the relocated-root self-transfer, `transfer prepare/accept <source> --self-transfer --confirm-relocated-root`, re-stamps it). Both are explained in docs/guides/write-refusals.md." },
redirect_uri_mismatch: { class: 'caller', summary: "Google connect credential error: redirect uri mismatch.", docs: 'docs/guides/google-connect.md#troubleshooting' },
ref_not_in_answer: { class: 'caller', summary: "The rated page is not one of the pages the answer used.", docs: 'docs/guides/retrieval-feedback.md#ref_not_in_answer' },