Skip to content

Commit 6a1892e

Browse files
committed
feat(spec,cli,plugin-audit): list sys_seed_landed_key on the platform object roster, inventory it for the ownership ceremony, keep it out of the audit ledger
Claude-Session: https://claude.ai/code/session_017xRBcTJTE7kSbcMoJQ4Txf Co-authored-by: Claude <noreply@anthropic.com>
1 parent d1abef0 commit 6a1892e

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎.changeset/seed-landed-keys-31021.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
'@objectstack/metadata-protocol': minor
33
'@objectstack/runtime': minor
44
'@objectstack/platform-objects': minor
5+
'@objectstack/spec': minor
6+
'@objectstack/cli': minor
7+
'@objectstack/plugin-audit': minor
58
---
69

710
fix(metadata-protocol,runtime): a seed row a person deleted is no longer inserted again under a new id by the next seed replay
@@ -21,3 +24,5 @@ The seed loads AppPlugin runs now keep a per-organization record of which seed r
2124
The deliberate re-seed is the `seed-replayer` service called with `{ reseed: true }`. It inserts every missing row, including the ones a person removed, and records them again. A new database starts with an empty record. Deleting an organization deletes its record.
2225

2326
`SeedLoaderService` takes the record through a new constructor option, `landedKeys: 'honour' | 'reseed'`. A caller that does not pass it neither reads nor writes the record, so the package publish, marketplace install, reseed and purge doors behave as before. A load keeps no record when it seeds no organization, and says so at `info`. It also keeps none when the composition does not register `sys_seed_landed_key`, and says so at `warn`. A record write that fails is reported once at `error`. It fails neither the rows nor the load, and the next load records every row that is still present.
27+
28+
`PLATFORM_OBJECTS_BY_PACKAGE['platform-objects']` in `@objectstack/spec` lists the new object, and so do `PLATFORM_PROVIDED_OBJECT_NAMES` and `isPlatformProvidedObjectName`, so a stack that references `sys_seed_landed_key` resolves it instead of drawing the unknown-platform-name advisory. `@objectstack/plugin-audit` leaves `sys_seed_landed_key` out of `sys_audit_log` and `sys_activity`: recording which seed rows landed writes no ledger row of its own, and the seeded rows stay audited. `os migrate organization-ownership` inventories the new table as organization-owned rows (fate 3, attribution), each written with the organization its load seeds.

‎packages/cli/src/utils/organization-ownership-inventory.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,12 @@ export const ORGANIZATION_OWNERSHIP_INVENTORY: readonly InventoryEntry[] = [
820820
// organization). The record an entry names is gone, so no parent row
821821
// anchors an entry.
822822
{ object: 'sys_recycle_bin', census: PMAIN, fate: 'attribution', citation: `${CENSUS_MAIN} (in reach, added since the first census); ${D10_SINGLE}`, anchors: [] },
823+
// The record of landed seed rows (`@objectstack/platform-objects`, #31021):
824+
// the seed loader writes each row with the organization the load seeds and
825+
// writes none when the load seeds no organization, so a NULL row has no
826+
// producer. A key names a seed row by its natural key, not by id, so no
827+
// parent row anchors it.
828+
{ object: 'sys_seed_landed_key', census: PMAIN, fate: 'attribution', citation: `${CENSUS_MAIN} (in reach, added since the first census); ${D10_SINGLE}`, anchors: [] },
823829
// A reader's own named list views (`@objectstack/platform-objects`, ruling
824830
// 6570568131 on #28971): user data on the preference template, each row in
825831
// its owner's organization; no parent row anchors a view.

‎packages/plugins/plugin-audit/src/audit-writers.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ const SKIP_OBJECTS = new Set<string>([
320320
// Not an act anyone performed; the ruling that created the object forbids
321321
// an audit row per sweep.
322322
'sys_lifecycle_state', // sweep watermark (1 write per sweep)
323+
// [#31021] The seed loader's record of which seed rows landed in an
324+
// organization (`managedBy: 'engine-owned'`, no data API), written ONLY by
325+
// `SeedLoaderService` under the seed write context, one row per key it
326+
// lands. Audited, every seed load would mirror its own bookkeeping into
327+
// `sys_audit_log` and `sys_activity` row for row — the first replay after
328+
// the upgrade, one per seeded row. The seeded rows themselves stay audited.
329+
'sys_seed_landed_key', // landed seed keys (1 write per new key)
323330
]);
324331

325332
/**

‎packages/spec/src/system/constants/platform-object-names.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export const PLATFORM_OBJECTS_BY_PACKAGE: Readonly<Record<string, readonly strin
8787
'sys_scim_subject',
8888
'sys_scim_user',
8989
'sys_secret',
90+
'sys_seed_landed_key',
9091
'sys_session',
9192
'sys_setting',
9293
'sys_setting_audit',

0 commit comments

Comments
 (0)