Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chore(facts): register relink in the CLI table, flag registry, goldens and writer inventory (#5836)
garrytan54f2c0a367cf
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsvindex 9e3a09e81a..8063cc475e 100644--- a/docs/architecture/canonical-writers.tsv+++ b/docs/architecture/canonical-writers.tsv@@ -68,6 +68,7 @@ src/core/facts/backstop.ts 3 engine_guard Canonical table SQL trigger requires csrc/core/facts/fence-write.ts 2 coordinator Managed brains publish fence rows through the managed_facts_entity intent before any file or row write; unmanaged writes keep the source filesystem ownership check before editing canonical fact fences.src/core/facts/forget.ts 4 filesystem_guard Managed callers journal withdrawal; legacy filesystem helper and the supersession-only expiry require coordinated write.src/core/facts/proposal-supersede.ts 4 filesystem_guard System One S9 accept/undo (local CLI only): unmanaged brains update the two facts rows and strike or restore the fence row in one transaction under the source filesystem lock and page lock, publishing the file last; managed brains run the same change as the coordinator mutation decide_proposal.+src/core/facts/relink-publish.ts 2 coordinator #5836 facts relink (local CLI only, managed or not): the coordinator mutation relink_facts re-locks each pinned unlinked fact, moves linked rows onto their entity fence positions (and retires exact duplicates expired and detached) ahead of the page's canonical projection in the same publication, then restores take resolutions and records the attempt and conflict-sweep handoff in that transaction.src/core/facts/withdrawal-schema.ts 1 schema Migration v174 DDL/backfill expires fact rows that match a folded withdrawal fingerprint; schema installation runs under coordinated activation, which quiesces canonical writers.src/core/facts/withdrawal.ts 2 coordinator Publication is transaction-scoped under admitted authority, source/page guards and revision checks.src/core/facts/write-single.ts 2 coordinator Managed brains publish the single fact through the managed_facts_entity intent before the legacy supersession or DB-only insert; those legacy writes run only unmanaged and stay trigger-guarded.diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.tsindex 2431787672..0d76efcc54 100644--- a/src/core/cli-flag-registry.generated.ts+++ b/src/core/cli-flag-registry.generated.ts@@ -56,6 +56,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {'export': ['--background', '--brain', '--dir', '--explain', '--fix', '--follow', '--help', '--json', '--progress-interval', '--progress-json', '--quiet', '--repo', '--restore-only', '--slug-prefix', '--source', '--timeout', '--type'],'extract': ['--admin-intent', '--after-slug', '--apply-preview', '--background', '--backup-verified', '--brain', '--break-lock', '--by-mention', '--catch-up', '--checkpoint', '--concurrency', '--confirm', '--db-url', '--dir', '--dry-run', '--expected-epoch', '--expected-state', '--explain', '--follow', '--from-meetings', '--help', '--include-frontmatter', '--infer-dates', '--json', '--kind', '--limit', '--manifest', '--ner', '--pack', '--path', '--progress-interval', '--progress-json', '--prune-orphans', '--quiet', '--rebuild', '--repair-attendance', '--self-transfer', '--since', '--source', '--source-id', '--stale', '--timeout', '--type', '--verbose', '--workers', '--yes'],'extract-conversation-facts': ['--admin-intent', '--background', '--brain', '--concurrency', '--confirm-destructive', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--help', '--json', '--limit', '--manifest', '--max-cost', '--max-cost-usd', '--max-runtime', '--no-embedding', '--override-disabled', '--path', '--pglite', '--progress-interval', '--progress-json', '--quiet', '--segment-limit', '--self-transfer', '--since', '--sleep', '--slug', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--types', '--url', '--workers', '--yes'],+ 'facts': ['--admin-intent', '--after-id', '--brain', '--dry-run', '--entity', '--examples', '--expected-state', '--help', '--include-private', '--json', '--limit', '--max-cost-usd', '--max-usd', '--no-conflict-queue', '--no-llm', '--path', '--retry-model', '--since', '--source'],'features': ['--all', '--auto', '--auto-fix', '--background', '--batch-size', '--brain', '--by-mention', '--catch-up', '--concurrency', '--dir', '--explain', '--facts', '--from-meetings', '--help', '--images', '--include-frontmatter', '--include-null-signature', '--infer-dates', '--json', '--kind', '--ner', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--path', '--priority', '--prune-orphans', '--rebuild', '--refresh', '--repo', '--since', '--slugs', '--source', '--source-id', '--stale', '--target', '--type', '--verbose', '--workers'],'files': ['--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-pointer', '--page', '--progress-interval', '--progress-json', '--quiet', '--retry-failed', '--source', '--timeout', '--type', '--yes'],'forget': ['--brain', '--help', '--json', '--reason', '--request-id', '--source'],diff --git a/test/fixtures/goldens/cli/dispatch-phase.json b/test/fixtures/goldens/cli/dispatch-phase.jsonindex 04ccea0843..5e98eecea6 100644--- a/test/fixtures/goldens/cli/dispatch-phase.json+++ b/test/fixtures/goldens/cli/dispatch-phase.json@@ -738,6 +738,25 @@"thinClient": "refuse","thinClientRoutedSubcommands": []},+ "facts": {+ "hasSwitchCase": false,+ "phase": "pre-connect-own-engine",+ "preConnectRules": [+ {+ "condition": "command === 'facts'",+ "connectsEngine": true,+ "refusesThinClient": false,+ "routesThinClient": false,+ "terminates": true,+ "thinClientCheck": false,+ "unconditionalFor": [+ "facts"+ ]+ }+ ],+ "thinClient": "refuse",+ "thinClientRoutedSubcommands": []+ },"features": {"hasSwitchCase": true,"phase": "post-connect",diff --git a/test/fixtures/goldens/cli/help-and-errors.json b/test/fixtures/goldens/cli/help-and-errors.jsonindex 3ac9d41398..d1b4e1e786 100644--- a/test/fixtures/goldens/cli/help-and-errors.json+++ b/test/fixtures/goldens/cli/help-and-errors.json@@ -108,6 +108,7 @@" compile-context --target <t> Compile a deterministic, scanned, budgeted context"," [--budget N] [--check] file (claude-code | codex | openclaw)"," decide <status|probe|enable|...> System One decision support (Jev); every slot off by default",+ " facts relink [--dry-run] Link facts saved without an entity to the entity they name"," check-resolvable [--json] [--fix] Validate skill tree (reachability/MECE/DRY)"," report --type <name> --content ... Save timestamped report to brain/reports/","",@@ -314,6 +315,7 @@" compile-context --target <t> Compile a deterministic, scanned, budgeted context"," [--budget N] [--check] file (claude-code | codex | openclaw)"," decide <status|probe|enable|...> System One decision support (Jev); every slot off by default",+ " facts relink [--dry-run] Link facts saved without an entity to the entity they name"," check-resolvable [--json] [--fix] Validate skill tree (reachability/MECE/DRY)"," report --type <name> --content ... Save timestamped report to brain/reports/","",@@ -520,6 +522,7 @@" compile-context --target <t> Compile a deterministic, scanned, budgeted context"," [--budget N] [--check] file (claude-code | codex | openclaw)"," decide <status|probe|enable|...> System One decision support (Jev); every slot off by default",+ " facts relink [--dry-run] Link facts saved without an entity to the entity they name"," check-resolvable [--json] [--fix] Validate skill tree (reachability/MECE/DRY)"," report --type <name> --content ... Save timestamped report to brain/reports/","",diff --git a/test/fixtures/goldens/cli/membership-sets.json b/test/fixtures/goldens/cli/membership-sets.jsonindex 2db3c0b660..253f3365f8 100644--- a/test/fixtures/goldens/cli/membership-sets.json+++ b/test/fixtures/goldens/cli/membership-sets.json@@ -124,6 +124,7 @@"export","extract","extract-conversation-facts",+ "facts","features","files","forget",@@ -220,6 +221,7 @@"export","extract","extract-conversation-facts",+ "facts","friction","frontmatter","google",@@ -299,6 +301,7 @@"eval","extract","extract-conversation-facts",+ "facts","files","integrity","migrate",@@ -335,6 +338,7 @@"eval","extract","extract-conversation-facts",+ "facts","files","integrity","jobs",