Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: #7341 covers a scaffolding file whose slug: is its bare leaf name

garrytanbd5d72b56744
diff --git a/docs/guides/live-sync.md b/docs/guides/live-sync.md
index 0dd12c16af..648ac579d8 100644
--- a/docs/guides/live-sync.md
+++ b/docs/guides/live-sync.md
@@ -346,8 +346,8 @@ indexed at such a path is kept (#1433). This is `sync.metafile_pages`:
(`gbrain config set sync.metafile_pages off`). The first sync after the upgrade,
or after setting it back to `typed`, imports the typed files already in the
tree once; it deletes or rewrites nothing else. A meta file whose frontmatter
-`slug:` names another page (`slug: projects/acme-example` in
-`projects/acme-example/index.md`) stays skipped, since the slug conflicts with
+`slug:` names another page (`slug: projects/acme-example`, or the bare
+`slug: acme-example`, in `projects/acme-example/index.md`) stays skipped, since the slug conflicts with
its path; remove the `slug:` line to make it a page (#7341).
A dot-directory you deliberately keep content in (say `.decisions/`) can be
diff --git a/llms-full.txt b/llms-full.txt
index 215f9399d6..8214074fc0 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -7194,8 +7194,8 @@ indexed at such a path is kept (#1433). This is `sync.metafile_pages`:
(`gbrain config set sync.metafile_pages off`). The first sync after the upgrade,
or after setting it back to `typed`, imports the typed files already in the
tree once; it deletes or rewrites nothing else. A meta file whose frontmatter
-`slug:` names another page (`slug: projects/acme-example` in
-`projects/acme-example/index.md`) stays skipped, since the slug conflicts with
+`slug:` names another page (`slug: projects/acme-example`, or the bare
+`slug: acme-example`, in `projects/acme-example/index.md`) stays skipped, since the slug conflicts with
its path; remove the `slug:` line to make it a page (#7341).
A dot-directory you deliberately keep content in (say `.decisions/`) can be
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 4ccf2088ae..4ff7e36ede 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -1157,7 +1157,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
// #7364 (GBRA-133 wave 3). `since` is restamped at the merge slot.
{ since: '0.60.397.0', text: '`gbrain sources reconcile --apply` that commits and leaves the page and its canonical file agreeing now clears that file\'s `preparation_stalled` or `write_interrupted` sync hold (the write owner stalled, not the file), and its result names the cleared row (`cleared_hold`); a file that still differs keeps its hold. A page write refused for a held file now names the hold row it read in its message (`Hold row: source <id>, incarnation <uuid>.`), and `gbrain sources retry-held --json` reports the rows it read (`hold_rows`) and each held file\'s `fingerprint`, so a refusal naming a row the listing does not show can be told apart (#7364).' },
// #7341 (GBRA-133 wave 3). `since` is restamped at the merge slot.
- { since: '0.60.397.0', text: 'A nested folder-scaffolding file (`index.md`, `README.md`, `log.md`, `schema.md`, `RESOLVER.md`) whose frontmatter `slug:` names another page, for example `slug: projects/acme-example` in `projects/acme-example/index.md`, is skipped by sync again, as before 0.60.337.0, even when it has `type:` or `title:`. Since then it was imported only to be held `frontmatter_slug_conflict`, so a folder of such hubs became one hold per file. The next sync releases those holds. One whose `slug:` is its own path slug, or that has none, is still a page; remove the `slug:` line to make a skipped one a page.' },
+ { since: '0.60.397.0', text: 'A nested folder-scaffolding file (`index.md`, `README.md`, `log.md`, `schema.md`, `RESOLVER.md`) whose frontmatter `slug:` names another page, for example `slug: projects/acme-example` or just `slug: acme-example` in `projects/acme-example/index.md`, is skipped by sync again, as before 0.60.337.0, even when it has `type:` or `title:`. Since then it was imported only to be held `frontmatter_slug_conflict`, so a folder of such hubs became one hold per file. The next sync releases those holds. One whose `slug:` is its own path slug, or that has none, is still a page; remove the `slug:` line to make a skipped one a page.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/test/sync-metafile-foreign-slug-7341.test.ts b/test/sync-metafile-foreign-slug-7341.test.ts
index 88700eb486..ac1f12b03a 100644
--- a/test/sync-metafile-foreign-slug-7341.test.ts
+++ b/test/sync-metafile-foreign-slug-7341.test.ts
@@ -1,7 +1,7 @@
/**
* #7341: since GBRA-150 a managed sync imports a typed nested scaffolding file (`index.md`, `README.md`, …) as a page.
* One whose frontmatter `slug:` names another page (typically its folder: `slug: dir/x` in `dir/x/index.md`) could
- * only be held `frontmatter_slug_conflict`, so a folder of generated hub pages turned into hundreds of holds after the
+ * only be held `frontmatter_slug_conflict` (it may name the folder, or just its leaf: `slug: x`), so a folder of generated hub pages turned into hundreds of holds after the
* upgrade. Such a file stays scaffolding, as it was before GBRA-150:
* - it is not imported and not held, and the source converges;
* - a hold an earlier version wrote for it is released by the next sync;
@@ -29,6 +29,7 @@ const FILES: Record<string, string> = {
'projects/beta-example/index.md': hub('beta-example', '"projects/beta-example"'),
'projects/gamma-example/index.md': hub('gamma-example', 'projects/gamma-example/index'),
'projects/delta-example/index.md': hub('delta-example', null),
+ 'projects/epsilon-example/index.md': hub('epsilon-example', 'epsilon-example'),
'notes/a.md': '---\ntitle: A\n---\nA synthetic observation.\n',
};
const holdCodes = async (engine: BrainEngine) => Object.fromEntries((await engine.executeRaw<{ record: { path: string; code: string } }>(