From 2c06b1a39644fdd9bd47d7db7d6eb79618885058 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 18 Oct 2026 21:10:50 +0000 Subject: [PATCH] fix(engine): six user-facing strings say "authored in this system", not "this environment" Inside the running system, user-facing copy names the system the user is in as "this system"; an item made here rather than shipped by a package reads "authored in this system". - objectql: the default-record-page holder text and the security-catalog environment holder's parenthesis ("the environment catalog" stays: it is the holder's documented name in ADR-0048 and the namespace docblock). - metadata-protocol: the protection-block and lock-family-key refusals and the default-record-page conflict's holder text. - platform-objects: sys_metadata_activation's object description and its package_id field description. The two objectql tests that pin the refusal's first sentence move with it. No code, status, error code or envelope field changes. Claude-Session: https://claude.ai/code/session_01Vp3Ze7Vv9L1PuejcRQC2bK Co-authored-by: Claude --- .changeset/24360-metadata-protocol-this-system.md | 10 ++++++++++ .changeset/24360-objectql-this-system.md | 10 ++++++++++ .changeset/24360-platform-objects-this-system.md | 10 ++++++++++ packages/metadata-protocol/src/protocol.ts | 6 +++--- .../objectql/src/default-record-page-save-door.test.ts | 4 ++-- packages/objectql/src/default-record-page.ts | 2 +- .../objectql/src/registry-default-record-page.test.ts | 2 +- packages/objectql/src/security-catalog-namespace.ts | 2 +- .../src/system/sys-metadata-activation.object.ts | 4 ++-- 9 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .changeset/24360-metadata-protocol-this-system.md create mode 100644 .changeset/24360-objectql-this-system.md create mode 100644 .changeset/24360-platform-objects-this-system.md diff --git a/.changeset/24360-metadata-protocol-this-system.md b/.changeset/24360-metadata-protocol-this-system.md new file mode 100644 index 00000000000..4614ddc6489 --- /dev/null +++ b/.changeset/24360-metadata-protocol-this-system.md @@ -0,0 +1,10 @@ +--- +'@objectstack/metadata-protocol': patch +--- + +Clause-②: no + +fix(metadata-protocol): the save door's lock refusals and its default-record-page refusal say "authored in this system" + +- **What changed.** Three refusal texts said an item saved through the metadata API is "authored in this environment". They now say "authored in this system": the `protection`-block refusal, the lock-family-key refusal, and the holder text a default-record-page conflict prints for a page no package ships (`page 'NAME', authored in this system`). Inside the running system, user-facing copy names the system the user is in as "this system". +- **Unchanged.** Every error code (`VALIDATION_ERROR`, `DEFAULT_RECORD_PAGE_CONFLICT`), status and `issues[]` entry. diff --git a/.changeset/24360-objectql-this-system.md b/.changeset/24360-objectql-this-system.md new file mode 100644 index 00000000000..216bd17a6cd --- /dev/null +++ b/.changeset/24360-objectql-this-system.md @@ -0,0 +1,10 @@ +--- +'@objectstack/objectql': patch +--- + +Clause-②: no + +fix(objectql): the default-record-page and security-catalog refusals name an item made here, not shipped by a package, as "authored in this system" + +- **What changed.** The holder text a `DEFAULT_RECORD_PAGE_CONFLICT` refusal prints for a page no package ships now reads `page "NAME", authored in this system`, and the holder text a `NAMESPACE_CONFLICT` refusal prints for the environment catalog reads `the environment catalog (an item authored in this system, not shipped by a package)`. Both said "authored in this environment". Inside the running system, user-facing copy names the system the user is in as "this system". +- **Unchanged.** Every error code, status and envelope field (`existing`, `incoming`, `existingHolder: { kind: 'environment' }`). "The environment catalog" is the documented name of that holder (ADR-0048), so it stays. diff --git a/.changeset/24360-platform-objects-this-system.md b/.changeset/24360-platform-objects-this-system.md new file mode 100644 index 00000000000..686631579f8 --- /dev/null +++ b/.changeset/24360-platform-objects-this-system.md @@ -0,0 +1,10 @@ +--- +'@objectstack/platform-objects': patch +--- + +Clause-②: no + +fix(platform-objects): `sys_metadata_activation`'s description and its `package_id` field description say "authored in this system" + +- **What changed.** The activation ledger's object description and the description of its `package_id` field described an item no package ships as "authored in this environment". Both now say "authored in this system". Inside the running system, user-facing copy names the system the user is in as "this system". +- **Unchanged.** The object's fields, their types and every stored value. diff --git a/packages/metadata-protocol/src/protocol.ts b/packages/metadata-protocol/src/protocol.ts index af22d251fb1..6abd847e4df 100644 --- a/packages/metadata-protocol/src/protocol.ts +++ b/packages/metadata-protocol/src/protocol.ts @@ -1140,7 +1140,7 @@ function protectionBlockRefusal( const err = new Error( `Remove the \`protection\` block from ${type} '${saveName}' and send it again. Nothing was written. ` + 'This door does not translate the block, so it would lock nothing: an item saved through the metadata API ' - + 'is authored in this environment (ADR-0010 §3.5). To lock an item, declare `protection` on it in a code ' + + 'is authored in this system (ADR-0010 §3.5). To lock an item, declare `protection` on it in a code ' + "package's source, where the package loader translates it into the item's lock (ADR-0010 Phase 4.3).", ) as Error & { code: 'VALIDATION_ERROR'; status: 400; issues: MetadataIssueEntry[] }; err.code = 'VALIDATION_ERROR'; @@ -1244,7 +1244,7 @@ function authoredLockFamilyRefusal( const err = new Error( `Remove ${keys.map((key) => `\`${key}\``).join(', ')} from ${type} '${saveName}' and send it again. ` + `Nothing was written. They would ${effect}, and the metadata API never sets, changes or removes a lock: ` - + 'an item saved here is authored in this environment (ADR-0010 §3.5). To lock an item, declare `protection` ' + + 'an item saved here is authored in this system (ADR-0010 §3.5). To lock an item, declare `protection` ' + "on it in a code package's source, where the package loader translates it into the item's lock " + '(ADR-0010 Phase 4.3).', ) as Error & { code: 'VALIDATION_ERROR'; status: 400; issues: MetadataIssueEntry[] }; @@ -22212,7 +22212,7 @@ export class ObjectStackProtocolImplementation implements return true; }); const describe = (h: Holder) => - h.packageId ? `page '${h.page}' of package '${h.packageId}'` : `page '${h.page}', authored in this environment`; + h.packageId ? `page '${h.page}' of package '${h.packageId}'` : `page '${h.page}', authored in this system`; const named = unique.map(describe); const others = named.length === 1 ? `${named[0]} already is` : `${named.join(' and ')} already are`; const remedy = unique.some((h) => h.shipped) diff --git a/packages/objectql/src/default-record-page-save-door.test.ts b/packages/objectql/src/default-record-page-save-door.test.ts index 01fdd860523..ab4aa920958 100644 --- a/packages/objectql/src/default-record-page-save-door.test.ts +++ b/packages/objectql/src/default-record-page-save-door.test.ts @@ -208,7 +208,7 @@ describe.each(TOPOLOGIES)('%s kernel — a page saved as a second default record const { save, storedPages } = await boot(topology); expect((await save('env_task_a', recordPage('env_task_a', 'acme_task'))).ok).toBe(true); const outcome = await save('env_task_b', recordPage('env_task_b', 'acme_task')); - expectRefusal(outcome, 'env_task_b', 'acme_task', "page 'env_task_a', authored in this environment"); + expectRefusal(outcome, 'env_task_b', 'acme_task', "page 'env_task_a', authored in this system"); expect(String((outcome as { error?: any }).error?.message)).toContain( "Save 'env_task_b' with `isDefault: false`, or first save 'env_task_a' with `isDefault: false` to make " + "'env_task_b' the default instead.", @@ -232,7 +232,7 @@ describe.each(TOPOLOGIES)('%s kernel — a page saved as a second default record expect({ code: err?.code, status: err?.status }).toEqual({ code: 'DEFAULT_RECORD_PAGE_CONFLICT', status: 422 }); expect(String(err.message).split('. ')[0]).toBe( "Default record page conflict: page 'env_task_a' cannot be published as the default record page of object " - + "'acme_task': page 'env_task_b', authored in this environment already is", + + "'acme_task': page 'env_task_b', authored in this system already is", ); }); diff --git a/packages/objectql/src/default-record-page.ts b/packages/objectql/src/default-record-page.ts index ab16db96369..508f9a49e1e 100644 --- a/packages/objectql/src/default-record-page.ts +++ b/packages/objectql/src/default-record-page.ts @@ -160,7 +160,7 @@ export function misplacedDefaultPages(manifest: unknown): MisplacedDefaultPage[] export function describeDefaultRecordPageHolder(holder: DefaultRecordPageHolder): string { return holder.kind === 'package' ? `page "${holder.page}" of package "${holder.packageId}"` - : `page "${holder.page}", authored in this environment`; + : `page "${holder.page}", authored in this system`; } /** A stable identity for de-duplicating holders. */ diff --git a/packages/objectql/src/registry-default-record-page.test.ts b/packages/objectql/src/registry-default-record-page.test.ts index a6cf4bdb920..18b04d29ccd 100644 --- a/packages/objectql/src/registry-default-record-page.test.ts +++ b/packages/objectql/src/registry-default-record-page.test.ts @@ -102,7 +102,7 @@ function expectRefusal(err: Refusal | undefined, object: string, incoming: Holde expect(err!.incoming).toEqual(incoming); expect(err!.existing).toEqual(existing); const name = (h: Holder) => - h.kind === 'package' ? `page "${h.page}" of package "${h.packageId}"` : `page "${h.page}", authored in this environment`; + h.kind === 'package' ? `page "${h.page}" of package "${h.packageId}"` : `page "${h.page}", authored in this system`; expect(err!.message.split('. ')[0]).toBe( `Default record page conflict: ${name(incoming)} cannot be the default record page of object "${object}": ${name(existing)} already is`, ); diff --git a/packages/objectql/src/security-catalog-namespace.ts b/packages/objectql/src/security-catalog-namespace.ts index a50ca9c8eae..446185286c0 100644 --- a/packages/objectql/src/security-catalog-namespace.ts +++ b/packages/objectql/src/security-catalog-namespace.ts @@ -209,7 +209,7 @@ export function describeSecurityCatalogHolder(holder: SecurityCatalogHolder): st case 'package': return `package "${holder.packageId}"`; case 'environment': - return 'the environment catalog (an item authored in this environment, not shipped by a package)'; + return 'the environment catalog (an item authored in this system, not shipped by a package)'; case 'built-in': return 'the platform, as a built-in name no package can declare'; } diff --git a/packages/platform-objects/src/system/sys-metadata-activation.object.ts b/packages/platform-objects/src/system/sys-metadata-activation.object.ts index 417872272bb..a999628bfaa 100644 --- a/packages/platform-objects/src/system/sys-metadata-activation.object.ts +++ b/packages/platform-objects/src/system/sys-metadata-activation.object.ts @@ -72,7 +72,7 @@ export const SysMetadataActivation = ObjectSchema.create({ managedBy: 'engine-owned', // ADR-0126 §4 — the reference lives in the docblock above, not in the copy. description: - 'Activation ledger for metadata artifacts: one row per artifact whose armed state has been changed from its default. No row means the default — active. Packaged artifacts and positions or permission sets authored in this environment are both recorded here.', + 'Activation ledger for metadata artifacts: one row per artifact whose armed state has been changed from its default. No row means the default — active. Packaged artifacts and positions or permission sets authored in this system are both recorded here.', displayNameField: 'name', nameField: 'name', // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField) highlightFields: ['metadata_type', 'name', 'package_id', 'active'], @@ -148,7 +148,7 @@ export const SysMetadataActivation = ObjectSchema.create({ label: 'Package', maxLength: 255, description: - 'The package that ships the artifact. Empty when no package ships it: an item authored in this environment.', + 'The package that ships the artifact. Empty when no package ships it: an item authored in this system.', group: 'Identity', }),