Repository navigation
test(api): keep the generated contracts sync test fast - #7946
Conversation
Effect codegen renders each schema on one line, up to ~30k characters,
and oxfmt formats such lines in superlinear time: about 27s for
contracts.ts, past the sync test's timeout under repo-wide test load.
The generator now breaks after `{` in object literals far wider than the
print width. oxfmt keeps such objects expanded without searching for a
fit, and would break them anyway, so the formatted output is unchanged
and formatting takes well under a second.
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 9 commands. Binary size: 135.3 MB, unchanged. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 AI Review
CLI reference prose guidance: not applicable (no reference sources changed).
Confirmed one documentation nit in the API generator. The comment presents a raw source-length heuristic as a guarantee about formatter output. The generated-output sync test was not run during adjudication. The PR changes no CLI reference prose and does not conflict with the pending work on next.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| ⚪ NIT | packages/api/scripts/generate.ts:555 |
code-comments |
codex | The comment overstates what the 200-character cutoff guarantees about formatted output. |
Stats
Claude findings: 0 · Codex findings: 1 · Confirmed: 1 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
Summary
The
generated-output-syncdrift test inpackages/apire-renderscontracts.tsand formats it with oxfmt to compare it with the committed file. Effect codegen prints each schema on a single line (up to ~30k characters), and oxfmt formats lines like that in superlinear time: about 27s for this file, which pushes the test past its timeout when the repo-wide unit and integration suites run together.pnpm generate:checkpaid the same cost.The generator now adds a line break after
{in object literals at least twice the print width. oxfmt keeps an object expanded when its source breaks after{, so it skips the fit search, and objects that wide would break anyway. The formatted output is byte-identical to the committed files, and formatting drops to well under a second. Brace matching skips string, template, and comment literals by reusing the generator's existing tokenizer.The test timeout drops from 120s to 30s, which still leaves headroom under load.