Skip to content

Commit b332246

Browse files
authored
docs(rest): correct the packages envelope suite's stale note on the code vocabulary (#3843 follow-up) (#4009)
Comment-only follow-up to #3972 (#3843). No behaviour change. Two sentences in package-envelope.conformance.test.ts's header were written while #3841 was still undecided, and #3843 landed after ADR-0112 settled it: - "why #3841 still owns the vocabulary" — it does not; ADR-0112 (#3988) closed it and ApiErrorSchema.code is a closed union now. - "this module needed MINTED codes" — half true. It had nothing to carry over (its `error` strings were human messages), but only four of the codes here are registered; the three generic conditions reuse the standard catalog, which is what the ledger asks for. Rewritten to state the actual split and why it makes the assertions below load-bearing: an unregistered code fails parse, so BaseResponseSchema.safeParse is what would catch an invented one. package-routes.ts already carried the corrected note; this was the test file missed beside it. Carries an empty changeset — the PR gate requires one, and this releases nothing.
1 parent 9b6fe7c commit b332246

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
---
3+
4+
Comment-only correction in `packages/rest/src/package-envelope.conformance.test.ts`
5+
(#3843 follow-up). Deliberately empty frontmatter: this releases nothing.
6+
7+
Two sentences in that suite's header were written while #3841 was still undecided —
8+
"why #3841 still owns the vocabulary" (ADR-0112 has since closed it) and "this
9+
module needed MINTED codes" (true only of the four registered ones; the three
10+
generic conditions reuse the standard catalog). `package-routes.ts` already carried
11+
the corrected note; this was the test file missed beside it.
12+
13+
No published behaviour, type, or wire shape changes, so there is nothing for a
14+
consumer to read in a CHANGELOG.

packages/rest/src/package-envelope.conformance.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@
1616
* res.status(400).json({ success: false, failed, cleanups });
1717
* res.status(400).json({ success: false });
1818
*
19-
* i.e. a caller was told it failed and never told why. Those two are the reason
20-
* this module needed MINTED codes rather than carried-over ones: there was
21-
* nothing to carry. See `sendError`'s note in `package-routes.ts` for why the
22-
* SCREAMING_SNAKE dialect was chosen and why #3841 still owns the vocabulary.
19+
* i.e. a caller was told it failed and never told why. They are also why this
20+
* module had no codes to carry over: its `error` strings were human messages, so
21+
* every code here had to be chosen rather than re-spelled.
22+
*
23+
* ADR-0112 (#3841) settled the vocabulary, so the choice was not free. Generic
24+
* conditions reuse the STANDARD catalog — `MISSING_REQUIRED_FIELD`,
25+
* `RESOURCE_NOT_FOUND`, `INTERNAL_ERROR` — and only the package-specific outcomes
26+
* are registered in `ERROR_CODE_LEDGER` (`PACKAGE_MANIFEST_INVALID`,
27+
* `PACKAGE_PUBLISH_FAILED`, `PACKAGE_DELETE_PARTIAL`, `PACKAGE_DELETE_FAILED`);
28+
* see `sendError`'s note in `package-routes.ts`. `ApiErrorSchema.code` is a closed
29+
* union now, so an unregistered code fails parse — which is what makes the
30+
* `BaseResponseSchema.safeParse` assertions below catch an invented one.
2331
*
2432
* The three bodies that already had the flag kept their payload as SIBLINGS of
2533
* it (`{ success: true, message, package }`); the assertions below pin that they

0 commit comments

Comments
 (0)