ci: run the CPU-independent scale PR tier in FE-GATE-005 (11-03)
No CI job ran any scale tier, and every tier past pr compares timings only on the baseline CPU. The pr tier checks counts, bounds and growth shape; it now includes S2 composition, since S0/S1 stay under the noise floor and let a quadratic accumulation through. The ungated-test check reads tier paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7f889a6d83
commit
45ee231bb0
@@ -3,12 +3,14 @@ import path from "node:path";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
import { SCALE_TIERS, type ScaleTier } from "../scale/run-scale-profile.ts";
|
||||
import { reachablePackageScripts } from "./package-script-graph.ts";
|
||||
|
||||
/**
|
||||
* 12-04. A test file protects nothing unless a CI gate runs it. The gated set
|
||||
* is read from the package scripts the CI contract's commands reach: Vitest
|
||||
* path filters (`run-vitest.ts run <paths>`) and Playwright config `testDir`s.
|
||||
* path filters (`run-vitest.ts run <paths>`), the Vitest steps of a scale tier
|
||||
* (`run-scale-profile.ts <tier>`) and Playwright config `testDir`s.
|
||||
* A test outside that set needs a reasoned entry in config/ci/ungated-tests.json.
|
||||
*/
|
||||
export const UNGATED_TESTS_PATH = "config/ci/ungated-tests.json";
|
||||
@@ -53,17 +55,22 @@ export function gatedTestPaths(
|
||||
readConfig: (file: string) => string,
|
||||
): string[] {
|
||||
const paths = new Set<string>();
|
||||
const addVitestPaths = (tokens: readonly string[]) => {
|
||||
const vitestRun = tokens.findIndex(
|
||||
(token, index) => token === "run" && /(?:run-vitest\.ts|vitest)$/u.test(tokens[index - 1] ?? ""),
|
||||
);
|
||||
if (vitestRun < 0) return;
|
||||
for (const token of tokens.slice(vitestRun + 1)) {
|
||||
if (!token.startsWith("-")) paths.add(token.replace(/\/$/u, ""));
|
||||
}
|
||||
};
|
||||
for (const script of reachablePackageScripts(scripts, entryScripts)) {
|
||||
for (const segment of scripts[script]!.split("&&")) {
|
||||
const tokens = segment.trim().split(/\s+/u);
|
||||
const vitestRun = tokens.findIndex(
|
||||
(token, index) => token === "run" && /(?:run-vitest\.ts|vitest)$/u.test(tokens[index - 1] ?? ""),
|
||||
);
|
||||
if (vitestRun >= 0) {
|
||||
for (const token of tokens.slice(vitestRun + 1)) {
|
||||
if (token.startsWith("-")) break;
|
||||
paths.add(token.replace(/\/$/u, ""));
|
||||
}
|
||||
addVitestPaths(tokens);
|
||||
const scaleProfile = tokens.findIndex((token) => /run-scale-profile\.ts$/u.test(token));
|
||||
if (scaleProfile >= 0) {
|
||||
for (const step of SCALE_TIERS[tokens[scaleProfile + 1] as ScaleTier] ?? []) addVitestPaths(step.command);
|
||||
}
|
||||
const playwrightTest = tokens.findIndex(
|
||||
(token, index) => token === "test" && tokens[index - 1] === "playwright",
|
||||
|
||||
@@ -3,14 +3,21 @@ import { mkdir, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
/**
|
||||
* Spec §47. CI execution tiers for the scale/chaos/soak program.
|
||||
* Spec §47. Execution tiers for the scale/chaos/soak program.
|
||||
*
|
||||
* pr S0/S1 architecture, composition and traffic invariants
|
||||
* main pr + S2 composition, TypeScript diagnostics and the stored
|
||||
* baseline regression gate (config/scale/benchmark-baseline.json)
|
||||
* pr architecture and traffic invariants, S0-S2 composition growth
|
||||
* main pr + TypeScript diagnostics and the stored baseline regression
|
||||
* gate (config/scale/benchmark-baseline.json)
|
||||
* nightly main + S3/S4 topology, telemetry storm, session cycles, browser soak
|
||||
* release release-coherence matrix + the stable main/nightly subset
|
||||
*
|
||||
* Only `pr` runs in CI (merge gate FE-GATE-005, 11-03). Its checks are counts,
|
||||
* bounds and growth shape, so they hold on any CPU; the composition timings it
|
||||
* writes are advisory. `main`, `nightly` and `release` include
|
||||
* `baseline-regression`, which compares timings only on the CPU model that
|
||||
* recorded config/scale/benchmark-baseline.json and is `incomplete` elsewhere,
|
||||
* so no CI job runs them; they are local commands for that machine.
|
||||
*
|
||||
* Every step's output goes to artifacts/scale/<tier>/<step>.log and the tier
|
||||
* writes one machine-readable summary.json. A step that could not run (e.g. a
|
||||
* browser soak without a build or browser) is `skipped`, and a tier with any
|
||||
@@ -49,18 +56,16 @@ const PR_STEPS: readonly Step[] = [
|
||||
"tests/scale/traffic",
|
||||
],
|
||||
},
|
||||
// 11-03: S2 is included because below it every workload stays under the
|
||||
// noise floor, so a quadratic accumulation passed S0/S1 unnoticed.
|
||||
{
|
||||
id: "composition-s0-s1",
|
||||
command: ["scripts/scale/run-composition-scale.ts", "--profiles=S0,S1"],
|
||||
id: "composition-s0-s2",
|
||||
command: ["scripts/scale/run-composition-scale.ts", "--profiles=S0,S1,S2"],
|
||||
},
|
||||
];
|
||||
|
||||
const MAIN_STEPS: readonly Step[] = [
|
||||
...PR_STEPS,
|
||||
{
|
||||
id: "composition-s0-s2",
|
||||
command: ["scripts/scale/run-composition-scale.ts", "--profiles=S0,S1,S2"],
|
||||
},
|
||||
{
|
||||
id: "composition-scale-suite",
|
||||
command: [...VITEST, "tests/scale/composition-scale.test.ts", "tests/scale/tsc-diagnostics-parser.test.ts"],
|
||||
|
||||
Reference in New Issue
Block a user