Skip to content

Commit 0251069

Browse files
committed
docs(spec): quote the registry door drive as it posts, com.example.pkg-a
The install door's residual docblock, its pinning test and the changeset transcribed the duplicate-id drive in domain-handler-registry.test.ts as { id: 'pkg-a', name: 'A', version: '1.0.0' }. That drive stopped posting that body at PR #19473, which made the door parse the manifest's id leg and repaired the fixture's id to com.example.pkg-a. The old body is the REVERSED pin beside it and is answered 400. It had been filed as a 201 residual under clause 1b. Read at the merge base fdeeea0 and at origin/main 2c1011b (the file is byte-identical at both): the drive posts { id: 'com.example.pkg-a', name: 'A', version: '1.0.0' }, answered 409 and then 201 on ?overwrite=true. The declaration refuses it on `type` alone. Clause 1b's "both door drives above" is true of that body, so 1b is unchanged. - package-api.zod.ts: the drives paragraph quotes the real body and credits both repairs, the version to PR #19326 and the id to PR #19473. - package-api.test.ts: DOOR_DRIVE_REGISTRY transcribes the real body. The control that rested on the stale id now asserts that the registry drive parses once `type` is added, like the conflict drive. The old `pkg-a` reading is kept, pointed at the old body: it is refused on the id alone. - changeset: the drives sentence names the body the drive posts. Prose and test only. No schema, accept set, export or runtime change. Claude-Session: https://claude.ai/code/session_019c3Hi6ZMU1p6m6aA6Bz45d Co-authored-by: Claude <noreply@anthropic.com>
1 parent 826e612 commit 0251069

3 files changed

Lines changed: 35 additions & 26 deletions

File tree

‎.changeset/19327-install-door-residual-split.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ The clause is now split: **1a** (missing `version`) is marked CLOSED by #19326
1717
and names the door-side pin, and **1b** (missing `type`) stays an open residual.
1818
The count of five classes is unchanged and still true, because class 1 stays
1919
open through its `type` half; the count sentence now says so. The paragraph
20-
that quotes the runtime's two door drives is updated too: the duplicate-id
21-
drive has posted a `version` since #19326, and the docblock now quotes that body.
20+
that quotes the runtime's two door drives is updated too. It quoted the
21+
duplicate-id drive as `{ id: 'pkg-a', name: 'A' }`, but that drive has posted a
22+
`version` since #19326 and the reverse-domain id `com.example.pkg-a` since
23+
#19473, and the door answers `400` to `pkg-a`. The docblock now quotes the body
24+
the drive posts, `{ id: 'com.example.pkg-a', name: 'A', version: '1.0.0' }`,
25+
which the declaration refuses on `type` alone and the door answers `201`.
2226

