Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Label a life-chronicle event private before its private origin is purged

garrytanbf8675606bba
diff --git a/docs/architecture/key-files/memory-purge.md b/docs/architecture/key-files/memory-purge.md
index e56af3e9da..f6b566b071 100644
--- a/docs/architecture/key-files/memory-purge.md
+++ b/docs/architecture/key-files/memory-purge.md
@@ -34,6 +34,6 @@ User-facing contract: [expire versus purge](../../guides/memory-boundaries.md#pu
- `src/commands/doctor/checks/atom-fence-rows.ts` — doctor `atom_fence_rows` (BRAIN, a host-only `WAVE_CHECKS` repair entry cleared by the explicit-only `atom-fence-rows`, so remediation classifies it `explicit_kind_required`): runs `findAtomFenceRows` per source, each statement bounded by `PLAN_STATEMENT_MS`; `warn` names the count per source and the read-only preview `gbrain repair atom-fence-rows --source <id> --json` as an agent `fix`, never a slug or row text; an overrun reports the count as unknown.
- `src/core/persistence/purge-parks.ts` — #6741 C: per-tombstone purge parks in op_checkpoints (op `purge-deleted-park`, key source+slug+deleted_at, so a re-deleted page starts fresh); park at `PURGE_PARK_LIMIT` (5) non-deferral failures, a success clears it, and parks of a source seen inactive rearm the first run its writer is active again (`notePurgeSourceWriter`). `purgeStaleCheckpoints` exempts the op; `prunePurgeParks` drops parks whose tombstone is gone. A park records the gbrain `version` of its last failure; `isParked` (the managed and unmanaged selection, doctor `purge_parked_pages`) counts only the running version's, so a park another version wrote (or one with no version) gets one automatic attempt and a failure re-parks it under the running version. Tests: `test/purge-deleted-parks.test.ts`, `test/purge-parks-version.test.ts` (Postgres: `test/e2e/purge-parks-version-postgres.test.ts`).
-- `src/core/persistence/derived-origin-hold.ts` + `src/core/repair/origin-carry.ts` — GST-2689: a page that reads as world by its own label but is hidden from remote callers only through a private origin (`derived_from`, an atom's `source_slug`, followed through `slug_aliases` and `slug_rename_history`, or a concept's provenance atom) keeps that privacy once the origin row is gone. `origin-carry.ts` finds the dependents with `private-labels.ts` `dependentsSql('remove')` (the postimage drops the origin rows; a page that names readers is returned when its listed readers would gain it, and gets the label with its `readable_by` kept; life-chronicle events are never returned) and gives each `visibility: private` through the label door (`publishMaintenancePages` with `keepTrust` and the label edit on a managed brain, batch `derived-origin-carry:<request_id>`; `writeLabelFile` or `importAtRevision` otherwise). `deletePageCarryingPrivate` is the `delete_page` handler body: a soft delete (local or remote) labels after it committed and returns the unchanged receipt; a purge labels first and, when that fails, soft-deletes instead (an existing tombstone stays), parks the origin and returns `purge_held`. `carryPrivateBeforePurge` runs before every expiry over all the origins (`type = 'atom'` or hidden by `privacyPartSql`) expired or expiring within `CARRY_LEAD_HOURS` (24) at once, so a page private through two of them is found and none crosses the cutoff mid-run uncarried; it publishes the labels 200 per maintenance batch, parks the blocked ones and returns the ones whose park no longer applies, which `purgeDeletedPagesCoordinated` clears only after its purge, so an origin parked when the purge was previewed stays that run; a consented manual purge (`gbrain pages purge-deleted`, `purge_deleted_pages`) first runs `retryParkedOrigins` so its preview lists the origins it frees. A soft-deleted dependent is returned too but never labelled: it blocks its origin (`dependent_soft_deleted`) until it is purged or restored, since a restore would bring it back with the origin row gone; a removed origin tied to another removed origin counts as such a dependent (judged on its own row), since another hold may keep it. Inside each delete transaction `parkUncarriedInPurge` rechecks the origins about to go (the page purge for an explicit or managed retention purge, the unmanaged bulk delete, and each recorded tombstone): an origin a page written after the carry still depends on is parked in that transaction and its row is kept (a live page is soft-deleted instead, and the receipt carries `purge_held` naming no page), so the next purge labels the page and the one after removes the origin. The origin is looked up by the lowercased slug, as `submitPageMutation` deletes it. `derived-origin-hold.ts` is the park (op_checkpoints op `derived-origin-park`, fingerprint the page id, with `blocking_slug`, `code` and `reason`), `derivedOriginPurgeHold` (no engine-sql imports), prune of restored or purged pages, and `readDerivedOriginParks` for doctor `derived_origin_parked`; `purgeStaleCheckpoints` exempts the op. Tests: `test/derived-origin-carry-private.test.ts` (repo-less, minted tokens), `test/derived-origin-carry-managed.test.ts` (managed Git brain).
+- `src/core/persistence/derived-origin-hold.ts` + `src/core/repair/origin-carry.ts` — GST-2689: a page that reads as world by its own label but is hidden from remote callers only through a private origin (`derived_from`, an atom's `source_slug`, followed through `slug_aliases` and `slug_rename_history`, or a concept's provenance atom) keeps that privacy once the origin row is gone. `origin-carry.ts` finds the dependents with `private-labels.ts` `dependentsSql('remove')` (the postimage drops the origin rows; a page that names readers is returned when its listed readers would gain it, and gets the label with its `readable_by` kept; a life-chronicle event is returned when the removal opens it, never when its `event.depth` page is removed, since it then fails closed) and gives each `visibility: private` through the label door (`publishMaintenancePages` with `keepTrust` and the label edit on a managed brain, batch `derived-origin-carry:<request_id>`; `writeLabelFile` or `importAtRevision` otherwise). `deletePageCarryingPrivate` is the `delete_page` handler body: a soft delete (local or remote) labels after it committed and returns the unchanged receipt; a purge labels first and, when that fails, soft-deletes instead (an existing tombstone stays), parks the origin and returns `purge_held`. `carryPrivateBeforePurge` runs before every expiry over all the origins (`type = 'atom'` or hidden by `privacyPartSql`) expired or expiring within `CARRY_LEAD_HOURS` (24) at once, so a page private through two of them is found and none crosses the cutoff mid-run uncarried; it publishes the labels 200 per maintenance batch, parks the blocked ones and returns the ones whose park no longer applies, which `purgeDeletedPagesCoordinated` clears only after its purge, so an origin parked when the purge was previewed stays that run; a consented manual purge (`gbrain pages purge-deleted`, `purge_deleted_pages`) first runs `retryParkedOrigins` so its preview lists the origins it frees. A soft-deleted dependent is returned too but never labelled: it blocks its origin (`dependent_soft_deleted`) until it is purged or restored, since a restore would bring it back with the origin row gone; a removed origin tied to another removed origin counts as such a dependent (judged on its own row), since another hold may keep it. Inside each delete transaction `parkUncarriedInPurge` rechecks the origins about to go (the page purge for an explicit or managed retention purge, the unmanaged bulk delete, and each recorded tombstone): an origin a page written after the carry still depends on is parked in that transaction and its row is kept (a live page is soft-deleted instead, and the receipt carries `purge_held` naming no page), so the next purge labels the page and the one after removes the origin. The origin is looked up by the lowercased slug, as `submitPageMutation` deletes it. `derived-origin-hold.ts` is the park (op_checkpoints op `derived-origin-park`, fingerprint the page id, with `blocking_slug`, `code` and `reason`), `derivedOriginPurgeHold` (no engine-sql imports), prune of restored or purged pages, and `readDerivedOriginParks` for doctor `derived_origin_parked`; `purgeStaleCheckpoints` exempts the op. Tests: `test/derived-origin-carry-private.test.ts` (repo-less, minted tokens), `test/derived-origin-carry-managed.test.ts` (managed Git brain).
- `src/core/repair/segmented-mirror.ts` — `gbrain repair segmented-mirror` (LPH a), explicit-only, preview-bound, destructive consent, `checks: []` (no doctor scan: detection reads every segmented file). `scanSegmentedMirrors` (read-only, owner host; a non-owner source is held `not_owner_host`) walks live `body_storage='segmented'` pages of sources with a worktree binding whose snapshot ledger applies (`ledgerApplies`), runs `prepareFileTarget(..., null, { allowMissing })` (the mirror's own drift check; `file_database_drift` or any other `OperationError` is held, never rewritten), then lists the page only when overlaying the ledger on the file's facts fences changes its region digests (`fileBodyDigests` vs `overlaidFileBodyDigests` over `FileBytes`, bounded memory) and the streamed render (`unreadPageFile`) hashes differently. The hash (`segmented-mirror-v1`) binds source selection, slug, page id, revision, path and both SHA-256s; the approved set lives in `op_checkpoints`. Apply re-checks revision and file hash of every page not yet admitted (`preview_changed`), then per page admits and commits, in one transaction like a withdrawal, a `repair_segmented_mirror` request (request id derived from the hash; its receipt) that inserts a version-2 targeted `withdrawal-mirror` + `git` effect (no embedding) whose `data.approved_file` carries the preview's file and render SHA-256 (`mirrorPage` skips the target `preview_changed` when the file's before-hash or the streamed render differs, before the gate or any recovery record; `publishGitPage` skips it when the file is not the approved render; the outcome is `refused` `preview_changed` with a read-only fix re-running the preview); it wakes this process's consumer and waits up to the write wait for them (`mirrored` / `mirror_queued` / `held` / `failed`; a replay is `replayed`). Test: `test/pathological/lp-a-segmented-mirror.test.ts`.
diff --git a/src/core/repair/origin-carry.ts b/src/core/repair/origin-carry.ts
index 394f9bdbd5..1feec7f669 100644
--- a/src/core/repair/origin-carry.ts
+++ b/src/core/repair/origin-carry.ts
@@ -5,7 +5,8 @@
* gets `visibility: private` through the label door (repair/label-write.ts): tighten-only, the trust tier kept, no lowering
* proposal filed, a managed file changed in that one line, readable_by kept. The dependents are private-labels.ts
* dependentsSql('remove'): a page already private, pinned or not lineage-dependent is never returned, a page that names
- * readers is returned when its listed readers would gain it, and a life-chronicle event already fails closed, so it is skipped.
+ * readers is returned when its listed readers would gain it, and so is a life-chronicle event the removal opens (its own
+ * derived_from, or the lineage of its event.depth page); one whose event.depth page is removed fails closed and is not.
*
* Two places run it. delete_page (deletePageCarryingPrivate): a soft delete, local or remote, labels the dependents once
* the delete committed, as a maintenance write whose batch names the delete's request id (on a managed brain); a failure
@@ -42,7 +43,7 @@ const failureOf = (error: unknown): Failure => ({ code: typeof (error as { code?
async function dependentsOf(engine: BrainEngine, origins: Origin[]): Promise<Dependent[]> {
const rows = await engine.executeRaw<{ id: number; cleared_id: number; source_id: string; slug: string; deleted: boolean }>(
- `SELECT d.id, d.cleared_id, p.source_id, p.slug, p.deleted_at IS NOT NULL AS deleted FROM (${dependentsSql('remove')}) d JOIN pages p ON p.id = d.id WHERE d.category <> 'life_chronicle' ORDER BY d.id`,
+ `SELECT d.id, d.cleared_id, p.source_id, p.slug, p.deleted_at IS NOT NULL AS deleted FROM (${dependentsSql('remove')}) d JOIN pages p ON p.id = d.id ORDER BY d.id`,
[origins.map(o => o.id), origins.map(o => o.source_id), origins.map(o => o.slug), origins.map(() => '')], bounded);
return rows.map(row => ({ id: Number(row.id), origin_id: Number(row.cleared_id), source_id: row.source_id, slug: row.slug, deleted: row.deleted === true }));
}
diff --git a/test/derived-origin-carry-managed.test.ts b/test/derived-origin-carry-managed.test.ts
index 022e734acf..806d68ef9e 100644
--- a/test/derived-origin-carry-managed.test.ts
+++ b/test/derived-origin-carry-managed.test.ts
@@ -24,6 +24,7 @@ import { operationsByName } from '../src/core/operations.ts';
import { performManagedSync } from '../src/core/persistence/sync-run.ts';
import { SYNC_DELETE_TOMBSTONE_OP } from '../src/core/persistence/sync-delete-tombstones.ts';
import { runPages } from '../src/commands/pages.ts';
+import { submitPageMutation } from '../src/core/persistence/page-mutations.ts';
import { installFaultHook } from '../src/core/persistence/fault-points.ts';
import { purgeDeletedPagesCoordinated } from '../src/core/persistence/purge-deleted.ts';
import { importFromContent } from '../src/core/import-file.ts';
@@ -62,9 +63,19 @@ function fileText(k: string, shape: Shape): string {
return ['---', `title: ${k} ${shape}`, ...fm[shape], '---', '', `Harbor ledger planning notes ${canaryOf(k, shape)} for the roadmap.`, ''].join('\n');
}
const KEYS = ['gitrm', 'purge', 'remote', 'midpurge'];
+/** A private origin, a public meeting, an event derived from the origin whose depth is the meeting, and an event whose depth is the origin. */
+const EVENT_SLUGS = { origin: 'notes/event-origin', depth: 'notes/event-depth', event: 'notes/event-event', closed: 'notes/event-closed' };
+const EVENT_FILES: Record<keyof typeof EVENT_SLUGS, string[]> = {
+ origin: ['type: note', 'visibility: private'],
+ depth: ['type: meeting'],
+ event: ['type: event', 'captured_via: life-chronicle:auto', 'visibility: world', `derived_from: [${EVENT_SLUGS.origin}.md]`, 'event:', ` depth: ${EVENT_SLUGS.depth}`, ' what: planning'],
+ closed: ['type: event', 'captured_via: life-chronicle:auto', 'visibility: world', 'event:', ` depth: ${EVENT_SLUGS.origin}`, ' what: review'],
+};
const setup = ({ root }: { root: string }) => {
mkdirSync(join(root, 'notes'), { recursive: true }); git(root, 'init', '-q', '-b', 'main');
for (const k of KEYS) for (const shape of SHAPES) writeFileSync(join(root, `${slugOf(k, shape)}.md`), fileText(k, shape));
+ for (const [name, fm] of Object.entries(EVENT_FILES)) writeFileSync(join(root, `${EVENT_SLUGS[name as keyof typeof EVENT_SLUGS]}.md`),
+ ['---', `title: event ${name}`, ...fm, '---', '', `Harbor ledger planning notes canaryevent${name} for the roadmap.`, ''].join('\n'));
commit(root, 'notes');
};
@@ -219,5 +230,49 @@ for (const backend of testBackends()) {
await cli(engine, ['purge-deleted', '--json', '--yes']);
await expectCarried(engine, root, k, files);
}, { setup, databaseUrl }), 300_000);
+
+ test('an explicit local purge labels a life-chronicle event whose own derived_from names the origin through the Git door; an event that fails closed on its depth keeps its bytes', () => managedBrain(async ({ engine, root, ctx }) => {
+ await performManagedSync(engine, OPTS);
+ const origin = EVENT_SLUGS.origin, event = EVENT_SLUGS.event, closed = EVENT_SLUGS.closed;
+ const files = Object.fromEntries(Object.values(EVENT_SLUGS).map(slug => [slug, readFileSync(join(root, `${slug}.md`), 'utf8')]));
+ const unbound = async () => {
+ __resetPrivateVisibilityCacheForTests();
+ const remote = { engine, config: { engine: engine.kind }, logger: { info() {}, warn() {}, error() {} }, dryRun: false, remote: true, sourceId: 'default' } as unknown as OperationContext;
+ const read = async (slug: string) => { try { return JSON.stringify(await operationsByName.get_page!.handler(remote, { slug })); } catch { return ''; } };
+ return { event: (await read(event)).includes('canaryeventevent'), closed: (await read(closed)).includes('canaryeventclosed') };
+ };
+ expect(await unbound()).toEqual({ event: false, closed: false });
+ const snapshot = await engine.readPageSnapshot(origin, { sourceId: 'default' });
+ const result = await operationsByName.delete_page!.handler(ctx, { slug: origin, purge: true, request_id: randomUUID(), expected_revision: snapshot!.revision }) as { status: string };
+ expect(result.status).toBe('purged');
+ await settleManagedGitEffects(engine);
+ expect(await page(engine, origin)).toBeUndefined();
+ expect((await fmOf(engine, event)).visibility).toBe('private');
+ const after = readFileSync(join(root, `${event}.md`), 'utf8');
+ const rest = (text: string) => text.split('\n').filter(line => !line.startsWith('visibility:'));
+ expect(after.split('\n').filter(line => line.startsWith('visibility:'))).toEqual(['visibility: private']);
+ expect(rest(after)).toEqual(rest(files[event]!));
+ expect(readFileSync(join(root, `${closed}.md`), 'utf8')).toBe(files[closed]!);
+ expect(await unbound()).toEqual({ event: false, closed: false });
+ }, { setup, databaseUrl }), 300_000);
+
+ test('a repo-less managed source: an explicit purge labels the life-chronicle event through the maintenance door (database only) before the row goes', () => managedBrain(async ({ engine }) => {
+ const sourceId = 'loose';
+ await fixtureWrite(engine, () => engine.executeRaw('INSERT INTO sources (id, name, local_path) VALUES ($1, $1, NULL)', [sourceId]));
+ const ctx = { engine, config: { engine: engine.kind, embedding_disabled: true }, sourceId, remote: false, dryRun: false, logger: { info() {}, warn() {}, error() {} } } as unknown as OperationContext;
+ for (const [name, fm] of Object.entries(EVENT_FILES)) {
+ const content = ['---', `title: event ${name}`, ...fm, '---', '', `Harbor ledger planning notes canaryevent${name} for the roadmap.`, ''].join('\n');
+ await submitPageMutation(ctx, { operation: 'put_page', params: { slug: EVENT_SLUGS[name as keyof typeof EVENT_SLUGS], content, request_id: randomUUID() } });
+ }
+ const fmIn = async (slug: string) => { const [row] = await engine.executeRaw<{ frontmatter: unknown }>('SELECT frontmatter FROM pages WHERE source_id=$1 AND slug=$2', [sourceId, slug]);
+ return row ? (typeof row.frontmatter === 'string' ? JSON.parse(row.frontmatter) : row.frontmatter) as Record<string, unknown> : undefined; };
+ const closedBefore = await fmIn(EVENT_SLUGS.closed);
+ const snapshot = await engine.readPageSnapshot(EVENT_SLUGS.origin, { sourceId });
+ const result = await operationsByName.delete_page!.handler(ctx, { slug: EVENT_SLUGS.origin, purge: true, request_id: randomUUID(), expected_revision: snapshot!.revision }) as { status: string };
+ expect(result.status).toBe('purged');
+ expect(await fmIn(EVENT_SLUGS.origin)).toBeUndefined();
+ expect((await fmIn(EVENT_SLUGS.event))?.visibility).toBe('private');
+ expect(await fmIn(EVENT_SLUGS.closed)).toEqual(closedBefore);
+ }), 300_000);
});
}
diff --git a/test/derived-origin-carry-private.test.ts b/test/derived-origin-carry-private.test.ts
index 47a3af6f38..137bce55e4 100644
--- a/test/derived-origin-carry-private.test.ts
+++ b/test/derived-origin-carry-private.test.ts
@@ -526,6 +526,82 @@ for (const kind of testBackends()) {
await expectCarriedHidden(k);
}, 240_000);
+ /**
+ * Life Chronicle events: one whose own derived_from names the private origin while its event.depth page is public
+ * (opens once the origin goes, so it is labelled), and one whose event.depth is the origin itself (fails closed once
+ * the origin is missing, so it is left as it is).
+ */
+ async function seedEvents(k: string): Promise<{ origin: string; event: string; closed: string }> {
+ const origin = `${k}/origin`, depth = `${k}/depth`, event = `${k}/event`, closed = `${k}/closed`;
+ const write = async (slug: string, fm: string[]) => expect((await importFromContent(engine, slug, ['---', `title: ${slug}`, ...fm, '---', `# ${slug}`, '',
+ `Harbor ledger planning notes ${canaryOf(k, 'plain')}${slug.split('/')[1]} for the roadmap.`].join('\n'), { sourceId: SRC, noEmbed: true })).status).toBe('imported');
+ await write(origin, ['type: note', 'visibility: private']);
+ await write(depth, ['type: meeting']);
+ await write(event, ['type: event', 'captured_via: life-chronicle:auto', 'visibility: world', `derived_from: [${origin}.md]`, 'event:', ` depth: ${depth}`, ' what: planning']);
+ await write(closed, ['type: event', 'captured_via: life-chronicle:auto', 'visibility: world', 'event:', ` depth: ${origin}`, ' what: review']);
+ return { origin, event, closed };
+ }
+ const eventRead = async (who: Caller, k: string, slug: string) => (await call(who, 'get_page', { slug })).text.includes(`${canaryOf(k, 'plain')}${slug.split('/')[1]}`);
+ async function expectEventsHidden(k: string, slugs: string[]): Promise<void> {
+ __resetPrivateVisibilityCacheForTests();
+ for (const who of ['unbound', 'alice'] as const) for (const slug of slugs) expect({ who, slug, read: await eventRead(who, k, slug) }).toEqual({ who, slug, read: false });
+ for (const slug of slugs) expect({ slug, read: await eventRead('owner', k, slug) }).toEqual({ slug, read: true });
+ }
+
+ test('an explicit purge labels a life-chronicle event whose own derived_from names the origin; an event that fails closed on its depth is left as it is', async () => {
+ const k = 'eventpurge';
+ const { origin, event, closed } = await seedEvents(k);
+ await expectEventsHidden(k, [event, closed]);
+ const closedBefore = await fm(closed);
+ const out = await localCall('delete_page', { slug: origin, purge: true, request_id: randomUUID(), expected_revision: await revision(origin) });
+ expect(out.isError ? out.text : '').toBe('');
+ expect(JSON.parse(out.text).status).toBe('purged');
+ await nothingKept(origin);
+ expect((await fm(event)).visibility).toBe('private');
+ expect(await fm(closed)).toEqual(closedBefore);
+ await expectEventsHidden(k, [event, closed]);
+ }, 240_000);
+
+ test('the retention purge labels a life-chronicle event whose own derived_from names the expired origin before the row goes', async () => {
+ const k = 'eventexpiry';
+ const { origin, event, closed } = await seedEvents(k);
+ const closedBefore = await fm(closed);
+ await softDelete(origin);
+ await backdate(origin);
+ expect((await purgeDeletedPagesCoordinated(engine, 72, { automatic: true })).slugs).toContain(origin);
+ await nothingKept(origin);
+ expect((await fm(event)).visibility).toBe('private');
+ expect(await fm(closed)).toEqual(closedBefore);
+ await expectEventsHidden(k, [event, closed]);
+ }, 240_000);
+
+ test('a life-chronicle event that cannot be labelled parks its origin: never purged, the event stays hidden; fixed, the origin goes', async () => {
+ const k = 'eventpark';
+ const { origin, event, closed } = await seedEvents(k);
+ const original = labelWrite.importAtRevision;
+ const failing = spyOn(labelWrite, 'importAtRevision').mockImplementation(async (...args: Parameters<typeof original>) => {
+ if (args[1].slug === event) throw new Error('forced label failure');
+ return original(...args);
+ });
+ try {
+ const out = JSON.parse((await localCall('delete_page', { slug: origin, purge: true, request_id: randomUUID(), expected_revision: await revision(origin) })).text);
+ expect(out.status).not.toBe('purged');
+ expect(out.purge_held?.code).toBe('derived_origin_parked');
+ await backdate(origin);
+ const held = await purgeDeletedPagesCoordinated(engine, 72, { automatic: true });
+ expect(held.slugs).not.toContain(origin);
+ expect(held.blocked.find(b => b.slug === origin)?.code).toBe('derived_origin_parked');
+ } finally { failing.mockRestore(); }
+ expect((await row(origin))?.deleted_at).not.toBeNull();
+ expect((await checkDerivedOriginParked(engine)).details).toEqual(expect.objectContaining({ origins: expect.arrayContaining([expect.objectContaining({ slug: origin, blocking_slug: event })]) }));
+ await expectEventsHidden(k, [event, closed]);
+ expect((await purgeDeletedPagesCoordinated(engine, 72, { automatic: true })).slugs).not.toContain(origin);
+ expect((await fm(event)).visibility).toBe('private');
+ expect((await purgeDeletedPagesCoordinated(engine, 72, { automatic: true })).slugs).toContain(origin);
+ await nothingKept(origin);
+ await expectEventsHidden(k, [event, closed]);
+ }, 240_000);
+
test('a stamp that fails parks the origin: never purged, named by doctor with the page that blocks it, the derived page stays hidden; fixed, the next purge stamps and unparks and the one after purges', async () => {
const k = 'park';
await seed(k);