Skip to content

Commit 0fc32b4

Browse files
committed
test(spec): two package-api pins move to the post-narrowing reality
`origin/main` landed `packages/spec/src/api/package-api.test.ts` while this branch was open, and two of its cases measured the accept set this branch narrows: the control that completes the domain-handler-registry drive (`pkg-a` is not reverse-domain notation, so completing the missing keys no longer makes it parse) and the residual that ran the other way (a whitespace-only `id` used to parse here while the door answered 400). Both are rewritten to what is now measured, each with a lit control proving the id is what decides it. No behaviour moves and the pattern is not relaxed. Claude-Session: https://claude.ai/code/session_012GcsUbuqFGBibkEDMRC1eE Co-authored-by: Claude <noreply@anthropic.com>
1 parent 94a4675 commit 0fc32b4

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -867,12 +867,23 @@ describe('#18058 — install contract bound to the live door', () => {
867867
expect(PackageInstallBodySchema.safeParse(DOOR_DRIVE_REGISTRY).success).toBe(false);
868868
});
869869

870-
it('the missing keys are what decide it — completing each drive turns it green', () => {
870+
it('the missing keys are what decide it — and since #17534 the registry drive needs its id repaired too', () => {
871871
// The control that makes the two refusals above a measurement of the
872872
// MANIFEST's required keys rather than of the bare branch existing at all.
873873
expect(PackageInstallBodySchema.safeParse({ ...DOOR_DRIVE_CONFLICT, type: 'app' }).success).toBe(true);
874+
// ⭐ #17534 moved this half. `ManifestSchema.id` carries
875+
// `MANIFEST_ID_PATTERN` now, and `pkg-a` is not reverse-domain notation,
876+
// so completing the missing keys is no longer sufficient for THIS drive —
877+
// it stays refused, on the id's shape rather than on an absent key.
878+
// ⛔ The remedy is to say that, not to relax the pattern: the drive posts
879+
// an id the registry face has always refused to publish.
880+
const registryKeysCompleted = { ...DOOR_DRIVE_REGISTRY, version: '1.0.0', type: 'app' };
881+
expect(PackageInstallBodySchema.safeParse(registryKeysCompleted).success).toBe(false);
882+
// Lit control — the id is what decides it now: the same body with a
883+
// reverse-domain id parses green, so the refusal above is not the missing
884+
// keys coming back.
874885
expect(PackageInstallBodySchema.safeParse({
875-
...DOOR_DRIVE_REGISTRY, version: '1.0.0', type: 'app',
886+
...registryKeysCompleted, id: 'com.acme.pkg-a',
876887
}).success).toBe(true);
877888
});
878889

@@ -893,10 +904,20 @@ describe('#18058 — install contract bound to the live door', () => {
893904
}
894905
});
895906

896-
it('and the residual runs the OTHER way too — a whitespace-only `id` parses here and the door answers 400', () => {
897-
// `handlePackages` trims before keying and refuses an empty id, so this
898-
// is the one class where the declaration is WIDER than the door.
899-
expect(PackageInstallBodySchema.safeParse({ manifest: { ...SDK_MANIFEST, id: ' ' } }).success).toBe(true);
907+
it('⭐ #17534 closed the one spelling that ran the OTHER way — a whitespace-only `id` is refused HERE now, not only by the door', () => {
908+
// What this pinned before: `handlePackages` trims before keying and
909+
// refuses an empty id, while this declaration ADMITTED `' '` — the one
910+
// measured class where the declaration was WIDER than the door.
911+
// `ManifestSchema.id` now carries `MANIFEST_ID_PATTERN`, which no
912+
// whitespace-only string matches, so the declaration refuses it first and
913+
// the two faces agree on this spelling.
914+
expect(PackageInstallBodySchema.safeParse({ manifest: { ...SDK_MANIFEST, id: ' ' } }).success).toBe(false);
915+
// Lit control — the id is what decided it: the same wrapped body with the
916+
// fixture's own conforming id parses green.
917+
expect(PackageInstallBodySchema.safeParse({ manifest: SDK_MANIFEST }).success).toBe(true);
918+
// ⛔ NOT a claim that declaration and door are now equal: the refusals
919+
// pinned above still run the other way — bodies the door answers 201 to
920+
// that this declaration refuses. One spelling closed; the class remains.
900921
});
901922
});
902923

0 commit comments

Comments
 (0)