Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

graduation(g2a): lane placeholders for G1/G2b modules (integrator: take the owning lane's file)

garrytanfa6088284d68
diff --git a/src/core/persistence/graduation-copy.ts b/src/core/persistence/graduation-copy.ts
new file mode 100644
index 0000000000..6d089a842a
--- /dev/null
+++ b/src/core/persistence/graduation-copy.ts
@@ -0,0 +1,15 @@
+/**
+ * LANE PLACEHOLDER (G2a branch only). Lane G2b owns this module; the integrator
+ * takes G2b's file. Signatures match GRADUATION_LANES.md.
+ */
+import type { BrainEngine } from '../engine.ts';
+import type { GraduationEngines, InventoryEntry, TriggerBypass } from './engine-graduation.types.ts';
+
+const placeholder = (fn: string): Error => new Error(`graduation-copy.ts placeholder: ${fn} is supplied by lane G2b`);
+
+export async function detectTriggerBypass(_target: BrainEngine): Promise<TriggerBypass | null> { throw placeholder('detectTriggerBypass'); }
+export async function copyTable(_e: GraduationEngines, _entry: InventoryEntry, _opts: { bypass: TriggerBypass; batchBytes?: number; onBatch?: (rows: number) => void; runId: string }): Promise<{ rows: number }> { throw placeholder('copyTable'); }
+export async function copySequences(_e: GraduationEngines): Promise<void> { throw placeholder('copySequences'); }
+export async function deferIndexes(_target: BrainEngine): Promise<void> { throw placeholder('deferIndexes'); }
+export async function buildDeferredIndexes(_target: BrainEngine): Promise<void> { throw placeholder('buildDeferredIndexes'); }
+export async function reenableTriggers(_target: BrainEngine, _relations: readonly string[]): Promise<void> { throw placeholder('reenableTriggers'); }
diff --git a/src/core/persistence/graduation-digest.ts b/src/core/persistence/graduation-digest.ts
new file mode 100644
index 0000000000..78aac68a49
--- /dev/null
+++ b/src/core/persistence/graduation-digest.ts
@@ -0,0 +1,12 @@
+/**
+ * LANE PLACEHOLDER (G2a branch only). Lane G1 owns this module; the integrator
+ * takes G1's file. Signatures match GRADUATION_LANES.md.
+ */
+import type { BrainEngine } from '../engine.ts';
+import type { InventoryEntry, TableReceipt } from './engine-graduation.types.ts';
+
+const placeholder = (fn: string): Error => new Error(`graduation-digest.ts placeholder: ${fn} is supplied by lane G1`);
+
+export interface ColumnMeta { name: string; type: string }
+export function canonicalRowText(_row: Record<string, unknown>, _columns: readonly ColumnMeta[]): string { throw placeholder('canonicalRowText'); }
+export async function digestTable(_engine: BrainEngine, _entry: InventoryEntry, _opts?: { batchRows?: number; applyTransforms?: boolean }): Promise<TableReceipt> { throw placeholder('digestTable'); }
diff --git a/src/core/persistence/graduation-drain.ts b/src/core/persistence/graduation-drain.ts
new file mode 100644
index 0000000000..c3669bf3ee
--- /dev/null
+++ b/src/core/persistence/graduation-drain.ts
@@ -0,0 +1,13 @@
+/**
+ * LANE PLACEHOLDER (G2a branch only). Lane G2b owns this module; the integrator
+ * takes G2b's file. Signatures match GRADUATION_LANES.md.
+ */
+import type { BrainEngine } from '../engine.ts';
+import type { GBrainConfig } from '../config.ts';
+import type { GraduationBlocker } from './engine-graduation.types.ts';
+
+const placeholder = (fn: string): Error => new Error(`graduation-drain.ts placeholder: ${fn} is supplied by lane G2b`);
+
+export async function graduationBlockers(_source: BrainEngine, _hostId: string): Promise<readonly GraduationBlocker[]> { throw placeholder('graduationBlockers'); }
+export async function drainForGraduation(_source: BrainEngine, _opts: { timeoutMs: number; hostId: string; config: GBrainConfig }): Promise<{ drained: readonly string[]; blockers: readonly GraduationBlocker[] }> { throw placeholder('drainForGraduation'); }
+export async function freezeSource(_source: BrainEngine): Promise<void> { throw placeholder('freezeSource'); }
diff --git a/src/core/persistence/graduation-inventory.ts b/src/core/persistence/graduation-inventory.ts
new file mode 100644
index 0000000000..0d70ccffa4
--- /dev/null
+++ b/src/core/persistence/graduation-inventory.ts
@@ -0,0 +1,15 @@
+/**
+ * LANE PLACEHOLDER (G2a branch only). Lane G1 owns this module; the integrator
+ * takes G1's file. Signatures match GRADUATION_LANES.md exactly so the
+ * orchestrator typechecks against the contract.
+ */
+import type { BrainEngine } from '../engine.ts';
+import type { Inventory, InventoryEntry } from './engine-graduation.types.ts';
+
+const placeholder = (fn: string): Error => new Error(`graduation-inventory.ts placeholder: ${fn} is supplied by lane G1`);
+
+export const GRADUATION_INVENTORY: Inventory = { version: 0, entries: [] };
+export function expectedRelations(_engine: 'pglite' | 'postgres'): readonly string[] { throw placeholder('expectedRelations'); }
+export async function assertRelationSet(_engine: BrainEngine, _kind: 'pglite' | 'postgres', _inv?: Inventory): Promise<void> { throw placeholder('assertRelationSet'); }
+export async function copyOrder(_engine: BrainEngine, _inv?: Inventory): Promise<readonly InventoryEntry[]> { throw placeholder('copyOrder'); }
+export async function fkClosure(_engine: BrainEngine, _relation: string): Promise<readonly string[]> { throw placeholder('fkClosure'); }
diff --git a/src/core/persistence/graduation-target.ts b/src/core/persistence/graduation-target.ts
new file mode 100644
index 0000000000..e6995c796e
--- /dev/null
+++ b/src/core/persistence/graduation-target.ts
@@ -0,0 +1,15 @@
+/**
+ * LANE PLACEHOLDER (G2a branch only). Lane G2b owns this module; the integrator
+ * takes G2b's file. Signatures match GRADUATION_LANES.md; `TargetProbe` is
+ * G2b's type (the orchestrator reads only `empty`, through `probeTargetEmpty`).
+ */
+import type { BrainEngine } from '../engine.ts';
+import type { TargetIdentity, TargetRoutes } from './engine-graduation.types.ts';
+
+const placeholder = (fn: string): Error => new Error(`graduation-target.ts placeholder: ${fn} is supplied by lane G2b`);
+
+export interface TargetProbe { empty: boolean }
+export function resolveTargetRoutes(_opts: { url?: string; urlEnv?: string; env?: NodeJS.ProcessEnv }): TargetRoutes & { mainUrl: string; ddlUrl: string } { throw placeholder('resolveTargetRoutes'); }
+export function targetIdentity(_url: string): TargetIdentity { throw placeholder('targetIdentity'); }
+export async function probeTarget(_routes: TargetRoutes & { mainUrl: string; ddlUrl: string }): Promise<TargetProbe> { throw placeholder('probeTarget'); }
+export async function crossCheckRoutes(_main: BrainEngine, _ddl: BrainEngine, _runId: string): Promise<void> { throw placeholder('crossCheckRoutes'); }
diff --git a/src/core/persistence/graduation-verify.ts b/src/core/persistence/graduation-verify.ts
new file mode 100644
index 0000000000..28b2204150
--- /dev/null
+++ b/src/core/persistence/graduation-verify.ts
@@ -0,0 +1,11 @@
+/**
+ * LANE PLACEHOLDER (G2a branch only). Lane G1 owns this module; the integrator
+ * takes G1's file. Signatures match GRADUATION_LANES.md.
+ */
+import type { BrainEngine } from '../engine.ts';
+import type { GraduationEngines, Inventory, ReplayProbeResult, TableReceipt, VerifyResult } from './engine-graduation.types.ts';
+
+const placeholder = (fn: string): Error => new Error(`graduation-verify.ts placeholder: ${fn} is supplied by lane G1`);
+
+export async function verifyGraduation(_e: GraduationEngines, _ctx: { inventory: Inventory; sourceReceipts: readonly TableReceipt[]; replayRequestId?: string; runDoctor: () => Promise<readonly string[]> }): Promise<VerifyResult> { throw placeholder('verifyGraduation'); }
+export async function replayProbe(_target: BrainEngine, _requestId: string, _callerIntent?: unknown): Promise<ReplayProbeResult> { throw placeholder('replayProbe'); }