2327
⛔ No behaviour changes. No schema, accept set, export or runtime code moves,
2428
and the other four residual classes are untouched.

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -921,10 +921,13 @@ describe('#18058 — install contract bound to the live door', () => {
921921
const DOOR_DRIVE_CONFLICT = { id: 'com.acme.crm', name: 'com.acme.crm', namespace: 'crm', version: '1.0.0' };
922922
/**
923923
* The duplicate-id drive in `packages/runtime/src/domain-handler-registry.test.ts` — no `type`.
924-
* It posted no `version` either until PR #19326 made the door refuse that half (the docblock's
925-
* clause 1a, CLOSED) and gave the drive a `version`; this is the body it posts now.
924+
* Two of its keys were repaired, each by the PR that made the door parse that leg: PR #19326
925+
* gave it the `version` it lacked (the docblock's clause 1a, CLOSED), and PR #19473 replaced its
926+
* id `pkg-a`, which `MANIFEST_ID_PATTERN` refuses. The old body is the REVERSED pin beside the
927+
* drive, answered `400`, so ⛔ it is no residual and is not transcribed here. This is the body
928+
* the drive posts: `409` first, then `201` on `?overwrite=true`.
926929
*/
927-
const DOOR_DRIVE_REGISTRY = { id: 'pkg-a', name: 'A', version: '1.0.0' };
930+
const DOOR_DRIVE_REGISTRY = { id: 'com.example.pkg-a', name: 'A', version: '1.0.0' };
928931

929932
it('the namespace-conflict drive is REFUSED — it carries no `type`', () => {
930933
expect(PackageInstallBodySchema.safeParse(DOOR_DRIVE_CONFLICT).success).toBe(false);
@@ -934,24 +937,22 @@ describe('#18058 — install contract bound to the live door', () => {
934937
expect(PackageInstallBodySchema.safeParse(DOOR_DRIVE_REGISTRY).success).toBe(false);
935938
});
936939

937-
it('the missing keys are what decide it — and since #17534 the registry drive needs its id repaired too', () => {
940+
it('the missing `type` is what decides it, for BOTH drives — the registry drive\'s old id is refused on its own', () => {
938941
// The control that makes the two refusals above a measurement of the
939942
// MANIFEST's required keys rather than of the bare branch existing at all.
940943
expect(PackageInstallBodySchema.safeParse({ ...DOOR_DRIVE_CONFLICT, type: 'app' }).success).toBe(true);
941-
// ⭐ #17534 moved this half. `ManifestSchema.id` carries
942-
// `MANIFEST_ID_PATTERN` now, and `pkg-a` is not reverse-domain notation,
943-
// so completing the missing `type` is no longer sufficient for THIS drive —
944-
// it stays refused, on the id's shape rather than on an absent key.
945-
// ⛔ The remedy is to say that, not to relax the pattern: the drive posts
946-
// an id the registry face has always refused to publish.
947944
const registryKeysCompleted = { ...DOOR_DRIVE_REGISTRY, type: 'app' };
948-
expect(PackageInstallBodySchema.safeParse(registryKeysCompleted).success).toBe(false);
949-
// Lit control — the id is what decides it now: the same body with a
950-
// reverse-domain id parses green, so the refusal above is not the missing
951-
// keys coming back.
952-
expect(PackageInstallBodySchema.safeParse({
953-
...registryKeysCompleted, id: 'com.acme.pkg-a',
954-
}).success).toBe(true);
945+
expect(PackageInstallBodySchema.safeParse(registryKeysCompleted).success).toBe(true);
946+
// ⭐ Until PR #19473 this half ran the other way. The drive posted `pkg-a`,
947+
// which `MANIFEST_ID_PATTERN` has refused since #17534 (PR #18319), so
948+
// completing its keys was not sufficient and this case pinned the
949+
// refusal. PR #19473 made the door parse the id leg as well, so the door
950+
// answers that body `400` (the REVERSED pin beside the drive), and it
951+
// repaired the drive's id. ⛔ The old reading is kept, pointed at the old
952+
// body: refused on the id alone (the lit control is the green parse just
953+
// above, the same body with the drive's current id), so it is no part of
954+
// the `201` residual.
955+
expect(PackageInstallBodySchema.safeParse({ ...registryKeysCompleted, id: 'pkg-a' }).success).toBe(false);
955956
});
956957

957958
/** Bodies the door still answers `201` to while this declaration refuses them — the live residual. */
@@ -982,7 +983,8 @@ describe('#18058 — install contract bound to the live door', () => {
982983
// cited rather than repeated — this package cannot import the door. On
983984
// that key the declaration and the door agree, so a versionless body in
984985
// the list above would record a `201` the door no longer answers, which
985-
// is what the registry drive's old transcription did.
986+
// is what the registry drive's first transcription, `{ id: 'pkg-a',
987+
// name: 'A' }`, did.
986988
// ⛔ Clause 1b stays open: both drives above still carry no `type`.
987989
for (const residual of DOOR_201_RESIDUALS) {
988990
const manifest = ('manifest' in residual ? residual.manifest : residual) as { version?: unknown };

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,15 @@ export type PackageInstallRequestParsed = z.infer<typeof PackageInstallRequestSc
478478
*
479479
* ⚠️ What those two drives post is NOT covered by this branch, and saying so
480480
* is the point. Measured: `{ id, name: id, namespace, version: '1.0.0' }` and
481-
* `{ id: 'pkg-a', name: 'A', version: '1.0.0' }` are both refused here
482-
* (`invalid_union`) because neither carries `type`. The second carried no
483-
* `version` either until PR #19326, which made the door refuse that half and
484-
* gave the drive the `version` it lacked (clause 1a below). They are bare in
485-
* FORM and incomplete in CONTENT — the form is declared, the content is part
486-
* of the residual below, and they are pinned as REFUSED in
481+
* `{ id: 'com.example.pkg-a', name: 'A', version: '1.0.0' }` are both refused
482+
* here (`invalid_union`) on `type` alone, and the door answers both `201` (the
483+
* second on the `?overwrite=true` limb of its duplicate-id case). The second
484+
* was repaired twice, each time by the PR that made the door parse the leg it
485+
* broke: PR #19326 gave it the `version` it lacked (clause 1a below), and
486+
* PR #19473 replaced its id `pkg-a`, which `MANIFEST_ID_PATTERN` refuses. The
487+
* door answers that old body `400` now, so it is no part of the residual. They
488+
* are bare in FORM and incomplete in CONTENT — the form is declared, the
489+
* content is part of the residual below, and they are pinned as REFUSED in
487490
* `package-api.test.ts` rather than dressed up as green fixtures.
488491
*
489492
* ## The two branches are disjoint — but only ONE of them is closed

0 commit comments

Comments
 (0)