From 47fba57a6d093f3f4ecb44d5ef2d3ab3a15de34e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 27 Nov 2026 20:28:15 +0100 Subject: [PATCH] thing-contract-ts: present's slot names are held by a test, and its forwarded getters are not enumerable (Stryker survivors) Co-Authored-By: Claude Sonnet 5.5 --- packages/thing-contract/src/domain.ts | 4 ++-- packages/thing-contract/test/names.test.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/thing-contract/src/domain.ts b/packages/thing-contract/src/domain.ts index f528746..7bbaea8 100644 --- a/packages/thing-contract/src/domain.ts +++ b/packages/thing-contract/src/domain.ts @@ -73,8 +73,8 @@ export function present(codec: Codec): Codec { if (!("names" in codec)) return held; const record = codec as SlotsCodec; return Object.defineProperties(held, { - names: { get: () => record.names, enumerable: true }, - members: { get: () => record.members, enumerable: true }, + names: { get: () => record.names }, + members: { get: () => record.members }, }); } diff --git a/packages/thing-contract/test/names.test.ts b/packages/thing-contract/test/names.test.ts index 7f89226..51bdcf1 100644 --- a/packages/thing-contract/test/names.test.ts +++ b/packages/thing-contract/test/names.test.ts @@ -53,3 +53,13 @@ test("TextInputNode's slot 2 is inputKind, and the name set holds no Kind-only s assert.ok(names.has(`${NS}InputKind`)); assert.equal([...names].filter((name) => name.endsWith(".Kind")).length, 0); }); + +test("a record keeps its slot names and members through presence, and a union, a list and a leaf carry none", () => { + const shapes = codecs as unknown as Record; + for (const record of ["boxNode", "bind", "nodeCommon", "rgba", "dimensionPx"]) { + assert.ok("names" in shapes[record] && "members" in shapes[record], record); + } + for (const other of ["node", "memberStep", "dimension", "colorRef"]) { + assert.ok(!("names" in shapes[other]) && !("members" in shapes[other]), other); + } +});