Commit 31d281d
docs(spec): PackageInstallBodySchema docblock records the install door residual as closed, and enableOnInstall as read off the parsed request (#20506)
Fixes #20219
Clause-②: no
## What this changes
Text only, in `@objectstack/spec`: the `PackageInstallBodySchema`
docblock, one sentence of the
`PackageInstallRequestSchema.enableOnInstall` docblock, the matching
block of `package-api.test.ts`, and a `patch` changeset. ⛔ No schema
shape, accept set, export or runtime file moves.
Every sentence was re-derived against the landed door on `origin/main`
`fc0db22b` (`packages/runtime/src/domains/packages.ts`), not against the
card's quotes.
## Premise check (dispatch assumption 1)
The card's line "Only the wrapped form's top-level unknown key is still
stripped" is false on `main`: since `28ad7e4b` the wrapped branch is a
`strictObject`, and the door refuses such a body `400`. Measured on the
built schema: `{ manifest, bogus: 1 }` fails
`PackageInstallBodySchema.safeParse`. What the declaration still strips
is only an unknown key NESTED in a strip-mode block. A walk of the built
union finds three such positions: `artifactRef`, and the expression
envelope of a manifest navigation item's `visible` plus its `meta`. Both
were measured parsing green with the key dropped. So the rewritten
section describes that strip, and no wrapped-form top-level strip.
## Sentences changed, each with the line that makes the new one true
| # | Where | Old sentence (gist) | New sentence (gist) | Evidence on
`fc0db22b` |
|--:|:--|:--|:--|:--|
| 1 | `enableOnInstall` docblock | the door "reads the raw body" | the
door reads the key off the PARSED wrapped request, after the body passes
`PackageInstallBodySchema` | `packages.ts:1019` `const declaredBody =
PackageInstallBodySchema.safeParse(body)`, `:1164` `const request =
'manifest' in declaredBody.data ? …`, `:1247` `const requestedEnabled =
request?.enableOnInstall` |
| 2 | body docblock, bare-form paragraph | the two runtime door drives
post no `type`, are refused here, and are answered `201` | both drives
carry `type: 'app'` since PR #20218, parse green through the bare
branch, and are answered `201` |
`package-door-namespace-conflict-code.test.ts:88` and
`domain-handler-registry.test.ts:605`, both with `type: 'app'` |
| 3 | residual heading and lead | a SUBSET description: the door
"additionally answers `201` to five classes" | the residual is empty on
the answer: the door refuses each class as the union does, `400` /
`VALIDATION_ERROR`, ahead of the `409` | `packages.ts:1155` answers
`!declaredBody.success` with `400`, ahead of the `409` at `:1176` |
| 4 | residual item 1 | 1b "still OPEN, answered `201`" | 1a and 1b both
landed; 1b with the whole-body parse | same union verdict,
`packages.ts:1155` |
| 5 | residual item 2 | unknown keys "`201` either way" | refused on
both forms, and at the wrapped top level since ruling record
`5856869656` | `packages.ts:1155`, plus `PackageInstallRequestSchema` is
`strictObject` (`package-api.zod.ts:228`) |
| 6 | residual item 3 | `'false'` installs ENABLED, `'true'` overwrite
read as ABSENT | both keys are `z.boolean()`, so the parse refuses
either string | `package-api.zod.ts` `enableOnInstall:
z.boolean().optional()`, `overwrite: z.boolean().optional()`;
`packages.ts:1155` |
| 7 | residual item 4 | bare-form options "ignored, never honoured" |
refused by `ManifestSchema`'s strict close; the door's refusal names the
wrapped form | `packages.ts:1155` → `installBodyRefusal`
(`:717`-`:750`), whose bare-form arm prescribes the wrapped form |
| 8 | residual item 5 | the door answers `400` to a whitespace-only `id`
"this declaration admits" | both faces refuse it, since
`ManifestSchema.id` carries `MANIFEST_ID_PATTERN` |
`packages.ts:1021`-`:1023` (trim, then `Package id is required`);
`manifest.zod.ts:272`; the spec test's own whitespace pin already said
so. **This sentence was already false before PR #20218.** |
| 9 | new paragraph | (none) | what the parsed value still does not
describe is what the door STORES: the manifest as SENT, so parse-time
defaults (`scope`, `defaultDatasource`) are not stored, and an unknown
key nested in a strip-mode manifest block is stored as sent |
`packages.ts:1020` (`manifest = body.manifest || body`, the raw body) →
`:1193` / `:1196` `installPackage({ manifest, settings })`; door pin
`packages-install-body-contract.test.ts` §7 ("stored as SENT"); defaults
measured on the built schema (`defaultDatasource`, `scope` are added by
the parse) |
| 10 | the ⛔ paragraph after the list | "the residual is RECORDED here …
closing it is its own decision with its own card" | none of this
licenses relaxing either branch, or making the door answer a body
differently from the declaration | follows from rows 3-8 |
## Sentences kept, because they are true on `main` (assumption 3)
- «The door reads `const manifest = body.manifest || body`, so a bare
manifest IS a body form it accepts» (`packages.ts:1020`).
- «A contract naming only the wrapped form would refuse bodies this door
answers `201` to»: the bare form is answered `201`
(`packages-install-body-contract.test.ts` §7, "BARE → 201").
- The whole "two branches are disjoint — and BOTH are closed" section,
including its ruling paragraph («Since `c02fa1276` … the door's answer
IS this declaration's answer»).
- «1 parent 1378ec7 commit 31d281d
3 files changed
Lines changed: 163 additions & 95 deletions
File tree
- .changeset
- packages/spec/src/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
910 | | - | |
911 | | - | |
912 | | - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
913 | 914 | | |
914 | 915 | | |
915 | 916 | | |
| |||
1027 | 1028 | | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | | - | |
1031 | | - | |
| 1031 | + | |
| 1032 | + | |
1032 | 1033 | | |
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1039 | 1043 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1043 | 1047 | | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1050 | 1054 | | |
1051 | | - | |
| 1055 | + | |
1052 | 1056 | | |
1053 | | - | |
1054 | | - | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1055 | 1062 | | |
1056 | 1063 | | |
1057 | | - | |
1058 | | - | |
| 1064 | + | |
| 1065 | + | |
1059 | 1066 | | |
1060 | 1067 | | |
1061 | | - | |
1062 | | - | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1063 | 1071 | | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1069 | 1076 | | |
1070 | 1077 | | |
1071 | 1078 | | |
1072 | 1079 | | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1077 | 1083 | | |
1078 | 1084 | | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1083 | 1093 | | |
1084 | 1094 | | |
1085 | 1095 | | |
1086 | 1096 | | |
1087 | 1097 | | |
1088 | 1098 | | |
1089 | | - | |
| 1099 | + | |
1090 | 1100 | | |
1091 | 1101 | | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1095 | 1106 | | |
1096 | 1107 | | |
1097 | 1108 | | |
1098 | 1109 | | |
1099 | | - | |
| 1110 | + | |
1100 | 1111 | | |
1101 | 1112 | | |
1102 | 1113 | | |
1103 | 1114 | | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1111 | 1123 | | |
1112 | 1124 | | |
1113 | 1125 | | |
| |||
1127 | 1139 | | |
1128 | 1140 | | |
1129 | 1141 | | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1133 | 1147 | | |
1134 | 1148 | | |
1135 | 1149 | | |
| |||
0 commit comments