Repository navigation
feat(scripts): a third test-budget class, "compiles the package type graph once" - #23897
Merged
objectstack-fleet[bot] merged 1 commit intoOct 16, 2026
Merged
Conversation
…graph once"
TEST_BUDGET_CLASSES gains its third value, as ruling record 6212133431
(letter A) names it. The number rule and the three prohibitions of ruling
record 6181973363 are unchanged. The refusal now lists every class
("one of ...") and says "none of the 3 classes the rulings name" instead of
"neither class". The self-test pins the three spellings as literals and
reads the third end to end: the ruling's line under the spec files' header,
the two earlier classes in that same header, six near misses refused naming
all three classes, and a --diff run from disk that holds the file at 18.10 s
of its 30 s and lists it at 31 s. Battery pin 14 -> 18.
Claude-Session: https://claude.ai/code/session_016PVjjuVPte5XEJvaQx1E4t
Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · PR #23897 (draft, head
|
objectstack-fleet
Bot
deleted the
claude/issue-23821-type-graph-budget-class
branch
October 16, 2026 12:42
This was referenced Oct 16, 2026
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.
Fixes #23821
Clause-②: no
The refresh diff's closed list of test-budget classes (
TEST_BUDGET_CLASSESinscripts/measure-test-shard-timings.mjs) gains its third value,compiles the package type graph once. A test file whose irreducible cost is one compile of its package's type graph can now declare its own measured budget, under the same grammar, number rule and refusals as the first two classes. One file changed: +107 / −16.The ruling
Ruling record
6212133431(letter A, the maintainer's 「同意」), which extends ruling record6181973363on #23534 by one class. Verbatim:Ruling item 3 (the two declarations themselves) is the spec lane's. The two header lines in
packages/spec/src/contracts/scoped-context.test.tsandpackages/spec/src/integration/connector-author-shape.test.tsfollow on #23180 in the spec lane once this lands. This PR touches nopackages/**file, no workflow and noAGENTS.md.Every place in the script that changed
Line numbers are at
origin/main497518c3f. They match the ruling's read.origin/main):1225-1231, thereadTestBudgetdocblock:1239, the grammar's CLASS row:1255-1258,TEST_BUDGET_CLASSES'compiles the package type graph once':1268-1269, the refusal's textCLASS is "a" or "b"CLASS is one of "a", "b", "c", so every refusal lists all three classes:1295, the class refusalthe class "X" is neither class the ruling namesthe class "X" is none of the 3 classes the rulings name(the count is read from the list):1662-1664, the battery roster'per-file budget declarations (ruling 6181973363)': 1418, and the comment names ruling record 6212133431's cases:2982-2986, self-test fixtures[producerClass, wholePackageClass]typeGraphClass;ruledClasses(the three spellings as literals);specFileWith(the two spec files' real header, declaration on line 2);typeGraphLine(the ruling's line):2996-2999, the class pinlength !== 2, two spellingslength !== 3, three spellings in order, against the literals:3019-3021, the off-list class caseThe only other places that cite the mechanism name no class and list none, so they are unchanged:
:212-217(FILE_BUDGET_SECONDS' doc);:1545(the rendered "Held to the budget it declares" line prints each file's own class);:2980.A tree-wide grep for
TEST_BUDGET_CLASSES, either class phrase andtest-budgetoutside this script found only the 12 declaring test files. It found nothing indocs/,content/,.claude/,AGENTS.mdor.github/workflows/.Proof the new value is read end to end
Four new self-test cases are in battery
per-file budget declarations (ruling 6181973363), which grows from 14 to 18:// test-budget: 30 — compiles the package type graph once: …, sits under the exact header of the two spec files (copyright line, then the declaration on line 2, where all 12 declarations in the tree sit). It reads as{ seconds: 30, cls: 'compiles the package type graph once', line: 2 }.type-graph, a droppedonce, a droppedpackage,packages, a capitalC, and a trailing space before the colon. Each refusal starts withf.test.ts:3:, quotes the bad spelling, and names all three classes.--diff. A file carrying the ruling's line goes throughdeclaredBudgetInTreeand the realdiffMain, with the same CLI path as the existing round trip.`src/integration/graph.test.ts` (`spec`) 18.10 s of its 30 s, compiles the package type graph once.| ... | 31.00 (declared 30) | 1 / 1 |.Ablation. This was one-off, on
f8bacd05b(the head), throughscripts/ablation-replace.mjsin WRAP mode, with a trap backstop on absolute paths. No permanent mutation test remains. All four legs restored to blob5e2b82584d38, which equals HEAD, andgit diff HEADwas empty after each.registered 18 case(s), below its pinned floor of 19. The battery runs exactly 18.budget: the classes read ["spawns the real producer once per single-cause fixture","whole-package import"]checkthunk catches each failure and printsREDinstead of aborting; the value is presentREDlinesREDlines; every other case stayed greenThe four
REDlines in leg 3:scoped-context.test.ts:2: the class "compiles the package type graph once" is none of the 2 classes the rulings name);--diffrefusesgraph.test.ts:2).Case 2 stayed green, as a control should.
The 12 declarations on
mainread unchanged. The script has no dry-run mode, so a read-only probe imported the script's ownreadTestBudgetand read every file inpackages/,apps/andexamples/that carries a// test-budget:line. The reading is the same 12 files (10 producer-class, 2 whole-package), with identical seconds, class, line and reason. The rows digest isf1975b9e4af0…at both497518c3f(before) andf8bacd05b(after). The two spec files readnullon disk today. With the ruling's line spliced in at line 2 in memory only, each reads as the third class at 30 s.Tests
node scripts/measure-test-shard-timings.mjs --self-testprintedmeasure-test-shard-timings: self-test OK, exit 0, atf8bacd05b.pnpm exec eslint --no-inline-config scripts/measure-test-shard-timings.mjsexited 0. The control-byte scan found nothing.Gates (local, at
f8bacd05b, the final head)node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 32 commands from git, against merge base497518c3f.pnpm check:pm-dispatch-gates, run detached with its exit written to a file:✓ dispatch-gates self-test (fast tier): 1884 cases pass;check:nul-bytes,check:entry-guardandcheck:cross-package-test-inputs;measure-test-shard-timings,partition-test-shards,ci/select-shard-timings-run).--ran:✓ dispatch-gates --ran: 32 derived famil(ies) accounted for — 32 run, 0 NOT-MEASURED (a DERIVED zero — all 32 recorded an exit code and none of them is 3).node scripts/pm/check-governed-merges.mjs --branch claude/issue-23821-type-graph-budget-classreported0 of 1 path(s) hit the register(NOT governed), with 123 changed lines, under the 3,000 threshold.scripts/**ships in no package, so no changeset.Acceptance notes (not filed)
The battery's name still reads
(ruling 6181973363). Renaming it would only churn the roster. Its comment names both records. Carrier: none.No PR-time parse of a declaration (as in PR feat(scripts): a test file of either ruled class is listed over its own declared budget, not the 10 s line #23595). The spec lane's two lines are parsed only by the next weekly refresh. The spec lane can check them locally before pushing:
node -e "import('./scripts/measure-test-shard-timings.mjs').then((m) => console.log(m.readTestBudget(require('fs').readFileSync(process.argv[1], 'utf8'), process.argv[1])))" packages/spec/src/contracts/scoped-context.test.tsGenerated by Claude Code