@hearsay-tools/squawk 0.18.0-dev.8217 → 0.18.0-dev.8218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/delegation/routes.d.ts +65 -65
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/models-routes.d.ts +13 -13
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/server.d.ts +1520 -1520
- package/package.json +4 -4
- package/scripts/profile-lint-compare.ts +101 -0
- package/scripts/profile-lint.ts +116 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hearsay-tools/squawk",
|
|
3
|
-
"version": "0.18.0-dev.
|
|
3
|
+
"version": "0.18.0-dev.8218",
|
|
4
4
|
"description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@babel/parser": "^8.0.8",
|
|
70
70
|
"@babel/types": "^8.0.8",
|
|
71
|
-
"@open-mercato/cezar-api-client": "0.18.0-dev.
|
|
72
|
-
"@open-mercato/cezar-contract": "0.18.0-dev.
|
|
71
|
+
"@open-mercato/cezar-api-client": "0.18.0-dev.8218",
|
|
72
|
+
"@open-mercato/cezar-contract": "0.18.0-dev.8218",
|
|
73
73
|
"@types/node": "^24.19.1",
|
|
74
74
|
"@types/ws": "^8.18.1",
|
|
75
75
|
"esbuild": "^0.28.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "b5cf06971421f9f9ae437e1ddccf33a81f24d31a"
|
|
90
90
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The report of `profile-lint.ts --compare` (hearsay-tools/squawk#4238): pure functions over the
|
|
3
|
+
* rounds that the script measured, so a test can pin the format without running oxlint.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { isAbsolute, relative, sep } from 'node:path';
|
|
7
|
+
|
|
8
|
+
export interface CompareMeasure { user: number; sys: number }
|
|
9
|
+
|
|
10
|
+
/** One alternating round: base, then candidate, each with its user-CPU run and its `--debug timings` run. */
|
|
11
|
+
export interface CompareRound {
|
|
12
|
+
/** The 1-minute load before each user-CPU run of the round. */
|
|
13
|
+
loads: number[];
|
|
14
|
+
base: CompareMeasure;
|
|
15
|
+
candidate: CompareMeasure;
|
|
16
|
+
baseTimings: Record<string, number>;
|
|
17
|
+
candidateTimings: Record<string, number>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CompareInput { base: string; command: string; rounds: CompareRound[]; cores: number }
|
|
21
|
+
|
|
22
|
+
export function median(values: readonly number[]): number {
|
|
23
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
24
|
+
const middle = Math.floor(sorted.length / 2);
|
|
25
|
+
const upper = sorted[middle] ?? Number.NaN;
|
|
26
|
+
return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? Number.NaN) + upper) / 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The `cez/*` rows of oxlint's `--debug timings` table: rule name to JS milliseconds. */
|
|
30
|
+
export function ruleTimings(output: string): Record<string, number> {
|
|
31
|
+
const timings: Record<string, number> = {};
|
|
32
|
+
for (const line of output.split('\n')) {
|
|
33
|
+
const [name, ms] = line.trim().split(/\s+/);
|
|
34
|
+
if (name?.startsWith('cez/') && Number.isFinite(Number(ms))) timings[name] = Number(ms);
|
|
35
|
+
}
|
|
36
|
+
return timings;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The file count of oxlint's `Finished in … on N files` line, or undefined when the line is missing. */
|
|
40
|
+
export function lintedFiles(output: string): number | undefined {
|
|
41
|
+
const match = /^Finished in .* on (\d+) files?\b/m.exec(output);
|
|
42
|
+
return match ? Number(match[1]) : undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Lint paths relative to the repository root, so each side lints its own tree: an absolute path would
|
|
47
|
+
* make an extracted base tree lint the working tree's files. A path outside the root is refused.
|
|
48
|
+
*/
|
|
49
|
+
export function rootRelativePaths(paths: readonly string[], root: string): string[] {
|
|
50
|
+
return paths.map(path => {
|
|
51
|
+
if (!isAbsolute(path)) return path;
|
|
52
|
+
const inside = relative(root, path);
|
|
53
|
+
if (inside === '..' || inside.startsWith(`..${sep}`) || isAbsolute(inside)) throw new Error(`${path} is outside ${root}`);
|
|
54
|
+
return inside === '' ? '.' : inside;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const sum = (timings: Record<string, number>) => Object.values(timings).reduce((total, ms) => total + ms, 0);
|
|
59
|
+
const fixed = (value: number, digits = 2) => value.toFixed(digits);
|
|
60
|
+
const ratio = (candidate: number, base: number) => (base > 0 ? fixed(candidate / base) : 'n/a');
|
|
61
|
+
|
|
62
|
+
function sideRow(label: string, measures: CompareMeasure[], timings: Record<string, number>[]): { row: string; user: number; js: number } {
|
|
63
|
+
const users = measures.map(m => m.user);
|
|
64
|
+
const user = median(users);
|
|
65
|
+
const js = median(timings.map(sum));
|
|
66
|
+
const row = `| ${label} | ${fixed(user)} | ${fixed(Math.min(...users))}–${fixed(Math.max(...users))} | ${fixed(median(measures.map(m => m.sys)))} | ${fixed(js, 0)} |`;
|
|
67
|
+
return { row, user, js };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function ruleRows(rounds: readonly CompareRound[]): string[] {
|
|
71
|
+
const names = [...new Set(rounds.flatMap(r => [...Object.keys(r.baseTimings), ...Object.keys(r.candidateTimings)]))];
|
|
72
|
+
const rows = names.map(name => {
|
|
73
|
+
const base = median(rounds.map(r => r.baseTimings[name] ?? 0));
|
|
74
|
+
const candidate = median(rounds.map(r => r.candidateTimings[name] ?? 0));
|
|
75
|
+
return { name, base, candidate };
|
|
76
|
+
});
|
|
77
|
+
rows.sort((a, b) => b.candidate - a.candidate || a.name.localeCompare(b.name));
|
|
78
|
+
return rows.map(r => `| ${r.name} | ${fixed(r.base, 0)} | ${fixed(r.candidate, 0)} | ${r.candidate - r.base >= 0 ? '+' : ''}${fixed(r.candidate - r.base, 0)} |`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The Markdown report: per-side medians and ranges, the ratios, host load against the ceiling, and per-rule JS time. */
|
|
82
|
+
export function compareReport({ base, command, rounds, cores }: CompareInput): string {
|
|
83
|
+
const baseSide = sideRow('base', rounds.map(r => r.base), rounds.map(r => r.baseTimings));
|
|
84
|
+
const candidateSide = sideRow('candidate', rounds.map(r => r.candidate), rounds.map(r => r.candidateTimings));
|
|
85
|
+
const load = median(rounds.flatMap(r => r.loads));
|
|
86
|
+
const ceiling = cores / 2;
|
|
87
|
+
const lines = [
|
|
88
|
+
`Base: ${base}. Candidate: the working tree. Command: ${command}; ${rounds.length} alternating rounds; CPU in seconds, JS time in ms.`,
|
|
89
|
+
'',
|
|
90
|
+
'| Side | User median | User range | Sys median | `cez/*` JS ms median |',
|
|
91
|
+
'| --- | ---: | ---: | ---: | ---: |',
|
|
92
|
+
baseSide.row,
|
|
93
|
+
candidateSide.row,
|
|
94
|
+
'',
|
|
95
|
+
`Candidate/base: user CPU ${ratio(candidateSide.user, baseSide.user)}, \`cez/*\` JS time ${ratio(candidateSide.js, baseSide.js)}.`,
|
|
96
|
+
`Host: ${cores} cores; median 1-minute load ${fixed(load)}; user-CPU ceiling ${fixed(ceiling)} (half the cores).`,
|
|
97
|
+
];
|
|
98
|
+
if (load >= ceiling) lines.push('', '**Load above ceiling: user CPU is not evidence; report the `--debug timings` sums.**');
|
|
99
|
+
lines.push('', '| Rule | Base ms | Candidate ms | Delta |', '| --- | ---: | ---: | ---: |', ...ruleRows(rounds));
|
|
100
|
+
return lines.join('\n');
|
|
101
|
+
}
|
package/scripts/profile-lint.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFileSync, spawnSync } from 'node:child_process';
|
|
2
|
-
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
-
import { tmpdir } from 'node:os';
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { availableParallelism, loadavg as osLoadavg, tmpdir } from 'node:os';
|
|
4
4
|
import { join, resolve } from 'node:path';
|
|
5
5
|
import { performance } from 'node:perf_hooks';
|
|
6
6
|
import { oxlintBin } from '../src/lint/run.ts';
|
|
@@ -10,12 +10,15 @@ import { PROCESS_OWNER_RULES } from '../src/lint/owner-process-rules.ts';
|
|
|
10
10
|
import { STATE_OWNER_RULES } from '../src/lint/owner-state-rules.ts';
|
|
11
11
|
import { READER_OWNER_RULES } from '../src/lint/owner-reader-rules.ts';
|
|
12
12
|
import { activeRunWriteRules } from '../src/lint/active-run-write.ts';
|
|
13
|
+
import { gitEnv, gitSync } from '../src/git-command.ts';
|
|
14
|
+
import { type CompareRound, compareReport, lintedFiles, rootRelativePaths, ruleTimings } from './profile-lint-compare.ts';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Measures what the `cez` oxlint plugin costs (hearsay-tools/squawk#3774). A developer tool, not a
|
|
16
18
|
* test: its numbers depend on the host and its load, so it prints `/proc/loadavg` beside each run.
|
|
17
19
|
*
|
|
18
20
|
* node packages/cezar/scripts/profile-lint.ts [--alone] [--families] [--runs N] [path...]
|
|
21
|
+
* node packages/cezar/scripts/profile-lint.ts --compare <ref|config> [--runs N] [path...]
|
|
19
22
|
*
|
|
20
23
|
* It runs `oxlint -c <config> <path...>` (default path `packages`) from the repository root with
|
|
21
24
|
* these configs, each written to a scratch directory:
|
|
@@ -28,32 +31,69 @@ import { activeRunWriteRules } from '../src/lint/active-run-write.ts';
|
|
|
28
31
|
* rule or family. Each run's user and system CPU come from the shell's `times` for its child.
|
|
29
32
|
* Last, it runs the full config once with `--debug timings` and lists oxlint's own JS time per rule
|
|
30
33
|
* (visitor and `create` time only; tree transfer, walking and garbage collection are not in it).
|
|
34
|
+
*
|
|
35
|
+
* `--compare` measures a base against the working tree in N alternating rounds (default 5); see
|
|
36
|
+
* `profile-lint-compare.ts` for the report. A base that names an existing file is an oxlint config,
|
|
37
|
+
* linted over the working tree. Any other base is a commit: its tree is extracted with `git archive`
|
|
38
|
+
* and linted with its own `.oxlintrc.json`, because the rules locate files relative to their own
|
|
39
|
+
* repository root. Both sides use the working tree's oxlint binary.
|
|
31
40
|
*/
|
|
32
41
|
|
|
33
42
|
interface Measure { label: string; user: number; sys: number; wall: number; load: string }
|
|
34
43
|
|
|
35
|
-
export interface ProfileOptions { paths: string[]; runs: number; alone: boolean; families: boolean }
|
|
44
|
+
export interface ProfileOptions { paths: string[]; runs: number; alone: boolean; families: boolean; compare?: string }
|
|
45
|
+
|
|
46
|
+
/** The value after `flag`, or undefined without the flag; a flag with no value throws. */
|
|
47
|
+
function flagValue(args: readonly string[], flag: string): string | undefined {
|
|
48
|
+
const index = args.indexOf(flag);
|
|
49
|
+
if (index < 0) return undefined;
|
|
50
|
+
const value = args[index + 1];
|
|
51
|
+
if (value === undefined || value.startsWith('--')) throw new Error(`${flag} needs a value`);
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** `--runs N`: a positive integer, or the statistics describe no run at all. */
|
|
56
|
+
function roundCount(value: string): number {
|
|
57
|
+
const count = Number(value);
|
|
58
|
+
if (!/^\d+$/.test(value) || count < 1) throw new Error(`--runs needs a positive integer, not ${value}`);
|
|
59
|
+
return count;
|
|
60
|
+
}
|
|
36
61
|
|
|
37
|
-
/** The command line: flags, `--runs N`, and the paths to lint (default `packages`). */
|
|
62
|
+
/** The command line: flags, `--runs N`, `--compare <ref|config>`, and the paths to lint (default `packages`). */
|
|
38
63
|
export function profileArgs(args: readonly string[]): ProfileOptions {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
64
|
+
const runs = flagValue(args, '--runs');
|
|
65
|
+
const compare = flagValue(args, '--compare');
|
|
66
|
+
const values = new Set(['--runs', '--compare'].map(flag => args.indexOf(flag) + 1).filter(index => index > 0));
|
|
67
|
+
const paths = args.filter((arg, index) => !arg.startsWith('--') && !values.has(index));
|
|
41
68
|
return {
|
|
42
69
|
paths: paths.length > 0 ? paths : ['packages'],
|
|
43
|
-
runs:
|
|
70
|
+
runs: runs === undefined ? (compare === undefined ? 1 : 5) : roundCount(runs),
|
|
44
71
|
alone: args.includes('--alone'),
|
|
45
72
|
families: args.includes('--families'),
|
|
73
|
+
...(compare === undefined ? {} : { compare }),
|
|
46
74
|
};
|
|
47
75
|
}
|
|
48
76
|
|
|
49
|
-
|
|
77
|
+
// The test imports `profileArgs`; only a direct run reads the command line, inside its error handler.
|
|
78
|
+
let paths: string[] = [];
|
|
79
|
+
let runs = 1;
|
|
80
|
+
let alone = false;
|
|
81
|
+
let byFamily = false;
|
|
82
|
+
let compare: string | undefined;
|
|
83
|
+
|
|
84
|
+
function readCommandLine(): void {
|
|
85
|
+
const options = profileArgs(process.argv.slice(2));
|
|
86
|
+
paths = rootRelativePaths(options.paths, repoRoot);
|
|
87
|
+
({ runs, alone, families: byFamily, compare } = options);
|
|
88
|
+
}
|
|
50
89
|
|
|
51
90
|
const base = JSON.parse(readFileSync(join(repoRoot, '.oxlintrc.json'), 'utf8')) as { jsPlugins?: string[]; rules: Record<string, unknown> };
|
|
52
91
|
const pluginPath = resolve(repoRoot, base.jsPlugins?.[0] ?? 'packages/cezar/src/lint/plugin.ts');
|
|
53
92
|
const builtinRules = Object.fromEntries(Object.entries(base.rules).filter(([name]) => !name.startsWith('cez/')));
|
|
54
93
|
let scratch = '';
|
|
55
94
|
|
|
56
|
-
const loadavg = () => (
|
|
95
|
+
const loadavg = () => osLoadavg().map(value => value.toFixed(2)).join(' ');
|
|
96
|
+
const oneMinute = () => osLoadavg()[0] ?? Number.NaN;
|
|
57
97
|
const seconds = (text: string) => {
|
|
58
98
|
const match = /^(\d+)m([\d.]+)s$/.exec(text);
|
|
59
99
|
return match ? Number(match[1]) * 60 + Number(match[2]) : Number.NaN;
|
|
@@ -77,10 +117,10 @@ function noopPlugin(name: string, visitors: string[]): string {
|
|
|
77
117
|
}
|
|
78
118
|
|
|
79
119
|
/** One oxlint run; `times` in a POSIX shell reports the CPU its children used. */
|
|
80
|
-
function measure(label: string, config: string): Measure {
|
|
120
|
+
function measure(label: string, config: string, cwd = repoRoot): Measure {
|
|
81
121
|
const load = loadavg();
|
|
82
122
|
const started = performance.now();
|
|
83
|
-
const shell = spawnSync('/bin/sh', ['-c', '"$@" >/dev/null 2>&1; times', 'sh', process.execPath, oxlintBin(), '-c', config, ...paths], { cwd
|
|
123
|
+
const shell = spawnSync('/bin/sh', ['-c', '"$@" >/dev/null 2>&1; times', 'sh', process.execPath, oxlintBin(), '-c', config, ...paths], { cwd, encoding: 'utf8' });
|
|
84
124
|
const wall = (performance.now() - started) / 1000;
|
|
85
125
|
const [user = '', sys = ''] = (shell.stdout.trim().split('\n').at(-1) ?? '').split(/\s+/);
|
|
86
126
|
return { label, user: seconds(user), sys: seconds(sys), wall, load };
|
|
@@ -113,8 +153,7 @@ function main(): void {
|
|
|
113
153
|
console.log(`Command: oxlint -c <config> ${paths.join(' ')} (cwd ${repoRoot}); best of ${runs}; CPU in seconds.\n`);
|
|
114
154
|
console.log('| Config | User | Sys | Wall | Load (1/5/15 min) |\n| --- | ---: | ---: | ---: | --- |');
|
|
115
155
|
for (const m of results) console.log(row(m));
|
|
116
|
-
const
|
|
117
|
-
const lines = timings.split('\n').filter(line => line.startsWith('cez/'));
|
|
156
|
+
const lines = timingsOutput('.oxlintrc.json').split('\n').filter(line => line.startsWith('cez/'));
|
|
118
157
|
console.log(`\nOxlint's JS time per rule (\`--debug timings\`, load ${loadavg()}):\n\n| Rule | ms | Calls |\n| --- | ---: | ---: |`);
|
|
119
158
|
for (const line of lines) {
|
|
120
159
|
const [name, ms, , calls] = line.split(/\s+/);
|
|
@@ -122,10 +161,73 @@ function main(): void {
|
|
|
122
161
|
}
|
|
123
162
|
}
|
|
124
163
|
|
|
164
|
+
/** Oxlint's `--debug timings` output for one run; lint findings make it exit 1, which is not a failure here. */
|
|
165
|
+
function timingsOutput(config: string, cwd = repoRoot): string {
|
|
166
|
+
const run = spawnSync(process.execPath, [oxlintBin(), '-c', config, '-f', 'default', '--debug', 'timings', ...paths], { cwd, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
|
|
167
|
+
if (run.status !== 0 && run.status !== 1) throw new Error(`oxlint --debug timings exited ${run.status}: ${run.stderr}`);
|
|
168
|
+
return run.stdout;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
interface Side { config: string; cwd: string }
|
|
172
|
+
|
|
173
|
+
/** The base side: an existing file is a config over the working tree; anything else is a commit's own tree. */
|
|
174
|
+
function baseSide(arg: string): { side: Side; describe: string } {
|
|
175
|
+
const file = resolve(arg);
|
|
176
|
+
if (existsSync(file)) return { side: { config: file, cwd: repoRoot }, describe: `config ${arg}` };
|
|
177
|
+
// The git helpers drop inherited `GIT_DIR`-style variables (a hook, `rebase --exec`), so git acts on `cwd`.
|
|
178
|
+
let sha: string;
|
|
179
|
+
try {
|
|
180
|
+
sha = gitSync(['rev-parse', '--verify', '--quiet', `${arg}^{commit}`], { cwd: repoRoot, stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
|
181
|
+
} catch {
|
|
182
|
+
throw new Error(`--compare ${arg}: not a file and not a commit`);
|
|
183
|
+
}
|
|
184
|
+
const tree = join(scratch, 'base');
|
|
185
|
+
mkdirSync(tree);
|
|
186
|
+
execFileSync('/bin/sh', ['-c', 'git archive "$1" | tar -x -C "$2"', 'sh', sha, tree], { cwd: repoRoot, env: gitEnv() });
|
|
187
|
+
// Oxlint applies the `.gitignore` of an enclosing repository. A temp directory inside an ignored
|
|
188
|
+
// path (a task's TMPDIR) would hide every file, so the tree gets a repository boundary of its own.
|
|
189
|
+
gitSync(['init', '--quiet', tree]);
|
|
190
|
+
for (const dir of ['.', ...readdirSync(join(repoRoot, 'packages')).map(name => join('packages', name))]) {
|
|
191
|
+
const modules = join(repoRoot, dir, 'node_modules');
|
|
192
|
+
if (existsSync(modules) && existsSync(join(tree, dir)) && !existsSync(join(tree, dir, 'node_modules'))) symlinkSync(modules, join(tree, dir, 'node_modules'), 'dir');
|
|
193
|
+
}
|
|
194
|
+
return { side: { config: join(tree, '.oxlintrc.json'), cwd: tree }, describe: `commit ${arg} (${sha.slice(0, 9)})` };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** One side's per-rule JS time. A side that lints no files fails: a CPU time from that run measures nothing. */
|
|
198
|
+
function sideTimings(label: string, side: Side): Record<string, number> {
|
|
199
|
+
const output = timingsOutput(side.config, side.cwd);
|
|
200
|
+
if (!lintedFiles(output)) throw new Error(`${label}: oxlint linted no files for ${paths.join(' ')} in ${side.cwd}`);
|
|
201
|
+
return ruleTimings(output);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function compareMain(arg: string): void {
|
|
205
|
+
const { side: base, describe } = baseSide(arg);
|
|
206
|
+
const candidate: Side = { config: join(repoRoot, '.oxlintrc.json'), cwd: repoRoot };
|
|
207
|
+
const rounds: CompareRound[] = [];
|
|
208
|
+
for (let round = 1; round <= runs; round++) {
|
|
209
|
+
const loads = [oneMinute()];
|
|
210
|
+
const baseRun = measure('base', base.config, base.cwd);
|
|
211
|
+
loads.push(oneMinute());
|
|
212
|
+
const candidateRun = measure('candidate', candidate.config, candidate.cwd);
|
|
213
|
+
const baseTimings = sideTimings('base', base);
|
|
214
|
+
const candidateTimings = sideTimings('candidate', candidate);
|
|
215
|
+
rounds.push({ loads, base: baseRun, candidate: candidateRun, baseTimings, candidateTimings });
|
|
216
|
+
const [baseLoad = Number.NaN, candidateLoad = Number.NaN] = loads;
|
|
217
|
+
console.error(`round ${round}/${runs}: base ${baseRun.user.toFixed(2)} s user at load ${baseLoad.toFixed(2)}, candidate ${candidateRun.user.toFixed(2)} s user at load ${candidateLoad.toFixed(2)}`);
|
|
218
|
+
}
|
|
219
|
+
console.log(compareReport({ base: describe, command: `oxlint -c <config> ${paths.join(' ')}`, rounds, cores: availableParallelism() }));
|
|
220
|
+
}
|
|
221
|
+
|
|
125
222
|
if (import.meta.main) {
|
|
126
223
|
scratch = mkdtempSync(join(tmpdir(), 'cez-profile-lint-'));
|
|
127
224
|
try {
|
|
128
|
-
|
|
225
|
+
readCommandLine();
|
|
226
|
+
if (compare === undefined) main();
|
|
227
|
+
else compareMain(compare);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
console.error(`profile-lint: ${error instanceof Error ? error.message : String(error)}`);
|
|
230
|
+
process.exitCode = 2;
|
|
129
231
|
} finally {
|
|
130
232
|
rmSync(scratch, { recursive: true, force: true });
|
|
131
233
|
}
|