Skip to content

Commit 384f175

Browse files
committed
test(metadata-protocol): author the OWD on every active-state object fixture
Re-measured today through the publish gate's call site: 56 active object writes across 10 test files, every one of which security-owd-unset would refuse once #8310 declares 'object' in runtimeTypes (up from PR #7886's 26/8 — the suite grew). Each fixture now authors sharingModel: 'private', so the suite passes both before and after the #8310 flip. Part of #8308. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Euoy6wyfzgiWtgCg4s6JK2
1 parent 9b702a6 commit 384f175

10 files changed

Lines changed: 40 additions & 2 deletions

‎packages/metadata-protocol/src/protocol-publish-drafts-endpoint-gate.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ const validEndpoint = (over: Record<string, unknown> = {}) => ({
218218
const objectBody = (name: string) => ({
219219
name,
220220
label: 'Thing',
221+
// [#8308] Authored OWD: the publish gate refuses an OWD-less custom object
222+
// (`security-owd-unset`) once #8310 declares `object` in `runtimeTypes`.
223+
sharingModel: 'private',
221224
fields: { title: { type: 'text', label: 'Title' } },
222225
});
223226

‎packages/metadata-protocol/src/protocol-publish-drafts-org-scope.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ function makeStubEngine() {
183183
const objectBody = (name: string) => ({
184184
name,
185185
label: 'Project Task',
186+
// [#8308] Authored OWD: the publish gate refuses an OWD-less custom object
187+
// (`security-owd-unset`) once #8310 declares `object` in `runtimeTypes`.
188+
sharingModel: 'private',
186189
fields: {
187190
title: { type: 'text', label: 'Title' },
188191
done: { type: 'boolean', label: 'Done' },

‎packages/metadata-protocol/src/protocol.audit-field-governance.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ function makeStubEngine() {
133133
const artifactObject = (name: string) => ({
134134
name,
135135
label: 'Invoice',
136+
// [#8308] Authored OWD: the publish gate refuses an OWD-less custom object
137+
// (`security-owd-unset`) once #8310 declares `object` in `runtimeTypes`.
138+
sharingModel: 'private',
136139
fields: {
137140
amount: { type: 'currency', label: 'Amount' },
138141
created_at: {

‎packages/metadata-protocol/src/protocol.injected-system-columns.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ const storedBody = (rows: Map<string, Row>, name: string) =>
136136
const authored = (name: string) => ({
137137
name,
138138
label: 'Invoice',
139+
// [#8308] Authored OWD: the publish gate refuses an OWD-less custom object
140+
// (`security-owd-unset`) once #8310 declares `object` in `runtimeTypes`.
141+
sharingModel: 'private',
139142
fields: { amount: { type: 'currency', label: 'Amount' } },
140143
});
141144

‎packages/metadata-protocol/src/protocol.org-scoped-write-refused.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ async function seedLegacyOrgDraft(
240240
const OBJECT = {
241241
name: 'org_widget',
242242
label: 'Org Widget',
243+
// [#8308] Authored OWD. This file pins the NOT_OVERRIDABLE org-scope
244+
// refusal, and the authoring gate runs BEFORE it — an OWD-less body would
245+
// swap the observed refusal for `security-owd-unset` 422 once #8310
246+
// declares `object` in `runtimeTypes`.
247+
sharingModel: 'private',
243248
fields: { title: { type: 'text', label: 'Title' } },
244249
};
245250

‎packages/metadata-protocol/src/protocol.read-decorations.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ const storedBody = (rows: Map<string, Row>, name: string) => {
118118
const objectBody = (name: string) => ({
119119
name,
120120
label: 'Invoice',
121+
// [#8308] Authored OWD: the publish gate refuses an OWD-less custom object
122+
// (`security-owd-unset`) once #8310 declares `object` in `runtimeTypes`.
123+
sharingModel: 'private',
121124
fields: { amount: { type: 'currency', label: 'Amount' } },
122125
});
123126

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,20 @@ describe('runtime authoring gate on saveMetaItem (#4463)', () => {
325325
// `object` writes are deliberately outside P1 — see the registry's
326326
// RUNTIME_OBJECT_WRITES_P2 reason. A type nobody declared must pass
327327
// through untouched rather than be silently half-checked.
328+
//
329+
// [#8308] The body carries an authored `sharingModel` so this write is
330+
// ALSO clean on the gated side: it succeeds today because nothing runs,
331+
// and keeps succeeding when #8310 declares `object` in `runtimeTypes`
332+
// (at which point this case's "no rule declares" premise ends — #8310
333+
// owns re-pinning what this test asserts).
328334
const { protocol } = makeProtocol();
329335
const result = await protocol.saveMetaItem({
330336
type: 'object',
331337
name: 'leave_request',
332338
item: {
333339
name: 'leave_request',
334340
label: 'Leave Request',
341+
sharingModel: 'private',
335342
fields: { owner: { type: 'text', label: 'Owner' } },
336343
},
337344
});

‎packages/metadata-protocol/src/protocol.save-receipt-wording.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ const OVERLAYLESS_PROBES: Record<string, Record<string, unknown>> = {
121121
object: {
122122
name: 'rc5_acct',
123123
label: 'Account',
124+
// [#8308] Authored OWD: the publish gate refuses an OWD-less custom
125+
// object (`security-owd-unset`) once #8310 declares `object` in
126+
// `runtimeTypes` — and this probe pins the RECEIPT wording, not that
127+
// refusal.
128+
sharingModel: 'private',
124129
fields: { name: { type: 'text', label: 'Name' } },
125130
},
126131
hook: { name: 'rc5_acct', object: 'task', events: ['beforeUpdate'] },

‎packages/metadata-protocol/src/sys-metadata-repository.package-writability.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ function makeFakeEngine() {
155155
};
156156
}
157157

158-
const objectBody = { name: 'showcase_task', label: 'Task', fields: { name: { type: 'text', label: 'Name' } } };
158+
// [#8308] `sharingModel` authored: the publish gate refuses an OWD-less custom
159+
// object (`security-owd-unset`) once #8310 declares `object` in `runtimeTypes`,
160+
// and this file pins the package-writability refusals, not that one.
161+
const objectBody = { name: 'showcase_task', label: 'Task', sharingModel: 'private', fields: { name: { type: 'text', label: 'Name' } } };
159162

160163
/**
161164
* `put` with everything but the base fixed, so each case differs in ONE way.

‎packages/metadata-protocol/src/view-container-runtime-expansion.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ describe('#7736 a runtime-authored view container is served', () => {
227227
const { engine, rows } = makeStubEngine();
228228
const protocol = new ObjectStackProtocolImplementation(engine);
229229

230-
const authored = { name: 'crm_invoice', label: 'Invoice', fields: { amount: { type: 'currency', label: 'Amount' } } };
230+
// [#8308] `sharingModel` authored: the publish gate refuses an
231+
// OWD-less custom object once #8310 declares `object` in
232+
// `runtimeTypes`; this case pins byte-identical storage, not that.
233+
const authored = { name: 'crm_invoice', label: 'Invoice', sharingModel: 'private', fields: { amount: { type: 'currency', label: 'Amount' } } };
231234
await protocol.saveMetaItem({ type: 'object', name: 'crm_invoice', item: authored });
232235

233236
const stored = Array.from(rows.values()).find((r) => r.name === 'crm_invoice')!;

0 commit comments

Comments
 (0)