Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(schema-pack): declare code and extract_receipt in gbrain-base-v2 1.5.0 (#6818)
time-attackd4e76082725f
diff --git a/docs/architecture/type-taxonomy.md b/docs/architecture/type-taxonomy.mdindex ecce8c61da..4f9a932888 100644--- a/docs/architecture/type-taxonomy.md+++ b/docs/architecture/type-taxonomy.md@@ -54,6 +54,11 @@ binds any uncovered legacy type to `note` withThe pack also declares `question`, the owner-private annotation typethe pinned-question writer stamps on its pages (non-extractable, nofolder prefix), so pinned questions never read as undeclared types.+It also declares `code` (the code importer's page type, non-extractable+media, no folder prefix) and `extract_receipt` (the extract receipt+writer's page type under `extracts/`, a non-extractable annotation), so+imported code and extraction receipts never read as undeclared types and+the catch-all retype leaves them alone.## Subtypes (declared in frontmatter post-unify)diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex cc2f0f5bfc..71d3aae633 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -904,6 +904,8 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;{ since: '0.60.299.0', text: 'Managed sync of a Markdown file over 24 MiB whose origin another page records (a page renamed with its file) now imports it into that page, as for a smaller file, instead of failing it `revision_conflict` ("A different page already owns this file identity") and stopping the source\'s sync at it.' },{ since: '0.60.299.0', text: '`gbrain repair stuck-recovery` now resolves a page recovery whose file is over 24 MiB, which used to be listed as refused (`recovery_large_file_unsupported`) with no exit while it stopped every write on its source\'s worktree. The preview lists it with both fingerprints and the state of the staged copy of the prior file, backs up both versions, and writes a summary instead of a full diff (both hashes and sizes, the first byte where they differ, and a window of at most 1 KiB); `--apply --expect <hash> --keep prior|disk --yes` resolves it as it does a small file. Every read, hash and copy of the large file is done in pieces of at most a segment. When the staged copy of the prior file is missing or damaged, `--keep prior` refuses with `recovery_prior_stage_unavailable`, whose fix is the `--keep disk` apply, which keeps a damaged copy in the backup directory and removes it from the checkout.' },{ since: '0.60.307.0', text: 'The remote doctor (`run_doctor`, `gbrain remote doctor`) now confines every check to the sources the caller may read. A source-scoped token no longer sees other sources\' ids, names, lag, embed coverage or failed jobs in `federation_health` and `sync_freshness`, or brain-wide counts in `sync_consolidation`, `links_extraction_lag` (each granted source is graded on its own and the worst is reported), `schema_pack_source_drift`, `graph_signals_coverage`, `hidden_by_search_policy`, `link_resolution_opportunity`, `embedding_migration_state`, the synopsis-failure line of `contextual_retrieval_coverage`, `brainstorm_health`, `abandoned_threads`, `calibration_freshness`, `grade_confidence_drift` and `voice_gate_health`. `federation_health` grades a scoped caller\'s sources even when it is granted only one. The local doctor and unscoped callers are unchanged.' },+ // Fix wave 20 lane 3.+ { since: '0.60.307.0', text: 'The bundled `gbrain-base-v2` schema pack (the `init` default, also inherited by `company-brain`) is now version 1.5.0 and declares the `code` page type the code importer stamps and the `extract_receipt` page type the extract receipt writer stamps under `extracts/` (#6818), so neither makes doctor `schema_pack_consistency` warn `page_type_undeclared` and `unify-types` no longer retypes those pages to `note`. Existing pages keep their type; no data changes. The active pack identity reads `[email protected]+<hash>`.' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */diff --git a/src/core/schema-pack/base/gbrain-base-v2.yaml b/src/core/schema-pack/base/gbrain-base-v2.yamlindex a04a2031a5..443b31b005 100644--- a/src/core/schema-pack/base/gbrain-base-v2.yaml+++ b/src/core/schema-pack/base/gbrain-base-v2.yaml@@ -10,6 +10,10 @@# v1.4.0 adds `question`, the type the pinned-question writer stamps on# questions/ pages (#6742), mirroring gbrain-base: a non-extractable# annotation outside the canonical content taxonomy.+# v1.5.0 adds `code` (stamped by the code importer) and `extract_receipt`+# (stamped by the extract receipt writer under extracts/), mirroring+# gbrain-base: non-extractable types outside the content taxonomy, so the+# catch-all retype rule leaves them alone.## STANDALONE pack (D11/F1): NO `extends:` field. Declaring inheritance# would compose gbrain-base's 24 types on top of the 16 declared here,@@ -32,7 +36,7 @@api_version: gbrain-schema-pack-v1name: gbrain-base-v2-version: 1.4.0+version: 1.5.0description: 15-type DRY/MECE canonical taxonomy + `note` catch-all (16 total). Successor to gbrain-base. Issue #1479.gbrain_min_version: 0.42.0extends: null@@ -374,6 +378,25 @@ page_types:extractable: falseexpert_routing: false+ # A code file's page, written by the code importer (import-file.ts).+ # Set via frontmatter only.+ - name: code+ primitive: media+ path_prefixes: []+ aliases: []+ extractable: false+ expert_routing: false++ # The receipt the extract framework writes after every extractor run+ # (src/core/extract/receipt-writer.ts), always under extracts/.+ - name: extract_receipt+ primitive: annotation+ path_prefixes:+ - extracts/+ aliases: []+ extractable: false+ expert_routing: false+link_types:- name: partner_ofinverse: partner_ofdiff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.jsonindex f80fc599da..31330df789 100644--- a/test/fixtures/goldens/doctor/content-pglite-human.json+++ b/test/fixtures/goldens/doctor/content-pglite-human.json@@ -238,8 +238,8 @@" [OK] entity_link_coverage: Only 2 entity pages (< 5) — coverage ratio not meaningful at this scale"," [OK] timeline_coverage: Only 2 entity pages (< 5) — coverage ratio not meaningful at this scale"," [INFO] takes_count: 0 takes (takes.bootstrap_enabled is false; opt in to enable)",- " [OK] pack_upgrade_available: Active pack [email protected]+1c5ba903 is current (no successor declared)",- " [OK] type_proliferation: 3 distinct typed values (pack gbrain-base-v2 declares 21)",+ " [OK] pack_upgrade_available: Active pack [email protected]+4604112a is current (no successor declared)",+ " [OK] type_proliferation: 3 distinct typed values (pack gbrain-base-v2 declares 23)"," [OK] dangling_aliases: No dangling aliases","Brain checks: 60/100 (category penalty)","Skill checks: 95/100",diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.jsonindex f714a6a089..08391f175a 100644--- a/test/fixtures/goldens/doctor/content-pglite-json.json+++ b/test/fixtures/goldens/doctor/content-pglite-json.json@@ -511,10 +511,10 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 68719476736,- "max_day_7d": 114245,+ "max_day_7d": 115490,"net_per_day_7d": 22378,"pct": 0,- "per_day_7d": 114245,+ "per_day_7d": 115490,"reclaimable_bytes": 16318,"recommended_limit": 137438953472,"resource": "terminal_bytes",@@ -522,7 +522,7 @@"spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 114245,+ "used": 115490,"window_days": 1},{@@ -548,10 +548,10 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 17179869184,- "max_day_7d": 114245,+ "max_day_7d": 115490,"net_per_day_7d": 22378,"pct": 0,- "per_day_7d": 114245,+ "per_day_7d": 115490,"reclaimable_bytes": 16318,"recommended_limit": 34359738368,"resource": "terminal_bytes",@@ -559,7 +559,7 @@"spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 114245,+ "used": 115490,"window_days": 1}],@@ -3610,14 +3610,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "3 distinct typed values (pack gbrain-base-v2 declares 21)",+ "message": "3 distinct typed values (pack gbrain-base-v2 declares 23)","name": "type_proliferation","status": "ok"},diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex 4a38a2225c..fe74e5e3b5 100644--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json@@ -512,18 +512,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 68719476736,- "max_day_7d": 195921,+ "max_day_7d": 197913,"net_per_day_7d": 58816,"pct": 0,- "per_day_7d": 195921,- "reclaimable_bytes": 137105,+ "per_day_7d": 197913,+ "reclaimable_bytes": 139097,"recommended_limit": 137438953472,"resource": "terminal_bytes","scope": "brain","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 195921,+ "used": 197913,"window_days": 1},{@@ -549,18 +549,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 17179869184,- "max_day_7d": 195921,+ "max_day_7d": 197913,"net_per_day_7d": 58816,"pct": 0,- "per_day_7d": 195921,- "reclaimable_bytes": 137105,+ "per_day_7d": 197913,+ "reclaimable_bytes": 139097,"recommended_limit": 34359738368,"resource": "terminal_bytes","scope": "principal:local_cli:<uuid>","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 195921,+ "used": 197913,"window_days": 1}],@@ -3966,14 +3966,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "5 distinct typed values (pack gbrain-base-v2 declares 21)",+ "message": "5 distinct typed values (pack gbrain-base-v2 declares 23)","name": "type_proliferation","status": "ok"},@@ -4809,18 +4809,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 68719476736,- "max_day_7d": 195921,+ "max_day_7d": 197913,"net_per_day_7d": 58816,"pct": 0,- "per_day_7d": 195921,- "reclaimable_bytes": 137105,+ "per_day_7d": 197913,+ "reclaimable_bytes": 139097,"recommended_limit": 137438953472,"resource": "terminal_bytes","scope": "brain","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 195921,+ "used": 197913,"window_days": 1},{@@ -4846,18 +4846,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 17179869184,- "max_day_7d": 195921,+ "max_day_7d": 197913,"net_per_day_7d": 58816,"pct": 0,- "per_day_7d": 195921,- "reclaimable_bytes": 137105,+ "per_day_7d": 197913,+ "reclaimable_bytes": 139097,"recommended_limit": 34359738368,"resource": "terminal_bytes","scope": "principal:local_cli:<uuid>","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 195921,+ "used": 197913,"window_days": 1}],@@ -8263,14 +8263,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "5 distinct typed values (pack gbrain-base-v2 declares 21)",+ "message": "5 distinct typed values (pack gbrain-base-v2 declares 23)","name": "type_proliferation","status": "ok"},diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.jsonindex fce2bc2aa6..cc6f706816 100644--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json@@ -506,18 +506,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 68719476736,- "max_day_7d": 196974,+ "max_day_7d": 198966,"net_per_day_7d": 58822,"pct": 0,- "per_day_7d": 196974,- "reclaimable_bytes": 138152,+ "per_day_7d": 198966,+ "reclaimable_bytes": 140144,"recommended_limit": 137438953472,"resource": "terminal_bytes","scope": "brain","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 196974,+ "used": 198966,"window_days": 1},{@@ -543,18 +543,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 17179869184,- "max_day_7d": 196974,+ "max_day_7d": 198966,"net_per_day_7d": 58822,"pct": 0,- "per_day_7d": 196974,- "reclaimable_bytes": 138152,+ "per_day_7d": 198966,+ "reclaimable_bytes": 140144,"recommended_limit": 34359738368,"resource": "terminal_bytes","scope": "principal:local_cli:<uuid>","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 196974,+ "used": 198966,"window_days": 1}],@@ -3967,14 +3967,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "5 distinct typed values (pack gbrain-base-v2 declares 21)",+ "message": "5 distinct typed values (pack gbrain-base-v2 declares 23)","name": "type_proliferation","status": "ok"},@@ -4804,18 +4804,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 68719476736,- "max_day_7d": 196974,+ "max_day_7d": 198966,"net_per_day_7d": 58822,"pct": 0,- "per_day_7d": 196974,- "reclaimable_bytes": 138152,+ "per_day_7d": 198966,+ "reclaimable_bytes": 140144,"recommended_limit": 137438953472,"resource": "terminal_bytes","scope": "brain","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 196974,+ "used": 198966,"window_days": 1},{@@ -4841,18 +4841,18 @@"days_to_exhaustion": null,"exhaustion_date": null,"limit": 17179869184,- "max_day_7d": 196974,+ "max_day_7d": 198966,"net_per_day_7d": 58822,"pct": 0,- "per_day_7d": 196974,- "reclaimable_bytes": 138152,+ "per_day_7d": 198966,+ "reclaimable_bytes": 140144,"recommended_limit": 34359738368,"resource": "terminal_bytes","scope": "principal:local_cli:<uuid>","spike_day": null,"status": "ok","under_reserved_receipts": 0,- "used": 196974,+ "used": 198966,"window_days": 1}],@@ -8265,14 +8265,14 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},{"category": "meta","elapsed_ms": "<volatile>",- "message": "5 distinct typed values (pack gbrain-base-v2 declares 21)",+ "message": "5 distinct typed values (pack gbrain-base-v2 declares 23)","name": "type_proliferation","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex 6a6ec317ac..1bcbcaea3c 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -3256,7 +3256,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 709f1565f1..ea16a2d519 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -3343,7 +3343,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex d4ebba0b02..222c57fa1e 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -3344,7 +3344,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "Active pack [email protected]+1c5ba903 is current (no successor declared)",+ "message": "Active pack [email protected]+4604112a is current (no successor declared)","name": "pack_upgrade_available","status": "ok"},diff --git a/test/lens-pack-manifests.test.ts b/test/lens-pack-manifests.test.tsindex 05fb0fe861..e6beae09a4 100644--- a/test/lens-pack-manifests.test.ts+++ b/test/lens-pack-manifests.test.ts@@ -255,8 +255,8 @@ describe('v0.41 T4: gbrain-everything meta-pack shape', () => {describe('#2117: gbrain-base-v2 ships link-inference regexes + explicit phases', () => {const pack = loadPack('gbrain-base-v2');- test('version bumped to 1.4.0 (question page type; 1.3.0 added account, 1.2.0 open-loop link verbs)', () => {- expect(pack.version).toBe('1.4.0');+ test('version bumped to 1.5.0 (code + extract_receipt page types; 1.4.0 added question, 1.3.0 account, 1.2.0 open-loop link verbs)', () => {+ expect(pack.version).toBe('1.5.0');});test('declares the 4 v1 inference regexes (founded/invested_in/advises/works_at)', () => {diff --git a/test/schema-cli-db-config.test.ts b/test/schema-cli-db-config.test.tsindex 07df8e8596..f19e213efc 100644--- a/test/schema-cli-db-config.test.ts+++ b/test/schema-cli-db-config.test.ts@@ -61,7 +61,7 @@ describe('#4653 schema inspection verbs honor DB-config schema_pack (tier 4)', (test('schema show prints the DB-configured pack header', () => {const r = runSchema('show');expect(r.status).toBe(0);- expect((r.stdout ?? '').split('\n')[0]).toBe('# gbrain-base-v2 v1.4.0');+ expect((r.stdout ?? '').split('\n')[0]).toBe('# gbrain-base-v2 v1.5.0');}, 90_000);test('schema explain <v2-only type> exits 0', () => {diff --git a/test/schema-cli.test.ts b/test/schema-cli.test.tsindex e6cd8c8e19..774ed6f4fa 100644--- a/test/schema-cli.test.ts+++ b/test/schema-cli.test.ts@@ -132,7 +132,7 @@ describe('gbrain schema CLI (Phase C)', () => {// link verbs became 17. (#2117 history: 14 became 15 with `advises`.)// v1.3.0 (entity recall): +account page type (alias crm).// v1.4.0 (#6742): +question page type (the pinned-question writer's).- expect(r.stdout).toContain('gbrain-base-v2 v1.4.0');+ expect(r.stdout).toContain('gbrain-base-v2 v1.5.0');expect(r.stdout).toContain('Page types (');expect(r.stdout).toContain('Link verbs (17)');});diff --git a/test/schema-pack-code-receipt-types.test.ts b/test/schema-pack-code-receipt-types.test.tsnew file mode 100644index 0000000000..ea952b2c35--- /dev/null+++ b/test/schema-pack-code-receipt-types.test.ts@@ -0,0 +1,77 @@+/**+ * #6818 + PR #6915: the stock base pack (gbrain-base-v2, the init default)+ * and packs extending it (company-brain) declare the two page types gbrain's+ * own writers stamp outside the canonical content taxonomy: `code` (the code+ * importer, import-file.ts) and `extract_receipt` (the extract receipt+ * writer, under extracts/).+ *+ * Protects: importing code or running an extractor on a default brain never+ * trips doctor `schema_pack_consistency` (`page_type_undeclared`), and the+ * catch-all retype rule never turns those pages into notes.+ * Regression: a pack edit that drops either declaration.+ */+import { afterAll, beforeAll, describe, expect, test } from 'bun:test';+import { PGLiteEngine } from '../src/core/pglite-engine.ts';+import { checkSchemaPackConsistency } from '../src/commands/doctor/schema-pack-checks.ts';+import { classifyStoredType } from '../src/core/schema-pack/type-usage.ts';+import { bundledPackPath } from '../src/core/schema-pack/bundled-assets.ts';+import { loadPackFromFile } from '../src/core/schema-pack/loader.ts';+import { mergeInheritedManifest } from '../src/core/schema-pack/merge.ts';+import { extractableTypesFromPack } from '../src/core/schema-pack/extractable.ts';+import { writeReceipt } from '../src/core/extract/receipt-writer.ts';++let engine: PGLiteEngine;++beforeAll(async () => {+ engine = new PGLiteEngine();+ await engine.connect({});+ await engine.initSchema();+ await engine.setConfig('schema_pack', 'gbrain-base-v2');+}, 120_000);++afterAll(async () => {+ await engine?.disconnect();+}, 60_000);++describe('#6818 code and extract_receipt page types in the stock base pack', () => {+ test('gbrain-base-v2 declares code as non-extractable media and extract_receipt as an extracts/ annotation', () => {+ const base = loadPackFromFile(bundledPackPath('gbrain-base-v2')!);+ expect(classifyStoredType('code', base)).toEqual({ kind: 'canonical' });+ expect(classifyStoredType('extract_receipt', base)).toEqual({ kind: 'canonical' });+ expect(base.page_types.find(t => t.name === 'code')).toMatchObject({+ primitive: 'media', path_prefixes: [], extractable: false, expert_routing: false,+ });+ expect(base.page_types.find(t => t.name === 'extract_receipt')).toMatchObject({+ primitive: 'annotation', path_prefixes: ['extracts/'], extractable: false, expert_routing: false,+ });+ const extractable = extractableTypesFromPack(base);+ expect(extractable.has('code')).toBe(false);+ expect(extractable.has('extract_receipt')).toBe(false);+ });++ test('company-brain inherits both declarations', () => {+ const base = loadPackFromFile(bundledPackPath('gbrain-base-v2')!);+ const company = mergeInheritedManifest([base], loadPackFromFile(bundledPackPath('company-brain')!), { page_types: [], link_types: [] });+ expect(classifyStoredType('code', company)).toEqual({ kind: 'canonical' });+ expect(classifyStoredType('extract_receipt', company)).toEqual({ kind: 'canonical' });+ });++ test('a written receipt and a code page keep the consistency check ok; a custom type still warns', async () => {+ const { slug } = await writeReceipt(engine, {+ kind: 'links', source_id: 'default', run_id: 'a1b2c3d4e5f6789abcdef', round: 'full',+ extracted_at: '2026-05-27T14:30:00.000Z', total_rows: 3, cost_usd: 0,+ });+ expect((await engine.getPage(slug, { sourceId: 'default' }))?.type).toBe('extract_receipt');+ await engine.putPage('src/example.ts', { type: 'code', title: 'example.ts', compiled_truth: 'export const x = 1;' }, { sourceId: 'default' });+ const ok = await checkSchemaPackConsistency(engine, { sourceIds: ['default'] });+ expect(ok.message).toBe('All pages match the active schema pack across every source.');+ expect(ok.status).toBe('ok');++ await engine.putPage('notes/custom-control', { type: 'custom_receipt_fixture', title: 'Custom control', compiled_truth: 'Fixture content.' }, { sourceId: 'default' });+ const warn = await checkSchemaPackConsistency(engine, { sourceIds: ['default'] });+ expect(warn.status).toBe('warn');+ expect(warn.message).toContain('custom_receipt_fixture');+ expect(warn.message).not.toContain("'extract_receipt'");+ expect(warn.message).not.toContain("'code'");+ }, 60_000);+});diff --git a/test/schema-pack-stats.test.ts b/test/schema-pack-stats.test.tsindex 8b29103f9b..2aa9665617 100644--- a/test/schema-pack-stats.test.ts+++ b/test/schema-pack-stats.test.ts@@ -339,7 +339,7 @@ describe('runStatsCore — #4653 DB-plane schema_pack tier', () => {await engine.setConfig('schema_pack', 'gbrain-base-v2');const result = await runStatsCore(ctxOf());// Pre-fix: loadActivePackBestEffort never read the engine → '[email protected]+…'.- expect(result.pack_identity).toStartWith('[email protected]');+ expect(result.pack_identity).toStartWith('[email protected]');});});});