Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(markdown): keep the #5966 stored-slug stamp under the #6454 strip; goldens and inventories for the new surface

garrytan0913bd7fc7f7
diff --git a/src/core/markdown.ts b/src/core/markdown.ts
index c63cd16ae2..da15cd3617 100644
--- a/src/core/markdown.ts
+++ b/src/core/markdown.ts
@@ -1252,9 +1252,11 @@ export function serializePageToMarkdown(
opts: SerializePageOpts = {},
): string {
// #6454: the columns are the page's type, title and tags; a stored reserved key (older imports kept
- // them) never overrides them in the rendered file. Stripped before the slug stamp so the #5966 rule still runs.
+ // them) never overrides them in the rendered file. A stored `slug` still reaches the #5966 stamp rule, which
+ // replaces one that names another identity with the page's slug.
+ const stored = page.frontmatter ?? {};
const frontmatter: Record<string, unknown> = {
- ...slugStampedFrontmatter(page.slug, comparableFrontmatter(page.frontmatter)),
+ ...slugStampedFrontmatter(page.slug, { ...comparableFrontmatter(stored), ...(stored.slug !== undefined ? { slug: stored.slug } : {}) }),
...(opts.frontmatterOverrides ?? {}),
};
return serializeMarkdown(
diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.json
index 9ae686f7e8..3cfa0bbb75 100644
--- a/test/fixtures/goldens/doctor/content-pglite-human.json
+++ b/test/fixtures/goldens/doctor/content-pglite-human.json
@@ -108,6 +108,7 @@
" [OK] captured_facts_active: No active fact from a gbrain self-capture or paste candidate remains. This counts facts in the database; the self_capture check counts corpus files.",
" [OK] loop_facts_drift: Every closed commitment loop has its fact retired.",
" [OK] ontology_facts_fenced: No ontology observation is held by a page's Facts table.",
+ " [OK] stale_frontmatter_keys: No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
" [OK] extraction_date_grounding: Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
" [OK] integrity: Sampled 5 pages; no bare-tweet phrases or external links.",
" [OK] jsonb_integrity: All JSONB columns store objects/arrays",
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index ef17a7b78c..9f4dda7359 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -1149,6 +1149,19 @@
"name": "ontology_facts_fenced",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/repair.md#frontmatter-keys",
+ "repair": "frontmatter-keys",
+ "source_ids": [],
+ "sources": []
+ },
+ "message": "No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
+ "name": "stale_frontmatter_keys",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index a01a782429..cf9414acfd 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -1259,6 +1259,19 @@
"name": "ontology_facts_fenced",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/repair.md#frontmatter-keys",
+ "repair": "frontmatter-keys",
+ "source_ids": [],
+ "sources": []
+ },
+ "message": "No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
+ "name": "stale_frontmatter_keys",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
@@ -4312,6 +4325,19 @@
"name": "ontology_facts_fenced",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/repair.md#frontmatter-keys",
+ "repair": "frontmatter-keys",
+ "source_ids": [],
+ "sources": []
+ },
+ "message": "No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
+ "name": "stale_frontmatter_keys",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index c6747d40f9..1cad35188d 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -1252,6 +1252,19 @@
"name": "ontology_facts_fenced",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/repair.md#frontmatter-keys",
+ "repair": "frontmatter-keys",
+ "source_ids": [],
+ "sources": []
+ },
+ "message": "No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
+ "name": "stale_frontmatter_keys",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
@@ -4294,6 +4307,19 @@
"name": "ontology_facts_fenced",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/repair.md#frontmatter-keys",
+ "repair": "frontmatter-keys",
+ "source_ids": [],
+ "sources": []
+ },
+ "message": "No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
+ "name": "stale_frontmatter_keys",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 41101b75bc..152293efff 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -1101,6 +1101,19 @@
"name": "ontology_facts_fenced",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "count": 0,
+ "docs": "docs/guides/repair.md#frontmatter-keys",
+ "repair": "frontmatter-keys",
+ "source_ids": [],
+ "sources": []
+ },
+ "message": "No stored frontmatter carries a parser-reserved key (type, title, tags, slug).",
+ "name": "stale_frontmatter_keys",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
diff --git a/test/fixtures/goldens/exports/runtime.json b/test/fixtures/goldens/exports/runtime.json
index 544c47c9ea..32b12021cb 100644
--- a/test/fixtures/goldens/exports/runtime.json
+++ b/test/fixtures/goldens/exports/runtime.json
@@ -29,6 +29,7 @@
"countChunklessPagesWithContent",
"countKeywordPages",
"countStaleChunks",
+ "countStaleFrontmatterKeyPages",
"countStalePagesForExtraction",
"countStaleTakes",
"countUnconsolidatedFacts",
@@ -118,6 +119,7 @@
"listPages",
"listPrefixSampledPages",
"listStaleChunks",
+ "listStaleFrontmatterKeyPages",
"listStalePagesForExtraction",
"listStaleTakes",
"listSupersessions",
@@ -171,6 +173,7 @@
"setPageEmbeddingSignature",
"softDeletePage",
"softDeletePages",
+ "stripStaleFrontmatterKeys",
"sumStaleChunkChars",
"supersedeTake",
"sweepContradictionCache",
@@ -213,6 +216,7 @@
"countChunklessPagesWithContent",
"countKeywordPages",
"countStaleChunks",
+ "countStaleFrontmatterKeyPages",
"countStalePagesForExtraction",
"countStaleTakes",
"countUnconsolidatedFacts",
@@ -306,6 +310,7 @@
"listPages",
"listPrefixSampledPages",
"listStaleChunks",
+ "listStaleFrontmatterKeyPages",
"listStalePagesForExtraction",
"listStaleTakes",
"listSupersessions",
@@ -365,6 +370,7 @@
"softDeletePage",
"softDeletePages",
"sql",
+ "stripStaleFrontmatterKeys",
"sumStaleChunkChars",
"supersedeTake",
"sweepContradictionCache",
@@ -692,8 +698,10 @@
"MAX_FRONTMATTER_YAML_ALIASES",
"PROTECTED_FRONTMATTER_KEYS",
"RECOVERY_VERSION",
+ "RESERVED_FRONTMATTER_KEYS",
"classifyImportHold",
"coerceFrontmatterString",
+ "comparableFrontmatter",
"contentSizeHold",
"findTimelineSplitIndex",
"frontmatterBodyOffset",
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index dc4ca93222..9188a0d25c 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -68,6 +68,7 @@
"countChunklessPagesWithContent: (opts?: { sourceId?: string; }) => Promise<number>",
"countKeywordPages: (query: string, opts?: SearchOpts & { timeoutMs?: number; }) => Promise<number>",
"countStaleChunks: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
+ "countStaleFrontmatterKeyPages: (opts: { sourceIds: string[]; }) => Promise<Array<{ source_id: string; n: number; }>>",
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
@@ -154,6 +155,7 @@
"listPages: (filters?: PageFilters) => Promise<Page[]>",
"listPrefixSampledPages: (opts: DomainBankSampleOpts) => Promise<DomainBankRow[]>",
"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>",
+ "listStaleFrontmatterKeyPages: (opts: { sourceId: string; afterId: number; limit: number; }) => Promise<Array<{ id: number; slug: string; keys: string[]; }>>",
"listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>",
"listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",
"listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: FactVisibility[]; eligibility?: FactListOpts[\"eligibility\"]; excludePrivate?: boolean; }) => Promise<FactRow[]>",
@@ -208,6 +210,7 @@
"setPageEmbeddingSignature: (slug: string, opts: { sourceId?: string; signature: string; }) => Promise<void>",
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
+ "stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
@@ -1033,6 +1036,7 @@
"countChunklessPagesWithContent: (opts?: { sourceId?: string; }) => Promise<number>",
"countKeywordPages: (query: string, opts?: SearchOpts & { timeoutMs?: number; }) => Promise<number>",
"countStaleChunks: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
+ "countStaleFrontmatterKeyPages: (opts: { sourceIds: string[]; }) => Promise<{ source_id: string; n: number; }[]>",
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
@@ -1121,6 +1125,7 @@
"listPages: (filters?: PageFilters) => Promise<Page[]>",
"listPrefixSampledPages: (opts: DomainBankSampleOpts) => Promise<DomainBankRow[]>",
"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>",
+ "listStaleFrontmatterKeyPages: (opts: { sourceId: string; afterId: number; limit: number; }) => Promise<{ id: number; slug: string; keys: string[]; }[]>",
"listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>",
"listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",
"listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: (\"private\" | \"world\")[]; eligibility?: FactListOpts[\"eligibility\"]; excludePrivate?: boolean; }) => Promise<FactRow[]>",
@@ -1214,6 +1219,7 @@
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
"sql: postgres.Sql<{}>",
+ "stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
@@ -3274,6 +3280,7 @@
"countChunklessPagesWithContent: (opts?: { sourceId?: string; }) => Promise<number>",
"countKeywordPages: (query: string, opts?: SearchOpts & { timeoutMs?: number; }) => Promise<number>",
"countStaleChunks: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
+ "countStaleFrontmatterKeyPages: (opts: { sourceIds: string[]; }) => Promise<Array<{ source_id: string; n: number; }>>",
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
@@ -3360,6 +3367,7 @@
"listPages: (filters?: PageFilters) => Promise<Page[]>",
"listPrefixSampledPages: (opts: DomainBankSampleOpts) => Promise<DomainBankRow[]>",
"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>",
+ "listStaleFrontmatterKeyPages: (opts: { sourceId: string; afterId: number; limit: number; }) => Promise<Array<{ id: number; slug: string; keys: string[]; }>>",
"listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>",
"listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",
"listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: FactVisibility[]; eligibility?: FactListOpts[\"eligibility\"]; excludePrivate?: boolean; }) => Promise<FactRow[]>",
@@ -3414,6 +3422,7 @@
"setPageEmbeddingSignature: (slug: string, opts: { sourceId?: string; signature: string; }) => Promise<void>",
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
+ "stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
@@ -5381,6 +5390,13 @@
"1"
]
},
+ {
+ "kind": "variable",
+ "name": "RESERVED_FRONTMATTER_KEYS",
+ "signature": [
+ "readonly [\"type\", \"title\", \"tags\", \"slug\"]"
+ ]
+ },
{
"kind": "type",
"name": "RecoveryKind",
@@ -5409,6 +5425,13 @@
"(v: unknown) => string"
]
},
+ {
+ "kind": "function",
+ "name": "comparableFrontmatter",
+ "signature": [
+ "(frontmatter: Record<string, unknown> | null | undefined) => Record<string, unknown>"
+ ]
+ },
{
"kind": "function",
"name": "contentSizeHold",
@@ -6292,6 +6315,7 @@
"countChunklessPagesWithContent: (opts?: { sourceId?: string; }) => Promise<number>",
"countKeywordPages: (query: string, opts?: SearchOpts & { timeoutMs?: number; }) => Promise<number>",
"countStaleChunks: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
+ "countStaleFrontmatterKeyPages: (opts: { sourceIds: string[]; }) => Promise<{ source_id: string; n: number; }[]>",
"countStalePagesForExtraction: (opts?: { sourceId?: string; versionTs?: string; attendance?: \"exclude\" | \"blocked\"; }) => Promise<number>",
"countStaleTakes: (opts?: StaleTakeOpts) => Promise<number>",
"countUnconsolidatedFacts: (source_id: string) => Promise<number>",
@@ -6379,6 +6403,7 @@
"listPages: (filters?: PageFilters) => Promise<Page[]>",
"listPrefixSampledPages: (opts: DomainBankSampleOpts) => Promise<DomainBankRow[]>",
"listStaleChunks: (opts?: { batchSize?: number; afterPageId?: number; afterChunkIndex?: number; sourceId?: string; orderBy?: \"page_id\" | \"updated_desc\"; afterUpdatedAt?: string | null; }) => Promise<StaleChunkRow[]>",
+ "listStaleFrontmatterKeyPages: (opts: { sourceId: string; afterId: number; limit: number; }) => Promise<{ id: number; slug: string; keys: string[]; }[]>",
"listStalePagesForExtraction: (opts: { batchSize: number; afterPageId?: number; sourceId?: string; versionTs?: string; }) => Promise<StalePageRow[]>",
"listStaleTakes: (opts?: StaleTakeOpts) => Promise<StaleTakeRow[]>",
"listSupersessions: (source_id: string, opts?: { since?: Date; limit?: number; visibility?: (\"private\" | \"world\")[]; eligibility?: FactListOpts[\"eligibility\"]; excludePrivate?: boolean; }) => Promise<FactRow[]>",
@@ -6465,6 +6490,7 @@
"setPageEmbeddingSignature: (slug: string, opts: { sourceId?: string; signature: string; }) => Promise<void>",
"softDeletePage: (slug: string, opts?: { sourceId?: string; }) => Promise<{ slug: string; } | null>",
"softDeletePages: (slugs: string[], opts: { sourceId: string; }) => Promise<string[]>",
+ "stripStaleFrontmatterKeys: (opts: { sourceId: string; ids: number[]; }) => Promise<number>",
"sumStaleChunkChars: (opts?: { sourceId?: string; signature?: string; includeNullSignature?: boolean; }) => Promise<number>",
"supersedeTake: (pageId: number, oldRow: number, newRow: Omit<TakeBatchInput, \"page_id\" | \"row_num\" | \"superseded_by\">) => Promise<{ oldRow: number; newRow: number; }>",
"sweepContradictionCache: () => Promise<number>",
diff --git a/test/frontmatter-reserved-keys-6454.test.ts b/test/frontmatter-reserved-keys-6454.test.ts
index fcbf53aa0e..4a6ff0c6d2 100644
--- a/test/frontmatter-reserved-keys-6454.test.ts
+++ b/test/frontmatter-reserved-keys-6454.test.ts
@@ -78,12 +78,14 @@ describe('serializePageToMarkdown renders the columns, never a stale stored rese
expect(serializePageToMarkdown(clean, ['x'])).toBe(serializeMarkdown(frontmatter, clean.compiled_truth, '', { type: 'person', title: 'Alice Example', tags: ['x'] }));
});
- test('the doubled-hyphen slug stamp (#5966) survives the strip, and a stored slug naming another page is dropped', () => {
+ test('the #5966 slug stamp rules survive the strip: a doubled hyphen is stamped, a stored slug naming another page is replaced by the page slug', () => {
const doubled = serializePageToMarkdown(page({ slug: 'people/a--b', frontmatter: { slug: 'people/elsewhere' } }), []);
expect(doubled).toMatch(/^slug: people\/a--b$/m);
const plain = serializePageToMarkdown(page({ frontmatter: { slug: 'people/elsewhere' } }), []);
- expect(plain).not.toMatch(/^slug:/m);
+ expect(plain).toMatch(/^slug: people\/alice-example$/m);
+ expect(plain).not.toContain('people/elsewhere');
expect(parseMarkdown(plain, 'people/alice-example.md').slug).toBe('people/alice-example');
+ expect(serializePageToMarkdown(page({ frontmatter: {} }), [])).not.toMatch(/^slug:/m);
});
});
diff --git a/test/receipt-coverage.test.ts b/test/receipt-coverage.test.ts
index 2f15a9decf..221c1764c2 100644
--- a/test/receipt-coverage.test.ts
+++ b/test/receipt-coverage.test.ts
@@ -44,6 +44,7 @@ const RECEIPT_COVERAGE: Record<string, Coverage> = {
'src/core/trust/owner-actions.ts': { sites: 1, tables: ['facts'], todo: 'TODO(receipts): the owner release of a held fact inserts it in withCoordinatedWrite as maintenance without a request; publish the release as an owner request' },
'src/core/trust/page-handlers.ts': { sites: 1, tables: ['pages', 'facts', 'takes', 'timeline_entries'], todo: 'TODO(receipts): owner tier decisions (confirm/lower) change only trust_tier/write_origin in withCoordinatedWrite as maintenance without a request; publish them as owner requests' },
'src/core/trust/backfill.ts': { sites: 1, tables: ['pages', 'facts', 'takes', 'timeline_entries'], todo: 'TODO(receipts): gbrain trust backfill classifies legacy trust_tier/write_origin (no content column) as attributed coordinated maintenance without a request; publish each batch as a maintenance intent' },
+ 'src/core/repair/frontmatter-keys.ts': { sites: 1, tables: ['pages'], todo: 'TODO(receipts): gbrain repair frontmatter-keys (#6454) strips the four parser-reserved keys from pages.frontmatter (no content column) in withCoordinatedWrite batches as explicit-only maintenance without a request; publish each batch as a maintenance intent' },
'src/core/cycle/concept-publication.ts': { sites: 1, tables: [], other: 'concept provenance links (links is not a guarded table)' },
'src/core/persistence/links-maintenance.ts': { sites: 1, tables: [], other: 'derived links and the pages attendance-blocked stamp (a physical column the guard exempts)' },
'src/core/persistence/database-write.ts': { sites: 1, tables: [], other: 'manual links and chronicle ontology observations (unguarded tables)' },