Repository navigation
feat(perf): lint repeated sort setup and schedule regression contracts - #18822
Conversation
There was a problem hiding this comment.
ℹ️ One minor suggestion inline — the plugin, audit, contracts, and workflow all check out end-to-end.
Reviewed changes
- Oxlint plugin + rule (
sort-comparator-performance/no-repeated-collator) — flags optionedlocaleCompareandIntl.Collatorconstruction inside inlinesort/toSortedcallbacks; registered aswarnin.oxlintrc.jsonand the new audit config. audit:perf+config/oxlint-performance-audit.json— advisory JSON inventory oversrccombining the new rule with the existing store-selector and buffer-concat rules.test:perf:contracts+config/vitest.performance.config.ts— selects 10 existing production-path contracts; missing listed files fail config load..github/workflows/performance-contracts.yml— daily/manual/PR-path workflow on Linux/macOS/Windows running the contracts and audit, uploading both JSON reports.- Docs and a formatter-driven duplicate-script dedup in
package.json(effective value unchanged; the shadowed--disable-warningvariant was already the losing duplicate key).
I verified the changed-line gate actually picks up the new warn rule (its "code quality" scan runs with no --config, so it inherits .oxlintrc.json), that audit:perf produces exactly six genuine positives and exits 0, and that test:perf:contracts runs 10 files / 54 tests — including the workflow's exact --reporter=json --outputFile invocation. The contract tests import no electron/node-pty/better-sqlite3 (SQLite is the built-in node:sqlite), so the workflow's native-runtime: none install is sufficient.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| - 'config/vitest.performance.config.ts' | ||
| - 'config/oxlint-performance-audit.json' | ||
| - 'config/oxlint-plugins/*performance.mjs' | ||
| - 'config/scripts/*performance-plugin.test.mjs' |
There was a problem hiding this comment.
This trigger list covers the plugin, its tests, and the audit/vitest configs, but not package.json (where audit:perf and test:perf:contracts are defined) or .oxlintrc.json (where no-repeated-collator is registered for the changed-line gate). A PR that edits a script definition — e.g. widening audit:perf to scan more than src — or re-tunes the rule registration would not run this workflow to validate the change. Consider adding package.json (and possibly .oxlintrc.json) to paths.
There was a problem hiding this comment.
ℹ️ No new issues in this commit — the SQLite fixture fix is correct and verified. The one prior minor suggestion (workflow
pull_request.pathscoverage) remains the only open item; this commit doesn't touch it.
Reviewed changes
- SQLite fixture leak fix — the two "read-only opens under contention" tests now register their
SyncDatabasereaders in the sharedopenDatabaseslist instead of constructing anonymous readers insideexpect(...)/try, soafterEachcloses them and Windows temp-dir cleanup stops failing withEBUSY. Assertions are preserved (errcode5,database is locked, the≥350msbusy-timeout bound), and it mirrors the existingopenDatabases.push(reader)pattern in the sibling "succeeds once the writer commits" test. Confirmed 13/13 tests pass.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds a repeated-collator oxlint rule and performance audit configuration. It adds Vitest performance contract selection and package scripts. A scheduled, manual, and pull-request workflow runs the contracts and audits across three operating systems and uploads JSON artifacts. SQLite contention tests now retain database instances for cleanup, and a benchmark command removes a Node warning flag. Merge Risk: ⚪ Minimal · up to This adds advisory performance auditing, contract-test automation, and SQLite test cleanup without an identified current-head correctness, security, or availability risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives a detailed ELI5 summary, change rationale, implementation scope, testing results, platform coverage, and limitations. However, it does not follow the required template because it omits the Linked Issue, Visual Proof or explicit N/A, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Resolution Add all required template sections. Include a linked issue using Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (2 skipped: 2 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Without these paths a contract rename lands green on PR CI and only breaks the next nightly, where nobody owns the failure. Also run the OS-independent source audit once instead of on all three runners.
There was a problem hiding this comment.
ℹ️ No new issues in this commit — the trigger-path and artifact changes are correct.
Reviewed changes
- Trigger-path coverage — added
config/oxlint-plugins/quadratic-buffer-concat.mjs(the one audit plugin the existing*performance.mjsglob missed), broadened the plugin-test glob toconfig/scripts/*-plugin.test.mjs, and listed the seven production-path contract files so edits to the contracts themselves re-run the workflow. - Linux-only source audit —
audit:perfnow runs only onubuntu-latest(a static, OS-independent scan) and uploads as its own artifact; the per-OS contracts artifact now carries onlyperformance-contracts.json. - Docs —
config/performance-audit.mdupdated to describe per-OS results plus the single Linux audit.
I checked the globs against the on-disk files: quadratic-buffer-concat.mjs is the only audit plugin not matched by *performance.mjs, and *-plugin.test.mjs legitimately matches all five plugin test files (a harmless superset of the three used by the audit). The matrix.os == 'ubuntu-latest' gating is applied consistently to the audit step and its upload, so non-Linux runs won't fail on the missing performance-audit.json. The one open prior suggestion (package.json in pull_request.paths) is unchanged by this commit and remains for the author to decide.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
stablyai#18822) * feat(perf): audit comparator setup and schedule performance contracts * test(sqlite): close readers after expected busy failures * ci(perf): trigger contract workflow on the contract files themselves Without these paths a contract rename lands green on PR CI and only breaks the next nightly, where nobody owns the failure. Also run the OS-independent source audit once instead of on all three runners.

ELI5 / TL;DR
Catch repeat performance mistakes before they reach users: add a lint rule for expensive setup repeated while sorting, plus a daily check of 54 existing performance regression tests on Mac, Windows, and Linux. The source audit found six candidates; one produced the measured sorting fix in #18823. The cross-platform tests also exposed two leaked SQLite test handles, now fixed. All three platforms pass.
The lint rule blocks new occurrences through the existing changed-code gate. The broader scan reports candidates for investigation; the daily tests catch regressions in the specific behaviors they cover.
Orca already guards fresh store selectors and growing buffer concatenations, but repeated collation setup inside sort callbacks still recurs. Add an Oxlint rule for optioned
localeCompare/Intl.Collatorinside inlinesortandtoSortedcallbacks. It warns in ordinary lint and fails the existing changed-line quality gate for new occurrences; there is no autofix.Add
audit:perffor an advisory JSON inventory using that rule plus existing store/buffer rules, andtest:perf:contractsto select existing production-path count, schema, concurrency, cancellation and backing-memory contracts. A daily/manual Linux/macOS/Windows workflow runs the selection and retains both reports; tooling changes also trigger it. This makes existing coverage easy to run and attribute, rather than claiming new runtime coverage. Missing listed tests fail configuration loading. Existing daily Electron terminal-scale CI remains the UI-latency check.Local run on macOS arm64 / Node 24.18.0: 10 files, 54 tests passed in 3.33s. Source audit: six collation candidates, zero findings from the included store/buffer rules. Remaining candidates require workload measurements; a clean scan is not proof the app is fast. Named comparator functions and custom methods are outside the rule's semantic analysis. See
config/performance-audit.mdfor commands and limits.Validation:
pnpm tc; changed-code quality; detector positive/negative fixtures; all 54 contracts; missing-file negative control; workflow YAML parsing; formatting and diff checks. The new contract/audit workflow passed on Linux, macOS and Windows: https://github.com/stablyai/orca/actions/runs/33959677757. The formatter also removes an existing duplicate package-script entry without changing its effective value.The first Windows matrix run caught two pre-existing SQLite fixture leaks: the expected
SQLITE_BUSYbranches constructed readers without registering them for cleanup, so temp-file deletion failed withEBUSY. Both readers now use the fixture's existingopenDatabasescleanup. The 54 tests pass locally after the fix; the Windows rerun passed, confirming handle release on the platform that rejects unlinking open files.The audit's measured automation-sort result is split into #18823. The other five collation candidates remain advisory rather than receiving unmeasured bulk edits.