Skip to content

Commit dc8a1a1

Browse files
committed
fix(metadata-protocol): refusals and hints state each decision in words instead of a tracker number (stage 2, author-visible)
The thrown refusals, the stored-type preflight and revert refusals, and the schedule-flow organization hint no longer send the reader to a tracker number: each says what was decided, or loses only the citation where the sentence already said it. Text only: no code, field, status or export moves. The prose-id ledger is recomputed with --census-ledger; only metadata-protocol rows move. Claude-Session: https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY Co-authored-by: Claude <noreply@anthropic.com>
1 parent 261c529 commit dc8a1a1

3 files changed

Lines changed: 15 additions & 23 deletions

File tree

‎packages/metadata-protocol/src/protocol.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10308,7 +10308,7 @@ export class ObjectStackProtocolImplementation implements
1030810308
`'${param}' entry #${badShape + 1} on object '${object}' is not a field name.`
1030910309
+ (retiredForm
1031010310
? ' The nested-select object form `{ field, fields, alias }` was removed in '
10311-
+ '@objectstack/spec 17 (#4196) — no engine or driver ever read it.'
10311+
+ '@objectstack/spec 17 — no engine or driver ever read it.'
1031210312
: '')
1031310313
// [#7532] The dotted-path half of this prescription is GONE.
1031410314
// It pointed at a spelling this same gate now refuses — and
@@ -13320,7 +13320,7 @@ export class ObjectStackProtocolImplementation implements
1332013320
this.assertObjectRegistered(request.object); // [#3770]
1332113321
const engineInsertMany = (this.engine as any)?.insertMany;
1332213322
if (typeof engineInsertMany !== 'function') {
13323-
throw new Error('insertManyData requires an engine with insertMany (framework#3172)');
13323+
throw new Error('insertManyData requires an engine with insertMany: the partial-success batch insert, which reports an outcome per row so a bad row neither fails the whole batch nor makes the good rows run their beforeInsert hooks twice');
1332413324
}
1332513325
// [#5503/#14147] The engine's events are collected WHOLE and merged —
1332613326
// the same handling `createManyData` gives them, and for the reason
@@ -14077,7 +14077,7 @@ export class ObjectStackProtocolImplementation implements
1407714077
+ `overlay"). An operator may set OS_METADATA_WRITABLE=${singular} to grant a runtime escape hatch, `
1407814078
+ `but note the row still will not survive a restart — the hatch unlocks the write, not the read, `
1407914079
+ `and boot logs every such row it walks past. `
14080-
+ `See docs/adr/0005-metadata-customization-overlay.md and #6190.`
14080+
+ `See docs/adr/0005-metadata-customization-overlay.md.`
1408114081
);
1408214082
err.code = 'NOT_OVERRIDABLE';
1408314083
err.status = 403;
@@ -15043,7 +15043,7 @@ export class ObjectStackProtocolImplementation implements
1504315043
+ `the non-canonical metadata type '${type}' (canonical: '${canonicalType}'). The registry `
1504415044
+ `holds exactly one plain key per (type, name) and every reader addresses it through the `
1504515045
+ `'/meta' boundary, which folds — an entry minted under '${type}' is a second namespace no `
15046-
+ `canonical read, listing or declaration lookup can reach (#4432). Fold the type at the `
15046+
+ `canonical read, listing or declaration lookup can reach. Fold the type at the `
1504715047
+ `producer (canonicalMetaType), not here; see this method's header for why the mint door `
1504815048
+ `refuses instead of folding.`,
1504915049
);
@@ -15818,8 +15818,8 @@ export class ObjectStackProtocolImplementation implements
1581815818
if (await this.metaTypeNamespaceExists(unrecognised.type)) return;
1581915819
const err = new Error(
1582015820
`'${unrecognised.type}' is not a metadata type. The platform declares `
15821-
+ `no such type, and since #8586 retired 'additionalTypes' a plugin cannot declare one `
15822-
+ `either — so this write would mint a sys_metadata namespace under `
15821+
+ `no such type, and a plugin cannot declare one either: 'additionalTypes' was retired because `
15822+
+ `nothing ever read it — so this write would mint a sys_metadata namespace under `
1582315823
+ `type='${unrecognised.type}' that nothing reads and nothing serves. Address a real `
1582415824
+ `metadata type; GET /api/v1/meta/types lists the ones this deployment carries.`,
1582515825
);
@@ -18667,11 +18667,11 @@ export class ObjectStackProtocolImplementation implements
1866718667
error: `Draft '${d.type}/${d.name}' is stored under the non-canonical metadata type `
1866818668
+ `'${d.type}'; the canonical type for this item is '${canonical}'. Publishing it would `
1866918669
+ `mint an ACTIVE row in a second namespace that no registry read and no compliance `
18670-
+ `query on '${canonical}' can see (#7894 closed this namespace at the '/meta' URL door; `
18670+
+ `query on '${canonical}' can see (the '/meta' URL door now folds a type to its canonical spelling before it writes; `
1867118671
+ `this row predates that). Re-author the item under '${canonical}' `
1867218672
+ `(PUT /meta/${canonical}/${d.name}) and drop the '${d.type}' row. Note that `
1867318673
+ `POST /meta/_migrate-stored does NOT rewrite a stored type spelling — it canonicalizes `
18674-
+ `bodies, and reports rows of this class as 'skipped' with that same reason (#8957).`,
18674+
+ `bodies, and reports rows of this class as 'skipped' with that same reason.`,
1867518675
code: 'STORED_TYPE_NOT_CANONICAL',
1867618676
organizationId: d.organizationId ?? null,
1867718677
});
@@ -20873,13 +20873,13 @@ export class ObjectStackProtocolImplementation implements
2087320873
+ `metadata type '${it.type}'; the canonical type for this item is `
2087420874
+ `'${canonical}'. Restoring it would write the pre-commit body back into a `
2087520875
+ `second namespace that no registry read and no compliance query on `
20876-
+ `'${canonical}' can see (#7894 closed this namespace at the '/meta' URL `
20877-
+ `door; this row predates that), and the registry refuses to serve it `
20876+
+ `'${canonical}' can see (the '/meta' URL door now folds a type to its canonical `
20877+
+ `spelling before it writes; this row predates that), and the registry refuses to serve it `
2087820878
+ `(REGISTRY_TYPE_NOT_CANONICAL), so the restored body would reach no reader. `
2087920879
+ `Re-author the item under '${canonical}' (PUT /meta/${canonical}/${it.name}) `
2088020880
+ `and drop the '${it.type}' row. Note that POST /meta/_migrate-stored does NOT `
2088120881
+ `rewrite a stored type spelling — it canonicalizes bodies, and reports rows `
20882-
+ `of this class as 'skipped' with that same reason (#8957).`,
20882+
+ `of this class as 'skipped' with that same reason.`,
2088320883
code: 'STORED_TYPE_NOT_CANONICAL',
2088420884
});
2088520885
continue;

