Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
errors: register page_projection_conflict and file_removed_during_scan with repair guide anchors
garrytan85bbffa6431d
diff --git a/docs/guides/error-codes.md b/docs/guides/error-codes.mdindex e9345bc76a..c4d83eed40 100644--- a/docs/guides/error-codes.md+++ b/docs/guides/error-codes.md@@ -883,6 +883,16 @@ More: [docs/guides/retrieval-feedback.md#feedback_not_authorized](../../docs/guiMore: [docs/guides/write-refusals.md#fetch_failed](../../docs/guides/write-refusals.md#fetch_failed)+### file_removed_during_scan++<a id="file_removed_during_scan"></a>++| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |+|---|---|---|---|---|---|---|+| A file lint listed was removed before lint read it, so it was not linted. | Another process deleted or renamed the file during the run; lint reports it and continues with the remaining files. | Re-run gbrain lint on the same target; it lints the files present now. | agent | `repeat the read that failed` | 1 | yes |++More: [docs/guides/repair.md#file-removed-during-scan](../../docs/guides/repair.md#file-removed-during-scan)+### file_too_large<a id="file_too_large"></a>@@ -1593,6 +1603,16 @@ More: [docs/guides/google-connect.md#troubleshooting](../../docs/guides/google-c|---|---|---|---|---|---|---|| No page with that slug exists in the selected source. | The request itself was wrong or no longer matches the brain; nothing was changed. | Correct the request using the message above, then retry. Run: gbrain get --source '{source_id}' -- '{slug}' | agent | `repeat the read that failed` | 1 | no |+### page_projection_conflict++<a id="page_projection_conflict"></a>++| Meaning | Why | Next step | Who acts · consent | Verify | Exit | Retryable |+|---|---|---|---|---|---|---|+| Another worker installed a newer search projection of the page while this command prepared its own. | The projection guard keeps the newer installation instead of overwriting it; the canonical page revision did not change. | Re-run the same command; it re-reads the current projection. If it conflicts again, wait for the other worker to finish. | agent | `repeat the read that failed` | 1 | yes |++More: [docs/guides/repair.md#page-projection-conflict](../../docs/guides/repair.md#page-projection-conflict)+### parse_error<a id="parse_error"></a>diff --git a/docs/guides/repair.md b/docs/guides/repair.mdindex f952f15980..1903b5ee12 100644--- a/docs/guides/repair.md+++ b/docs/guides/repair.md@@ -1307,6 +1307,35 @@ brain's own autopilot job (or the shared job an older install still runs itfrom) for a brain under another `GBRAIN_HOME`. The autopilot launchd labelfollows `GBRAIN_AUTOPILOT_LABEL` when set.+### Page projection conflict++`page_projection_conflict` (retryable): another worker installed a newer+search projection (chunks and text seal) of the same page while this command+prepared its own, at an unchanged page revision. The usual other worker is the+persistence owner's resident projection rebuild (`gbrain serve` or autopilot);+an `embed` or `import` run can be one too. Nothing was installed by the losing+command, and the newer projection is kept. `detail` names what changed:+`text_projection_revision` (the page was sealed), `chunk_digest` (its chunk+set changed) or `indexing_context` (the embedding column, model, chunker+version or another indexing input changed).++Callers that install a projection re-read the page and prepare again up to+three times before reporting this code. To recover, re-run the same command;+it re-reads the current projection. If it conflicts again, another worker is+still installing: wait for it to finish (`gbrain doctor` shows the pending+count in `text_projection_readiness`), then re-run. `gbrain get --source <id>+-- <slug>` shows the page as stored now.++### File removed during scan++`file_removed_during_scan` is a non-fixable `gbrain lint` issue: a file the+scan listed was deleted or renamed before lint read it, so that file was not+linted. Lint continues with the remaining files. Re-run `gbrain lint <target>`+to check the files that exist now. On a managed brain, `lint --fix` instead+reports the page as a pending `canonical_file_missing` repair (counted in+`fix_pending`); see+[lint repairs waiting on a managed brain](concurrent-writes.md#lint-repairs-waiting-on-a-managed-brain).+## Related- [Write refusal reasons](write-refusals.md) — what a refused write means and the recovery commanddiff --git a/src/core/error-catalogue.ts b/src/core/error-catalogue.tsindex ded394f7a5..5dfb735f93 100644--- a/src/core/error-catalogue.ts+++ b/src/core/error-catalogue.ts@@ -37,6 +37,8 @@ export const ERROR_CATALOGUE = {legacy_job_authority: { code: 'permission_denied', docs: 'docs/guides/repair.md#legacy-job-authority' },preview_changed: { code: 'preview_changed', docs: 'docs/guides/repair.md#preview-changed' },projection_owner_resident: { code: 'projection_owner_resident', docs: 'docs/guides/repair.md#projection-owner-resident' },+ file_removed_during_scan: { code: 'file_removed_during_scan', docs: 'docs/guides/repair.md#file-removed-during-scan' },+ page_projection_conflict: { code: 'page_projection_conflict', docs: 'docs/guides/repair.md#page-projection-conflict' },explicit_kind_required: { code: 'explicit_kind_required', docs: 'docs/guides/repair.md#explicit-only-repair-kinds' },repair_kind_unavailable: { code: 'unavailable', docs: 'docs/guides/repair.md#explicit-only-repair-kinds' },colon_slug_windows_write_through: { code: 'colon_slug_windows_write_through', docs: 'docs/guides/write-refusals.md#colon_slug_windows_write_through' },diff --git a/src/core/error-registry.ts b/src/core/error-registry.tsindex cc8ae1f02b..fa43197d3f 100644--- a/src/core/error-registry.ts+++ b/src/core/error-registry.ts@@ -151,6 +151,7 @@ export const CODES = {feedback_disabled: { class: 'host_only', summary: "Retrieval feedback is off (or not learning) on this brain, so ratings are not recorded.", docs: 'docs/guides/retrieval-feedback.md#feedback_disabled' },feedback_not_authorized: { class: 'host_only', summary: "This caller may not change the brain's shared ranking for that source.", docs: 'docs/guides/retrieval-feedback.md#feedback_not_authorized' },fetch_failed: { class: 'retryable', summary: "Fetching the upstream failed." },+ file_removed_during_scan: { class: 'retryable', summary: "A file lint listed was removed before lint read it, so it was not linted.", why: "Another process deleted or renamed the file during the run; lint reports it and continues with the remaining files.", docs: 'docs/guides/repair.md#file-removed-during-scan', suggestion: "Re-run gbrain lint on the same target; it lints the files present now." },file_too_large: { class: 'caller', summary: "The file is over the import size limit (5 MB for Markdown and code, 10 MiB for any sync read), so it was not imported.", why: "Size limits bound parsing, chunking and embedding cost. The same bytes refuse on every retry.", suggestion: 'Split the file into smaller files, or leave it out of the source (sync.exclude), then sync or import again.' },follow_approval_required: { class: 'caller', summary: "Following a brain's shared skills needs the user's explicit follow approval.", docs: 'docs/guides/shared-brain-skills.md#approve-publication-following-and-editing-separately' },frontmatter_slug_conflict: { class: 'caller', summary: "The file's frontmatter `slug:` names a different page than its path does.", why: "The path decides a file's page; a conflicting declared slug would overwrite or fork another page, so the file is refused until one of them changes.", suggestion: 'Remove the `slug:` line or make it match the path, then commit and sync again.' },@@ -231,6 +232,7 @@ export const CODES = {overlapping_path: { class: 'caller', summary: "Sources cannot claim overlapping canonical directories." },owner_unavailable: { class: 'retryable', summary: "The brain's persistence owner is not reachable right now." },page_identity_changed: { class: 'caller', summary: "The page was deleted or replaced while the operation ran.", fix: { argv: ['gbrain', 'get', '--source', '{source_id}', '--', '{slug}'], mcp: { tool: 'get_page', arguments: { slug: '{slug}', source_id: '{source_id}' } }, consent: [], actor: 'agent', why: "Shows which page holds the slug now and its revision; a new attempt needs a new request_id.", requires_exclusive: false } },+ page_projection_conflict: { class: 'retryable', summary: "Another worker installed a newer search projection of the page while this command prepared its own.", why: "The projection guard keeps the newer installation instead of overwriting it; the canonical page revision did not change.", docs: 'docs/guides/repair.md#page-projection-conflict', suggestion: "Re-run the same command; it re-reads the current projection. If it conflicts again, wait for the other worker to finish." },page_not_found: { class: 'caller', summary: "No page with that slug exists in the selected source.", legacy_error: 'page_identity_changed', fix: { argv: ['gbrain', 'get', '--source', '{source_id}', '--', '{slug}'], mcp: { tool: 'get_page', arguments: { slug: '{slug}', source_id: '{source_id}' } }, consent: [], actor: 'agent', why: "Confirms whether the page exists in this source before anything is recreated.", requires_exclusive: false } },parse_error: { class: 'caller', summary: "The request body is not valid JSON." },parser_regression: { class: 'server', summary: "A file whose exact bytes imported before is now refused by gbrain's frontmatter reader.", why: "The same bytes imported under an earlier gbrain version, so only gbrain changed; with `sync.parser_regression=hold` such a file is held and the rest of the sync continues.", suggestion: 'Report it as a gbrain bug with the gbrain version, the file and the code; upgrade or pin the last good version, then sync again with --retry-failed.' },