Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(sync): an unsupported_path hold classes as one page waiting on a rename, not an unknown systemic fault
garrytan5322d061edfd
diff --git a/docs/guides/sync-unblock-runbook.md b/docs/guides/sync-unblock-runbook.mdindex 6b08a2bc43..2fb3bb4e51 100644--- a/docs/guides/sync-unblock-runbook.md+++ b/docs/guides/sync-unblock-runbook.md@@ -130,6 +130,7 @@ Every hold and error has three fields, from one table| `origin_conflict_decision` | page | none | yes | always: the pages differ, their ids conflict or none is the page the path names || `file_unreadable` | page | none | yes | always: only a change to the checkout makes the file readable || `absent_from_worktree` | page | none | yes | always: only a person decides whether the file comes back or its deletion is committed |+| `unsupported_path` | page | none | yes | always: only a rename makes the name a page path || `revision_conflict` | page | retry | no | the same path fails again after a rerun || `page_identity_changed` | page | retry | no | the same path fails again after a rerun || `pinned_git_worktree_conflict` | page | retry | no | the same path fails again after a rerun |diff --git a/src/core/persistence/public-category.ts b/src/core/persistence/public-category.tsindex 2b81d502b9..4c7e43f2ab 100644--- a/src/core/persistence/public-category.ts+++ b/src/core/persistence/public-category.ts@@ -39,7 +39,7 @@ export const PUBLIC_BY_CODE: Readonly<Record<string, PublicCategory>> = {rename_identity_unreadable: 'content_refused', rename_reconcile_failed: 'conflict',file_too_large: 'content_refused', content_rejected: 'content_refused', managed_image_sync_unsupported: 'content_refused',purged_content: 'content_refused', write_gate_rejected: 'content_refused', frontmatter_alias_limit: 'content_refused',- file_unreadable: 'content_refused', absent_from_worktree: 'file_missing',+ file_unreadable: 'content_refused', absent_from_worktree: 'file_missing', unsupported_path: 'content_refused',file_database_drift: 'drift', raw_file_changed: 'drift', pending_import: 'transient',source_binding_changed: 'config', unsafe_file_target: 'config',canonical_file_missing: 'file_missing',diff --git a/src/core/persistence/sync-fault-class.ts b/src/core/persistence/sync-fault-class.tsindex b4266af0b0..1fb864dade 100644--- a/src/core/persistence/sync-fault-class.ts+++ b/src/core/persistence/sync-fault-class.ts@@ -100,6 +100,9 @@ export const SYNC_FAULT_TABLE: ReadonlyArray<SyncFaultRule> = [// GBRA-133: a committed file missing from the working tree (a sparse checkout, a deletion not committed); classic sync holds it.{ code: 'absent_from_worktree', class: 'page', safe_actions: ['none'], needs_human: true, escalate: 'always: only a person decides whether the file comes back or its deletion is committed',human_reason: 'The file is committed but missing from the checkout; a person restores it (git restore, or widens the sparse checkout) so the next sync imports it, or commits the deletion with gbrain git commit-push, which clears the hold.' },+ // GBRA-133: a committed file name that is not valid UTF-8 or holds a control character cannot be a page path; classic sync holds it.+ { code: 'unsupported_path', class: 'page', safe_actions: ['none'], needs_human: true, escalate: 'always: only a rename makes the name a page path',+ human_reason: 'The file name is not valid UTF-8 or contains a control character, so it cannot be a page path; a person renames the file to a valid name and commits, and the next sync imports it and clears the hold.' },// Older releases recorded these as run failures; a rerun on this release holds the page instead.{ code: 'revision_conflict', class: 'page', safe_actions: ['retry'], needs_human: false, escalate: 'the same path fails again after a rerun' },{ code: 'page_identity_changed', class: 'page', safe_actions: ['retry'], needs_human: false, escalate: 'the same path fails again after a rerun' },diff --git a/test/pathological/s-classic-byte-paths.test.ts b/test/pathological/s-classic-byte-paths.test.tsindex a0e80bbc23..62e82679f3 100644--- a/test/pathological/s-classic-byte-paths.test.ts+++ b/test/pathological/s-classic-byte-paths.test.ts@@ -94,6 +94,15 @@ describe('unsupported_path key, display and fix (no engine)', () => {}} finally { rmSync(dir, { recursive: true, force: true }); }});++ test('sync status classes the hold as one page waiting on a rename, not an unknown systemic fault', async () => {+ const { classifySyncFault } = await import('../../src/core/persistence/sync-fault-class.ts');+ const { publicCategory } = await import('../../src/core/persistence/public-category.ts');+ const verdict = classifySyncFault({ code: 'unsupported_path', detail: 'not_utf8' });+ expect({ class: verdict.class, safe_actions: verdict.safe_actions, needs_human: verdict.needs_human }).toEqual({ class: 'page', safe_actions: ['none'], needs_human: true });+ expect(verdict.human_reason).toContain('renames the file');+ expect(publicCategory({ code: 'unsupported_path' })).toBe('content_refused');+ });});describe('sync Git reads take no optional lock (GIT_OPTIONAL_LOCKS=0)', () => {