Skip to content

Commit bd5407e

Browse files
fix(metadata-protocol): the served type schemas no longer offer the keys the platform stamps (#38209)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuVFUgB5fpb8vei5czKLWGBM)_ Fixes #35879 Clause-②: no (narrowing — a key leaves a served description; nothing a client could save before is refused) Metadata-protocol: none Skills-docs: none — the skills already say these keys are populated by the runtime (`objectstack-data` examples-objects) and tell an MCP client to write only the keys the contract shows (`objectstack-mcp-build` §3); the served contract now matches that instruction, so no skill text changes ## 维护者速读 - 用户能看到什么变化:Studio 和 AI 助手读到的「这类配置能写哪些字段」说明里,不再列出锁定状态、来源、所属包等 7 个由平台自己盖章的内部字段;保存时的接受与拒绝完全不变。 - 为什么做:AI 助手被要求「只写说明里列出的字段」,说明却把平台内部字段也列成可写,容易诱导它写进去。 - 出错会怎样:最坏是某个界面不再显示这几个内部字段的输入框;它们本就不该由作者填写,可直接撤回。 - 要你做什么:无。 ## What changes - `packages/metadata-protocol/src/unauthorable-nodes.ts`: the served-schema strip stage gains a second class. Besides a node no instance satisfies, it now withholds every key of the ADR-0010 protection envelope — `PLATFORM_STAMPED_KEYS`, read off `MetadataProtectionFields` (`_lock`, `_lockReason`, `_lockSource`, `_provenance`, `_packageId`, `_packageVersion`, `_lockDocsUrl`) — from any schema node's `properties` map, at every depth. Same position rule as the tombstones (only a `properties` entry, never a `$defs` name or a data keyword) and the same `required` veto (a required key stays). - `protocol-meta-type-schema.ts`: comment on the import only; both derivation arms already pass through the strip. - No change to `packages/spec`: the Zod schemas still declare the envelope, so a served body keeps re-parsing. No change to any save, publish or read path. - `.changeset/35879-served-schema-platform-stamped-keys.md`: `@objectstack/metadata-protocol` patch. Measured before the change (`origin/main` 7605e0c, the real `getMetaTypes()`): 308 stamped-key nodes, 44 whole envelopes, across 33 served types — `object` at its root, in its `fields` entry schema and in a `$defs` union; `view` in each union arm. A security item is with the owner seat. ## Tests - `protocol.meta-types-unauthorable-columns.test.ts`, new describe `[#35879] the served types offer no key the platform stamps`: - control: the pre-strip derivation lists the whole envelope on `object` (root and field entry) and in more than one `view` arm; - dark: no served type lists a stamped key in any `properties` map at any depth; - lit: `object` keeps `name`/`label`/`fields`/`enable`, its field entry keeps `type`/`label`/`required`, `view` keeps its four arms; - over-drop guard: every stamped node in every derivation (both arms, every type) equals the envelope's own derived node and sits where all seven are spread, so a same-named property of another shape can never be what is withheld; - the Zod `object` schema still parses a body carrying `_packageId` / `_lock`. - Same file, existing over-drop guard: a removal is now explained by either class; the exact `dashboard` tombstone ledger is kept on tombstones only. - `protocol.meta-types-degenerate-derivation.test.ts`: `retiredTopLevelCount` adds the stamped keys back, so every pinned declared total (`object` 52, `field` 89, …) stays the authority unchanged. - `unauthorable-nodes.test.ts`, new describe: the key set is the seven envelope keys and frozen; dropped at the root and inside a record's entry; kept when required; never read outside a `properties` map. - `packages/runtime/src/domains/mcp-authoring.test.ts`: the MCP door's lean `contract: true` reply for `object` (root and the `fields/additionalProperties` drill) and `view` names no stamped key, with the control that `getMetadataTypeSchema('object')` still declares all seven. ## Acceptance notes - Omit, not `readOnly`: the card allowed either. The converter's existing convention for "not an author's to write" is to drop the property (`retiredKey()` tombstones), and the MCP door's lean contract follows from the served schema without a second rule. Dropping a key from a description refuses nothing a save accepted before. - `runtime` `typecheck`: `tsc --noEmit` is clean; its `check:test-typecheck` step reports TS2307 `@objectstack/driver-turso` in three untouched test files because that package was not in the locally built closure. Left to CI's typecheck job, which builds it. ## Verification Two-minute check: `pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.meta-types-unauthorable-columns.test.ts -t 35879` — five passing tests, the "dark" one asserting no served type lists `_lock` or any sibling. <details><summary>Local readings, head da34944 (CI check-runs are the authority on every family it runs)</summary> - `@objectstack/metadata-protocol` `vitest run` at ddb6acb: Test Files 372 passed, 9 skipped; Tests 23614 passed, 45 skipped. `typecheck` (`tsc --noEmit`) exit 0. - da34944 adds one module-top `import '@objectstack/lint';` to `protocol.meta-types-unauthorable-columns.test.ts`, so the lint root load is paid at collection rather than reached through the lazy import (`check:test-source-alias` flagged it in CI on ddb6acb). At da34944: that file 16 passed; `-t 35879` 5 passed; `check-test-source-alias` exit 0. - `@objectstack/runtime` `src/domains/mcp-authoring.test.ts`: 76 passed. `tsc --noEmit` clean (see Acceptance notes for its test-typecheck step). - Ablation, committed first, restored by blob hash with `git diff HEAD` empty: the strip predicate swapped back to tombstones only turns 16 tests red in `metadata-protocol` (the 14 declared-total controls of the degeneracy pin, the new dark pin and the unit drop pin); with that mutation built into `dist/` (marker absence proved by `ablation-dist-preflight`), the runtime lean-contract pin goes red; restored and rebuilt, the marker is back in `dist/` and the tree is clean. - Derived families (`dispatch-gates.mjs --commands`, 67 on this diff), run locally: exit 0 apart from `check-plugin-teardown-shape --self-test` (needs an unshallow clone) and `check:dual-build-cjs-loads` (PREREQUISITE NOT MET: packages outside this closure unbuilt) — NOT MEASURED here, CI's. `check-adr-0087-registration`: not-required (no-migration-prescription), notice only. `check-changeset-no-major` against this body: patch, no major. - Dogfood battery (owed: the `(narrowing)` arm), head da34944, under `os-verify-lock`: VERDICT command-exit 0 (held the lock 37m23s); `@objectstack/dogfood` Test Files 490 passed, 3 skipped (493); Tests 4144 passed, 68 skipped (4212); no failures. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgVPzC3zNXbLrxYGzzH --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgVPzC3zNXbLrxYGzzH)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgVPzC3zNXbLrxYGzzH --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6e8056c commit bd5407e

7 files changed

Lines changed: 277 additions & 14 deletions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): the served type schemas no longer offer the keys the platform stamps
6+
7+
Clause-②: no (narrowing — a key leaves a served description; nothing a client could save before is refused)
8+
Metadata-protocol: none
9+
10+
`GET /meta/types` (and the MCP draft door's `contract: true` read of `list_metadata_items`, which answers from it) describes what an author may write for each metadata type. Every type spreads the ADR-0010 protection envelope, so the served JSON Schema listed `_lock`, `_lockReason`, `_lockSource`, `_provenance`, `_packageId`, `_packageVersion` and `_lockDocsUrl` among each type's properties, and again inside every schema embedded in one (an object's field entries, each arm of a view). Studio's panels and an MCP client told to write only the keys the contract shows read those as writable.
11+
12+
They are the platform's to write: a package's loader and the registration stamp them, and an author declares a lock through `protection` in a code package's source. The served schema now leaves them out, at every depth, the same way it already leaves out a retired key's tombstone.
13+
14+
- **What a client sends is unchanged.** The save door refuses and accepts exactly what it did, and the Zod schemas still declare the envelope, so a served body re-parses.
15+
- **What changes is the description only.** A client that built a form or a key list from the served schema no longer shows these seven keys.
16+
17+
Nothing to migrate.
18+
19+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed or renamed, and nothing stored is rewritten: the Zod schemas keep declaring the envelope and the save door is unchanged. What moves is the served JSON Schema description, which stops listing seven keys only the platform writes; there is nothing for a migration to rewrite. -->

‎packages/metadata-protocol/src/protocol-meta-type-schema.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
// [#17502] The served JSON Schema publishes what an author MAY write, so a
1111
// property no instance can satisfy — a `retiredKey()` tombstone, rendered
1212
// `{ not: {} }` — is dropped from it. See the module header for the channels
13-
// that keep carrying the retirement's prescription.
13+
// that keep carrying the retirement's prescription. [#35879] So is every key
14+
// the platform stamps (the ADR-0010 protection envelope): declared so a served
15+
// body re-parses, never an author's to write.
1416
import { stripUnauthorableProperties } from './unauthorable-nodes.js';
1517
// [#19295] The output derivation of a `ZodPipe` erases the arm's own input
1618
// type, so an authoring arm that accepts a bare string is served as the

‎packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ import { ObjectStackProtocolImplementation } from './protocol.js';
107107
// [#17502] The emitter's OWN strip and its predicate — the baseline below is
108108
// stripped with the same code the server runs, so this pin can never drift
109109
// into measuring a second, hand-written idea of "admits nothing".
110-
import { acceptsNothing, stripUnauthorableProperties } from './unauthorable-nodes.js';
110+
import { acceptsNothing, isPlatformStampedKey, stripUnauthorableProperties } from './unauthorable-nodes.js';
111111
// [#19295] The emitter's OWN erased-authoring hook, for the same reason: the
112112
// baseline is derived with the code the server derives with, so the only
113113
// difference left to find is the degeneracy retry's.
@@ -182,7 +182,10 @@ function preFixServedBaseline(type: string): Record<string, unknown> | undefined
182182

183183
/**
184184
* [#17502] How many TOP-LEVEL properties the strip removes from this type's
185-
* served document.
185+
* served document. [#35879] That is the ones no instance satisfies AND the
186+
* ADR-0010 keys the platform stamps: both are declared on the type and
187+
* withheld from the served offer, so both are added back to reach the declared
188+
* total each count below pins.
186189
*
187190
* Counted on whichever derivation the server can actually use: `action` has no
188191
* properties at all on the default arm, so its three tombstones are visible
@@ -200,7 +203,7 @@ function retiredTopLevelCount(type: string): number {
200203
}
201204
const properties = json.properties as Record<string, unknown> | undefined;
202205
if (properties && Object.keys(properties).length > 0) {
203-
return Object.values(properties).filter(acceptsNothing).length;
206+
return Object.entries(properties).filter(([key, node]) => acceptsNothing(node) || isPlatformStampedKey(key)).length;
204207
}
205208
}
206209
return 0;

‎packages/metadata-protocol/src/protocol.meta-types-unauthorable-columns.test.ts‎

Lines changed: 126 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@
5858
* uses, so the assertions are about what the endpoint SERVES and not about a
5959
* derivation picked for convenience.
6060
*/
61+
// [#35879] The served-payload pins boot the protocol, whose diagnostics load the
62+
// lint root lazily: pay that load during collection, never inside a clocked case.
63+
import '@objectstack/lint';
6164
import { describe, expect, it } from 'vitest';
6265
import { z } from 'zod';
6366
// [#5619] The producer's OWN write-verb dispatch decisions, so the fake engine
6467
// below cannot accept a call ObjectQL itself refuses.
6568
import { assertEngineDeleteDispatch, assertEngineUpdateDispatch, assertEngineFindOnePredicate, type EngineFindOneQueryInput } from '@objectstack/metadata-core';
66-
import { DEFAULT_METADATA_TYPE_REGISTRY, getMetadataTypeSchema } from '@objectstack/spec/kernel';
69+
import { DEFAULT_METADATA_TYPE_REGISTRY, getMetadataTypeSchema, MetadataProtectionFields } from '@objectstack/spec/kernel';
6770
import { METADATA_FORM_REGISTRY } from '@objectstack/spec/system';
6871
import { ObjectStackProtocolImplementation } from './protocol.js';
69-
import { acceptsNothing } from './unauthorable-nodes.js';
72+
import { acceptsNothing, isPlatformStampedKey } from './unauthorable-nodes.js';
7073
// [#19295] The emitter's OWN erased-authoring hook — the baseline below is
7174
// derived with the code the server derives with, so the one difference this
7275
// pin reads is the strip's.
@@ -303,7 +306,7 @@ describe('#17502 — the served repeater row offers no column the parse door ref
303306
expect(offenders).toEqual([]);
304307
});
305308

306-
it('over-drop guard: the served payload is its derivation MINUS unsatisfiable nodes, nothing else', async () => {
309+
it('over-drop guard: the served payload is its derivation MINUS unsatisfiable nodes and platform-stamped keys, nothing else', async () => {
307310
// ⚠️ This is the direction the blast-radius pin in
308311
// `protocol.meta-types-degenerate-derivation.test.ts` CANNOT see. Since
309312
// #17502 its baseline is `stripUnauthorableProperties(preFixDerivation(type))`,
@@ -332,9 +335,16 @@ describe('#17502 — the served repeater row offers no column the parse door ref
332335
.map((before) => strippedDiff(before, after))
333336
.find((d) => d.other.length === 0);
334337
if (!diff) { unexplained.push(type); continue; }
335-
removedByType.set(type, diff.removed.map((r) => `${type}${r.path.slice(1)}`));
338+
// [#35879] The strip's second class: an ADR-0010 key the platform
339+
// stamps, dropped from a `properties` map. Judged by its position
340+
// and name, never by its node — those nodes admit instances.
341+
const stamped = (path: string) => {
342+
const at = path.lastIndexOf('.properties.');
343+
return at >= 0 && isPlatformStampedKey(path.slice(at + '.properties.'.length));
344+
};
345+
removedByType.set(type, diff.removed.filter((r) => !stamped(r.path)).map((r) => `${type}${r.path.slice(1)}`));
336346
for (const r of diff.removed) {
337-
if (!acceptsNothing(r.node)) overDropped.push(`${type}${r.path.slice(1)}`);
347+
if (!acceptsNothing(r.node) && !stamped(r.path)) overDropped.push(`${type}${r.path.slice(1)}`);
338348
}
339349
}
340350

@@ -440,3 +450,114 @@ describe('#17502 — the removal is payload-only: every prescription channel sur
440450
}
441451
});
442452
});
453+
454+
/**
455+
* [#35879] The served payload offers no key the platform stamps.
456+
*
457+
* Every metadata type spreads the ADR-0010 protection envelope, and so does
458+
* every schema embedded in one, so the derivation lists `_lock`, `_lockReason`,
459+
* `_lockSource`, `_provenance`, `_packageId`, `_packageVersion` and
460+
* `_lockDocsUrl` among the properties Studio and the MCP draft door read as
461+
* the offer. None of them is an author's to write: a package's loader and the
462+
* registration stamp them (ADR-0010). Measured on `origin/main` at 7605e0c9
463+
* before the strip: 308 such
464+
* nodes (44 envelopes) across 33 served types, `object` at its root, inside its
465+
* `fields` entries and in a `$defs` union, `view` in each union arm.
466+
*
467+
* The controls make each half fail on the tree before the fix: the pre-strip
468+
* derivation must carry the envelope where this pins its absence, and every
469+
* node the strip took must be an envelope node exactly as the envelope
470+
* declares it, at a place the whole envelope is spread, so a property that
471+
* merely shares a name is never what went missing.
472+
*/
473+
describe('[#35879] the served types offer no key the platform stamps', () => {
474+
const STAMPED = Object.keys(MetadataProtectionFields);
475+
476+
/** Every `<path>.properties.<key>` in a document whose key is a stamped one, at any depth. */
477+
function stampedPaths(node: unknown, path = '$'): string[] {
478+
if (Array.isArray(node)) return node.flatMap((n, i) => stampedPaths(n, `${path}[${i}]`));
479+
if (!node || typeof node !== 'object') return [];
480+
const out: string[] = [];
481+
for (const [key, value] of Object.entries(node as Record<string, unknown>)) {
482+
if (key === 'default' || key === 'const' || key === 'enum' || key === 'examples') continue;
483+
if (key === 'properties' && value && typeof value === 'object') {
484+
for (const prop of Object.keys(value as Record<string, unknown>)) {
485+
if (STAMPED.includes(prop)) out.push(`${path}.properties.${prop}`);
486+
}
487+
}
488+
out.push(...stampedPaths(value, `${path}.${key}`));
489+
}
490+
return out;
491+
}
492+
493+
/** The node at a `$`-rooted dotted path with `[i]` indices, as `stampedPaths` spells it. */
494+
function at(doc: unknown, path: string): unknown {
495+
const steps = path.slice(1).split(/\.|(?=\[)/).filter(Boolean);
496+
let node: any = doc;
497+
for (const step of steps) {
498+
const index = /^\[(\d+)\]$/.exec(step);
499+
node = index ? node?.[Number(index[1])] : node?.[step];
500+
}
501+
return node;
502+
}
503+
504+
it('control: the pre-strip derivation lists the whole envelope on `object` (root and field entry) and in every `view` arm', () => {
505+
const object = preStripDerivation('object') as any;
506+
expect(Object.keys(object.properties)).toEqual(expect.arrayContaining(STAMPED));
507+
expect(Object.keys(object.properties.fields.additionalProperties.properties)).toEqual(expect.arrayContaining(STAMPED));
508+
const view = preStripDerivation('view') as any;
509+
const arms = stampedPaths(view).filter((p) => p.endsWith('.properties._lock'));
510+
expect(arms.length).toBeGreaterThan(1);
511+
});
512+
513+
it('dark: no served type lists a stamped key in any properties map, at any depth', async () => {
514+
const served = await servedSchemas();
515+
const offenders: string[] = [];
516+
for (const type of SERVED_TYPES) offenders.push(...stampedPaths(served.get(type), type));
517+
// ⛔ An entry here is a key the endpoint offers that only the platform writes.
518+
expect(offenders).toEqual([]);
519+
});
520+
521+
it('lit: `object` and `view` still serve the keys an author writes beside them', async () => {
522+
const served = await servedSchemas();
523+
const object = served.get('object') as any;
524+
for (const key of ['name', 'label', 'fields', 'enable']) expect(Object.keys(object.properties)).toContain(key);
525+
for (const key of ['type', 'label', 'required']) {
526+
expect(Object.keys(object.properties.fields.additionalProperties.properties)).toContain(key);
527+
}
528+
const view = served.get('view') as any;
529+
expect((view.anyOf as unknown[]).length).toBe(4);
530+
});
531+
532+
it('over-drop guard: every stamped node the strip took is the envelope\'s own node, at a place the whole envelope is spread', () => {
533+
// The envelope node each key derives to on its own: what a removed node
534+
// must equal, so a same-named property of another shape is never taken.
535+
const envelope = z.toJSONSchema(z.object(MetadataProtectionFields), { unrepresentable: 'any', override: markErasedAuthoringInput }) as any;
536+
let measured = 0;
537+
const foreign: string[] = [];
538+
for (const type of SERVED_TYPES) {
539+
for (const io of ['output', 'input'] as const) {
540+
const before = preStripDerivation(type, io);
541+
if (!before) continue;
542+
for (const path of stampedPaths(before, '$')) {
543+
measured += 1;
544+
const key = path.slice(path.lastIndexOf('.') + 1);
545+
const parent = at(before, path.slice(0, path.lastIndexOf('.properties.'))) as any;
546+
const whole = STAMPED.every((k) => k in (parent?.properties ?? {}));
547+
if (!whole || JSON.stringify(parent.properties[key]) !== JSON.stringify(envelope.properties[key])) {
548+
foreign.push(`${type}(${io})${path.slice(1)}`);
549+
}
550+
}
551+
}
552+
}
553+
expect(measured, 'the sweep read the envelope somewhere').toBeGreaterThan(0);
554+
// ⛔ An entry here is a property named like a stamp that is not the envelope's: it must not be withheld.
555+
expect(foreign).toEqual([]);
556+
});
557+
558+
it('the Zod shape still declares the envelope: a served body keeps re-parsing, nothing is removed upstream', () => {
559+
const object = getMetadataTypeSchema('object') as z.ZodTypeAny;
560+
const parsed = object.safeParse({ name: 'acct', label: 'Account', fields: {}, _packageId: 'com.acme.crm', _lock: 'none' });
561+
expect(parsed.success, JSON.stringify(parsed.error?.issues)).toBe(true);
562+
});
563+
});

‎packages/metadata-protocol/src/unauthorable-nodes.test.ts‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
*/
99
import { describe, expect, it } from 'vitest';
1010
import { z } from 'zod';
11-
import { acceptsNothing, stripUnauthorableProperties } from './unauthorable-nodes.js';
11+
import { MetadataProtectionFields } from '@objectstack/spec/kernel';
12+
import { acceptsNothing, isPlatformStampedKey, PLATFORM_STAMPED_KEYS, stripUnauthorableProperties } from './unauthorable-nodes.js';
1213

1314
const NEVER = { description: '[REMOVED] `x` was removed. Delete the key.', not: {} };
1415

@@ -116,3 +117,50 @@ describe('stripUnauthorableProperties', () => {
116117
expect(out.default).toEqual({ properties: { dead: { not: {} } } });
117118
});
118119
});
120+
121+
describe('[#35879] the platform-stamped keys', () => {
122+
const STAMPED = Object.keys(MetadataProtectionFields);
123+
124+
it('are the ADR-0010 envelope, read off its declaration: seven keys, frozen', () => {
125+
expect([...PLATFORM_STAMPED_KEYS].sort()).toEqual([
126+
'_lock', '_lockDocsUrl', '_lockReason', '_lockSource', '_packageId', '_packageVersion', '_provenance',
127+
]);
128+
expect(STAMPED.every(isPlatformStampedKey)).toBe(true);
129+
expect(isPlatformStampedKey('_diagnostics'), 'a read decoration is not a stamp').toBe(false);
130+
expect(isPlatformStampedKey('name')).toBe(false);
131+
expect(Object.isFrozen(PLATFORM_STAMPED_KEYS)).toBe(true);
132+
});
133+
134+
it('are dropped from a properties map at the root and at depth, beside the live keys', () => {
135+
// The envelope derives to satisfiable nodes: only the NAME decides.
136+
const shape = z.object({
137+
name: z.string(),
138+
fields: z.record(z.string(), z.object({ type: z.string(), ...MetadataProtectionFields })),
139+
...MetadataProtectionFields,
140+
});
141+
const json = z.toJSONSchema(shape, { unrepresentable: 'any' }) as any;
142+
expect(Object.keys(json.properties)).toEqual(expect.arrayContaining(STAMPED));
143+
expect(STAMPED.some((k) => acceptsNothing(json.properties[k])), 'no envelope node is a tombstone').toBe(false);
144+
145+
const out: any = stripUnauthorableProperties(json);
146+
expect(Object.keys(out.properties)).toEqual(['name', 'fields']);
147+
expect(Object.keys(out.properties.fields.additionalProperties.properties)).toEqual(['type']);
148+
});
149+
150+
it('keeps a stamped key its parent requires, as it keeps a required tombstone', () => {
151+
const input = { type: 'object', properties: { _lock: { type: 'string' }, name: { type: 'string' } }, required: ['_lock'] };
152+
const out: any = stripUnauthorableProperties(input);
153+
expect(Object.keys(out.properties)).toEqual(['_lock', 'name']);
154+
expect(out).toBe(input);
155+
});
156+
157+
it('never reads a stamped NAME outside a properties map: a $defs entry and DATA keep it', () => {
158+
const input = {
159+
type: 'object',
160+
$defs: { _lock: { type: 'string' } },
161+
default: { _lock: 'full' },
162+
properties: { name: { type: 'string' } },
163+
};
164+
expect(stripUnauthorableProperties(input)).toBe(input);
165+
});
166+
});

0 commit comments

Comments
 (0)