Skip to content

feat(scripts): check:route-envelope audits rest-server.ts — dialect facts only (#7295) - #7459

Merged
os-help merged 1 commit into
mainfrom
claude/issue-7295-route-envelope-dialect-discovery
Aug 10, 2026
Merged

feat(scripts): check:route-envelope audits rest-server.ts — dialect facts only (#7295)#7459
os-help merged 1 commit into
mainfrom
claude/issue-7295-route-envelope-dialect-discovery

Conversation

@os-help

@os-help os-help commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #7295

discover() collected *-routes.ts plus one named exception, so packages/rest/src/rest-server.ts — the largest response-emitting file in the repo (#5949), 208 hand-built write sites — had never been audited by the gate whose own header promises that "a module nobody thought to convert still gets audited".

Per the maintainer ruling of 2026-08-10 (option 3), it is now discovered and held to dialect facts only, never to responses: a write-site ratchet on a file that changes several times a day would go red for edits that are not envelope drift, and the pressure would be to raise the number rather than fix anything (option 2, rejected).

What changed

  • discover() takes an OFF_CONVENTION_MODULES set — i18n-service-plugin.ts as before, plus rest-server.ts.
  • New siblingCode counter: a top-level code as a sibling of error instead of a key inside it — the second dialect from finding: rest-server.ts 里三个相邻 /meta handler 的错误信封是三种不同形状,其中两种不符合 ADR-0112 #7035, which no counter here could see. Shorthand ({ error, code }) is the same dialect; nested ({ error: { code, message } }) is the conformant envelope and is not counted. Asserted for every audited module, defaulting to 0.
  • New dialectOnly module state, exclusive with responses/ok/err/privateOk and requiring a ratchet. Its two counts ratchet in ONE direction: an increase is a new non-conforming body, and a decrease must be banked by lowering the baseline.
  • Baseline measured on this branch point, not assumed: stringError 44, siblingCode 77.
  • Self-test: three positives (literal pair, computed message, shorthand) and four negatives (nested code, code inside data, a lone code, commented-out prose).

packages/rest/src/rest-server.ts itself is untouched — converting it onto the shared sendOk/sendError is #7035 option 1 and stays out of scope.

Scope

One file: scripts/check-route-envelope.mjs (+277/−17). No package source changes, hence no changeset.


Implemented by a dispatched dev agent in its own container; PR opened by the PM seat because the container had git push but no GitHub API access. Full rationale is preserved verbatim in the commit message of bb9966fa3.


Generated by Claude Code

…acts only (#7295)

`discover()` collected `*-routes.ts` plus one named exception, so
`packages/rest/src/rest-server.ts` — the largest response-emitting file in the
repo (#5949), 208 hand-built write sites — had never been audited by the gate
whose own header promises that "a module nobody thought to convert still gets
audited".

Per the maintainer ruling of 2026-08-10 (option 3), it is now discovered and
held to DIALECT FACTS ONLY, never to `responses`: a write-site ratchet on a file
that changes several times a day would go red for edits that are not envelope
drift, and the pressure would be to raise the number rather than fix anything
(option 2, rejected).

- `discover()` takes an `OFF_CONVENTION_MODULES` set — `i18n-service-plugin.ts`
  as before, plus `rest-server.ts`.
- New `siblingCode` counter: a top-level `code` as a SIBLING of `error` instead
  of a key inside it — the second dialect from #7035, which no counter here
  could see. Shorthand (`{ error, code }`) is the same dialect; nested
  (`{ error: { code, message } }`) is the conformant envelope and is not counted.
  Asserted for every audited module, defaulting to 0.
- New `dialectOnly` module state, exclusive with `responses`/`ok`/`err`/
  `privateOk` and requiring a `ratchet`. Its two counts ratchet in ONE
  direction: an increase is a new non-conforming body, and a decrease must be
  banked by lowering the baseline.
- Baseline measured on this branch point, not assumed: stringError 44,
  siblingCode 77.
- Self-test: three positives (literal pair, computed message, shorthand) and
  four negatives (nested code, code inside `data`, a lone `code`, commented-out
  prose).

`packages/rest/src/rest-server.ts` itself is untouched — converting it onto the
shared sendOk/sendError is #7035 option 1 and stays out of scope.

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

vercel Bot commented Aug 10, 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 Aug 10, 2026 1:37pm

Request Review

@os-help os-help added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 10, 2026 — with Claude
@os-help
os-help marked this pull request as ready for review August 10, 2026 13:50
@os-help
os-help added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 2dce9b9 Aug 10, 2026
23 of 24 checks passed
@os-help
os-help deleted the claude/issue-7295-route-envelope-dialect-discovery branch August 10, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants