Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/24360-metadata-protocol-this-system.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions .changeset/24360-objectql-this-system.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions .changeset/24360-platform-objects-this-system.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 3 additions & 3 deletions packages/metadata-protocol/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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[] };
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions packages/objectql/src/default-record-page-save-door.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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",
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/default-record-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/registry-default-record-page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/security-catalog-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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',
}),

Expand Down
Loading