You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
metadata: the artifact door's memory loader and the database loader keep one row per name, so a slotted type's removed or second holder's item is still served (ADR-0150 D4) #32246
area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratedomain:serverDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p1High: required for production / M2
Filed by seat 3, carried out of #32198's step 0 (readings 6769829196, tree e40f2df2) per the seat's ruling there (Q1 write side, Q2). ⛔ Not a claim.
④ coordination card: a child of the ADR-0150 epic #31527.
Epic: ADR-0150 (#31527). Lane:domain:server (metadata). Reader: the server seat that claims it. Serial: after #32198 (removal by (package, name) in MetadataManager), which pins the residue this card removes.
Two loaders below the slotted store still key by bare name
DatabaseLoader saves and deletes by {type, name} and never writes the package_id column. A name has one row (the last writer's), and the package lives only in the body. For a slotted type, the second holder's save overwrites the first's stored row. No in-tree production bootstrap wires DatabaseLoader (setDatabaseDriver and setDataEngine have no production caller), so first-party reach is 0 today.
Do
The MemoryLoader. For a type in PACKAGE_SLOTTED_STORE_TYPES, it keys by (package, name) and unregisterAt deletes P's row. Non-slotted types are unchanged (CONTROL), and the claimer measures that they are.
The DatabaseLoader. For a slotted type, it writes package_id and keys save and delete by (package, name). A migration for existing rows is re-runnable and never guesses a package. Rows whose body names no package stay as they are.
Census the other loaders (file system, remote) for the same keying, and record each.
Clause-②: the seat declares it. A removed item that was still served stops being served (exists true → false), so declare it FROM → TO. Dedupe (open and closed, MemoryLoader name, DatabaseLoader package_id, DatabaseLoader package): none for this. Business reason: without this, uninstalling a package does not remove its agents, skills or APIs from reads, and two packages' same-named items overwrite each other in the database. Epic red-line review before landing.
Carried from the #32274 contract review · 2026-11-10T16:13Z
The contract review of PR #32274 (#32198, record on that PR at head 9e2a4a91) passed with no must-fix. These items belong to this card's per-package storage work and are carried here, so the next dev reads them at step 0:
Cluster replay drops every slot.attachClusterPubSub replays a peer's watcher event through invalidateForForeignWrite(type, name), which calls deleteRegistryEntries(type, name) with no keys. Removing P1's slot on one node still drops P2's slot on the other nodes. The same holds on main for any write; the peer cannot rehydrate two slots until storage is per package.
register() realtime events name no package for artifact-door items.created/updated read data.packageId only, while deleted now carries the package, so a packageId-filtered subscription sees the removal and never the arrival.
unregisterPackage judges a slotted item by its body, not its slot. A package-less customization written into sole holder P's slot (storeWriteKey) survives unregisterPackage(P). For a slotted type, slotPackageOf(key) === P should select it too.
Two attribution rules.isPackageMember reads packageId, package, _packageId; storedItemPackageId reads packageId, _packageId. Align them, or say why in isPackageMember's doc.
DatabaseLoader.delete reads one row by (type, name). With per-package rows that lookup must take the package; the package_id column branch of storedRowPackageId has no pin.
Bare slot beside package slots. No pin registers a package-less item beside package items in storeRemovalKeys; with two holders plus a bare slot, the bare item cannot be removed on its own.
#32198 landed (PR #32274, 8080763c), so this card's serial line is met. Step 0 reads the six items carried from the #32274 contract review (comment above) and the residue pin #32274 left in metadata-manager-match-endpoint.test.ts, which this card flips. The card stays a precondition of #31700. pm:blocked is replaced by pm:queue with this note.
Claim: PM loop round 2 · #32246 (the artifact door's memory loader and the database loader keep one row per name for a slotted type) · 2026-11-10T17:44Z
Session: session_01WGufzeeBmtefMTT21doena (seat); dev = a new card thread, its session restated by amendment
Account: os-support-ai
Branch: claude/project-thread-PENDING (the card thread's harness-pinned branch, restated by amendment before its first push)
Worktree: the card thread's checkout of objectstack-ai/objectstack
Domain: domain:server
Seat: domain:server#3
File surface: metadata loaders/memory-loader.ts and loaders/database-loader.ts (save, load, delete keyed by (package, name) for a slotted type), the sys_metadatapackage_id write and a re-runnable migration for existing rows, metadata-manager.ts only where the six carried items touch it (attachClusterPubSub replay, register() realtime package, unregisterPackage by slot, one attribution rule, bare slot beside package slots); tests, dogfood pins, changeset. package-slotted-store.ts membership is read, not changed. Stop on breach.
Container & model: M, mode:thread, model: TIER_DEFAULT, effort: xhigh (p1, #31700 precondition)
Clause-②: yes — a widening, each holder served its own stored body, restated after step 0
Metadata-protocol: none
Responsibility: metadata (objectstack) stores a slotted type by bare name below the slotted store, so the last writer's row is served after removal and a second holder overwrites the first | #32274 already removes by (package, name) in memory and scopes the row delete | ADR-0150 D4; the six items carried from the #32274 contract review (comment 6772564384 on this card); step 0 measures every loader and caller
Thread-read: 6774691130
Premise: holds. At main8080763c, MemoryLoader and DatabaseLoader key by {type, name}, and #32274 pinned the residue as today's behaviour.
Serial constraints: #32198 landed (8080763c). #32162 (seat 4) adds permission to the slotted set; this card's pins iterate the live set, and whichever lands second merges main. #31700 waits on this card.
Step 0 readings: per-package loader rows for every slotted type · 2026-11-10T17:59Z
Tree: objectstack-ai/objectstack at 60b99f8f (origin/main at dispatch). PACKAGE_SLOTTED_STORE_TYPES there is api, agent, skill; #32162 (permission) has not landed. Dev branch claude/project-thread-5jksh9 (this card thread's harness-pinned branch, the one claim 6774718444 left as PENDING), session session_01WGufzhDgj3dYme67H4LpZi. Nothing is pushed. Waiting for the seat's go.
How it was measured. A scratch vitest (not committed; copy and raw JSON in the project files under server-orders/seat3/32246-step0/) on the real MetadataManager, booted the way the artifact door boots: the sink runs MemoryLoader.save then register(…, { notify: false }), and a DatabaseLoader on an in-memory driver is the one writable datasource: loader. P1 com.acme.alpha then P2 com.acme.beta each register one item named shared_TYPE for api, agent, skill, in two shapes: the door's (_packageId only) and an envelope item (flat packageId only). Removal by unregisterPackage and by unregister(…, { packageId }), in both orders: 48 scenarios, plus a view CONTROL. After every step each read was taken twice: on the live manager, and on a second manager over the same rows and the same door loader with an empty registry (a restart over stored rows, or a cluster peer after its replay dropped the slots). 43/43 green, exit 0.
1. What each save stores and what each read serves (same for all three types and both shapes)
step
door MemoryLoader
DatabaseLoader rows
live manager: list · bare get · exists · get(P1) · get(P2)
empty registry: same reads
save P1
P1
one row, P1's body, package_id NULL
P1 · P1 · true · P1 · undefined
P1 · P1 · true · P1 · P1
save P2
P2 only (keyed by name, last writer wins)
one row, P2's body, package_id NULL (P1's body overwritten)
The registry answers correctly while it holds a slot of the name. Every wrong answer comes from the loaders, in two ways. (a) Neither loader keys by package, so the stored state is "the last writer's body" and P1's stored item is lost at P2's save. (b) The manager's loader fallback ignores the package: get/getDiagnosed fall back to load(type, name) with no package, so a read naming P1 is served P2's body (empty-registry column, every row), and a bare read of a name two packages stored is served the last writer instead of D3's 409. list admits loader items one per name (admitLoaderItems dedupes by name), so it shows one item where two are stored.
unregisterAt deletes from datasource: loaders only, so the door's memory: loader is never deleted from: after the last holder goes, every read is served P2's body, the read naming the removed P1 included.
CONTROL view (outside the set): one item per name in the registry and in both loaders, last writer wins, and the same door residue after removal. Do 1 keeps it CONTROL.
2. Census of loaders and of DatabaseLoader wiring
loader
protocol · key
manager writes / deletes
first-party construction
verdict
MemoryLoader
memory: · type → name → body
never saved by register, never deleted by unregisterAt (the door saves into it directly)
1: the artifact door, plugin.ts_parseAndRegisterArtifact, one per artifact load; an HMR reload builds a new one and registerLoader replaces it under the same contract name
this card (Do 1)
DatabaseLoader
datasource: · rows by (type, name), package_id never written
register → save; unregisterAt → delete (package-scoped since #32274)
0: setDatabaseDriver, setDataEngine and the constructor's datasource + driver pair have no production caller; the only production manager is NodeMetadataManager in plugin.ts (rootDir, watch, formats)
this card (Do 2); @objectstack/metadata is published, so an outside host's wiring is not measurable here
FilesystemLoader
file: · ROOT/TYPE/NAME.EXT
never (register writes datasource: only); only the legacy save() API writes it
1: NodeMetadataManager's constructor on every MetadataPlugin boot
no change: one root is one package (MetadataPluginOptions.packageId stamps every item, else every item is package-less), so two packages' same-named items cannot share a root
RemoteLoader
http: · BASEURL/TYPE/NAME
never; it has no delete
0 constructions
recorded, no change: keyed by name on the remote's wire; per-package would be a wire change
any other MetadataLoader
—
—
none in tree (implements MetadataLoader: the four above)
—
Not a MetadataLoader, but the production writer of sys_metadata: metadata-protocol's SysMetadataRepository, which already keys rows by (type, name, package_id, bundle_member).
The manager's other loader reads, which a per-package loader must be read through: loadMany dedupes by body.name, loadManyKeyed by key, listNames and exists are name-level (they stay so), and listForPackageScopedIndex (the api endpoint index) already slots loader entries by package.
3. sys_metadata.package_id and the migration
The column exists: metadata-core sys-metadata.object.ts, text(255), nullable. It is part of the declared unique idx_sys_metadata_overlay_active (type, name, package_id, bundle_member) and of the protocol's partial (type, name, COALESCE(package_id,''), COALESCE(bundle_member,'')) WHERE state = 'active', so one row per (package, name) is already admitted by both.
DatabaseLoader rows are marked: its save creates every row with source = 'database', a column the repository never writes.
A ripple Do 2 must carry: sys_metadata_history has no package column and a unique (type, name, version), and DatabaseLoader numbers a row's versions from that row's own version. Two per-package rows of one name would both write (type, name, 1); the second insert collides, is caught, logged at error, and that history row is lost. So the write numbers versions per name across packages. registerRollback, getHistoryRecord and queryHistory stay keyed by (type, name), so for a two-holder name a rollback reads whichever row comes first: proposed as a recorded follow-up (0 wiring), not this card.
Proposed migration.migrateDatabaseLoaderRowPackages in @objectstack/metadata/migrations, beside migrateProjectIdToEnvironmentId, run best-effort once per loader from ensureSchema and callable by an operator. It binds a row when all four hold: its type is in the live set, package_id is NULL, source = 'database', and its stored body names a package (storedItemPackageId: the envelope's packageId, else _packageId). It sets package_id to that package and reports what it bound and what it left.
Re-runnable: a bound row no longer matches.
Never guesses: a body that names no package (a package-less customization, D4) stays NULL. A row the protocol wrote (no source) is never touched, because "a body stamp binds nothing" is the protocol's served-override rule and those rows are R15's (ADR-0146 D11; its ceremony covers the five overlay types, none of them slotted).
The write path adopts an unbound legacy row whose body names the package instead of creating a second one, so a boot before the migration runs never duplicates a row.
Not recoverable: the first holder's body that a pre-upgrade save overwrote. The next boot's door registration writes it back, because register persists every door item to a writable datasource: loader.
4. The six items carried from the #32274 contract review
#
reachable on main?
proposal
1 cluster replay drops every slot
Only with MetadataClusterBridgePlugin composed and a watcher-notifying write of a two-holder name. First-party notifying writers on these types: 0 (the door, the filesystem boot and AppPlugin's registerInMemory do not notify; removal callers 0).
Record. Once loaders answer per package, a dropped slot is re-read from per-package storage: the empty-registry column above is that peer state, and it turns from P2's body to P1's. What stays is a slot no loader holds (AppPlugin's registerInMemory('api')), which a name-level event already drops for every type on main. Cost of per-slot invalidation, if ruled in:ClusterMetadataChangedPayload is metadata-local (not spec) and gains an optional packageId. register sends storedItemPackageId(data) and unregisterAt its removal package, for a slotted type. On receipt the peer drops (P, name)'s slot, plus the bare slot a package write replaced. A peer on an older release ignores the field and drops every slot, as today. About 40 lines plus pins; spec MetadataWatchEvent unchanged; one more clause-② row (the peer keeps the other package's slot).
2 register() realtime names no package for door items
Producer yes, measured: a _packageId-only agent publishes metadata.agent.created with no packageId; an envelope agent names it. At boot the realtime bridge is set after the artifact load, so nothing is published; the HMR artifact reload (os dev) re-registers with it set. First-party subscribeMetadata callers: 0. Among slotted types only agent has realtime events.
Fix: created/updated read the package with storedItemPackageId(data), one line, for every type, so deleted and the arrivals name the package the same way.
3 unregisterPackage judges a slotted item by its body
Yes, measured: a package-less register after P1's door item lands in P1's slot (D4); unregisterPackage(P1) leaves it, still served to get(…, P1) and to the bare read. Callers: 0.
Fix: for a slotted type, also select the entries in P's slot (slotPackageOf(key) === P, exported from package-slotted-store.ts); its stored copies go with it.
4 two attribution rules
They differ on three inputs: the legacy package key (only isPackageMember; first-party writer onto an item: 0 found), a nested envelope's body _packageId (only storedItemPackageId), and an item whose keys name two packages (isPackageMember matches any; storedItemPackageId takes the envelope first).
Record, with the reason in isPackageMember's doc: it is the membership of the package-wide verbs over every type, legacy package included; the slot rule is storedItemPackageId, and after item 3 a slotted type's membership also reads the slot. Aligning instead moves unregisterPackage/publishPackage/revertPackage membership on the last two inputs (0 first-party callers).
5 DatabaseLoader.delete reads one row by (type, name)
Only with a DatabaseLoader: 0 wiring.
Fix in Do 2: delete keyed by the package; the package_id column branch gets pins, since this card writes the column.
6 bare slot beside package slots
Measured: two holders plus a package-less write; unregister(type, name) is refused 409, unregister(…, { packageId }) takes only that package's slot, and the bare item can be removed only after both package slots go (then unregister(type, name) takes it). Writers of a package-less slotted item: the filesystem boot with no packageId option; removal callers 0.
Record, and pin today's state; storage mirrors it (the bare row is package_id NULL). An address for the environment's own item is ADR-0150 D5's reserved _env segment, not this card.
5. Clause-②: answers that move (a type in the live set; non-slotted types unchanged, CONTROL)
After the last holder of a name is removed on an artifact-door boot, list, bare get, exists and get(type, name, P): FROM the body registered last (served by the door's MemoryLoader) TO nothing ([], undefined, false, undefined). First-party removal callers on these types: 0.
A read that reaches the loaders (no registry slot of the name: a restart over stored rows, a cluster peer after replay, a filesystem-watch drop) of a name two packages stored:
get(type, name, P1): FROM P2's body (the last writer) TO P1's body;
get(type, name, P) where P holds nothing and another package does: FROM that package's body TO undefined;
bare get: FROM the last writer's body TO 409 RESOURCE_CONFLICT, ambiguous-in-environment, naming both — this narrows: a bare read that answered now refuses, matching what the registry already answers on the same state;
list: FROM one item TO both packages' items.
First-party reach: DatabaseLoader wiring 0; cluster notifying writers on these types 0; a door boot reads its registry first.
Storage: DatabaseLoader.save FROM one row per name holding the last writer's body with package_id NULL, TO one row per (package, name) with package_id filled (a package-less customization of the sole holder goes in that holder's row, D4; an environment item NULL); delete FROM the name's row TO the package's row. The door's MemoryLoader is keyed the same way. Wiring: DatabaseLoader 0; the door store on every artifact boot, read only through the manager.
If item 2 is ruled in: realtime created/updated for a _packageId-only item, FROM no packageId TO the package. Producer: the HMR reload; subscribeMetadata callers 0.
If item 3 is ruled in: unregisterPackage(P) FROM leaving a package-less customization in P's slot TO removing it. Callers 0.
Narrowing: only 2's bare read (and, read strictly, 2's read naming a package that holds nothing, which answered another package's body).
6. Questions for the seat
Q1, the read side. Do 2 keys save and delete by package. Two rows of one name then make DatabaseLoader.load(type, name) answer whichever row comes first, and the manager's fallback never names a package (table above). I propose this card also carries the package to the loader reads of a slotted type: the manager asks the loaders for every stored item of the name with its package, and answers through readStoreEntry, and list slots loader entries by package the way listForPackageScopedIndex already does. The D3 rule stays in package-slotted-store.ts, once; the MemoryLoader holds a slotted type's items under the same keys (storeWriteKey, storeRemovalKeys), and unregisterAt deletes from memory: loaders too for a slotted type. Non-slotted calls stay byte-identical. Recommend: in scope. Without it, the second row turns "the last writer" into "an arbitrary row".
Q2, items 1–6 as proposed above: fix 2, 3, 5; record 1, 4, 6.
Q3, the migration scope: source = 'database' rows only, as above. Recommend: yes.
Q4, the non-slotted door residue (CONTROL view): Do 1 leaves it. It has real first-party removal callers on other types (objectql unregister('object', …), datasource admin, the security echo), so it is a wider move than this card; recommend a separate card, not measured here.
Size estimate for the build: about 700–1,000 changed lines (src + pins + changeset), under the 3,000-line line.
Claim amendment · #32246 · step-0 rulings · 2026-11-10T18:01Z
Clause-②: no — a bare read that reaches the loaders for a two-holder name narrows to the D3 409, declared beside the widenings
Thread-read: 6775070064
The step-0 readings are 6775070064 (tree 60b99f8f, evidence in server-orders/seat3/32246-step0/). Seat rulings:
Q1, the read side: in scope. The manager asks the loaders for every stored item of a slotted name with its package, and answers through readStoreEntry. list slots loader entries by package. The D3 rule stays once, in package-slotted-store.ts. MemoryLoader holds a slotted type's items under storeWriteKey / storeRemovalKeys, and unregisterAt deletes from memory: loaders for a slotted type. Non-slotted calls stay byte-identical (CONTROL).
Q2, the six carried items: as proposed. Fix 2, 3 and 5. Record 1, 4 and 6 in the changeset and the os-dev-report: per-package storage lets a cluster peer re-read a dropped slot; the residue is a slot no loader holds, and it is the same on main for every type. Per-slot cluster invalidation is not built here.
The history ripple: carry it. The sys_metadata_history write numbers versions per name across packages, so no history row is lost. Pin a two-holder save that writes both history rows. Rollback, getHistoryRecord and queryHistory stay keyed by (type, name). The os-dev-report records that as a follow-up, and the seat files it.
Q3, the migration scope: yes. Only source = 'database' rows of slotted types whose body names a package. It is re-runnable, never guesses, and leaves a package-less row as it is.
Q4, the non-slotted door residue: a separate card. The seat files it from the os-dev-report.
Declarations: in the changeset and the PR body, write Clause-②: no (narrowing). Then list as FROM → TO lines: the bare loader-reached read (last writer's body → 409 ambiguous-in-environment); a read naming a package that holds nothing (another package's body → not found); and every widening, each with its first-party count (0 production DatabaseLoader wiring, 0 notifying cluster writers). Add the ADR-0087 marker and Metadata-protocol: none. Flip fix(metadata)!: remove metadata by (package, name), and refuse a package-less removal of a name two packages hold (ADR-0150 D3/D4) #32274's residue pin. Pins iterate the live set; report the ablation counts. Keep it under 3000 lines.
{
"issue": 32246,
"status": "done",
"branch": "claude/project-thread-5jksh9",
"pr": "https://github.com/objectstack-ai/objectstack/pull/32347",
"head": "6442b43d9e95754451a0b3224126eb27b53f28d1 (remote branch head == PR head, read back after pr_create)",
"session": "session_01WGufzhDgj3dYme67H4LpZi",
"premise_still_valid": true,
"summary": "The artifact door's MemoryLoader and DatabaseLoader now store every type in PACKAGE_SLOTTED_STORE_TYPES (api, agent, skill, action since #32213) per package, by the rules in package-slotted-store.ts: the door under the registry's own keys, DatabaseLoader one row per (package, name) with package_id filled and versions numbered per name, so both packages' history rows are written. The manager's get/getDiagnosed fallback, list and endpoint index read every loader's stored items with their package (new optional MetadataLoader.loadSlots/loadManySlots) and answer through readStoreEntry, so D3 stays once; unregister also deletes these types from memory: loaders (the #32198 residue pin is flipped), and carried items 2, 3 and 5 are fixed while 1, 4 and 6 are recorded. The loaders' own load/loadMany/loadManyKeyed keep answering one item per name, the one saved last, because action's router rung and objectql's action audit read them; migrateDatabaseLoaderRowPackages is the operator-run, re-runnable binding of old rows.",
"tests": "At 6442b43d under os-verify-lock: `pnpm --filter @objectstack/metadata typecheck` exit 0; `pnpm --filter @objectstack/metadata test` Test Files 73 passed (73), Tests 1165 passed (1165); the four pinned files (match-endpoint, database-loader, bind-database-loader-row-packages, keyed-plural-read) 292 passed. Downstream consumers of the loader reads at 52729d39 (source differs from the head only in the migration test's row store and the changeset wording): objectql Test Files 584/584, Tests 12079/12079; metadata-protocol Test Files 332 passed + 5 skipped (337), Tests 22658 passed + 29 skipped; runtime Test Files 578/578, Tests 9649 passed + 19 skipped. Direction: downstream consumers of @objectstack/metadata that read loaders, not the full `...@objectstack/metadata` closure; dogfood covers the rest end to end. Ablations, fix committed first (52729d39), each via scripts/ablation-replace.mjs (anchor x1 -> x0, restore blob == HEAD, git diff HEAD empty), against the 292 cases; tests import src relatively, so no dist leg applies: A1 storeSlotKey without package 52 red; A1b storeRowKey without package 53; A2 door store keyed by name 33; A3 DatabaseLoader.save without slot target 50; A4 no memory: removal 21; A5 realtime reads data.packageId only 2; A6 unregisterPackage without slot clause 4; A7 versions per row 8; A8 migration reads no package 12; A9 list one per name 17; A10 get falls back to unscoped load 36; A11 loadManySlots never read 13; A12a MemoryLoader.loadManyKeyed every slot 4; A12b DatabaseLoader unscoped reads every row 5; A13 DatabaseLoader.load unordered 4; A14 MemoryLoader.delete by storeRemovalKeys for a named package 1. Every one red, every restore proven.",
"gates": "`node scripts/pm/dispatch-gates.mjs --commands` derived 65 families (same list at 52729d39 and 6442b43d); run serially at 6442b43d after a full `pnpm turbo run build` (120/120 tasks), each exit code captured before any pipe: 65 run, 65 exit 0. `--ran` reconciliation: 65 derived, 65 run, 0 NOT-MEASURED, 0 UNRUN. First round at 52729d39 had check:objectql-double-limit exit 1 (the migration test's row store ignored limit) and check-adr-0087-registration exit 1 (the remedy line's arrow label read as a migration prescription), both fixed in 6442b43d; check-plugin-teardown-shape --self-test exit 3 (fixture commit fetched) and check:dual-build-cjs-loads exit 3 (needed the full build), both exit 0 at the head. `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0. Changeset gate reproduced on the PR's title and body (`check-changeset-no-major.mjs --event`): exit 0, patch level for `no (narrowing)` + `none`. PR check-runs at report time on 6442b43d: 40 total, 4 success, 16 skipped, 20 in_progress; pnpm lint, test:repo and the rest of the farm are CI's.",
"dogfood_battery": "6442b43d · os-verify-lock VERDICT command-exit 0 (one locked run: full build, gates, dogfood; held 57m55s on a shared box) · Test Files 449 passed, 3 skipped (452) · Tests 3749 passed, 42 skipped (3791) · no failure (also green at 52729d39 with the same counts)",
"mcp_calls": "2 — mcp__github__issue_read x2 (get and get_comments on #32246, step 0); no write tool",
"api_writes": "3 — all via the fleet-write relay: comment on #32246 (step-0 readings, 6775070064, ordered by step 0), pr_create #32347 (draft, no assignee, no labels), comment on #32246 (this report)",
"open_questions": [],
"security_findings": "none",
"deviations": [
"Main merged (c37dab01, via os-regen-merge) after #32213 added action to the set during the build; the step-0 shape made the loaders' own reads D3-aware, which would have narrowed action's router rung (loadDiagnosed('action', ...)) and objectql's loadManyKeyed('action') audit. The per-package view went behind new optional loadSlots/loadManySlots read only by the manager's get/getDiagnosed/list/endpoint index, as Q1 rules; the loaders' unscoped reads keep answering one item per name, the one saved last.",
"The row-binding migration is operator-run only: DatabaseLoader no longer binds old rows on its own (an earlier draft bound them at schema time), because metadata-manager-keyed-plural-read pins one find per type and one findOne per name on action, and an unattended data rewrite is the operator's call; a save binds the row it writes.",
"Downstream suites (objectql, metadata-protocol, runtime) ran at 52729d39, not re-run at 6442b43d; the delta is the migration test's row store and the changeset's wording. test:repo not run locally (no repo-project file in the diff).",
"The PR body carries a Skills-docs line (none, with the grep), owed by the (narrowing) arm per the claim template.",
"The platform's auto PR subscription posture is not followed: per os-dev, no CI waiting after the report; reds after this report come back as a patch round."
],
"out_of_scope_findings": [
"carrier: none · noted, not filed — storeRemovalKeys naming a package removes only that package's object-less key (#32213 shape), so unregister('action', name, { packageId }) leaves an object-bound action's registry slot while this PR's door delete and DatabaseLoader delete remove the stored copies; first-party callers of unregister with packageId on action: 0; unregisterPackage removes each slot by its own key and is unaffected. In the PR's Acceptance notes. Dedupe words: storeRemovalKeys bound action packageId unregister slot",
"carrier: seat 3 (Q4 card) · noted, not filed — for types outside the set the artifact door's memory: loader copy is still never deleted from on removal (pinned as CONTROL)",
"carrier: seat 3 (ruled follow-up) · noted, not filed — DatabaseLoader rollback, getHistoryRecord and queryHistory stay keyed by (type, name); rollback by package not built",
"carrier: #32162 · noted — when permission joins the set these pins iterate it; whichever of #32162 and #32347 lands second merges main"
]
}
{
"issue": 32246,
"round": "2 (fix round for the contract review FAIL 6779418424 at 6442b43d)",
"status": "done",
"branch": "claude/project-thread-5jksh9",
"pr": "https://github.com/objectstack-ai/objectstack/pull/32347",
"head": "3fa27d709a597b769323fb482ebeedd9763d06ab (remote branch head == PR head, read back after the push)",
"session": "session_01WGufzhDgj3dYme67H4LpZi",
"premise_still_valid": true,
"summary": "M1: unregister(type, name) naming no package, for a type stored per (package, name), now judges the holders over the registry's slots and every loader's stored items of the name (removalOf over slotViewOf) before anything is touched, so a name two packages hold only in the loaders, or one in the registry and the other in a loader, is refused 409 RESOURCE_CONFLICT naming both, with nothing deleted or announced and bulkUnregister reporting it failed. S2: get/getDiagnosed naming a package the registry holds no slot for read the same view, so that package's stored item answers beside another package's registry slot, never another package's. S3: DatabaseLoader numbers a by-package type's next version over the name's rows and its history rows. S1, S4 and the three nits in section 2 are in the changeset, and the refusal pin now asserts code. All of these are pinned on the live set.",
"tests": "At 3fa27d70 under os-verify-lock, after a full turbo build (120/120): metadata typecheck exit 0; metadata test Test Files 73/73, Tests 1205/1205; the four pinned files 332 passed. Downstream at this head: objectql Test Files 584/584, Tests 12079/12079; metadata-protocol 332 passed + 5 skipped (337), Tests 22658 + 29 skipped; runtime 578/578, Tests 9649 + 19 skipped. Ablations (fix committed first, scripts/ablation-replace.mjs, anchor x1 -> x0, restore blob == HEAD and git diff HEAD empty), at e7287968 against 328 cases (the amend to 3fa27d70 added one pin and no source line): A1 72, A1b 73, A2 53, A3 70, A4 29, A5 2, A6 4, A8 12, A9 17, A10 40, A11 13, A12a 4, A12b 5, A13 4, A14 1, B1 (removal judged over the registry alone) 16, B2a/B2b (settled registry answer returned before the loaders, get/getDiagnosed) 4 each, B3 (view without the registry's slots) 4, B4 (next version over live rows only) 4; A7 (rows term of the next version dropped) 4 at 3fa27d70 against 332. Void first tries, redone: A7's pre-review anchor was gone after the rework, so the tool refused the anchor miss and the history-off pin was added for the redo. B2a/B2b's first replacement contained the anchor, so the tool refused a count drop of 0; they were rerun with a replacement that does not contain it. Every mutation went red and every restore is proven.",
"gates": "dispatch-gates --commands derived 65 families (same list as round 1), run serially at 3fa27d70 after the full build, each exit code captured before any pipe: 65 run, 65 exit 0; --ran 65 derived, 65 run, 0 NOT-MEASURED, 0 UNRUN. check-changeset-no-major --event on the PR title with the revised body: exit 0, patch. PR check-runs on 3fa27d70 at report time: 51 total, 34 success, 16 skipped, 1 failure. The failure is Live E2E UI (job 130141275985): master-detail.spec.ts:78 failed in its beforeEach, where the heading 'New Project + Tasks' was not visible within 5 s. Tests 4 and 6 run the same beforeEach on the same page and passed, and the same check was green on 6442b43d. This diff reaches the manager's get only for api/agent/skill/action names the registry cannot answer. Read as a flake; a rerun of the failed job is the seat's.",
"dogfood_battery": "3fa27d70 · os-verify-lock VERDICT command-exit 0 (one locked run: full build, suites, gates, dogfood; held 1h15m43s on a shared box) · Test Files 449 passed, 3 skipped (452) · Tests 3749 passed, 42 skipped (3791) · no failure",
"mcp_calls": "3 — mcp__github__issue_read x2 (round 1, #32246 get/get_comments), mcp__github__get_job_logs x1 (Live E2E UI job 130141275985); no write tool",
"api_writes": "this round: 1 (this comment on #32246, via the fleet-write relay); whole claim: 4 (step-0 readings 6775070064, pr_create #32347, round-1 report 6779127728, this report)",
"pr_body_edit_for_the_seat": "/mnt/project-files/server-orders/seat3/32347-body-r1.md, the whole body revised, for the seat to apply (the dev never PATCHes). It adds narrowing lines 2 (the read beside another package's registry slot), 3 (endpoint index), 4 (loaders-only reads after a removal), 6 (realtime sentinel/empty packageId) and 7 (the bare-removal move, M1), and rewrites the 'Unchanged' sentence. It adds the new What changes/Tests bullets, S1/S4 and the bound-action card to Acceptance notes, Verification at 3fa27d70, and the maintainer-quick-read count. Declarations unchanged. The refusal-pin sentence ('code, status, reason and both candidates') is now true: the pin asserts code.",
"open_questions": [],
"security_findings": "none",
"deviations": [
"The removal judgment reads every loader's slots for the name (the same view a read uses), not only the loaders it deletes from, so reads and removals agree on the holders. A loader that throws while being read is skipped there: its delete is attempted and reported as before.",
"An object-bound action's slots are outside the holder count, as in the registry's own rule. That is the seat's new card (round-1 flag 1), so for a bound name DatabaseLoader.delete can still refuse inside the storage loop. Documented on removalOf.",
"S2 changes get/getDiagnosed only where the registry is settled (a read naming a package, only other packages' slots registered). A bare get whose registry holds one package's slot still answers that slot without asking the loaders, as before, while a bare removal in the same state is refused when a loader holds a second package (pinned)."
],
"review_items_recorded_only": [
"S5: DatabaseLoader's 'saved last' is the row changed last; an identical re-save writes nothing and bumps no version, so its load can answer a different package than the door's store. Now stated in the changeset's loaders bullet.",
"S6: DatabaseLoader.loadSlots is the type-wide read filtered in memory (shares loadManyKeyed's cache); a cold get miss on a by-package type costs a type scan where it was one findOne. The removal judgment and the settled read now take the same read. First-party DatabaseLoader wiring: 0."
],
"out_of_scope_findings": [
"carrier: seat 3 (new card, round-1 flag 1) · unregister('action', name, { packageId }) leaves an object-bound action's registry slot, and a bare removal of a bound name two packages hold is not refused (holder count reads only the object-less key)",
"carrier: seat 3 (follow-up card, S1) · rollback for a two-holder name can write one package's body into the other package's row; stated in the changeset",
"carrier: seat 3 (Q4 card) · types outside the set: the door's memory: copy is still never deleted from",
"carrier: #32162 · noted: plugin-security's bare unregister('permission' | 'position', ...) meets M1's refusal once permission joins the set; whichever lands second merges main"
]
}
Claim amendment · #32246 · epic red-line requirement R1 on PR #32347 · 2026-11-10T23:02Z
Clause-②: no — a rollback of a slotted name whose rows two packages hold narrows to the D3 409, declared beside the existing narrowings
Thread-read: 6781671139
The epic red-line read at 7dd25890 (6781671139) withholds a PASS for one required fix. The seat adopts it into this card's scope:
R1, DatabaseLoader.registerRollback on a two-holder name. This card makes rows one per (package, name). registerRollback still finds its row with _findOne by name, so it writes the target body into whichever row the driver returns first, which can be the other package's row. This PR creates that guess, so this PR removes it.
What to build: for a slotted type whose name has rows of two or more packages, refuse with PackageScopedNameRefusedError (ambiguous-in-environment, naming each holder) before any write or history row.
Pin: both rows stay byte-unchanged and no history row is written. Add a one-holder CONTROL that still rolls back.
Claim amendment · #32246 · epic red-line requirement R1b on PR #32347 · 2026-11-10T23:20Z
Clause-②: no — a rollback of a slotted name with more than one row of any kind narrows to the D3 409, widening R1's refusal, declared beside it
Thread-read: 6782013288
The epic re-read at a1a5e146 (6782013288) closes R1 for two packages and adds R1b. The seat adopts it into this card:
R1b.storeRemovalKeys counts package slots only. One package's row beside the name's package-less row passes the check, and _findOne then writes into whichever row the driver returns first. That is R1's guess. Per-package rows let the two coexist: P1 saves, P2 saves, a package-less save lands on the bare key, then P2 is removed.
What to build:registerRollback refuses when the name's rowSlots hold more than one slot of any kind (bySlot.size > 1). The refusal names the environment for the bare row. It comes before any write or history row.
Pin: both rows byte-unchanged and no history row written. Extend the FROM→TO line from R1 to cover the bare row.
PR #32347 merged at 2026-11-11T01:13Z as c8794cf7. @objectstack/metadata's MetadataManager and its two loaders now keep one item per (package, name) for every type in PACKAGE_SLOTTED_STORE_TYPES:
a read naming no package, of a name two packages stored, is refused with the 409 (ambiguous-in-environment), as the registry answers it;
a read naming a package gets that package's own item, or not found;
delete takes the slots storeRemovalKeys picks;
a rollback by name of a name with more than one row slot (two packages' rows, or one package's beside the package-less row) is refused before any write or history row.
Reviews: contract review rounds 1 to 4 passed, the last on the landing head 4504de0b (6782244276). The epic red-line re-read passed with R1 and R1b closed (6782210273). ACCEPT 6783504569.
area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratedomain:serverDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p1High: required for production / M2
Activity
objectstack-fleet commentedon Nov 10, 2026
triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U
Path: none
Triage: confirmed ·
domain:server· p1 ·pm:blocked· 2026-11-10T15:00ZBlocked-by: #32198
⛔ Not a claim.
pm:blocking.domain:server(metadata loaders, one row per(package, name)). p1, under design(metadata): address behavioural metadata by package — key flows, actions, jobs and other non-object types by (package, name); re-open ADR-0028 (replaces #30806 phase 3 renames) #31527.Generated by Claude Code
objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Carried from the #32274 contract review · 2026-11-10T16:13Z
The contract review of PR #32274 (#32198, record on that PR at head
9e2a4a91) passed with no must-fix. These items belong to this card's per-package storage work and are carried here, so the next dev reads them at step 0:attachClusterPubSubreplays a peer's watcher event throughinvalidateForForeignWrite(type, name), which callsdeleteRegistryEntries(type, name)with no keys. Removing P1's slot on one node still drops P2's slot on the other nodes. The same holds onmainfor any write; the peer cannot rehydrate two slots until storage is per package.register()realtime events name no package for artifact-door items.created/updatedreaddata.packageIdonly, whiledeletednow carries the package, so apackageId-filtered subscription sees the removal and never the arrival.unregisterPackagejudges a slotted item by its body, not its slot. A package-less customization written into sole holder P's slot (storeWriteKey) survivesunregisterPackage(P). For a slotted type,slotPackageOf(key) === Pshould select it too.isPackageMemberreadspackageId,package,_packageId;storedItemPackageIdreadspackageId,_packageId. Align them, or say why inisPackageMember's doc.DatabaseLoader.deletereads one row by(type, name). With per-package rows that lookup must take the package; thepackage_idcolumn branch ofstoredRowPackageIdhas no pin.storeRemovalKeys; with two holders plus a bare slot, the bare item cannot be removed on its own.objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Unblocked · 2026-11-10T17:42Z
#32198 landed (PR #32274,
8080763c), so this card's serial line is met. Step 0 reads the six items carried from the #32274 contract review (comment above) and the residue pin #32274 left inmetadata-manager-match-endpoint.test.ts, which this card flips. The card stays a precondition of #31700.pm:blockedis replaced bypm:queuewith this note.objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Claim: PM loop round 2 · #32246 (the artifact door's memory loader and the database loader keep one row per name for a slotted type) · 2026-11-10T17:44Z
Session:
session_01WGufzeeBmtefMTT21doena(seat); dev = a new card thread, its session restated by amendmentAccount:
os-support-aiBranch:
claude/project-thread-PENDING(the card thread's harness-pinned branch, restated by amendment before its first push)Worktree: the card thread's checkout of
objectstack-ai/objectstackDomain:
domain:serverSeat:
domain:server#3File surface: metadata
loaders/memory-loader.tsandloaders/database-loader.ts(save, load, delete keyed by(package, name)for a slotted type), thesys_metadatapackage_idwrite and a re-runnable migration for existing rows,metadata-manager.tsonly where the six carried items touch it (attachClusterPubSubreplay,register()realtime package,unregisterPackageby slot, one attribution rule, bare slot beside package slots); tests, dogfood pins, changeset.package-slotted-store.tsmembership is read, not changed. Stop on breach.Container & model:
M,mode:thread,model: TIER_DEFAULT,effort: xhigh(p1, #31700 precondition)Clause-②: yes — a widening, each holder served its own stored body, restated after step 0
Metadata-protocol: none
Responsibility: metadata (objectstack) stores a slotted type by bare name below the slotted store, so the last writer's row is served after removal and a second holder overwrites the first | #32274 already removes by
(package, name)in memory and scopes the row delete | ADR-0150 D4; the six items carried from the #32274 contract review (comment 6772564384 on this card); step 0 measures every loader and callerThread-read: 6774691130
Premise: holds. At
main8080763c,MemoryLoaderandDatabaseLoaderkey by{type, name}, and #32274 pinned the residue as today's behaviour.Serial constraints: #32198 landed (
8080763c). #32162 (seat 4) addspermissionto the slotted set; this card's pins iterate the live set, and whichever lands second mergesmain. #31700 waits on this card.objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Claim amendment · #32246 · dev thread started · 2026-11-10T17:45Z
Branch:
claude/project-thread-5jksh9Session:
session_01WGufzhDgj3dYme67H4LpZi(dev, card thread)The card thread is on step 0 (read-only), following the seat's order. Nothing else in the claim changes.
fix(metadata)!: remove metadata by (package, name), and refuse a pack…
objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzhDgj3dYme67H4LpZi
Step 0 readings: per-package loader rows for every slotted type · 2026-11-10T17:59Z
Tree:
objectstack-ai/objectstackat60b99f8f(origin/mainat dispatch).PACKAGE_SLOTTED_STORE_TYPESthere isapi,agent,skill; #32162 (permission) has not landed. Dev branchclaude/project-thread-5jksh9(this card thread's harness-pinned branch, the one claim 6774718444 left asPENDING), sessionsession_01WGufzhDgj3dYme67H4LpZi. Nothing is pushed. Waiting for the seat's go.How it was measured. A scratch vitest (not committed; copy and raw JSON in the project files under
server-orders/seat3/32246-step0/) on the realMetadataManager, booted the way the artifact door boots: the sink runsMemoryLoader.savethenregister(…, { notify: false }), and aDatabaseLoaderon an in-memory driver is the one writabledatasource:loader. P1com.acme.alphathen P2com.acme.betaeach register one item namedshared_TYPEforapi,agent,skill, in two shapes: the door's (_packageIdonly) and an envelope item (flatpackageIdonly). Removal byunregisterPackageand byunregister(…, { packageId }), in both orders: 48 scenarios, plus aviewCONTROL. After every step each read was taken twice: on the live manager, and on a second manager over the same rows and the same door loader with an empty registry (a restart over stored rows, or a cluster peer after its replay dropped the slots). 43/43 green, exit 0.1. What each save stores and what each read serves (same for all three types and both shapes)
MemoryLoaderDatabaseLoaderrowslist· bareget·exists·get(P1)·get(P2)package_idNULLundefinedpackage_idNULL (P1's body overwritten)409 ambiguous-in-environment· true · P1 · P2undefined· P2undefinedRead off it:
get/getDiagnosedfall back toload(type, name)with no package, so a read naming P1 is served P2's body (empty-registry column, every row), and a bare read of a name two packages stored is served the last writer instead of D3's409.listadmits loader items one per name (admitLoaderItemsdedupes by name), so it shows one item where two are stored.unregisterAtdeletes fromdatasource:loaders only, so the door'smemory:loader is never deleted from: after the last holder goes, every read is served P2's body, the read naming the removed P1 included.view(outside the set): one item per name in the registry and in both loaders, last writer wins, and the same door residue after removal. Do 1 keeps it CONTROL.2. Census of loaders and of
DatabaseLoaderwiringMemoryLoadermemory:·type → name → bodyregister, never deleted byunregisterAt(the door saves into it directly)plugin.ts_parseAndRegisterArtifact, one per artifact load; an HMR reload builds a new one andregisterLoaderreplaces it under the same contract nameDatabaseLoaderdatasource:· rows by(type, name),package_idnever writtenregister→save;unregisterAt→delete(package-scoped since #32274)setDatabaseDriver,setDataEngineand the constructor'sdatasource+driverpair have no production caller; the only production manager isNodeMetadataManagerinplugin.ts(rootDir, watch, formats)@objectstack/metadatais published, so an outside host's wiring is not measurable hereFilesystemLoaderfile:·ROOT/TYPE/NAME.EXTregisterwritesdatasource:only); only the legacysave()API writes itNodeMetadataManager's constructor on every MetadataPlugin bootMetadataPluginOptions.packageIdstamps every item, else every item is package-less), so two packages' same-named items cannot share a rootRemoteLoaderhttp:·BASEURL/TYPE/NAMEdeleteMetadataLoaderimplements MetadataLoader: the four above)Not a
MetadataLoader, but the production writer ofsys_metadata: metadata-protocol'sSysMetadataRepository, which already keys rows by(type, name, package_id, bundle_member).The manager's other loader reads, which a per-package loader must be read through:
loadManydedupes bybody.name,loadManyKeyedby key,listNamesandexistsare name-level (they stay so), andlistForPackageScopedIndex(theapiendpoint index) already slots loader entries by package.3.
sys_metadata.package_idand the migrationsys-metadata.object.ts, text(255), nullable. It is part of the declared uniqueidx_sys_metadata_overlay_active (type, name, package_id, bundle_member)and of the protocol's partial(type, name, COALESCE(package_id,''), COALESCE(bundle_member,'')) WHERE state = 'active', so one row per(package, name)is already admitted by both.SysMetadataRepository.put(the target package; it keeps an existing non-null binding), publish (request.packageId) and the package-commit rebinding.DatabaseLoadernever writes it; it reads it only instoredRowPackageId(fix(metadata)!: remove metadata by (package, name), and refuse a package-less removal of a name two packages hold (ADR-0150 D3/D4) #32274, unpinned).DatabaseLoaderrows are marked: itssavecreates every row withsource = 'database', a column the repository never writes.sys_metadata_historyhas no package column and a unique(type, name, version), andDatabaseLoadernumbers a row's versions from that row's ownversion. Two per-package rows of one name would both write(type, name, 1); the second insert collides, is caught, logged aterror, and that history row is lost. So the write numbers versions per name across packages.registerRollback,getHistoryRecordandqueryHistorystay keyed by(type, name), so for a two-holder name a rollback reads whichever row comes first: proposed as a recorded follow-up (0 wiring), not this card.Proposed migration.
migrateDatabaseLoaderRowPackagesin@objectstack/metadata/migrations, besidemigrateProjectIdToEnvironmentId, run best-effort once per loader fromensureSchemaand callable by an operator. It binds a row when all four hold: itstypeis in the live set,package_idis NULL,source = 'database', and its stored body names a package (storedItemPackageId: the envelope'spackageId, else_packageId). It setspackage_idto that package and reports what it bound and what it left.source) is never touched, because "a body stamp binds nothing" is the protocol's served-override rule and those rows are R15's (ADR-0146 D11; its ceremony covers the five overlay types, none of them slotted).registerpersists every door item to a writabledatasource:loader.4. The six items carried from the #32274 contract review
main?MetadataClusterBridgePlugincomposed and a watcher-notifying write of a two-holder name. First-party notifying writers on these types: 0 (the door, the filesystem boot and AppPlugin'sregisterInMemorydo not notify; removal callers 0).registerInMemory('api')), which a name-level event already drops for every type onmain. Cost of per-slot invalidation, if ruled in:ClusterMetadataChangedPayloadis metadata-local (not spec) and gains an optionalpackageId.registersendsstoredItemPackageId(data)andunregisterAtits removal package, for a slotted type. On receipt the peer drops(P, name)'s slot, plus the bare slot a package write replaced. A peer on an older release ignores the field and drops every slot, as today. About 40 lines plus pins; specMetadataWatchEventunchanged; one more clause-② row (the peer keeps the other package's slot).register()realtime names no package for door items_packageId-only agent publishesmetadata.agent.createdwith nopackageId; an envelope agent names it. At boot the realtime bridge is set after the artifact load, so nothing is published; the HMR artifact reload (os dev) re-registers with it set. First-partysubscribeMetadatacallers: 0. Among slotted types onlyagenthas realtime events.created/updatedread the package withstoredItemPackageId(data), one line, for every type, sodeletedand the arrivals name the package the same way.unregisterPackagejudges a slotted item by its bodyregisterafter P1's door item lands in P1's slot (D4);unregisterPackage(P1)leaves it, still served toget(…, P1)and to the bare read. Callers: 0.slotPackageOf(key) === P, exported frompackage-slotted-store.ts); its stored copies go with it.packagekey (onlyisPackageMember; first-party writer onto an item: 0 found), a nested envelope's body_packageId(onlystoredItemPackageId), and an item whose keys name two packages (isPackageMembermatches any;storedItemPackageIdtakes the envelope first).isPackageMember's doc: it is the membership of the package-wide verbs over every type, legacypackageincluded; the slot rule isstoredItemPackageId, and after item 3 a slotted type's membership also reads the slot. Aligning instead movesunregisterPackage/publishPackage/revertPackagemembership on the last two inputs (0 first-party callers).DatabaseLoader.deletereads one row by(type, name)DatabaseLoader: 0 wiring.package_idcolumn branch gets pins, since this card writes the column.unregister(type, name)is refused409,unregister(…, { packageId })takes only that package's slot, and the bare item can be removed only after both package slots go (thenunregister(type, name)takes it). Writers of a package-less slotted item: the filesystem boot with nopackageIdoption; removal callers 0.package_idNULL). An address for the environment's own item is ADR-0150 D5's reserved_envsegment, not this card.5. Clause-②: answers that move (a type in the live set; non-slotted types unchanged, CONTROL)
list, bareget,existsandget(type, name, P): FROM the body registered last (served by the door'sMemoryLoader) TO nothing ([],undefined,false,undefined). First-party removal callers on these types: 0.get(type, name, P1): FROM P2's body (the last writer) TO P1's body;get(type, name, P)where P holds nothing and another package does: FROM that package's body TOundefined;get: FROM the last writer's body TO409 RESOURCE_CONFLICT,ambiguous-in-environment, naming both — this narrows: a bare read that answered now refuses, matching what the registry already answers on the same state;list: FROM one item TO both packages' items.First-party reach:
DatabaseLoaderwiring 0; cluster notifying writers on these types 0; a door boot reads its registry first.DatabaseLoader.saveFROM one row per name holding the last writer's body withpackage_idNULL, TO one row per(package, name)withpackage_idfilled (a package-less customization of the sole holder goes in that holder's row, D4; an environment item NULL);deleteFROM the name's row TO the package's row. The door'sMemoryLoaderis keyed the same way. Wiring:DatabaseLoader0; the door store on every artifact boot, read only through the manager.created/updatedfor a_packageId-only item, FROM nopackageIdTO the package. Producer: the HMR reload;subscribeMetadatacallers 0.unregisterPackage(P)FROM leaving a package-less customization in P's slot TO removing it. Callers 0.Narrowing: only 2's bare read (and, read strictly, 2's read naming a package that holds nothing, which answered another package's body).
6. Questions for the seat
DatabaseLoader.load(type, name)answer whichever row comes first, and the manager's fallback never names a package (table above). I propose this card also carries the package to the loader reads of a slotted type: the manager asks the loaders for every stored item of the name with its package, and answers throughreadStoreEntry, andlistslots loader entries by package the waylistForPackageScopedIndexalready does. The D3 rule stays inpackage-slotted-store.ts, once; theMemoryLoaderholds a slotted type's items under the same keys (storeWriteKey,storeRemovalKeys), andunregisterAtdeletes frommemory:loaders too for a slotted type. Non-slotted calls stay byte-identical. Recommend: in scope. Without it, the second row turns "the last writer" into "an arbitrary row".source = 'database'rows only, as above. Recommend: yes.view): Do 1 leaves it. It has real first-party removal callers on other types (objectqlunregister('object', …), datasource admin, the security echo), so it is a wider move than this card; recommend a separate card, not measured here.Size estimate for the build: about 700–1,000 changed lines (src + pins + changeset), under the 3,000-line line.
objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Claim amendment · #32246 · step-0 rulings · 2026-11-10T18:01Z
Clause-②: no — a bare read that reaches the loaders for a two-holder name narrows to the D3 409, declared beside the widenings
Thread-read: 6775070064
The step-0 readings are 6775070064 (tree
60b99f8f, evidence inserver-orders/seat3/32246-step0/). Seat rulings:readStoreEntry.listslots loader entries by package. The D3 rule stays once, inpackage-slotted-store.ts.MemoryLoaderholds a slotted type's items understoreWriteKey/storeRemovalKeys, andunregisterAtdeletes frommemory:loaders for a slotted type. Non-slotted calls stay byte-identical (CONTROL).mainfor every type. Per-slot cluster invalidation is not built here.sys_metadata_historywrite numbers versions per name across packages, so no history row is lost. Pin a two-holder save that writes both history rows. Rollback,getHistoryRecordandqueryHistorystay keyed by(type, name). The os-dev-report records that as a follow-up, and the seat files it.source = 'database'rows of slotted types whose body names a package. It is re-runnable, never guesses, and leaves a package-less row as it is.Clause-②: no (narrowing). Then list as FROM → TO lines: the bare loader-reached read (last writer's body → 409ambiguous-in-environment); a read naming a package that holds nothing (another package's body → not found); and every widening, each with its first-party count (0 productionDatabaseLoaderwiring, 0 notifying cluster writers). Add the ADR-0087 marker andMetadata-protocol: none. Flip fix(metadata)!: remove metadata by (package, name), and refuse a package-less removal of a name two packages hold (ADR-0150 D3/D4) #32274's residue pin. Pins iterate the live set; report the ablation counts. Keep it under 3000 lines.Go.
objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzhDgj3dYme67H4LpZi
os-dev-report
{ "issue": 32246, "status": "done", "branch": "claude/project-thread-5jksh9", "pr": "https://github.com/objectstack-ai/objectstack/pull/32347", "head": "6442b43d9e95754451a0b3224126eb27b53f28d1 (remote branch head == PR head, read back after pr_create)", "session": "session_01WGufzhDgj3dYme67H4LpZi", "premise_still_valid": true, "summary": "The artifact door's MemoryLoader and DatabaseLoader now store every type in PACKAGE_SLOTTED_STORE_TYPES (api, agent, skill, action since #32213) per package, by the rules in package-slotted-store.ts: the door under the registry's own keys, DatabaseLoader one row per (package, name) with package_id filled and versions numbered per name, so both packages' history rows are written. The manager's get/getDiagnosed fallback, list and endpoint index read every loader's stored items with their package (new optional MetadataLoader.loadSlots/loadManySlots) and answer through readStoreEntry, so D3 stays once; unregister also deletes these types from memory: loaders (the #32198 residue pin is flipped), and carried items 2, 3 and 5 are fixed while 1, 4 and 6 are recorded. The loaders' own load/loadMany/loadManyKeyed keep answering one item per name, the one saved last, because action's router rung and objectql's action audit read them; migrateDatabaseLoaderRowPackages is the operator-run, re-runnable binding of old rows.", "tests": "At 6442b43d under os-verify-lock: `pnpm --filter @objectstack/metadata typecheck` exit 0; `pnpm --filter @objectstack/metadata test` Test Files 73 passed (73), Tests 1165 passed (1165); the four pinned files (match-endpoint, database-loader, bind-database-loader-row-packages, keyed-plural-read) 292 passed. Downstream consumers of the loader reads at 52729d39 (source differs from the head only in the migration test's row store and the changeset wording): objectql Test Files 584/584, Tests 12079/12079; metadata-protocol Test Files 332 passed + 5 skipped (337), Tests 22658 passed + 29 skipped; runtime Test Files 578/578, Tests 9649 passed + 19 skipped. Direction: downstream consumers of @objectstack/metadata that read loaders, not the full `...@objectstack/metadata` closure; dogfood covers the rest end to end. Ablations, fix committed first (52729d39), each via scripts/ablation-replace.mjs (anchor x1 -> x0, restore blob == HEAD, git diff HEAD empty), against the 292 cases; tests import src relatively, so no dist leg applies: A1 storeSlotKey without package 52 red; A1b storeRowKey without package 53; A2 door store keyed by name 33; A3 DatabaseLoader.save without slot target 50; A4 no memory: removal 21; A5 realtime reads data.packageId only 2; A6 unregisterPackage without slot clause 4; A7 versions per row 8; A8 migration reads no package 12; A9 list one per name 17; A10 get falls back to unscoped load 36; A11 loadManySlots never read 13; A12a MemoryLoader.loadManyKeyed every slot 4; A12b DatabaseLoader unscoped reads every row 5; A13 DatabaseLoader.load unordered 4; A14 MemoryLoader.delete by storeRemovalKeys for a named package 1. Every one red, every restore proven.", "gates": "`node scripts/pm/dispatch-gates.mjs --commands` derived 65 families (same list at 52729d39 and 6442b43d); run serially at 6442b43d after a full `pnpm turbo run build` (120/120 tasks), each exit code captured before any pipe: 65 run, 65 exit 0. `--ran` reconciliation: 65 derived, 65 run, 0 NOT-MEASURED, 0 UNRUN. First round at 52729d39 had check:objectql-double-limit exit 1 (the migration test's row store ignored limit) and check-adr-0087-registration exit 1 (the remedy line's arrow label read as a migration prescription), both fixed in 6442b43d; check-plugin-teardown-shape --self-test exit 3 (fixture commit fetched) and check:dual-build-cjs-loads exit 3 (needed the full build), both exit 0 at the head. `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0. Changeset gate reproduced on the PR's title and body (`check-changeset-no-major.mjs --event`): exit 0, patch level for `no (narrowing)` + `none`. PR check-runs at report time on 6442b43d: 40 total, 4 success, 16 skipped, 20 in_progress; pnpm lint, test:repo and the rest of the farm are CI's.", "dogfood_battery": "6442b43d · os-verify-lock VERDICT command-exit 0 (one locked run: full build, gates, dogfood; held 57m55s on a shared box) · Test Files 449 passed, 3 skipped (452) · Tests 3749 passed, 42 skipped (3791) · no failure (also green at 52729d39 with the same counts)", "mcp_calls": "2 — mcp__github__issue_read x2 (get and get_comments on #32246, step 0); no write tool", "api_writes": "3 — all via the fleet-write relay: comment on #32246 (step-0 readings, 6775070064, ordered by step 0), pr_create #32347 (draft, no assignee, no labels), comment on #32246 (this report)", "open_questions": [], "security_findings": "none", "deviations": [ "Main merged (c37dab01, via os-regen-merge) after #32213 added action to the set during the build; the step-0 shape made the loaders' own reads D3-aware, which would have narrowed action's router rung (loadDiagnosed('action', ...)) and objectql's loadManyKeyed('action') audit. The per-package view went behind new optional loadSlots/loadManySlots read only by the manager's get/getDiagnosed/list/endpoint index, as Q1 rules; the loaders' unscoped reads keep answering one item per name, the one saved last.", "The row-binding migration is operator-run only: DatabaseLoader no longer binds old rows on its own (an earlier draft bound them at schema time), because metadata-manager-keyed-plural-read pins one find per type and one findOne per name on action, and an unattended data rewrite is the operator's call; a save binds the row it writes.", "Downstream suites (objectql, metadata-protocol, runtime) ran at 52729d39, not re-run at 6442b43d; the delta is the migration test's row store and the changeset's wording. test:repo not run locally (no repo-project file in the diff).", "The PR body carries a Skills-docs line (none, with the grep), owed by the (narrowing) arm per the claim template.", "The platform's auto PR subscription posture is not followed: per os-dev, no CI waiting after the report; reds after this report come back as a patch round." ], "out_of_scope_findings": [ "carrier: none · noted, not filed — storeRemovalKeys naming a package removes only that package's object-less key (#32213 shape), so unregister('action', name, { packageId }) leaves an object-bound action's registry slot while this PR's door delete and DatabaseLoader delete remove the stored copies; first-party callers of unregister with packageId on action: 0; unregisterPackage removes each slot by its own key and is unaffected. In the PR's Acceptance notes. Dedupe words: storeRemovalKeys bound action packageId unregister slot", "carrier: seat 3 (Q4 card) · noted, not filed — for types outside the set the artifact door's memory: loader copy is still never deleted from on removal (pinned as CONTROL)", "carrier: seat 3 (ruled follow-up) · noted, not filed — DatabaseLoader rollback, getHistoryRecord and queryHistory stay keyed by (type, name); rollback by package not built", "carrier: #32162 · noted — when permission joins the set these pins iterate it; whichever of #32162 and #32347 lands second merges main" ] }objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzhDgj3dYme67H4LpZi
os-dev-report
{ "issue": 32246, "round": "2 (fix round for the contract review FAIL 6779418424 at 6442b43d)", "status": "done", "branch": "claude/project-thread-5jksh9", "pr": "https://github.com/objectstack-ai/objectstack/pull/32347", "head": "3fa27d709a597b769323fb482ebeedd9763d06ab (remote branch head == PR head, read back after the push)", "session": "session_01WGufzhDgj3dYme67H4LpZi", "premise_still_valid": true, "summary": "M1: unregister(type, name) naming no package, for a type stored per (package, name), now judges the holders over the registry's slots and every loader's stored items of the name (removalOf over slotViewOf) before anything is touched, so a name two packages hold only in the loaders, or one in the registry and the other in a loader, is refused 409 RESOURCE_CONFLICT naming both, with nothing deleted or announced and bulkUnregister reporting it failed. S2: get/getDiagnosed naming a package the registry holds no slot for read the same view, so that package's stored item answers beside another package's registry slot, never another package's. S3: DatabaseLoader numbers a by-package type's next version over the name's rows and its history rows. S1, S4 and the three nits in section 2 are in the changeset, and the refusal pin now asserts code. All of these are pinned on the live set.", "tests": "At 3fa27d70 under os-verify-lock, after a full turbo build (120/120): metadata typecheck exit 0; metadata test Test Files 73/73, Tests 1205/1205; the four pinned files 332 passed. Downstream at this head: objectql Test Files 584/584, Tests 12079/12079; metadata-protocol 332 passed + 5 skipped (337), Tests 22658 + 29 skipped; runtime 578/578, Tests 9649 + 19 skipped. Ablations (fix committed first, scripts/ablation-replace.mjs, anchor x1 -> x0, restore blob == HEAD and git diff HEAD empty), at e7287968 against 328 cases (the amend to 3fa27d70 added one pin and no source line): A1 72, A1b 73, A2 53, A3 70, A4 29, A5 2, A6 4, A8 12, A9 17, A10 40, A11 13, A12a 4, A12b 5, A13 4, A14 1, B1 (removal judged over the registry alone) 16, B2a/B2b (settled registry answer returned before the loaders, get/getDiagnosed) 4 each, B3 (view without the registry's slots) 4, B4 (next version over live rows only) 4; A7 (rows term of the next version dropped) 4 at 3fa27d70 against 332. Void first tries, redone: A7's pre-review anchor was gone after the rework, so the tool refused the anchor miss and the history-off pin was added for the redo. B2a/B2b's first replacement contained the anchor, so the tool refused a count drop of 0; they were rerun with a replacement that does not contain it. Every mutation went red and every restore is proven.", "gates": "dispatch-gates --commands derived 65 families (same list as round 1), run serially at 3fa27d70 after the full build, each exit code captured before any pipe: 65 run, 65 exit 0; --ran 65 derived, 65 run, 0 NOT-MEASURED, 0 UNRUN. check-changeset-no-major --event on the PR title with the revised body: exit 0, patch. PR check-runs on 3fa27d70 at report time: 51 total, 34 success, 16 skipped, 1 failure. The failure is Live E2E UI (job 130141275985): master-detail.spec.ts:78 failed in its beforeEach, where the heading 'New Project + Tasks' was not visible within 5 s. Tests 4 and 6 run the same beforeEach on the same page and passed, and the same check was green on 6442b43d. This diff reaches the manager's get only for api/agent/skill/action names the registry cannot answer. Read as a flake; a rerun of the failed job is the seat's.", "dogfood_battery": "3fa27d70 · os-verify-lock VERDICT command-exit 0 (one locked run: full build, suites, gates, dogfood; held 1h15m43s on a shared box) · Test Files 449 passed, 3 skipped (452) · Tests 3749 passed, 42 skipped (3791) · no failure", "mcp_calls": "3 — mcp__github__issue_read x2 (round 1, #32246 get/get_comments), mcp__github__get_job_logs x1 (Live E2E UI job 130141275985); no write tool", "api_writes": "this round: 1 (this comment on #32246, via the fleet-write relay); whole claim: 4 (step-0 readings 6775070064, pr_create #32347, round-1 report 6779127728, this report)", "pr_body_edit_for_the_seat": "/mnt/project-files/server-orders/seat3/32347-body-r1.md, the whole body revised, for the seat to apply (the dev never PATCHes). It adds narrowing lines 2 (the read beside another package's registry slot), 3 (endpoint index), 4 (loaders-only reads after a removal), 6 (realtime sentinel/empty packageId) and 7 (the bare-removal move, M1), and rewrites the 'Unchanged' sentence. It adds the new What changes/Tests bullets, S1/S4 and the bound-action card to Acceptance notes, Verification at 3fa27d70, and the maintainer-quick-read count. Declarations unchanged. The refusal-pin sentence ('code, status, reason and both candidates') is now true: the pin asserts code.", "open_questions": [], "security_findings": "none", "deviations": [ "The removal judgment reads every loader's slots for the name (the same view a read uses), not only the loaders it deletes from, so reads and removals agree on the holders. A loader that throws while being read is skipped there: its delete is attempted and reported as before.", "An object-bound action's slots are outside the holder count, as in the registry's own rule. That is the seat's new card (round-1 flag 1), so for a bound name DatabaseLoader.delete can still refuse inside the storage loop. Documented on removalOf.", "S2 changes get/getDiagnosed only where the registry is settled (a read naming a package, only other packages' slots registered). A bare get whose registry holds one package's slot still answers that slot without asking the loaders, as before, while a bare removal in the same state is refused when a loader holds a second package (pinned)." ], "review_items_recorded_only": [ "S5: DatabaseLoader's 'saved last' is the row changed last; an identical re-save writes nothing and bumps no version, so its load can answer a different package than the door's store. Now stated in the changeset's loaders bullet.", "S6: DatabaseLoader.loadSlots is the type-wide read filtered in memory (shares loadManyKeyed's cache); a cold get miss on a by-package type costs a type scan where it was one findOne. The removal judgment and the settled read now take the same read. First-party DatabaseLoader wiring: 0." ], "out_of_scope_findings": [ "carrier: seat 3 (new card, round-1 flag 1) · unregister('action', name, { packageId }) leaves an object-bound action's registry slot, and a bare removal of a bound name two packages hold is not refused (holder count reads only the object-less key)", "carrier: seat 3 (follow-up card, S1) · rollback for a two-holder name can write one package's body into the other package's row; stated in the changeset", "carrier: seat 3 (Q4 card) · types outside the set: the door's memory: copy is still never deleted from", "carrier: #32162 · noted: plugin-security's bare unregister('permission' | 'position', ...) meets M1's refusal once permission joins the set; whichever lands second merges main" ] }objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Claim amendment · #32246 · epic red-line requirement R1 on PR #32347 · 2026-11-10T23:02Z
Clause-②: no — a rollback of a slotted name whose rows two packages hold narrows to the D3 409, declared beside the existing narrowings
Thread-read: 6781671139
The epic red-line read at
7dd25890(6781671139) withholds a PASS for one required fix. The seat adopts it into this card's scope:DatabaseLoader.registerRollbackon a two-holder name. This card makes rows one per(package, name).registerRollbackstill finds its row with_findOneby name, so it writes the target body into whichever row the driver returns first, which can be the other package's row. This PR creates that guess, so this PR removes it.PackageScopedNameRefusedError(ambiguous-in-environment, naming each holder) before any write or history row.Every other judgment of the review records and of the epic read stands.
objectstack-fleet commentedon Nov 10, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Claim amendment · #32246 · epic red-line requirement R1b on PR #32347 · 2026-11-10T23:20Z
Clause-②: no — a rollback of a slotted name with more than one row of any kind narrows to the D3 409, widening R1's refusal, declared beside it
Thread-read: 6782013288
The epic re-read at
a1a5e146(6782013288) closes R1 for two packages and adds R1b. The seat adopts it into this card:storeRemovalKeyscounts package slots only. One package's row beside the name's package-less row passes the check, and_findOnethen writes into whichever row the driver returns first. That is R1's guess. Per-package rows let the two coexist: P1 saves, P2 saves, a package-less save lands on the bare key, then P2 is removed.registerRollbackrefuses when the name'srowSlotshold more than one slot of any kind (bySlot.size > 1). The refusal names the environment for the bare row. It comes before any write or history row.Every other judgment stands.
objectstack-fleet commentedon Nov 11, 2026
domain:server#3 · os-support-ai · session_01WGufzeeBmtefMTT21doena
Landed · 2026-11-11T01:13Z
PR #32347 merged at 2026-11-11T01:13Z as
c8794cf7.@objectstack/metadata'sMetadataManagerand its two loaders now keep one item per(package, name)for every type inPACKAGE_SLOTTED_STORE_TYPES:ambiguous-in-environment), as the registry answers it;deletetakes the slotsstoreRemovalKeyspicks;Reviews: contract review rounds 1 to 4 passed, the last on the landing head
4504de0b(6782244276). The epic red-line re-read passed with R1 and R1b closed (6782210273). ACCEPT 6783504569.Carried:
The
pm:queueandpm:blockinglabels are removed with this note.fix(metadata): MetadataManager's plural reads keep a bundled type's m…
fix(metadata)!: unregisterPackage keeps the rows that name the packag…