test(runtime): the dispatcher envelope check uses the shared predicate (#4090 follow-up) - #4105
Merged
Merged
Conversation
#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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 0 changed package(s). ✅ |
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
marked this pull request as ready for review
July 30, 2026 10:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The caller that motivated #4090's extraction, now actually using it. One file, one test body.
Why this isn't cosmetic
domain-handler-registry.test.tshand-rolled "no key beside the envelope's own may hold the payload" when I wrote it for #4038. #4090 promoted that rule intoenvelopeViolationsprecisely so it would stop having two definitions. Leaving the local copy in place would have recreated the failure this whole line has been closing — one rule, two places, and only one of them updated next time.It also wasn't the same rule. The local version was:
That passes any body whose top-level keys fall in the set — including a success body with no
dataat all, and one carrying anerroralongsidesuccess: true. The shared predicate rejects both.Verified as a strict improvement, not a refactor
I broke the producer two ways and checked the suite catches each:
{ success: true, data: link, link }(the #4049 drift){ success: true }(no payload)Both now fail the suite; the second is the one that used to slip through.
Verification
@objectstack/runtime914 passed. All ten gates in the TypeScript Type Check job, plus the sixcheck:*guards — 16 total, all green.Stale-dist note, worth recording because it cost me a round and reads as a real failure. After restarting this branch onto the newer
main, two gates failed against a stalepackages/spec/dist:check:api-surfacereported- strictUnknownKeyError,+ AggregationFunction… "3 breaking, 8 added" — other people's exports, because the built.d.tspredated their commits.check:i18n-coveragerejectedexamples/app-showcase/objectstack.config.tsfor a'combo'chart type — which the fresh spec allows.Neither is a real failure and neither is mine; rebuilding spec cleared both, and I confirmed the i18n one passes identically with and without my change. Related:
gen:api-surfacereadsdist/index.d.ts, so it cannot run underOS_SKIP_DTS=1at all.Generated by Claude Code