Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(GST-1209): keep the repo-less test's title; the empty-preview check is add-only
garrytand2b6df3d900f
diff --git a/test/large-pages/segmented-tiling-repair.test.ts b/test/large-pages/segmented-tiling-repair.test.tsindex 44ccd320ed..31bbdfd118 100644--- a/test/large-pages/segmented-tiling-repair.test.ts+++ b/test/large-pages/segmented-tiling-repair.test.ts@@ -5,8 +5,8 @@* preview names the page, its file and HEAD's blob under a hash; `--apply` refuses without that hash; the apply* republishes the page from the blob at HEAD as a new generation that tiles, keeps the damaged generation as a* version by reference, writes a receipt, clears the sync hold, and the next managed sync completes with no hold.- * A source with no Git checkout previews nothing while no page is damaged and refuses once one is (not_a_git_repo);- * a remote caller is refused.+ * A source with no Git checkout refuses the preview (not_a_git_repo); a remote caller is refused.+ * With no damaged page, a source with no Git checkout previews nothing (doctor's remediation plan runs the preview).* 2. Fails when: doctor misses the page or writes, an apply runs without the previewed hash or against a changed page,* the republished generation does not tile, the hold survives, a repo-less source reads as republishable, or a file* that narrows who can read the page or that the content gate would quarantine is republished under the stored frontmatter.@@ -224,7 +224,7 @@ test('a claim the owner purged stays out: the apply republishes the file throughexpect(await engine.executeRaw('SELECT count(*)::int AS n FROM content_chunks WHERE page_id=$1 AND chunk_text LIKE $2', [f.pageId, `%${PURGED}%`])).toEqual([{ n: 0 }]);}), 300_000);-test('a source without a Git checkout previews nothing while no page is damaged, then refuses: Git is the only copy it republishes', async () => withEnv(env, async () => {+test('a source without a Git checkout refuses the preview: Git is the only copy it republishes', async () => withEnv(env, async () => {await disposePersistenceConsumer(engine);await engine.executeRaw('UPDATE persistence_brain SET enabled=false WHERE singleton=1');const sourceId = `repoless-${randomUUID().slice(0, 8)}`;@@ -232,10 +232,11 @@ test('a source without a Git checkout previews nothing while no page is damaged,await engine.setConfig('pages.segmented_storage', 'on');await importFromContent(engine, 'notes/repoless-example', person(1260 * 1024), { sourceId, noEmbed: true });const [row] = await engine.executeRaw<{ id: number }>('SELECT id FROM pages WHERE source_id=$1 AND slug=$2', [sourceId, 'notes/repoless-example']);- const scope = await resolveRepairScope(engine, sourceId);- expect((await repairRunner(engine, { apply: false, logger }).then(runner => runner.run('segmented-tiling', scope, { explicit: true, sourceFlag: sourceId }))).listing ?? []).toEqual([]);+ const undamaged = await resolveRepairScope(engine, sourceId);+ expect((await repairRunner(engine, { apply: false, logger }).then(runner => runner.run('segmented-tiling', undamaged, { explicit: true, sourceFlag: sourceId }))).listing ?? []).toEqual([]);await engine.executeRaw('DELETE FROM page_body_manifest WHERE page_id=$1 AND staging_id IS NULL AND seq=(SELECT max(seq) FROM page_body_manifest WHERE page_id=$1 AND staging_id IS NULL)', [row!.id]);expect((await segmentedTilingCheck(engine, [sourceId])).status).toBe('fail');+ const scope = await resolveRepairScope(engine, sourceId);await expect(repairRunner(engine, { apply: false, logger }).then(runner => runner.run('segmented-tiling', scope, { explicit: true, sourceFlag: sourceId }))).rejects.toMatchObject({ code: 'not_a_git_repo' });await engine.executeRaw('UPDATE persistence_brain SET enabled=true WHERE singleton=1');