‎packages/metadata-protocol/src/runtime-authoring-gate.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ export function findPlatformScheduleOrgGaps(args: {
329329
hint:
330330
`Declare the owning organization on this node: `
331331
+ `config.fields.${ORGANIZATION_FIELD}. An author-supplied value always wins over the `
332-
+ `engine's fill (#6153), so this is the one place the answer can come from for a `
332+
+ `engine's fill, and the engine fills only an organization the run resolved — so this is `
333+
+ `the one place the answer can come from for a `
333334
+ `scheduled run. A NULL ${ORGANIZATION_FIELD} is not merely untidy: an `
334335
+ `(${ORGANIZATION_FIELD}, …) unique index does not constrain across NULL and org-scoped `
335336
+ `queries never see the row. Alternatively, publish this flow into an organization, or `

‎scripts/doc-authoring-prose-id.baseline.json‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -324,19 +324,10 @@
324324
},
325325
"packages/metadata-protocol/src/protocol.ts": {
326326
"#10377": 1,
327-
"#3172": 1,
328327
"#3770": 1,
329-
"#4196": 1,
330-
"#4432": 1,
331-
"#6190": 3,
328+
"#6190": 2,
332329
"#6992": 1,
333-
"#7894": 2,
334-
"#8502": 1,
335-
"#8586": 1,
336-
"#8957": 2
337-
},
338-
"packages/metadata-protocol/src/runtime-authoring-gate.ts": {
339-
"#6153": 1
330+
"#8502": 1
340331
},
341332
"packages/metadata-protocol/src/sys-metadata-repository.ts": {
342333
"#4867": 1

0 commit comments

Comments
 (0)