Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

GBRA-161 PR 1b: peel extract-atoms generation helpers (module-size), census prune, guard exemption, pg lanes

garrytane9274111e5d0
diff --git a/docs/architecture/derived-census.tsv b/docs/architecture/derived-census.tsv
index 1dd66d256a..aee37f6820 100644
--- a/docs/architecture/derived-census.tsv
+++ b/docs/architecture/derived-census.tsv
@@ -22,6 +22,5 @@ src/core/pglite-engine.ts 4 engine PGLite engine soft-delete methods
src/core/postgres-engine.ts 4 engine Postgres engine soft-delete methods
src/core/repair/ghost-pages.ts 1 canonical repair ghost-pages soft-deletes a live page whose canonical file is gone, after operator agreement
src/core/repair/rename-identity.ts 2 canonical repair rename-identity closes the old page of a rename pair, after operator agreement
-src/core/repair/stale-atoms.ts 1 pending:inventory derived or mixed writer not yet on the generation primitive; reviewed in a later GBRA-161 PR
src/core/schema-pack/page-to-alias.ts 1 pending:inventory derived or mixed writer not yet on the generation primitive; reviewed in a later GBRA-161 PR
src/core/schema-pack/page-to-link.ts 1 pending:inventory derived or mixed writer not yet on the generation primitive; reviewed in a later GBRA-161 PR
diff --git a/scripts/check-core-guard-coverage.mjs b/scripts/check-core-guard-coverage.mjs
index 66d362b60e..0c8c371014 100644
--- a/scripts/check-core-guard-coverage.mjs
+++ b/scripts/check-core-guard-coverage.mjs
@@ -35,6 +35,7 @@ const EXEMPT = {
'src/core/persistence/connector-google-receipts.ts': 'connector receipt rows, not page text',
'src/core/persistence/projection-reindex.ts': 'rebuilds derived projections; page text is unchanged',
'src/core/persistence/noop-kernel.ts': 'decides that nothing would change; publishes nothing',
+ 'src/core/generations/managed.ts': 'the generation activation flips the derived ledger; it writes no page text (its member page writes go through preparePageMutation)',
'src/core/persistence/consumer.ts': 'dispatches to preparers; no page content of its own',
'src/core/persistence/coordinator.ts': 'takes the ordered source lock from exclusiveSources; prepares nothing itself',
'src/core/persistence/effect-journal.ts': 'post-publication effects; no page text',
diff --git a/scripts/page-body-readers-baseline.tsv b/scripts/page-body-readers-baseline.tsv
index 4642f7f7e7..3005178ba3 100644
--- a/scripts/page-body-readers-baseline.tsv
+++ b/scripts/page-body-readers-baseline.tsv
@@ -610,3 +610,4 @@ src/core/generations/adapters/page.ts preimageMarkdown call:serializeMarkdown NO
src/core/generations/adapters/page.ts preimageMarkdown field NONE reads the body field of a ledger preimage JSON copy; segmented and oversize pages have no preimage
src/core/generations/adapters/page.ts pageVersionEvidence sql INLINE legacy-adoption evidence: hashes retained page_versions copies of derived atom pages and compares identity hashes only; segmented versions (compiled_truth NULL) are skipped
src/core/generations/adapters/atoms.ts atomGenerationAdapter sql META input size only: body_bytes for a segmented page, octet_length of an inline page columns (pages leave body_bytes NULL inline)
+src/core/generations/repair.ts releaseManaged field INLINE assertInlineBody refuses a segmented origin page before the managed release reads its body to bind the origin
diff --git a/src/core/cycle/extract-atoms-generation.ts b/src/core/cycle/extract-atoms-generation.ts
new file mode 100644
index 0000000000..5e76dce0fb
--- /dev/null
+++ b/src/core/cycle/extract-atoms-generation.ts
@@ -0,0 +1,107 @@
+/**
+ * GBRA-161: how extract_atoms maps its items onto atom generations (generations/adapters/atoms.ts): each item's key and
+ * adapter context, the unmanaged one-transaction publication, and the transcript keys (root label plus root-relative
+ * path, with the rename map) and slugs. Peeled out of extract-atoms.ts (module-size ratchet).
+ */
+import { existsSync } from 'node:fs';
+import { isAbsolute, relative, resolve, sep } from 'node:path';
+import type { BrainEngine, LinkBatchInput } from '../engine.ts';
+import { isAvailable } from '../ai/gateway.ts';
+import { ATOM_KIND, atomGenerationAdapter, atomOwnerKey, atomPagePin, TRANSCRIPT_KEY_PREFIX, type AtomGenerationContext } from '../generations/adapters/atoms.ts';
+import { markdownItem } from '../generations/adapters/page.ts';
+import type { GenerationKey } from '../generations/contract.ts';
+import { publishGeneration } from '../generations/publish.ts';
+import type { ExtractAtomsItem } from './extract-atoms-input.ts';
+
+/**
+ * GBRA-161: one unmanaged item's atoms, their provenance edges (#3961, #4733), the completion flip (source_hash, #4148)
+ * and the versioned retirement of the atoms this extraction no longer produced (C-14) publish as one generation in one
+ * transaction (#5575 I2/B3: gated and stamped at the origin's taint inside the adapter). #6503: a cut item publishes
+ * additively, stays provisional (`pending:<hash>`) and retires nothing. A held result changes nothing and is logged.
+ */
+export async function publishUnmanagedAtoms(engine: BrainEngine, sourceId: string, item: ExtractAtomsItem, atoms: ReadonlyArray<{ slug: string; content: string }>,
+ links: LinkBatchInput[], opts: { partial: boolean; runId: string; originLabel: string }) {
+ const { key, context, locator } = atomGenerationOrigin(sourceId, item);
+ context.links = links;
+ context.embed = isAvailable('embedding');
+ const outcome = await publishGeneration(engine, atomGenerationAdapter, { key, items: atoms.map(atom => markdownItem(atom.slug, atom.content)),
+ input: { pin: atomInputPin(item), size: Buffer.byteLength(item.content) }, partial: opts.partial, context, runId: opts.runId, locator });
+ for (const complete of context.postCommit ?? []) {
+ await complete().catch(error => console.error(`[extract_atoms] ${opts.originLabel}: post-commit embedding failed (the embedding backfill retries it): ${error instanceof Error ? error.message : String(error)}`));
+ }
+ if (outcome.state === 'held') console.error(heldLine(opts.originLabel, key, outcome.reason));
+ return outcome;
+}
+
+/** GBRA-161: the input pin an unmanaged item was read at (a page's is bound to its row and revision, see atomPagePin). */
+export function atomInputPin(item: ExtractAtomsItem): string {
+ return item.kind === 'page' ? atomPagePin(item.contentHash, item.identity) : item.contentHash;
+}
+
+/**
+ * GBRA-161: the generation key of one item and the context its adapter reads (a transcript's input is not in the
+ * database). A transcript's key is its root label and root-relative path (resolveTranscriptKeys), or its path when the
+ * caller named no root.
+ */
+export function atomGenerationOrigin(sourceId: string, item: ExtractAtomsItem): { key: GenerationKey; context: AtomGenerationContext; locator?: string } {
+ if (item.kind === 'page') return { key: { kind: ATOM_KIND, sourceId, ownerKey: atomOwnerKey({ kind: 'page', slug: item.slug }) }, context: { postCommit: [] } };
+ return { key: { kind: ATOM_KIND, sourceId, ownerKey: atomOwnerKey({ kind: 'transcript', transcriptKey: item.transcriptKey ?? item.filePath }) }, locator: item.filePath,
+ context: { postCommit: [], locator: item.filePath, transcriptInput: { pin: item.contentHash, size: Buffer.byteLength(item.content) } } };
+}
+
+export const heldLine = (originLabel: string, key: GenerationKey, reason: string) =>
+ `[extract_atoms] ${originLabel}: result held (${reason}); the previous atoms stay live. Preview: gbrain repair generations --kind ${ATOM_KIND} --mode release-held --key ${key.ownerKey} --source ${key.sourceId}`;
+
+/** GBRA-161 PR 1b: the corpus root a discovered transcript lies under, with the label its key carries. */
+export function transcriptRoot(filePath: string, corpusDir: string, meetingDir: string | undefined): { path: string; label: string } {
+ const inside = (dir: string) => { const rel = relative(resolve(dir), resolve(filePath)); return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel); };
+ return meetingDir && inside(meetingDir) && !(inside(corpusDir) && resolve(corpusDir).length > resolve(meetingDir).length)
+ ? { path: meetingDir, label: 'meetings' } : { path: corpusDir, label: 'corpus' };
+}
+
+/**
+ * GBRA-161 PR 1b (Eng r3 F1): each transcript's generation key: its root label and path relative to that root, never its
+ * basename or content hash, so two files of one name in two folders never share a key. A file a live generation names as
+ * its locator keeps that generation's key (the rename map). A file whose key has no live generation but whose content
+ * equals the input of a live transcript generation whose file is gone was moved: it keeps that key, and the generation's
+ * locator follows it (recorded even when the unchanged file is not extracted again).
+ */
+export async function resolveTranscriptKeys(engine: BrainEngine, sourceId: string, transcripts: ReadonlyArray<{ filePath: string; contentHash: string; root?: { path: string; label: string } }>,
+ dryRun: boolean): Promise<Map<string, string>> {
+ const own = new Map(transcripts.map(t => [t.filePath, t.root ? `${t.root.label}/${relative(resolve(t.root.path), resolve(t.filePath)).split(sep).join('/')}` : t.filePath]));
+ if (!transcripts.length) return own;
+ const live = await engine.executeRaw<{ id: number; owner_key: string; locator: string | null; input_pin: string | null }>(
+ `SELECT id, owner_key, locator, input_pin FROM derived_generations WHERE source_id=$1 AND kind=$2 AND state='live' AND owner_key LIKE $3`,
+ [sourceId, ATOM_KIND, `${TRANSCRIPT_KEY_PREFIX}%`]);
+ const located = new Set<string>();
+ for (const t of transcripts) {
+ const at = live.find(row => row.locator === t.filePath);
+ if (at) { own.set(t.filePath, at.owner_key.slice(TRANSCRIPT_KEY_PREFIX.length)); located.add(t.filePath); }
+ }
+ const claimed = new Set([...own.values()].map(key => `${TRANSCRIPT_KEY_PREFIX}${key}`).filter(key => live.some(row => row.owner_key === key)));
+ for (const t of transcripts) {
+ if (located.has(t.filePath) || claimed.has(`${TRANSCRIPT_KEY_PREFIX}${own.get(t.filePath)}`)) continue;
+ const moved = live.find(row => !claimed.has(row.owner_key) && row.input_pin === t.contentHash && row.locator && row.locator !== t.filePath && !existsSync(row.locator));
+ if (!moved) continue;
+ claimed.add(moved.owner_key);
+ own.set(t.filePath, moved.owner_key.slice(TRANSCRIPT_KEY_PREFIX.length));
+ if (!dryRun) await engine.executeRaw('UPDATE derived_generations SET locator=$2, updated_at=now() WHERE id=$1', [moved.id, t.filePath]);
+ }
+ return own;
+}
+
+/**
+ * GBRA-161 PR 1b: a transcript atom's slug. The title-and-date slug, unless a live atom of another transcript already
+ * holds it (two files of one name in two folders extract the same title): then the slug folds in the transcript's key.
+ */
+export async function resolveTranscriptAtomSlug(engine: BrainEngine, sourceId: string, title: string, item: { filePath: string; transcriptKey?: string },
+ undatedDate: string, atomSlug: (title: string, srcRef: string, sourcePageSlug: string | undefined, undatedDate: string) => string): Promise<string> {
+ const legacy = atomSlug(title, item.filePath, undefined, undatedDate);
+ const [held] = await engine.executeRaw<{ source_path: string | null }>(
+ `SELECT frontmatter->>'source_path' AS source_path FROM pages WHERE source_id=$1 AND slug=$2 AND deleted_at IS NULL`, [sourceId, legacy]);
+ if (!held || held.source_path === item.filePath || !held.source_path) return legacy;
+ const [mine] = await engine.executeRaw<{ locator: string | null }>(
+ `SELECT locator FROM derived_generations WHERE source_id=$1 AND kind=$2 AND owner_key=$3 AND state='live'`,
+ [sourceId, ATOM_KIND, atomOwnerKey({ kind: 'transcript', transcriptKey: item.transcriptKey ?? item.filePath })]);
+ return mine?.locator === held.source_path ? legacy : atomSlug(title, item.filePath, item.transcriptKey ?? item.filePath, undatedDate);
+}
diff --git a/src/core/cycle/extract-atoms.ts b/src/core/cycle/extract-atoms.ts
index 188f34671f..da3c4b76bb 100644
--- a/src/core/cycle/extract-atoms.ts
+++ b/src/core/cycle/extract-atoms.ts
@@ -64,7 +64,7 @@ import type { BrainEngine, LinkBatchInput } from '../engine.ts';
import type { PhaseResult } from '../cycle.ts';
import type { GBrainConfig } from '../config.ts';
import type { ProgressReporter } from '../progress.ts';
-import { chat as gatewayChat, withBudgetTracker, isAvailable } from '../ai/gateway.ts';
+import { chat as gatewayChat, withBudgetTracker } from '../ai/gateway.ts';
import { createGlobalLlmHaltTracker, haltedClassOf, providerContentBlockReason, type GlobalLlmErrorClass } from '../ai/errors.ts';
import { derivedWriteThrough, reportFileHolds } from './derived-write-through.ts';
import { serializeMarkdown } from '../markdown.ts';
@@ -80,8 +80,6 @@ import { classifyRunStop, providerHaltReason, upsertExtractRollup } from '../ext
import { abortableSleep } from '../retry.ts';
import { throwIfAborted } from '../abort-check.ts';
import { createHash } from 'crypto';
-import { existsSync } from 'node:fs';
-import { isAbsolute, relative, resolve, sep } from 'node:path';
import { slugifySegment } from '../sync.ts';
import { resolveAlias, resolveTierDefault } from '../model-config.ts';
import { isMissingSchemaObject, warnOncePerProcess } from '../utils.ts';
@@ -97,10 +95,8 @@ import { isOpPageSlug } from '../ops/context.ts';
import type { WriteReceipt } from '../persistence/types.ts';
import { acceptedPendingReceipt } from '../persistence/accepted-pending.ts';
import { AtomPageStateError, MAX_DETERMINISTIC_FAILURES, readAtomPageIdentity, writeAtomPageState, type AtomPageInput } from './extract-atoms-page-state.ts';
-import { ATOM_KIND, atomGenerationAdapter, atomOwnerKey, atomPagePin, TRANSCRIPT_KEY_PREFIX, type AtomGenerationContext } from '../generations/adapters/atoms.ts';
-import { markdownItem } from '../generations/adapters/page.ts';
-import type { GenerationKey } from '../generations/contract.ts';
-import { heldForInput, publishGeneration } from '../generations/publish.ts';
+import { atomGenerationOrigin, atomInputPin, heldLine, publishUnmanagedAtoms, resolveTranscriptAtomSlug, resolveTranscriptKeys, transcriptRoot } from './extract-atoms-generation.ts';
+import { heldForInput } from '../generations/publish.ts';
import { ATOM_TYPES, ATOMS_RESPONSE_SCHEMA } from './extract-atoms-schema.ts';
import { parseAtomsOutcome } from './extract-atoms-parse.ts';
export { parseAtomsOutcome, parseAtomsResponse, type AtomsParseOutcome } from './extract-atoms-parse.ts';
@@ -1193,7 +1189,7 @@ export async function runPhaseExtractAtoms(
const slug =
item.kind === 'page'
? await resolvePageAtomSlug(engine, atom.title, item.slug, sourceId, undatedDate, pageAtomTitles)
- : await resolveTranscriptAtomSlug(engine, sourceId, atom.title, item, undatedDate);
+ : await resolveTranscriptAtomSlug(engine, sourceId, atom.title, item, undatedDate, atomSlug);
const originFrontmatter =
item.kind === 'transcript'
? { source_path: item.filePath }
@@ -1460,99 +1456,6 @@ export async function runPhaseExtractAtoms(
}, atomFiles?.held, 'atom');
}
-/**
- * GBRA-161: one unmanaged item's atoms, their provenance edges (#3961, #4733), the completion flip (source_hash, #4148)
- * and the versioned retirement of the atoms this extraction no longer produced (C-14) publish as one generation in one
- * transaction (#5575 I2/B3: gated and stamped at the origin's taint inside the adapter). #6503: a cut item publishes
- * additively, stays provisional (`pending:<hash>`) and retires nothing. A held result changes nothing and is logged.
- */
-async function publishUnmanagedAtoms(engine: BrainEngine, sourceId: string, item: ExtractAtomsItem, atoms: ReadonlyArray<{ slug: string; content: string }>,
- links: LinkBatchInput[], opts: { partial: boolean; runId: string; originLabel: string }) {
- const { key, context, locator } = atomGenerationOrigin(sourceId, item);
- context.links = links;
- context.embed = isAvailable('embedding');
- const outcome = await publishGeneration(engine, atomGenerationAdapter, { key, items: atoms.map(atom => markdownItem(atom.slug, atom.content)),
- input: { pin: atomInputPin(item), size: Buffer.byteLength(item.content) }, partial: opts.partial, context, runId: opts.runId, locator });
- for (const complete of context.postCommit ?? []) {
- await complete().catch(error => console.error(`[extract_atoms] ${opts.originLabel}: post-commit embedding failed (the embedding backfill retries it): ${error instanceof Error ? error.message : String(error)}`));
- }
- if (outcome.state === 'held') console.error(heldLine(opts.originLabel, key, outcome.reason));
- return outcome;
-}
-
-/** GBRA-161: the input pin an unmanaged item was read at (a page's is bound to its row and revision, see atomPagePin). */
-function atomInputPin(item: ExtractAtomsItem): string {
- return item.kind === 'page' ? atomPagePin(item.contentHash, item.identity) : item.contentHash;
-}
-
-/**
- * GBRA-161: the generation key of one item and the context its adapter reads (a transcript's input is not in the
- * database). A transcript's key is its root label and root-relative path (resolveTranscriptKeys), or its path when the
- * caller named no root.
- */
-function atomGenerationOrigin(sourceId: string, item: ExtractAtomsItem): { key: GenerationKey; context: AtomGenerationContext; locator?: string } {
- if (item.kind === 'page') return { key: { kind: ATOM_KIND, sourceId, ownerKey: atomOwnerKey({ kind: 'page', slug: item.slug }) }, context: { postCommit: [] } };
- return { key: { kind: ATOM_KIND, sourceId, ownerKey: atomOwnerKey({ kind: 'transcript', transcriptKey: item.transcriptKey ?? item.filePath }) }, locator: item.filePath,
- context: { postCommit: [], locator: item.filePath, transcriptInput: { pin: item.contentHash, size: Buffer.byteLength(item.content) } } };
-}
-
-const heldLine = (originLabel: string, key: GenerationKey, reason: string) =>
- `[extract_atoms] ${originLabel}: result held (${reason}); the previous atoms stay live. Preview: gbrain repair generations --kind ${ATOM_KIND} --mode release-held --key ${key.ownerKey} --source ${key.sourceId}`;
-
-/** GBRA-161 PR 1b: the corpus root a discovered transcript lies under, with the label its key carries. */
-function transcriptRoot(filePath: string, corpusDir: string, meetingDir: string | undefined): { path: string; label: string } {
- const inside = (dir: string) => { const rel = relative(resolve(dir), resolve(filePath)); return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel); };
- return meetingDir && inside(meetingDir) && !(inside(corpusDir) && resolve(corpusDir).length > resolve(meetingDir).length)
- ? { path: meetingDir, label: 'meetings' } : { path: corpusDir, label: 'corpus' };
-}
-
-/**
- * GBRA-161 PR 1b (Eng r3 F1): each transcript's generation key: its root label and path relative to that root, never its
- * basename or content hash, so two files of one name in two folders never share a key. A file a live generation names as
- * its locator keeps that generation's key (the rename map). A file whose key has no live generation but whose content
- * equals the input of a live transcript generation whose file is gone was moved: it keeps that key, and the generation's
- * locator follows it (recorded even when the unchanged file is not extracted again).
- */
-async function resolveTranscriptKeys(engine: BrainEngine, sourceId: string, transcripts: ReadonlyArray<{ filePath: string; contentHash: string; root?: { path: string; label: string } }>,
- dryRun: boolean): Promise<Map<string, string>> {
- const own = new Map(transcripts.map(t => [t.filePath, t.root ? `${t.root.label}/${relative(resolve(t.root.path), resolve(t.filePath)).split(sep).join('/')}` : t.filePath]));
- if (!transcripts.length) return own;
- const live = await engine.executeRaw<{ id: number; owner_key: string; locator: string | null; input_pin: string | null }>(
- `SELECT id, owner_key, locator, input_pin FROM derived_generations WHERE source_id=$1 AND kind=$2 AND state='live' AND owner_key LIKE $3`,
- [sourceId, ATOM_KIND, `${TRANSCRIPT_KEY_PREFIX}%`]);
- const located = new Set<string>();
- for (const t of transcripts) {
- const at = live.find(row => row.locator === t.filePath);
- if (at) { own.set(t.filePath, at.owner_key.slice(TRANSCRIPT_KEY_PREFIX.length)); located.add(t.filePath); }
- }
- const claimed = new Set([...own.values()].map(key => `${TRANSCRIPT_KEY_PREFIX}${key}`).filter(key => live.some(row => row.owner_key === key)));
- for (const t of transcripts) {
- if (located.has(t.filePath) || claimed.has(`${TRANSCRIPT_KEY_PREFIX}${own.get(t.filePath)}`)) continue;
- const moved = live.find(row => !claimed.has(row.owner_key) && row.input_pin === t.contentHash && row.locator && row.locator !== t.filePath && !existsSync(row.locator));
- if (!moved) continue;
- claimed.add(moved.owner_key);
- own.set(t.filePath, moved.owner_key.slice(TRANSCRIPT_KEY_PREFIX.length));
- if (!dryRun) await engine.executeRaw('UPDATE derived_generations SET locator=$2, updated_at=now() WHERE id=$1', [moved.id, t.filePath]);
- }
- return own;
-}
-
-/**
- * GBRA-161 PR 1b: a transcript atom's slug. The title-and-date slug, unless a live atom of another transcript already
- * holds it (two files of one name in two folders extract the same title): then the slug folds in the transcript's key.
- */
-async function resolveTranscriptAtomSlug(engine: BrainEngine, sourceId: string, title: string, item: { filePath: string; transcriptKey?: string },
- undatedDate: string): Promise<string> {
- const legacy = atomSlug(title, item.filePath, undefined, undatedDate);
- const [held] = await engine.executeRaw<{ source_path: string | null }>(
- `SELECT frontmatter->>'source_path' AS source_path FROM pages WHERE source_id=$1 AND slug=$2 AND deleted_at IS NULL`, [sourceId, legacy]);
- if (!held || held.source_path === item.filePath || !held.source_path) return legacy;
- const [mine] = await engine.executeRaw<{ locator: string | null }>(
- `SELECT locator FROM derived_generations WHERE source_id=$1 AND kind=$2 AND owner_key=$3 AND state='live'`,
- [sourceId, ATOM_KIND, atomOwnerKey({ kind: 'transcript', transcriptKey: item.transcriptKey ?? item.filePath })]);
- return mine?.locator === held.source_path ? legacy : atomSlug(title, item.filePath, item.transcriptKey ?? item.filePath, undatedDate);
-}
-
/**
* Canonical slug stem for an atom title. Routes through slugifySegment (the
* same normalizer the FS-import path uses) and RE-STRIPS a trailing dash after
diff --git a/src/core/generations/repair.ts b/src/core/generations/repair.ts
index a89ed5e22c..259c32d851 100644
--- a/src/core/generations/repair.ts
+++ b/src/core/generations/repair.ts
@@ -23,6 +23,7 @@ import { opError, OperationError, type OperationContext } from '../ops/contract.
import { readFix } from '../ops/op-fix.ts';
import { maintenanceTransaction } from '../persistence/attribution.ts';
import { managedPersistenceEnabled } from '../persistence/ownership.ts';
+import { assertInlineBody } from '../page-body/page-shape.ts';
import { stableJson } from '../persistence/digest.ts';
import { clearApprovedSet, loadApprovedSet, previewChangedError, previewHash, saveApprovedSet } from '../persistence/preview-approval.ts';
import { afterCursor, type RepairHandler, type RepairItem, type RepairItemOutcome, type RepairPlan, type RepairScope } from '../repair/core.ts';
@@ -306,6 +307,7 @@ async function releaseManaged(engine: BrainEngine, adapter: GenerationAdapter<un
const slug = key.ownerKey.slice('source_slug:'.length);
const page = await engine.getPage(slug, { sourceId: key.sourceId });
if (!page?.content_hash) return refused(`origin page ${slug} is gone; the held result cannot publish`);
+ assertInlineBody(page, 'repair generations release-held');
const origin = await atoms.readAtomOrigin(engine, session, { kind: 'page', slug, content: page.compiled_truth, contentHash: page.content_hash });
const outcome = await atoms.publishManagedAtomGeneration(engine, session, origin, proposal.map(item => ({ slug: item.key, content: item.content, links: [] })),
{ key, content: page.compiled_truth, runId: `release:${approved.hold_id}`, release: { holdId: approved.hold_id, reason: approved.reason } });
diff --git a/test/postgres-unit-arms.txt b/test/postgres-unit-arms.txt
index 5314e2b09e..6d6fe3ca7a 100644
--- a/test/postgres-unit-arms.txt
+++ b/test/postgres-unit-arms.txt
@@ -316,8 +316,11 @@ test/pathological/facts-mirror-failures.test.ts
test/pathological/g0-derived-retirement-hold.test.ts
test/pathological/g1-atom-generations.test.ts
test/pathological/g1-generation-crash.test.ts
+test/pathological/g1-generation-load.test.ts
test/pathological/g1-generation-probes.test.ts
test/pathological/g1-generations.test.ts
+test/pathological/g1-managed-atom-keys.test.ts
+test/pathological/g1-managed-atom-probes.test.ts
test/pathological/h1-zero-yield-atom-reextract.test.ts
test/pathological/h2-git-effect-moved-remote.test.ts
test/pathological/h3-chronicle-partial-generation.test.ts