Skip to content

docs(rest): correct the packages envelope suite's stale note on the code vocabulary (#3843 follow-up) - #4009

Merged
os-zhuang merged 2 commits into
mainfrom
claude/envelope-drift-route-modules-v2zoky
Jul 30, 2026
Merged

docs(rest): correct the packages envelope suite's stale note on the code vocabulary (#3843 follow-up)#4009
os-zhuang merged 2 commits into
mainfrom
claude/envelope-drift-route-modules-v2zoky

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Comment-only follow-up to #3972 (#3843). No behaviour change, no changeset.

Two sentences in package-envelope.conformance.test.ts's header were written while #3841 was still undecided. #3843 landed after ADR-0112 settled it, and I updated the matching note in package-routes.ts but missed the one in the test file beside it.

Both sentences were left inaccurate:

was why it's wrong
"why #3841 still owns the vocabulary" It doesn't — ADR-0112 (#3988) closed it, and ApiErrorSchema.code is a closed union now.
"this module needed MINTED codes" Half true. It genuinely 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.

The second one is the more useful correction: recording that generic conditions go to the standard catalog (MISSING_REQUIRED_FIELD, RESOURCE_NOT_FOUND, INTERNAL_ERROR) and only package-specific outcomes get registered (PACKAGE_MANIFEST_INVALID, PACKAGE_PUBLISH_FAILED, PACKAGE_DELETE_PARTIAL, PACKAGE_DELETE_FAILED) is what the ledger actually asks for, and it explains why the assertions below are load-bearing: an unregistered code fails parse, so BaseResponseSchema.safeParse is what would catch an invented one.

Branch restarted from main rather than reusing the merged one, per the repo's branch hygiene.

Verification

pnpm lint clean · pnpm check:route-envelope 8 modules (5 conformant / 2 ratcheted / 1 exempt) + self-test green · @objectstack/rest 472 passed (33 files).

Also grepped the repo for the other stale phrasings of the same claim (#3841's call, #3841 can pick, vocabulary wins is #3841, …) — this was the only remaining one.


Generated by Claude Code

…ode vocabulary (#3843 follow-up)

Two sentences in this suite's header comment were written while #3841 was still
undecided, and #3843 landed after ADR-0112 settled it. Both were left inaccurate:

  - "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 and is the more useful thing to record.

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.

Comment-only — no behaviour change. `package-routes.ts` already carried the
corrected note; this is the test file that was missed alongside it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 30, 2026 2:42am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/rest.

7 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/api/error-handling-server.mdx (via @objectstack/rest)
  • content/docs/api/index.mdx (via @objectstack/rest)
  • content/docs/plugins/index.mdx (via @objectstack/rest)
  • content/docs/plugins/packages.mdx (via @objectstack/rest)
  • content/docs/protocol/kernel/i18n-standard.mdx (via packages/rest)
  • content/docs/releases/implementation-status.mdx (via @objectstack/rest)
  • content/docs/releases/v12.mdx (via @objectstack/rest)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

`Check Changeset` fails any PR that adds no changeset. I had reasoned that a
comment-only diff needs none — but the gate's own error message states the right
escape hatch: "an empty changeset is fine for changes that release nothing".

So this is empty frontmatter, not a patch bump: giving @objectstack/rest a version
bump for a corrected doc comment would put a line in the CHANGELOG that consumers
cannot act on. There are already several precedents in .changeset for exactly this
shape (adr-0104-design-doc-only.md, adr-0110-draft-only.md, …).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Jul 30, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 30, 2026 02:56
@os-zhuang
os-zhuang merged commit b332246 into main Jul 30, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the claude/envelope-drift-route-modules-v2zoky branch July 30, 2026 02:57
os-zhuang pushed a commit that referenced this pull request Jul 30, 2026
Check Changeset requires one on every PR; an empty-frontmatter changeset is the
sanctioned form for a change that releases nothing, and the gate's own error
message says so.

Second time this session — #4009 was a comment-only PR that failed the same way.
I fixed that one and did not draw the rule, which is that "this releases nothing"
is a reason to write an EMPTY changeset, not a reason to skip the file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z
os-zhuang added a commit that referenced this pull request Jul 30, 2026
#4090 follow-up) (#4105)

* test(runtime): the dispatcher envelope check uses the shared predicate (#4090 follow-up)

`domain-handler-registry.test.ts` hand-rolled "no key beside the envelope's own
may hold the payload" for #4038. #4090 extracted that rule into
`envelopeViolations` so it stops having two definitions; this is the caller that
motivated the extraction, now using it.

Leaving the local copy would have recreated the exact failure this line has been
closing — one rule, two places, and only one of them updated next time. It also
was not the same rule: the local set allowed any body whose top-level keys were
success/data/meta, so it passed a success body with NO `data` at all, and one
carrying an `error` alongside `success: true`. The shared predicate rejects both.

Verified the swap is a strict improvement rather than a refactor, by breaking the
producer two ways and checking the suite catches each:

  { success: true, data: link, link }   → caught (the old check caught this too)
  { success: true }                     → caught (the old check PASSED this)

runtime 914 passed. All ten gates in the TypeScript Type Check job pass, plus the
six `check:*` guards.

Note for the next person touching spec: after restarting a branch onto a newer
main, `check:api-surface` and `check:i18n-coverage` both fail against a stale
`packages/spec/dist` — the first reports other people's exports as added/removed,
the second rejects an example config for a chart type the fresh spec allows.
Neither is a real failure; rebuilding spec clears both. They read as "my change
broke something" and are not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z

* chore: add the empty changeset this PR needs

Check Changeset requires one on every PR; an empty-frontmatter changeset is the
sanctioned form for a change that releases nothing, and the gate's own error
message says so.

Second time this session — #4009 was a comment-only PR that failed the same way.
I fixed that one and did not draw the rule, which is that "this releases nothing"
is a reason to write an EMPTY changeset, not a reason to skip the file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants