Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

sync: a nested scaffolding file whose slug: names another page stays scaffolding (#7341)

garrytan459975fd29bd
diff --git a/docs/architecture/key-files/files-and-sync-2.md b/docs/architecture/key-files/files-and-sync-2.md
index 00a5e03a21..8333ab2a97 100644
--- a/docs/architecture/key-files/files-and-sync-2.md
+++ b/docs/architecture/key-files/files-and-sync-2.md
@@ -15,7 +15,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/sync-upstream-rewrite.ts` — classic sync's upstream watch for a source that syncs with pull (GBRA-133 S-58/S-59). `recordUpstreamBeforeFetch` (called by `src/commands/sync/preflight.ts` before every pull) stores in `sources.config.upstream_baseline` the upstream commit HEAD contains, only when HEAD contains it, so a rewritten upstream fetched earlier never replaces it; `settleUpstreamAfterPull` records the new baseline and clears `sources.config.upstream_divergence` after a pull that fast-forwarded or was up to date, and after a pull that failed with HEAD and `@{upstream}` diverged stores `upstream_rewritten` (baseline not an ancestor of the new upstream), `upstream_unknown` (no baseline or its object is gone) or `upstream_diverged` (baseline contained: plain local commits); nothing is classified while a rebase, merge, cherry-pick or revert marker (`GIT_OPERATION_MARKERS` in `src/core/git/commit-push.ts`) exists. Best effort: it never throws into the sync and never writes a sync-failure ledger row. `upstreamFix` is the typed next step (`ask_user` reset bound to the observed SHAs for rewritten/unknown, never a merge; `gbrain git commit-push --pull` for diverged; both `then` the sync). Read by `performSyncInner` (`result.upstream`), `buildSingleSyncJsonEnvelope`, `gbrain sources status --json` (`upstream`) and doctor `sync_failures` (`details.upstream`, warn, local fix; remote callers get counts only). Pinned by `test/pathological/s-58-upstream-rewrite.test.ts`.
- `src/core/sync-attempt.ts` + `src/commands/doctor/sync-outcome.ts` — doctor `sync_freshness` for a source with no successful sync (`last_sync_at` NULL, #4960). `readLastSyncAttempt` reads, read-only, the newest `sync` Minions job of the source and, on a managed brain, `readSyncStatus` (holds, last error, cursor, its `next`); nothing found is `no_attempt`, an unreadable read is `no_attempt` with `unreadable`. A live first-sync lock inside the staleness ceiling is `warn` (`sync_first_run_in_progress`, fix `next: wait`); no lock is `fail` (`sync_no_successful_sync`) naming last attempt, result and held count, with a per-`reason` fix (`attempt_queued` wait, `holds_pending` the managed `next` or `sync status`, `last_attempt_unsuccessful` inspect the job then retry, `no_attempt` retry). Entries land in `details.no_successful_sync[]`; these sources stay in `stale_count`. Test: `test/doctor-sync-freshness-outcome-4960.test.ts`.
-- `src/core/sync.ts` — Pure sync functions (manifest parsing, filtering, slug conversion). Exported `pruneDir(name: string): boolean` is the single source of truth for descent-time directory exclusion across walkers — blocks `node_modules` (no leading dot, so a naive walker would descend into it and inflate MISSING_OPEN counts via vendor packages), `vendor`/`dist`/`build`/`venv`, dot-prefix dirs, and `*.raw` sidecars — NOT `ops/`, which is ordinary user content (the bundled daily-task-manager stores `ops/tasks` there); `isSyncable` applies it per path segment, and `walkMarkdownFiles` in `src/commands/extract.ts` + `listTextFiles` in `src/core/cycle/transcript-discovery.ts` consult it BEFORE recursing to save the IO of walking thousands of vendor files. `manageGitignore` worktree discriminator matches the gitdir path segment (`/modules/<name>` = submodule, `/worktrees/<name>` = worktree, per Git's documented layout) so Conductor worktrees (first-class repos) get `.gitignore` management for storage-tiering. The sync-failure ledger (failure store, error classifier, the shared bookmark gate, and the doctor severity rule) lives in `src/core/sync-failure-ledger.ts`; `sync.ts` re-exports `classifyErrorCode`, `summarizeFailuresByCode`, `loadSyncFailures`, `unacknowledgedSyncFailures`, `acknowledgeSyncFailures`, `recordSyncFailures`, `decideSyncFailureSeverity`, `applySyncFailureGate`, and the `SyncFailure` type for backward-compatible imports — see its entry below. `isSyncable` factored through private `classifySync(path, opts): SyncableReason | null`; exported companion `unsyncableReason(path, opts)` returns the same tagged reason or null when syncable. `SYNC_SKIP_FILES` is a named export (the canonical metafile basenames `schema.md`, `index.md`, `log.md`, `README.md`, `RESOLVER.md`, skipped at any depth unless `SyncableOptions.metafilePage` says a nested one is a page: `metafileIsPage(path, head, mode)` is true for an `isNestedSkipMetafile` path whose closed leading frontmatter has a non-empty top-level `type:` or `title:` under `sync.metafile_pages` `typed`, the one default `DEFAULT_METAFILE_PAGES_MODE`; `off` skips every metafile; `readMetafilePagesMode` reads the key); `SYNC_ROOT_SKIP_FILES` (#5186, W14 P1.5b) adds the bootstrap scaffolding `AGENTS.md` / `CLAUDE.md` at depth 0 only, and `isSyncMetafile(path)` is the one predicate `classifySync` and the bulk-import collector (`commands/import.ts`) share (the managed effect scan's `isMetafilePage` in `persistence/effects.ts` adds the head of the file on disk, so a typed nested metafile page is mirrored and published like any page), so an earlier-indexed root `agents` page survives under the #1433 guard (`test/sync-root-agents-metafile.test.ts`). `SyncableReason` union: `'metafile' | 'strategy' | 'pruned-dir' | 'include-glob-miss' | 'exclude-glob-hit' | 'malformed-path'`. Malformed filenames are TWO-TIER: `hasMalformedPathSegment` (ADMISSION — control chars on any path; square brackets on `.md`/`.mdx` paths only, so code-strategy lanes keep indexing `app/[id]/page.tsx` framework layouts) vs `isPoisonedPath` (DESTRUCTION — only the injection signature `](` or control chars; sync's row-DELETING lanes gate on this so a bare-bracket markdown row already in the DB survives reconcile while its file exists). `sanitizePathForDisplay` scrubs control bytes + caps length before echoing such paths. The un-syncable cleanup loop (`sweepUnsyncableModified` in `src/commands/sync/deletes.ts`) guards on `unsyncableReason(path)` being `'metafile'` OR `'pruned-dir'` so previously-indexed metafile pages AND deliberately put-created pages under pruned dirs survive every re-sync. Does NOT cover `manifest.deleted` (the upstream filter already strips metafiles). Pinned by `test/sync-isSyncable-shape.test.ts` (15 cases, duality contract) + `test/sync-metafile-skip.test.ts` (3 PGLite cases incl. the renamed `.md → .txt` negative). `pruneDir`: `pruneDir(name, parentDir?)` extended with optional `parentDir`. When provided, additionally rejects directories containing `.git` as a FILE — the git submodule gitfile pattern (regular repos have `.git` as a DIRECTORY; submodules as a file pointing into the parent's `.git/modules/`). Sync + extract walkers thread `parentDir` so the gitfile-as-FILE check fires per descend step. Best-effort: `statSync` failures fall through and treat as a normal dir. Prevents phantom imports from a worktree-with-submodules sync walking into submodule trees. Pinned by `test/sync-walker-submodule.test.ts`. The legacy failure ledger re-export is distinct from managed cursor-keyed mirrors: repeat managed observation does not inflate attempts, success clears only the matching cursor, and managed failures cannot be acknowledged or auto-skipped. `isMultimodalEnabled(env)` (`GBRAIN_EMBEDDING_MULTIMODAL=true`) is the one predicate managed discovery, the hold re-screen, `embed --stale`, the blocked-projection hint and doctor `image_embedding_coverage` read for whether images are imported and embedded.
+- `src/core/sync.ts` — Pure sync functions (manifest parsing, filtering, slug conversion). Exported `pruneDir(name: string): boolean` is the single source of truth for descent-time directory exclusion across walkers — blocks `node_modules` (no leading dot, so a naive walker would descend into it and inflate MISSING_OPEN counts via vendor packages), `vendor`/`dist`/`build`/`venv`, dot-prefix dirs, and `*.raw` sidecars — NOT `ops/`, which is ordinary user content (the bundled daily-task-manager stores `ops/tasks` there); `isSyncable` applies it per path segment, and `walkMarkdownFiles` in `src/commands/extract.ts` + `listTextFiles` in `src/core/cycle/transcript-discovery.ts` consult it BEFORE recursing to save the IO of walking thousands of vendor files. `manageGitignore` worktree discriminator matches the gitdir path segment (`/modules/<name>` = submodule, `/worktrees/<name>` = worktree, per Git's documented layout) so Conductor worktrees (first-class repos) get `.gitignore` management for storage-tiering. The sync-failure ledger (failure store, error classifier, the shared bookmark gate, and the doctor severity rule) lives in `src/core/sync-failure-ledger.ts`; `sync.ts` re-exports `classifyErrorCode`, `summarizeFailuresByCode`, `loadSyncFailures`, `unacknowledgedSyncFailures`, `acknowledgeSyncFailures`, `recordSyncFailures`, `decideSyncFailureSeverity`, `applySyncFailureGate`, and the `SyncFailure` type for backward-compatible imports — see its entry below. `isSyncable` factored through private `classifySync(path, opts): SyncableReason | null`; exported companion `unsyncableReason(path, opts)` returns the same tagged reason or null when syncable. `SYNC_SKIP_FILES` is a named export (the canonical metafile basenames `schema.md`, `index.md`, `log.md`, `README.md`, `RESOLVER.md`, skipped at any depth unless `SyncableOptions.metafilePage` says a nested one is a page: `metafileIsPage(path, head, mode)` is true for an `isNestedSkipMetafile` path whose closed leading frontmatter has a non-empty top-level `type:` or `title:` under `sync.metafile_pages` `typed` and no top-level `slug:` naming another page (#7341: such a file stays scaffolding instead of being held `frontmatter_slug_conflict`), the one default `DEFAULT_METAFILE_PAGES_MODE`; `off` skips every metafile; `readMetafilePagesMode` reads the key); `SYNC_ROOT_SKIP_FILES` (#5186, W14 P1.5b) adds the bootstrap scaffolding `AGENTS.md` / `CLAUDE.md` at depth 0 only, and `isSyncMetafile(path)` is the one predicate `classifySync` and the bulk-import collector (`commands/import.ts`) share (the managed effect scan's `isMetafilePage` in `persistence/effects.ts` adds the head of the file on disk, so a typed nested metafile page is mirrored and published like any page), so an earlier-indexed root `agents` page survives under the #1433 guard (`test/sync-root-agents-metafile.test.ts`). `SyncableReason` union: `'metafile' | 'strategy' | 'pruned-dir' | 'include-glob-miss' | 'exclude-glob-hit' | 'malformed-path'`. Malformed filenames are TWO-TIER: `hasMalformedPathSegment` (ADMISSION — control chars on any path; square brackets on `.md`/`.mdx` paths only, so code-strategy lanes keep indexing `app/[id]/page.tsx` framework layouts) vs `isPoisonedPath` (DESTRUCTION — only the injection signature `](` or control chars; sync's row-DELETING lanes gate on this so a bare-bracket markdown row already in the DB survives reconcile while its file exists). `sanitizePathForDisplay` scrubs control bytes + caps length before echoing such paths. The un-syncable cleanup loop (`sweepUnsyncableModified` in `src/commands/sync/deletes.ts`) guards on `unsyncableReason(path)` being `'metafile'` OR `'pruned-dir'` so previously-indexed metafile pages AND deliberately put-created pages under pruned dirs survive every re-sync. Does NOT cover `manifest.deleted` (the upstream filter already strips metafiles). Pinned by `test/sync-isSyncable-shape.test.ts` (15 cases, duality contract) + `test/sync-metafile-skip.test.ts` (3 PGLite cases incl. the renamed `.md → .txt` negative). `pruneDir`: `pruneDir(name, parentDir?)` extended with optional `parentDir`. When provided, additionally rejects directories containing `.git` as a FILE — the git submodule gitfile pattern (regular repos have `.git` as a DIRECTORY; submodules as a file pointing into the parent's `.git/modules/`). Sync + extract walkers thread `parentDir` so the gitfile-as-FILE check fires per descend step. Best-effort: `statSync` failures fall through and treat as a normal dir. Prevents phantom imports from a worktree-with-submodules sync walking into submodule trees. Pinned by `test/sync-walker-submodule.test.ts`. The legacy failure ledger re-export is distinct from managed cursor-keyed mirrors: repeat managed observation does not inflate attempts, success clears only the matching cursor, and managed failures cannot be acknowledged or auto-skipped. `isMultimodalEnabled(env)` (`GBRAIN_EMBEDDING_MULTIMODAL=true`) is the one predicate managed discovery, the hold re-screen, `embed --stale`, the blocked-projection hint and doctor `image_embedding_coverage` read for whether images are imported and embedded.
- `src/core/sync-metafile-pages.ts` — the head readers behind `sync.metafile_pages`: `metafilePagePredicate(mode, read, rootRelative)` (memoized, the `SyncableOptions.metafilePage` every classifying caller passes), `diskMetafileHeads(root)` (regular files only, never a symlink), `gitMetafileHeads(gitRoot, commits)` (first commit that has the path; `prime` batch-reads blobs a caller already streams through one `cat-file --batch-check` plus one `--batch`), `firstMetafileHead` (disk, then the last synced blob, so a deleted file is judged as last committed), `listMetafileNamedBlobs` (one `ls-tree`), and the classic backfill marker `sync.metafile_pages.applied.<source>` (`metafileBackfillDue` / `recordMetafilePagesApplied`, written with the bookmark): a source that has not finished a sync under `typed` adds its tree's nested metafile-named files to the next delta once. Managed sync instead folds the mode into the pass selection fingerprint (`sync-pass-run.ts`; unchanged under `off`). Only metafile-named paths are ever read. `config set sync.metafile_pages` refuses a value outside `typed | off` (`src/commands/config/sync-metafile-pages-value.ts`); the restore check and doctor `missing_recorded_files` (`persistence/detached-pages.ts`) judge a recorded nested metafile with the same disk-then-last-synced predicate `sync --full` uses. Pinned by `test/sync-metafile-pages.test.ts` (classic) and `test/persistence-sync-metafile-pages.test.ts` (managed, PGLite and Postgres).
- `src/core/sync-rename-identity.ts` — the one confirmation stage for inexact Git renames (#6729). `confirmRenameIdentities` reads committed sides through one `git cat-file --batch` stream (64 KiB heads) and the dirty tree's working side from disk, with id and `slug:` from the frontmatter and the title by parseMarkdown precedence (frontmatter, then the first H1, no filename fallback; `markdown.ts` `explicitMarkdownTitle`), the old side taking the title its page row stores; it keeps an R<100 pair on a same-slug respelling, a unique shared `id`, or with no id on either side a unique `slug:` line or title (titles also unique among live pages). `explicitIdVeto` is the one explicit-id veto the managed takeovers consult (also the #6727 legacy-slug adoption in `sync-discovery.ts`: two different explicit ids hold `legacy_slug_conflict`, reason `explicit_id_conflict`). An add whose id uniquely matches a delete in the range becomes a rename only with continuity (same file name, title or bytes; `digest` is the sha256 of a file that fits the head read), as decideImportIdentity asks of a move. Downgraded pairs record `read.from` / `read.to`. A dirty-tree verdict is bound to the bytes it read: each kept rename carries `identityHead` (sha256 of the first 64 KiB), classic `applyRename` re-checks it before the identity moves and managed `readSyncContent` refuses `source_changed` on frozen bytes that differ. GBRA-133 S-51: an id, `slug:` or title holding U+0000 or a lone surrogate is absent before any SQL (never normalized), so the pair takes the ordinary unconfirmed-rename rules; both identity reads batch every path and, on SQLSTATE 22021/22P05 only, retry path by path, and the inexact pairs carrying a refused value come back in `heldRenames` (classic `preflight.ts` holds them as `rename_identity_unreadable`, keeping the old page; with `holdUnreadable` unset, as in managed discovery, the error is rethrown). `redecideHeldRename` decides a held pair again from the kept page's stored id and title once its file changes. Any other error propagates. Pinned by `test/pathological/s-51-rename-identity-unreadable.test.ts`.
diff --git a/docs/guides/live-sync.md b/docs/guides/live-sync.md
index 8f8d912627..0dd12c16af 100644
--- a/docs/guides/live-sync.md
+++ b/docs/guides/live-sync.md
@@ -345,7 +345,10 @@ indexed at such a path is kept (#1433). This is `sync.metafile_pages`:
`typed` (the default) or `off`, which skips every meta file as before
(`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.
+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
+its path; remove the `slug:` line to make it a page (#7341).
A dot-directory you deliberately keep content in (say `.decisions/`) can be
waived back in with `--include-hidden '<glob>'` on `gbrain sync` — the glob
diff --git a/src/core/sync.ts b/src/core/sync.ts
index cd2e95ea5a..fa073cbbe0 100644
--- a/src/core/sync.ts
+++ b/src/core/sync.ts
@@ -614,12 +614,15 @@ export function isNestedSkipMetafile(path: string): boolean {
}
const METAFILE_PAGE_KEY_RE = /^(?:type|title|"type"|"title"|'type'|'title')[ \t]*:(?:[ \t]+(.*))?$/;
+const METAFILE_SLUG_KEY_RE = /^(?:slug|"slug"|'slug')[ \t]*:[ \t]+(.+)$/;
/**
* Whether the file at `path` (relative to its source root) is imported as a page although it is named like scaffolding:
* a non-root `SYNC_SKIP_FILES` name under mode `typed` whose head opens with a closed frontmatter fence holding a
* top-level `type:` or `title:` key with a value. `head` is the file's text (only the first `METAFILE_HEAD_BYTES`
* characters are read); undefined (absent or unreadable) is bare. Every other path returns false.
+ * #7341: a top-level `slug:` naming another page (often the folder, `dir/x` for `dir/x/index.md`) keeps the file
+ * scaffolding, as before GBRA-150: importing it could only hold it `frontmatter_slug_conflict`.
*/
export function metafileIsPage(path: string, head: string | undefined, mode: MetafilePagesMode): boolean {
if (mode !== 'typed' || head === undefined || !isNestedSkipMetafile(path)) return false;
@@ -627,12 +630,16 @@ export function metafileIsPage(path: string, head: string | undefined, mode: Met
let i = 0;
while (i < lines.length && lines[i]!.trim() === '') i++;
if (lines[i]?.trimEnd() !== '---') return false;
- let typed = false;
+ let typed = false, foreignSlug = false;
+ const own = slugifyPath(path);
for (i++; i < lines.length; i++) {
const line = lines[i]!;
- if (/^---[ \t]*$/.test(line)) return typed;
+ if (/^---[ \t]*$/.test(line)) return typed && !foreignSlug;
const value = METAFILE_PAGE_KEY_RE.exec(line)?.[1]?.trim();
if (value && !value.startsWith('#') && !/^(?:null|~)$/i.test(value)) typed = true;
+ const declared = METAFILE_SLUG_KEY_RE.exec(line)?.[1]?.trim().replace(/^(['"])(.*)\1$/, '$2');
+ // A source with a Git-root slug mode prefixes its scope, so the file's own slug may end the declared one.
+ if (declared && !declared.startsWith('#')) foreignSlug = slugifyPath(declared) !== own && !slugifyPath(declared).endsWith(`/${own}`);
}
return false;
}
diff --git a/test/sync-metafile-foreign-slug-7341.test.ts b/test/sync-metafile-foreign-slug-7341.test.ts
new file mode 100644
index 0000000000..88700eb486
--- /dev/null
+++ b/test/sync-metafile-foreign-slug-7341.test.ts
@@ -0,0 +1,63 @@
+/**
+ * #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
+ * 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;
+ * - a typed index whose `slug:` is its own path slug, and one with no `slug:`, still import as pages.
+ * Real PGLite (and Postgres when DATABASE_URL is set), real managed syncs and real Git.
+ */
+import { describe, expect, test } from 'bun:test';
+import { execFileSync } from 'node:child_process';
+import { mkdirSync, writeFileSync } from 'node:fs';
+import { join } from 'node:path';
+import type { BrainEngine } from '../src/core/engine.ts';
+import { RECOVERY_VERSION } from '../src/core/markdown.ts';
+import { writeGitHold } from '../src/core/persistence/sync-holds.ts';
+import { performManagedSync } from '../src/core/persistence/sync-run.ts';
+import { shadowConvergence } from '../src/core/persistence/sync-pass.ts';
+import { managedBrain } from './helpers/managed-brain.ts';
+import { requirePostgresTestDatabase, testBackends } from './helpers/test-backends.ts';
+
+const git = (root: string, ...args: string[]) => execFileSync('git', ['-C', root, '-c', 'user.name=Example', '-c', '[email protected]',
+ '-c', 'commit.gpgsign=false', ...args], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
+const OPTS = { sourceId: 'default', noPull: true, noEmbed: true, noExtract: true };
+const hub = (name: string, slug: string | null) => `---\ntype: project\ntitle: ${name}\n${slug === null ? '' : `slug: ${slug}\n`}---\n\nThe project hub of ${name}.\n`;
+const FILES: Record<string, string> = {
+ 'projects/acme-example/index.md': hub('acme-example', 'projects/acme-example'),
+ '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),
+ '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 } }>(
+ "SELECT completed_keys->0 AS record FROM op_checkpoints WHERE op='sync-hold'")).map(({ record }) => [record.path, record.code]));
+const slugs = async (engine: BrainEngine) => (await engine.executeRaw<{ slug: string }>(
+ "SELECT slug FROM pages WHERE source_id='default' AND deleted_at IS NULL ORDER BY slug")).map(row => row.slug);
+
+for (const backend of testBackends()) describe(`[${backend}] #7341: a scaffolding file whose slug: names another page stays scaffolding`, () => {
+ const databaseUrl = backend === 'postgres' ? requirePostgresTestDatabase() : undefined;
+ const setup = ({ root }: { root: string }) => {
+ git(root, 'init', '-q');
+ for (const [path, content] of Object.entries(FILES)) { mkdirSync(join(root, path, '..'), { recursive: true }); writeFileSync(join(root, path), content); }
+ git(root, 'add', '-A'); git(root, 'commit', '-qm', 'hubs');
+ };
+
+ test('not imported, not held, converges; an earlier hold is released; own-slug and slug-less hubs import', () => managedBrain(async ({ engine }) => {
+ expect((await performManagedSync(engine, OPTS)).status).toBe('first_sync');
+ expect(await holdCodes(engine)).toEqual({});
+ expect(await slugs(engine)).toEqual(['notes/a', 'projects/delta-example/index', 'projects/gamma-example/index']);
+ expect((await shadowConvergence(engine, { sourceId: 'default' }))!.counts).toEqual({ matched: 3 });
+
+ // A hold an earlier version wrote for the folder-slug hub is released by the next sync.
+ const [source] = await engine.executeRaw<{ incarnation: string }>("SELECT incarnation::text AS incarnation FROM sources WHERE id='default'");
+ await engine.transaction(tx => writeGitHold(tx, { source_id: 'default', incarnation: source!.incarnation, path: 'projects/acme-example/index.md',
+ source_path: 'projects/acme-example/index.md', slug: 'projects/acme-example/index', page_id: null, code: 'frontmatter_slug_conflict',
+ message: 'The frontmatter slug of projects/acme-example/index.md does not match its path-derived slug.', upstream_version: null,
+ observed_at: new Date(Date.now() - 60_000).toISOString(), run_id: null, mode: 'managed', meta: { recovery_version: RECOVERY_VERSION, key: 'slug' } }));
+ await performManagedSync(engine, OPTS);
+ expect(await holdCodes(engine)).toEqual({});
+ expect(await slugs(engine)).toEqual(['notes/a', 'projects/delta-example/index', 'projects/gamma-example/index']);
+ }, { databaseUrl, setup }), 300_000);
+});