Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(dream): concept merges survive synthesize_concepts (#6161)
garrytan72a9ea29b3fe
diff --git a/docs/architecture/key-files/core-cycle-continued.md b/docs/architecture/key-files/core-cycle-continued.mdindex bc768c893a..e29da96b83 100644--- a/docs/architecture/key-files/core-cycle-continued.md+++ b/docs/architecture/key-files/core-cycle-continued.md@@ -20,6 +20,6 @@ Synthesis, patterns, consolidation and connector atom gating.- `src/core/cycle/triage-rescue.ts` — THE dream triage gate (`passesTriageGate`) + the verified-segment rescue (`applyTriageRescue`). Rescue fires only for scores in `[floor, threshold)` (floor inclusive; at/above threshold is the plain gate's job) with content_type in the buried-signal allowlist (default mixed/reflection/idea/strategy/people — never routine/technical) and ≥ minSegments of the judge's own segments verifying as normalized transcript substrings (`normForGrounding`, ≥40 chars, deduped by normalized quote — repetition is not more evidence). $0 — no LLM calls; fabricated segments cannot fire it; works on cached verdicts (gate-time only). Fail-closed on every malformed shape (null score, missing/short/non-string segments), never throws. `minSegments: 0` is the kill switch (gate degenerates to the plain threshold). ONE-GATE RULE: `runTriagePass` (report construction — `worth`/`rescued`/telemetry/dry-run), the synthesize fan-out, and `dream retriage` (reconcile-queue cancels + `--audit-rejects` sampling) all read this predicate — a second hand-rolled `score >= threshold` check is how an operator sweep cancels exactly the jobs the rescue admitted. Config: `dream.triage.rescue_floor` / `rescue_min_segments` / `rescue_content_types`. Pinned by `test/cycle-triage-rescue.test.ts` + the rescue suites in `test/cycle-synthesize-triage.test.ts` / `test/dream-retriage.test.ts`. System One S7: a decide verdict (`model` starting with `DECIDE_VERDICT_PREFIX`) is gated against the S7 slot threshold (the optional fifth argument) and never enters the rescue band.- `src/core/cycle/derived-write-through.ts` — opt-in markdown write-through for generated pages on an unmanaged brain (#5041). `cycle.extract_atoms.write_through` / `cycle.synthesize_concepts.write_through` (off by default; `true`/`1`/`yes`/`on`) make `derivedWriteThrough` return a hook (null when off, managed or dry run): `extract_atoms` writes each item's atoms after the completion flip and removes the files of atoms it retired; `synthesize_concepts` writes through `publishClassicConcept`, which also rewrites a concept that already has a file whatever the key says. Creating the hook writes up to 200 generated pages per run that have no file yet (`source_path` NULL; pending atoms excluded), so enabling the key backfills. `writeDerivedPageThrough` keeps a page database-only when its target is ignored by git or sits in a declared `storage.db_only` directory, then calls `writePageThrough` (which honours `sync.write_through=off`). Tests: `test/cycle/derived-write-through.test.ts`.-- `src/core/cycle/concept-publication.ts` — managed `synthesize_concepts` publication: `publishManagedConcept` publishes through `publishMaintenancePage` (a concept with a recorded `source_path` republishes to its file unless a `db_only` tier covers it; new concepts are database-only), and `composeConceptRepublication` keeps an existing concept's facts/takes fences, timeline, tags and other frontmatter, holding the concept (`concept_preservation_hold`) when a fence is duplicated, unbalanced, unparseable or below the timeline sentinel. `addManagedProvenanceLinks` commits the concept-provenance edges inside a coordinated transaction. On an unmanaged brain `publishClassicConcept` writes under the page lock the fence writers take: it re-reads the page, defers (`revision_conflict`) when the narrative changed since synthesis started or another writer owns it, and otherwise composes the new narrative with the latest fences (from the page's file when it has one), so a take added during synthesis survives. `stripFenceSections` is the shared narrative view. Tests: `test/cycle/synthesize-concepts-fences.test.ts`. The phase keeps the private-first, provenance, then promotion order; revision races are deferred and holds reported in the phase details. Tests: `test/managed-writers-w3.test.ts`.+- `src/core/cycle/concept-publication.ts` — managed `synthesize_concepts` publication: `publishManagedConcept` publishes through `publishMaintenancePage` (a concept with a recorded `source_path` republishes to its file unless a `db_only` tier covers it; new concepts are database-only), and `composeConceptRepublication` keeps an existing concept's facts/takes fences, timeline, tags and other frontmatter, holding the concept (`concept_preservation_hold`) when a fence is duplicated, unbalanced, unparseable or below the timeline sentinel. `addManagedProvenanceLinks` commits the concept-provenance edges inside a coordinated transaction. On an unmanaged brain `publishClassicConcept` writes under the page lock the fence writers take: it re-reads the page, defers (`revision_conflict`) when the narrative changed since synthesis started or another writer owns it, and otherwise composes the new narrative with the latest fences (from the page's file when it has one), so a take added during synthesis survives. `stripFenceSections` is the shared narrative view. Tests: `test/cycle/synthesize-concepts-fences.test.ts`. The phase keeps the private-first, provenance, then promotion order; revision races are deferred and holds reported in the phase details. Tests: `test/managed-writers-w3.test.ts`. #6161: `preserveCanonicalFences` also carries curated `## Facets` / `## Merged` sections verbatim (`cycle/concept-sections.ts`; a model-written copy is dropped, and the lossless check covers them), and `synthesize-concepts.ts` groups atoms through `cycle/concept-redirects.ts` `loadConceptRedirects` (`merged_into` on any live concept page, `aliases` on phase-owned ones; one hop, two-way redirects ignored) and skips a tombstoned concept page as `skipped_deleted` instead of resurrecting it (`test/cycle/synthesize-concepts-merge.test.ts`).- `src/core/cycle/connector-atoms.ts` — the connector atom setting (#5856). `CONNECTOR_ATOM_PAGES_KEY` (`cycle.extract_atoms.connector_pages`, on when unset; `connectorAtomPagesEnabled` treats only false/0/off/no as opted out) gates `CONNECTOR_ATOM_PAGE_TYPES` (`email`, `meeting`) of sources whose `config.kind` is a connector kind (`CONNECTOR_SOURCE_KINDS`). `connectorAtomExclusionSql` returns the `pages p` predicate atom discovery and the backlog count append (empty unless opted out), so the routine cycle, `dream --drain` and autopilot auto-drain extract connector mail and calendar pages under the auto-drain budget until the user opts out. Other page types of a connector source and every checkout-backed page are unaffected. Tests: `test/connector-atom-pages.test.ts`, `test/autopilot-auto-drain-dispatch.test.ts`, and the `atom_drain_default_on` / `atom_drain_opted_out` cases of `test/helpers/managed-connector-job-contract.ts`, run by `test/managed-connector-job-contract.test.ts` and its Postgres twin `test/e2e/managed-connector-job-contract.test.ts`.diff --git a/src/core/cycle/concept-publication.ts b/src/core/cycle/concept-publication.tsindex 8e0cabec69..68e19fdf86 100644--- a/src/core/cycle/concept-publication.ts+++ b/src/core/cycle/concept-publication.ts@@ -7,6 +7,7 @@* the #5525 order: publish private, bank provenance edges, then promote.*/import type { BrainEngine, LinkBatchInput } from '../engine.ts';+import { preservedConceptSections, stripPreservedConceptSections } from './concept-sections.ts';import type { Page } from '../types.ts';import { serializeMarkdown, parseMarkdown } from '../markdown.ts';import { FACTS_FENCE_BEGIN, FACTS_FENCE_END, parseFactsFence, replaceOrInsertFactsFence, stripFactsFence } from '../facts-fence.ts';@@ -91,22 +92,27 @@ export function composeConceptRepublication(page: Pick<Page, 'type' | 'title' |* body written by a model or a synthesis phase, which owns only the prose. Any* fence in the replacement is dropped and the original blocks are inserted* verbatim, so publication neither expires fence facts nor deletes takes.- * Throws a hold (`concept_preservation_hold`) when the original fences are- * ambiguous or the result would not carry exactly the original rows.+ * Curated `## Facets` / `## Merged` sections (#6161: the record of a concept+ * merge) are carried the same way. Throws a hold+ * (`concept_preservation_hold`) when the original fences are ambiguous or the+ * result would not carry exactly the original rows and sections.*/export function preserveCanonicalFences(page: Pick<Page, 'compiled_truth' | 'timeline'>, replacement: string): string {const hold = conceptPreservationHold(page);if (hold) throw conceptHoldError(hold);const body = page.compiled_truth ?? '';- let compiled = stripTakesFence(stripFactsFence(replacement)).trim();+ let compiled = stripPreservedConceptSections(stripTakesFence(stripFactsFence(replacement))).trim();+ const sections = preservedConceptSections(body);+ if (sections.length) compiled = [compiled, ...sections].join('\n\n');const facts = fenceBlock(body, FACTS_FENCE_BEGIN, FACTS_FENCE_END);if (facts) compiled = replaceOrInsertFactsFence(compiled, facts).trimEnd();const takes = fenceBlock(body, TAKES_FENCE_BEGIN, TAKES_FENCE_END);if (takes) compiled = `${compiled}\n\n## Takes\n\n${takes}`;const out = parseMarkdown(serializeMarkdown({}, compiled, (page.timeline ?? '').trim(), { type: 'note', title: 'x', tags: [] }), 'page');if (JSON.stringify(canonicalRows(out.compiled_truth)) !== JSON.stringify(canonicalRows(body))+ || JSON.stringify(preservedConceptSections(out.compiled_truth)) !== JSON.stringify(sections)|| (out.timeline ?? '').trim() !== (page.timeline ?? '').trim()) {- throw conceptHoldError('CONCEPT_REPUBLICATION_LOSSY: composed page would not preserve the existing fences or timeline');+ throw conceptHoldError('CONCEPT_REPUBLICATION_LOSSY: composed page would not preserve the existing fences, curated sections or timeline');}return compiled;}diff --git a/src/core/cycle/concept-redirects.ts b/src/core/cycle/concept-redirects.tsnew file mode 100644index 0000000000..6d968c9ad2--- /dev/null+++ b/src/core/cycle/concept-redirects.ts@@ -0,0 +1,37 @@+/**+ * #6161: concept merges a human made, read back as stem redirects for+ * synthesize_concepts' grouping. The concept-synthesis skill merges concept B+ * into A by archiving B under `concepts/_merged/` with `merged_into: A` and+ * listing B in A's `aliases`. Either record redirects B's atoms to A, so the+ * phase grows A instead of recreating B. Aliases count only on pages the phase+ * owns (`synthesized_by: synthesize_concepts…`), the pages a merge targets.+ */+import type { BrainEngine } from '../engine.ts';++/** Map of concept stem → canonical stem. The first record (by slug) wins a conflict. */+export async function loadConceptRedirects(engine: BrainEngine, sourceId: string,+ stemFor: (ref: string) => string | null): Promise<Map<string, string>> {+ const rows = await engine.executeRaw<{ slug: string; merged_into: string | null; aliases: unknown; synthesized_by: string | null }>(+ `SELECT slug, frontmatter->>'merged_into' AS merged_into, frontmatter->'aliases' AS aliases, frontmatter->>'synthesized_by' AS synthesized_by+ FROM pages+ WHERE source_id = $1 AND slug LIKE 'concepts/%' AND deleted_at IS NULL+ AND ((frontmatter->>'merged_into') IS NOT NULL OR jsonb_typeof(frontmatter->'aliases') = 'array')+ ORDER BY slug`, [sourceId]);+ const redirects = new Map<string, string>();+ const add = (from: string | null, to: string | null) => {+ if (from && to && from !== to && !redirects.has(from)) redirects.set(from, to);+ };+ for (const row of rows) {+ if (row.merged_into) add(stemFor(row.slug), stemFor(row.merged_into));+ const aliases = typeof row.aliases === 'string' ? JSON.parse(row.aliases) as unknown : row.aliases;+ if (!String(row.synthesized_by ?? '').startsWith('synthesize_concepts') || !Array.isArray(aliases)) continue;+ for (const alias of aliases) if (typeof alias === 'string') add(stemFor(alias), stemFor(row.slug));+ }+ return redirects;+}++/** One hop through the redirects; a two-way redirect (a cycle) keeps the stem. */+export function canonicalConceptStem(stem: string, redirects: Map<string, string>): string {+ const target = redirects.get(stem);+ return target && redirects.get(target) !== stem ? target : stem;+}diff --git a/src/core/cycle/concept-sections.ts b/src/core/cycle/concept-sections.tsnew file mode 100644index 0000000000..5425327bf0--- /dev/null+++ b/src/core/cycle/concept-sections.ts@@ -0,0 +1,40 @@+/**+ * #6161: body sections a human curates on a concept page that synthesis must+ * carry through republication verbatim, like the facts and takes fences. The+ * concept-synthesis skill records a merge as a `## Facets` section on the+ * canonical page (`## Merged` is accepted for the same purpose). A section+ * runs from its heading to the next `#`/`##` heading or fence marker; headings+ * inside code are ignored.+ */+import { stripCodeBlocks } from '../markdown-code.ts';++const SECTION_HEADING_RE = /^##[ \t]+(?:Facets|Merged)[ \t]*$/i;+const SECTION_END_RE = /^(?:#{1,2}[ \t]|<!---? gbrain:)/;++function sectionRanges(body: string): Array<[number, number]> {+ const masked = stripCodeBlocks(body);+ const ranges: Array<[number, number]> = [];+ let offset = 0;+ let open = -1;+ for (const line of masked.split('\n')) {+ const text = line.replace(/\r$/, '');+ if (open !== -1 && SECTION_END_RE.test(text)) { ranges.push([open, offset]); open = -1; }+ if (open === -1 && SECTION_HEADING_RE.test(text)) open = offset;+ offset += line.length + 1;+ }+ if (open !== -1) ranges.push([open, body.length]);+ return ranges;+}++/** The preserved sections of a body, each trimmed, in order. */+export function preservedConceptSections(body: string): string[] {+ return sectionRanges(body).map(([start, end]) => body.slice(start, end).trim());+}++/** The body without its preserved sections. */+export function stripPreservedConceptSections(body: string): string {+ let out = '';+ let at = 0;+ for (const [start, end] of sectionRanges(body)) { out += body.slice(at, start); at = end; }+ return (out + body.slice(at)).replace(/\n{3,}/g, '\n\n');+}diff --git a/src/core/cycle/synthesize-concepts.ts b/src/core/cycle/synthesize-concepts.tsindex 76c623ed86..db4c500a29 100644--- a/src/core/cycle/synthesize-concepts.ts+++ b/src/core/cycle/synthesize-concepts.ts@@ -43,6 +43,7 @@ import { validatePageSlug } from '../ops/context.ts';import { privatePagesFilterFragment, strictestVisibility, type Visibility } from '../search/private-visibility.ts';import { maintenancePreflight } from '../persistence/prepared-maintenance.ts';import { derivedWriteThrough } from './derived-write-through.ts';+import { canonicalConceptStem, loadConceptRedirects } from './concept-redirects.ts';import {addManagedProvenanceLinks, CONCEPT_DEFERRAL_CODES, CONCEPT_HOLD_CODES, publishClassicConcept, publishManagedConcept, stripFenceSections,} from './concept-publication.ts';@@ -215,9 +216,12 @@ export async function runPhaseSynthesizeConcepts(}// 2. Group atoms by normalized concept slug; one atom counts once per concept.+ // #6161: a concept merged into another (merged_into / a canonical alias) groups under the canonical one.+ const redirects = await loadConceptRedirects(engine, opts.sourceId ?? 'default', conceptStemFor).catch(() => new Map<string, string>());const groups = new Map<string, { slugs: string[]; titles: string[]; bodies: string[]; visibilities: Visibility[] }>();for (const atom of atoms) {- const conceptSlugs = new Set(atom.concept_refs.map(conceptStemFor).filter((s): s is string => s !== null));+ const conceptSlugs = new Set(atom.concept_refs.map(conceptStemFor).filter((s): s is string => s !== null)+ .map((stem) => canonicalConceptStem(stem, redirects)));for (const conceptSlug of conceptSlugs) {const existing = groups.get(conceptSlug) ?? { slugs: [], titles: [], bodies: [], visibilities: [] };existing.slugs.push(atom.slug);@@ -330,6 +334,7 @@ export async function runPhaseSynthesizeConcepts(const publicationDeferred: Array<{ concept: string; reason: string }> = [];const publicationHeld: Array<{ concept: string; reason: string }> = [];const skippedHumanOwned: string[] = [];+ const skippedDeleted: string[] = [];const skippedUnchanged: string[] = [];const rehashed: string[] = [];const keptExistingNarrative: string[] = [];@@ -339,7 +344,12 @@ export async function runPhaseSynthesizeConcepts(const conceptSlug = `concepts/${group.conceptSlug}`;// A concept page this phase did not write belongs to a human (or another// writer). Check before any spend; never replace its body.- const existingSnapshot = await engine.readPageSnapshot(conceptSlug, { sourceId: opts.sourceId ?? 'default' });+ const existingSnapshot = await engine.readPageSnapshot(conceptSlug, { sourceId: opts.sourceId ?? 'default', includeDeleted: true });+ // #6161: a concept page someone deleted (with no merge redirect) is never resurrected.+ if (existingSnapshot?.page.deleted_at) {+ skippedDeleted.push(conceptSlug);+ continue;+ }const existing = existingSnapshot?.page ?? null;if (existing && !String(existing.frontmatter?.synthesized_by ?? '').startsWith('synthesize_concepts')) {skippedHumanOwned.push(conceptSlug);@@ -622,6 +632,7 @@ export async function runPhaseSynthesizeConcepts(link_warnings: linkWarnings,warnings,skipped_human_owned: skippedHumanOwned,+ skipped_deleted: skippedDeleted,skipped_unchanged: skippedUnchanged,rehashed,kept_existing_narrative: keptExistingNarrative,diff --git a/test/cycle/synthesize-concepts-merge.test.ts b/test/cycle/synthesize-concepts-merge.test.tsnew file mode 100644index 0000000000..981735f055--- /dev/null+++ b/test/cycle/synthesize-concepts-merge.test.ts@@ -0,0 +1,118 @@+// #6161: a concept merge done by hand (the concept-synthesis skill: aliases and+// a `## Facets` section on the canonical page, the merged page archived under+// concepts/_merged/ with `merged_into`, the original deleted) survives the next+// synthesize_concepts run.+//+// Protects: atoms of a merged-away concept join the canonical concept (by+// `merged_into` or a canonical alias) instead of recreating it; a concept page+// deleted without a redirect is never resurrected; the canonical page's+// `## Facets` section survives republication; alias cycles are ignored.+// Fails when: grouping ignores redirects, the pre-check misses tombstones, or+// republication keeps only the facts/takes fences.++import { describe, test, expect, beforeAll, afterAll, beforeEach } from 'bun:test';+import { PGLiteEngine } from '../../src/core/pglite-engine.ts';+import { runPhaseSynthesizeConcepts } from '../../src/core/cycle/synthesize-concepts.ts';+import { composeConceptRepublication } from '../../src/core/cycle/concept-publication.ts';+import { importFromContent } from '../../src/core/import-file.ts';+import { serializeMarkdown } from '../../src/core/markdown.ts';+import { resetPgliteState } from '../helpers/reset-pglite.ts';+import { loadConceptRedirects } from '../../src/core/cycle/concept-redirects.ts';+import { isolatedSharedSkillsEngine } from '../helpers/shared-skills-engine.ts';+import { requirePostgresTestDatabase, testBackends } from '../helpers/test-backends.ts';++let engine: PGLiteEngine;+beforeAll(async () => {+ engine = new PGLiteEngine();+ await engine.connect({});+ await engine.initSchema();+}, 240000);+afterAll(async () => { await engine.disconnect(); });+beforeEach(async () => { await resetPgliteState(engine); }, 120000);++type Atom = { slug: string; title: string; body: string; concept_refs: string[]; visibility: 'world' };+const atom = (slug: string, ref: string): Atom => ({ slug, title: slug, body: `Body of ${slug}.`, concept_refs: [ref], visibility: 'world' });+const ATOMS = [atom('atoms/a0', 'concept-a'), atom('atoms/a1', 'concept-a'), atom('atoms/b0', 'concept-b'), atom('atoms/b1', 'concept-b')];+const run = (atoms: Atom[] = ATOMS) => runPhaseSynthesizeConcepts(engine, { _atoms: atoms, sourceId: 'default' });+const page = (slug: string) => engine.getPage(slug, { sourceId: 'default' });+const FACETS = '## Facets\n\n- **concept-b**: the narrower framing, merged here.';++async function mergeBIntoA(): Promise<void> {+ const a = (await page('concepts/concept-a'))!;+ await importFromContent(engine, 'concepts/concept-a', serializeMarkdown({ ...a.frontmatter, aliases: ['concept-b'] },+ `${a.compiled_truth.trim()}\n\n${FACETS}`, '', { type: 'concept', title: a.title, tags: [] }), { sourceId: 'default', noEmbed: true });+ const b = (await page('concepts/concept-b'))!;+ await importFromContent(engine, 'concepts/_merged/c/concept-b', serializeMarkdown({ ...b.frontmatter, merged_into: 'concepts/concept-a' },+ b.compiled_truth, '', { type: 'concept', title: b.title, tags: [] }), { sourceId: 'default', noEmbed: true });+}++describe('synthesize_concepts honors concept merges (#6161)', () => {+ test('a merged-away concept is not recreated after purge; its atoms join the canonical concept', async () => {+ await run();+ expect(await page('concepts/concept-b')).not.toBeNull();+ await mergeBIntoA();+ await engine.deletePage('concepts/concept-b', { sourceId: 'default' });+ await run();+ expect(await page('concepts/concept-b')).toBeNull();+ const a = (await page('concepts/concept-a'))!;+ expect(a.frontmatter.mention_count).toBe(4);+ expect(a.compiled_truth).toContain(FACETS);+ }, 120000);++ test('merged_into alone redirects, even without an alias on the canonical page', async () => {+ await run();+ const b = (await page('concepts/concept-b'))!;+ await importFromContent(engine, 'concepts/_merged/c/concept-b', serializeMarkdown({ ...b.frontmatter, merged_into: 'concepts/concept-a' },+ b.compiled_truth, '', { type: 'concept', title: b.title, tags: [] }), { sourceId: 'default', noEmbed: true });+ await engine.deletePage('concepts/concept-b', { sourceId: 'default' });+ await run();+ expect(await page('concepts/concept-b')).toBeNull();+ expect((await page('concepts/concept-a'))!.frontmatter.mention_count).toBe(4);+ }, 120000);++ test('a concept deleted without a redirect is not resurrected', async () => {+ await run();+ await engine.softDeletePage('concepts/concept-b', { sourceId: 'default' });+ const r = await run();+ expect(await page('concepts/concept-b')).toBeNull();+ expect((r.details as { skipped_deleted?: string[] }).skipped_deleted).toEqual(['concepts/concept-b']);+ }, 120000);++ test('alias cycles are ignored safely', async () => {+ await run();+ for (const [slug, alias] of [['concepts/concept-a', 'concept-b'], ['concepts/concept-b', 'concept-a']] as const) {+ const p = (await page(slug))!;+ await importFromContent(engine, slug, serializeMarkdown({ ...p.frontmatter, aliases: [alias] }, p.compiled_truth, '',+ { type: 'concept', title: p.title, tags: [] }), { sourceId: 'default', noEmbed: true });+ }+ await run();+ expect((await page('concepts/concept-a'))!.frontmatter.mention_count).toBe(2);+ expect((await page('concepts/concept-b'))!.frontmatter.mention_count).toBe(2);+ }, 120000);++ test('republication keeps a ## Facets section verbatim and drops one the model wrote', () => {+ const existing = { type: 'concept' as const, title: 'concept a', timeline: '', frontmatter: { synthesized_by: 'synthesize_concepts-v0.41' },+ compiled_truth: `Old narrative.\n\n${FACETS}\n` };+ const out = composeConceptRepublication(existing, [], { tier: 'T3' }, 'New narrative.\n\n## Facets\n\n- invented by the model');+ expect(out).toContain('New narrative.');+ expect(out).toContain(FACETS);+ expect(out).not.toContain('invented by the model');+ });+});++// The redirect query on both engines (Postgres when DATABASE_URL is set).+for (const backend of testBackends()) {+ const databaseUrl = backend === 'postgres' ? requirePostgresTestDatabase() : undefined;+ test(`${backend}: loadConceptRedirects reads merged_into and canonical aliases`, async () => {+ const { engine: e, close } = await isolatedSharedSkillsEngine(databaseUrl);+ try {+ await e.putPage('concepts/concept-a', { type: 'concept', title: 'a', compiled_truth: 'A.',+ frontmatter: { synthesized_by: 'synthesize_concepts-v0.41', aliases: ['Concept C'] } });+ await e.putPage('concepts/_merged/c/concept-b', { type: 'concept', title: 'b', compiled_truth: 'B.', frontmatter: { merged_into: 'concepts/concept-a' } });+ await e.putPage('concepts/human', { type: 'concept', title: 'h', compiled_truth: 'H.', frontmatter: { aliases: ['concept-d'] } });+ const stem = (ref: string) => ref.split('/').pop()!.toLowerCase().replace(/\s+/g, '-');+ const redirects = await loadConceptRedirects(e, 'default', stem);+ expect([...redirects].sort()).toEqual([['concept-b', 'concept-a'], ['concept-c', 'concept-a']]);+ } finally { await close(); }+ }, 120000);+}diff --git a/test/postgres-unit-arms.txt b/test/postgres-unit-arms.txtindex c7dbb9002d..84ffcf53f1 100644--- a/test/postgres-unit-arms.txt+++ b/test/postgres-unit-arms.txt@@ -18,6 +18,7 @@ test/chronicle-backfill-max-usd.test.tstest/colon-slug-windows-5032.test.tstest/company-brain-policy.test.tstest/company-brain-runtime.test.ts+test/cycle/synthesize-concepts-merge.test.tstest/decide/conflict-proposals-managed.test.tstest/declared-lineage-visibility.test.tstest/derived-link-reconciliation.test.ts