Skip to content

Commit 0b352e9

Browse files
committed
docs(runtime,spec): the install door's comment states the wrapped top level is closed, and item 2 cites its ruling record
The install branch comment in packages/runtime/src/domains/packages.ts said PackageInstallRequestSchema was strip mode and forbidden to close; since the wrapped branch became a strictObject that is false. It now states the close, the door's 400 VALIDATION_ERROR with nothing installed, and cites ruling record 5856869656. The residual item-2 clause in package-api.zod.ts gains the same record id inline. Comments only; no code token moves. Claude-Session: https://claude.ai/code/session_01CiCTczDo7tGhafXjf61dUJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5941e9a commit 0b352e9

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎packages/runtime/src/domains/packages.ts‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,14 +1000,17 @@ export async function handlePackagesRequest(deps: DomainHandlerDeps, path: strin
10001000
// declaration's own docblock forbids it («a caller that needs an
10011001
// option sends the wrapped form»).
10021002
//
1003-
// ⚠️ What the union does NOT refuse, deliberately: an unknown key at
1004-
// the TOP LEVEL of the wrapped form. `PackageInstallRequestSchema`
1005-
// is a plain `z.object` (strip mode) and its docblock forbids
1006-
// closing it, so `{ manifest, bogus }` parses green with `bogus`
1007-
// dropped — and this door, reading only parsed keys, now does
1008-
// exactly what the declaration says. Refusing it here without the
1009-
// declaration would make the published contract admit a body the
1010-
// door refuses; that is the declaration's decision to make.
1003+
// ⭐ The TOP LEVEL of the wrapped form is closed too — by the
1004+
// declaration, not by this door. `PackageInstallRequestSchema` is a
1005+
// `strictObject` (ruling record `5856869656`, decision batch #227
1006+
// item 3, letter A), so an unknown top-level key such as
1007+
// `{ manifest, enabledOnInstall: false }` fails the union by name,
1008+
// and this door answers `400` / `VALIDATION_ERROR` and installs
1009+
// nothing — with no line of its own for it: reading only parsed
1010+
// keys, it does exactly what the declaration says. ⛔ Never refuse or
1011+
// admit a key here that the declaration decides the other way: the
1012+
// published contract and this door would then answer differently,
1013+
// and which keys the body may carry is the declaration's decision.
10111014
//
10121015
// The verdict is answered after the `id` and `version` legs below,
10131016
// which keep their own published sentences; every later read (the

‎packages/spec/src/api/package-api.zod.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ export type PackageInstallRequestParsed = z.infer<typeof PackageInstallRequestSc
423423
* - 1b. missing `type` — still OPEN, answered `201` (both door drives
424424
* above);
425425
* 2. unknown keys on either form — refused by name on the bare branch and,
426-
* since decision batch #227 item 3, on the wrapped one too, `201` either way;
426+
* since ruling record `5856869656` (decision batch #227 item 3), on the
427+
* wrapped one too, `201` either way;
427428
* 3. a string-typed `enableOnInstall` / `overwrite` — the door compares
428429
* against `true`/`false` and `'true'`, so `'false'` installs ENABLED and a
429430
* body-side `'true'` overwrite is treated as ABSENT;

0 commit comments

Comments
 (0)