@mutmutco/codex-plugin 4.5.234 → 4.5.236
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/cli/dist/main.cjs
CHANGED
|
@@ -1216,6 +1216,8 @@ var init_house_map = __esm({
|
|
|
1216
1216
|
// allowlisted GitHub REST GET reads for automation (pull files, compare, contents)
|
|
1217
1217
|
ci: "devops",
|
|
1218
1218
|
// the CI/gate audit
|
|
1219
|
+
jev: "devops",
|
|
1220
|
+
// #9295: read-only status of the Hub-maintained Jev test-ordering learner
|
|
1219
1221
|
rcand: "devops",
|
|
1220
1222
|
release: "devops",
|
|
1221
1223
|
hotfix: "devops",
|
|
@@ -25116,6 +25118,7 @@ function createDocsIndexDeps(repoRoot2) {
|
|
|
25116
25118
|
var BLESSED_RUN_WITH_BUDGET_SHA = "5ce541add569e54e7ca96de67a768577d3d604e4";
|
|
25117
25119
|
var BLESSED_RUNNER_GATE_SHA = "a19e9392e5ad9b0675f02e4304d68dd933fad60f";
|
|
25118
25120
|
var BLESSED_KIT_AGENT_FILES_SHA = "a8b273ed418e703c0aa501a53ea87228ba28b1f0";
|
|
25121
|
+
var BLESSED_JEV_FAILURES_SHA = "d5278c6133318b33727483ddfdfddc8f841e3ef6";
|
|
25119
25122
|
var BLESSED_RUNBOOK_GUARD_SHA = "e661e0aedc0e58b73c738bf6cdfeac65e5914584";
|
|
25120
25123
|
var REMOTE_USE = /^mutmutco\/MMI-Hub\/\.github\/actions\/run-with-budget@(\S+)$/;
|
|
25121
25124
|
var LOCAL_USE = "./.github/actions/run-with-budget";
|
|
@@ -25498,7 +25501,9 @@ function gateSeedVars(cls, releaseTrack, runtime = "node", requiredCheckBranches
|
|
|
25498
25501
|
GATE_RUNBOOK_SHA: BLESSED_RUNBOOK_GUARD_SHA,
|
|
25499
25502
|
// #7407: repo-declared service containers and extra check steps; empty renders today's gate byte-for-byte.
|
|
25500
25503
|
GATE_SERVICES_YAML: "",
|
|
25501
|
-
GATE_EXTRA_STEPS_YAML: ""
|
|
25504
|
+
GATE_EXTRA_STEPS_YAML: "",
|
|
25505
|
+
// #9293: Jev failure-memory fetch/report steps from the blessed jev-failures pin (an empty pin renders none).
|
|
25506
|
+
...gateJevStepsYaml(BLESSED_JEV_FAILURES_SHA, runtime)
|
|
25502
25507
|
};
|
|
25503
25508
|
const track = releaseTrack ?? (cls === "content" ? "trunk" : "full");
|
|
25504
25509
|
const trackBranches = track === "trunk" ? ["main"] : track === "single" ? ["development"] : track === "direct" ? ["development", "main"] : ["development", "rc", "main"];
|
|
@@ -25647,6 +25652,39 @@ function gateServicesYaml(services) {
|
|
|
25647
25652
|
}
|
|
25648
25653
|
return out;
|
|
25649
25654
|
}
|
|
25655
|
+
function gateJevStepsYaml(sha, runtime = "node") {
|
|
25656
|
+
if (!/^[0-9a-f]{40}$/.test(sha)) return { GATE_JEV_FETCH_YAML: "", GATE_JEV_REPORT_YAML: "" };
|
|
25657
|
+
const listFiles = runtime === "python" ? `git ls-files -z -- 'test_*.py' '*_test.py' | python3 -c "import sys,json;print(json.dumps([p for p in sys.stdin.read().split(chr(0)) if p]))" > .jerv/jev-test-files.json` : `git ls-files -z -- '*.test.*' '*.spec.*' | node -e "process.stdout.write(JSON.stringify(require('fs').readFileSync(0,'utf8').split('\\0').filter(Boolean)))" > .jerv/jev-test-files.json`;
|
|
25658
|
+
const listStep = [
|
|
25659
|
+
"\n - name: List test files for the Jev plan",
|
|
25660
|
+
"\n if: ${{ steps.development-gate.outputs.reuse != 'true' }}",
|
|
25661
|
+
"\n continue-on-error: true",
|
|
25662
|
+
"\n timeout-minutes: 1",
|
|
25663
|
+
`
|
|
25664
|
+
run: mkdir -p .jerv && ${listFiles}`
|
|
25665
|
+
].join("");
|
|
25666
|
+
const step = (name, cond, mode) => [
|
|
25667
|
+
`
|
|
25668
|
+
- name: ${name}`,
|
|
25669
|
+
`
|
|
25670
|
+
if: \${{ ${cond}steps.development-gate.outputs.reuse != 'true' }}`,
|
|
25671
|
+
"\n continue-on-error: true",
|
|
25672
|
+
"\n timeout-minutes: 1",
|
|
25673
|
+
`
|
|
25674
|
+
uses: mutmutco/MMI-Hub/.github/actions/jev-failures@${sha}`,
|
|
25675
|
+
"\n with:",
|
|
25676
|
+
`
|
|
25677
|
+
mode: ${mode}`,
|
|
25678
|
+
mode === "outcomes" ? `
|
|
25679
|
+
report-format: ${runtime === "python" ? "junit-xml" : "vitest-json"}` : "",
|
|
25680
|
+
mode === "plan" ? "\n plan-files: .jerv/jev-test-files.json" : "",
|
|
25681
|
+
"\n token: ${{ github.token }}"
|
|
25682
|
+
].join("");
|
|
25683
|
+
return {
|
|
25684
|
+
GATE_JEV_FETCH_YAML: step("Fetch Jev recent failures (empty on any fault)", "", "fetch") + listStep + step("Plan Jev test order and PR-only skips (full order on any fault)", "", "plan"),
|
|
25685
|
+
GATE_JEV_REPORT_YAML: step("Report test outcomes to Jev", "always() && ", "outcomes")
|
|
25686
|
+
};
|
|
25687
|
+
}
|
|
25650
25688
|
function gateExtraStepsYaml(steps) {
|
|
25651
25689
|
return steps.map((step) => [
|
|
25652
25690
|
`
|
|
@@ -27242,10 +27280,10 @@ var rollout_plan_default = {
|
|
|
27242
27280
|
note: "The v4.0.0 stamp happens at cut time (D6e #4463); until then the candidate is the origin/development head artifacts (built cli/dist + npm pack), identity proven by dist content hash (D6a)."
|
|
27243
27281
|
},
|
|
27244
27282
|
baseline: {
|
|
27245
|
-
version: "4.5.
|
|
27246
|
-
tag: "v4.5.
|
|
27247
|
-
commit: "
|
|
27248
|
-
npm: "@mutmutco/cli@4.5.
|
|
27283
|
+
version: "4.5.236",
|
|
27284
|
+
tag: "v4.5.236",
|
|
27285
|
+
commit: "b28d6f0940ce",
|
|
27286
|
+
npm: "@mutmutco/cli@4.5.236"
|
|
27249
27287
|
},
|
|
27250
27288
|
exitCriterion: "fleet-n-of-n",
|
|
27251
27289
|
hubOnlyShortcut: "forbidden",
|
|
@@ -27262,14 +27300,14 @@ var rollout_plan_default = {
|
|
|
27262
27300
|
repo: "mutmutco/mmi-hub",
|
|
27263
27301
|
role: "canary",
|
|
27264
27302
|
schedule: "train",
|
|
27265
|
-
v3Target: "v4.5.
|
|
27303
|
+
v3Target: "v4.5.236"
|
|
27266
27304
|
}
|
|
27267
27305
|
],
|
|
27268
27306
|
rollbackTrigger: "Any red inside the post-contract soak window: `devops train gate` FAIL attributable to the v4 doors, Hub endpoint health probe failure, a pre-v4 client admitted instead of receiving actionable HTTP 426, or npm consumer install/doctor failure on the v4-only dist.",
|
|
27269
27307
|
rollback: {
|
|
27270
27308
|
independent: true,
|
|
27271
|
-
mechanism: "npm dist-tag latest -> 4.5.
|
|
27272
|
-
v3Target: "v4.5.
|
|
27309
|
+
mechanism: "npm dist-tag latest -> 4.5.236 and redeploy the Hub Lambda from tag v4.5.236 (b28d6f0940ce); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
|
|
27310
|
+
v3Target: "v4.5.236 (@mutmutco/cli@4.5.236, tag commit b28d6f0940ce \u2014 last known-good release carrying the repo-index v4-only contract)"
|
|
27273
27311
|
}
|
|
27274
27312
|
},
|
|
27275
27313
|
{
|
|
@@ -38291,6 +38329,7 @@ function registryRepoKey(repo) {
|
|
|
38291
38329
|
}
|
|
38292
38330
|
|
|
38293
38331
|
// src/ci-audit.ts
|
|
38332
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
38294
38333
|
var HUB_REPO4 = "mutmutco/MMI-Hub";
|
|
38295
38334
|
var HUB_GATE_CONTEXTS = ["cli", "infra", "docs"];
|
|
38296
38335
|
var PRODUCT_GATE_PATH = ".github/workflows/gate.yml";
|
|
@@ -38357,6 +38396,127 @@ function auditRunnerFallbacks(repo, files, closure) {
|
|
|
38357
38396
|
remediation: f.cost === "hosted" || f.cost === "unknown" ? "Resolve source reads and unsupported selectors/callees; preserve checks and artifacts. See gh-runner-runbook.md." : void 0
|
|
38358
38397
|
}));
|
|
38359
38398
|
}
|
|
38399
|
+
var LIVE_SELF_HOSTED_LINUX_LABELS = /* @__PURE__ */ new Set([
|
|
38400
|
+
"self-hosted",
|
|
38401
|
+
"linux",
|
|
38402
|
+
"x64",
|
|
38403
|
+
"mmi-live",
|
|
38404
|
+
"mmi-heavy",
|
|
38405
|
+
"mmi-bare-metal",
|
|
38406
|
+
"mmi-journeys",
|
|
38407
|
+
"mmi-deploy",
|
|
38408
|
+
"mmi-browser"
|
|
38409
|
+
]);
|
|
38410
|
+
var NON_LINUX_RUNNER_LABEL = /^(?:macos|windows|arm64)$/i;
|
|
38411
|
+
var NODE_SETUP_USE = /(?:^|\/)(?:actions\/setup-node|runner-node-toolchain)(?:@|$)/;
|
|
38412
|
+
var RUNS_NODE = /(?:^|[\s;&|(`])(?:node|npm|npx)(?=\s|$)/m;
|
|
38413
|
+
var plainRecord = (value) => Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
38414
|
+
function runsOnLabelSets(job) {
|
|
38415
|
+
const toSet = (value) => typeof value === "string" ? [value] : Array.isArray(value) && value.every((l) => typeof l === "string") ? value : void 0;
|
|
38416
|
+
let selector = job["runs-on"];
|
|
38417
|
+
if (plainRecord(selector)) selector = selector.labels;
|
|
38418
|
+
if (typeof selector !== "string" || !selector.includes("${{")) return [toSet(selector)].filter((s) => Boolean(s));
|
|
38419
|
+
const sets = [];
|
|
38420
|
+
for (const m of selector.matchAll(/fromJSON\('([^']+)'\)/g)) {
|
|
38421
|
+
try {
|
|
38422
|
+
const parsed = toSet(JSON.parse(m[1]));
|
|
38423
|
+
if (parsed) sets.push(parsed);
|
|
38424
|
+
} catch {
|
|
38425
|
+
}
|
|
38426
|
+
}
|
|
38427
|
+
const axis = /^\$\{\{\s*matrix\.([\w-]+)\s*\}\}$/.exec(selector.trim())?.[1];
|
|
38428
|
+
const matrix = plainRecord(job.strategy) && plainRecord(job.strategy.matrix) ? job.strategy.matrix : void 0;
|
|
38429
|
+
if (axis && matrix && Array.isArray(matrix[axis])) for (const value of matrix[axis]) {
|
|
38430
|
+
const s = toSet(value);
|
|
38431
|
+
if (s) sets.push(s);
|
|
38432
|
+
}
|
|
38433
|
+
return sets;
|
|
38434
|
+
}
|
|
38435
|
+
function auditSelfHostedRunnerHygiene(files) {
|
|
38436
|
+
const checks = [];
|
|
38437
|
+
for (const { path: path2, body } of files) {
|
|
38438
|
+
let doc;
|
|
38439
|
+
try {
|
|
38440
|
+
doc = (0, import_yaml2.parse)(body);
|
|
38441
|
+
} catch {
|
|
38442
|
+
continue;
|
|
38443
|
+
}
|
|
38444
|
+
const jobs = plainRecord(doc) && plainRecord(doc.jobs) ? doc.jobs : {};
|
|
38445
|
+
for (const [id, job] of Object.entries(jobs)) {
|
|
38446
|
+
if (!plainRecord(job)) continue;
|
|
38447
|
+
const linuxSets = runsOnLabelSets(job).filter((set) => set.some((l) => l.toLowerCase() === "self-hosted") && !set.some((l) => NON_LINUX_RUNNER_LABEL.test(l)));
|
|
38448
|
+
if (!linuxSets.length) continue;
|
|
38449
|
+
const stale = [...new Set(linuxSets.flat().filter((l) => !LIVE_SELF_HOSTED_LINUX_LABELS.has(l.toLowerCase())))];
|
|
38450
|
+
if (stale.length) {
|
|
38451
|
+
checks.push({
|
|
38452
|
+
ok: false,
|
|
38453
|
+
label: `self-hosted job requests only live runner labels (#9293): ${path2}:${id}`,
|
|
38454
|
+
detail: stale.map((l) => /^mmi-runner/i.test(l) ? `'${l}' is a host pin \u2014 route by class label, never hostname` : `'${l}' is carried by no live lane`).join("; "),
|
|
38455
|
+
remediation: `Use ubuntu-latest, or a live class tuple such as [self-hosted, linux, x64, mmi-live]. Live labels: ${[...LIVE_SELF_HOSTED_LINUX_LABELS].join(", ")} (gh-runner-runbook.md \xA7 Lane classes).`
|
|
38456
|
+
});
|
|
38457
|
+
}
|
|
38458
|
+
if (job.container !== void 0 || !Array.isArray(job.steps)) continue;
|
|
38459
|
+
for (const [index, step] of job.steps.entries()) {
|
|
38460
|
+
if (!plainRecord(step)) continue;
|
|
38461
|
+
const uses = typeof step.uses === "string" ? step.uses : "";
|
|
38462
|
+
if (NODE_SETUP_USE.test(uses)) break;
|
|
38463
|
+
const command = typeof step.run === "string" ? step.run : uses.includes("run-with-budget") && plainRecord(step.with) && typeof step.with.command === "string" ? step.with.command : "";
|
|
38464
|
+
if (!RUNS_NODE.test(command)) continue;
|
|
38465
|
+
checks.push({
|
|
38466
|
+
ok: true,
|
|
38467
|
+
severity: "warn",
|
|
38468
|
+
label: `self-hosted job sets up node before running it (#9293): ${path2}:${id}`,
|
|
38469
|
+
detail: `step ${index + 1}${typeof step.name === "string" ? ` ('${step.name}')` : ""} runs node/npm/npx before any actions/setup-node or runner-node-toolchain step \u2014 it gets whatever node the lane's PATH has`,
|
|
38470
|
+
remediation: "Add mutmutco/MMI-Hub/.github/actions/runner-node-toolchain (or actions/setup-node) before the first node command, or run the job on ubuntu-latest."
|
|
38471
|
+
});
|
|
38472
|
+
break;
|
|
38473
|
+
}
|
|
38474
|
+
}
|
|
38475
|
+
}
|
|
38476
|
+
return checks;
|
|
38477
|
+
}
|
|
38478
|
+
var RUNS_TESTS = /(?:^|[\s;&|(`])(?:vitest|jest|pytest|npm\s+(?:run\s+)?test|npm\s+t|npx\s+(?:vitest|jest)|node\s+--test|mmi-cli\s+tests\b|ci-jev-tests)(?=\s|$)/m;
|
|
38479
|
+
var JEV_ACTION = /(?:^|\/)\.github\/actions\/jev-failures@?([0-9a-fA-F]*)/;
|
|
38480
|
+
function auditJevOutcomes(files) {
|
|
38481
|
+
const checks = [];
|
|
38482
|
+
for (const { path: path2, body } of files) {
|
|
38483
|
+
let doc;
|
|
38484
|
+
try {
|
|
38485
|
+
doc = (0, import_yaml2.parse)(body);
|
|
38486
|
+
} catch {
|
|
38487
|
+
continue;
|
|
38488
|
+
}
|
|
38489
|
+
const jobs = plainRecord(doc) && plainRecord(doc.jobs) ? doc.jobs : {};
|
|
38490
|
+
for (const [id, job] of Object.entries(jobs)) {
|
|
38491
|
+
if (!plainRecord(job) || !Array.isArray(job.steps)) continue;
|
|
38492
|
+
const steps = job.steps.filter(plainRecord);
|
|
38493
|
+
const stepCommand = (s) => typeof s.run === "string" ? s.run : typeof s.uses === "string" && s.uses.includes("run-with-budget") && plainRecord(s.with) && typeof s.with.command === "string" ? s.with.command : "";
|
|
38494
|
+
const jev = steps.filter((s) => typeof s.uses === "string" && JEV_ACTION.test(s.uses));
|
|
38495
|
+
const reports = jev.some((s) => plainRecord(s.with) && s.with.mode === "outcomes" && /\balways\(\)/.test(String(s.if ?? "")));
|
|
38496
|
+
if (!reports && steps.some((s) => RUNS_TESTS.test(stepCommand(s)))) {
|
|
38497
|
+
checks.push({
|
|
38498
|
+
ok: true,
|
|
38499
|
+
severity: "warn",
|
|
38500
|
+
label: `test job reports outcomes to the Jev learner (#9295): ${path2}:${id}`,
|
|
38501
|
+
detail: "this job runs tests but has no jev-failures step with mode: outcomes and if: always(), so the Hub learns nothing from it and cannot order or skip its tests",
|
|
38502
|
+
remediation: `Add after the test step: uses: mutmutco/MMI-Hub/.github/actions/jev-failures@${BLESSED_JEV_FAILURES_SHA} with mode: outcomes and if: always() - see skills/bootstrap/seeds/gate.template.yml`
|
|
38503
|
+
});
|
|
38504
|
+
}
|
|
38505
|
+
for (const s of jev) {
|
|
38506
|
+
const sha = JEV_ACTION.exec(String(s.uses))?.[1]?.toLowerCase();
|
|
38507
|
+
if (!sha || sha === BLESSED_JEV_FAILURES_SHA) continue;
|
|
38508
|
+
checks.push({
|
|
38509
|
+
ok: true,
|
|
38510
|
+
severity: "warn",
|
|
38511
|
+
label: `jev-failures pin is the blessed SHA (#9295): ${path2}:${id}`,
|
|
38512
|
+
detail: `pins ${sha.slice(0, 7)}, blessed is ${BLESSED_JEV_FAILURES_SHA.slice(0, 7)}`,
|
|
38513
|
+
remediation: `Re-pin to mutmutco/MMI-Hub/.github/actions/jev-failures@${BLESSED_JEV_FAILURES_SHA}`
|
|
38514
|
+
});
|
|
38515
|
+
}
|
|
38516
|
+
}
|
|
38517
|
+
}
|
|
38518
|
+
return checks;
|
|
38519
|
+
}
|
|
38360
38520
|
var PENDING_LANDING_LABEL = "pending PRs landing (#8783)";
|
|
38361
38521
|
var PENDING_LANDING_LIST_CAP = 50;
|
|
38362
38522
|
var PENDING_LANDING_STALL_MS = 15 * 60 * 1e3;
|
|
@@ -39150,6 +39310,8 @@ async function auditRepoCi(repo, callerDeps) {
|
|
|
39150
39310
|
} catch (e) {
|
|
39151
39311
|
checks.push({ ok: false, label: "runner workflow source is readable (#8958)", detail: e instanceof WorkflowSourceError ? e.message : "workflow source: read-failed" });
|
|
39152
39312
|
}
|
|
39313
|
+
checks.push(...auditSelfHostedRunnerHygiene(workflows));
|
|
39314
|
+
checks.push(...auditJevOutcomes(workflows));
|
|
39153
39315
|
if (repoClass !== "hub") checks.push(...await auditSharedActionPins(workflows, deps));
|
|
39154
39316
|
} else {
|
|
39155
39317
|
checks.push({ ok: false, label: "runner workflow source is readable (#8958)", detail: "workflow source inventory unreadable" });
|
|
@@ -39845,7 +40007,7 @@ var PRIMARY_GROUPS = [
|
|
|
39845
40007
|
["Setup and support", ["bootstrap", "secrets", "docs", "tests", "spawn", "dist"]],
|
|
39846
40008
|
["Coordinate and improve", ["wave", "report", "skill-lesson", "closure-rate"]]
|
|
39847
40009
|
];
|
|
39848
|
-
var OPERATIONAL_TOP_LEVEL = /* @__PURE__ */ new Set(["oauth", "org", "runtime", "plugin", "packages", "github", "archive-prune", "intercom"]);
|
|
40010
|
+
var OPERATIONAL_TOP_LEVEL = /* @__PURE__ */ new Set(["oauth", "org", "runtime", "plugin", "packages", "github", "archive-prune", "intercom", "jev"]);
|
|
39849
40011
|
var CAMPAIGN_ORCHESTRATOR_TOP_LEVEL = /* @__PURE__ */ new Set(["pickup", "read"]);
|
|
39850
40012
|
var SUPPORT_PRIMARY = /* @__PURE__ */ new Set(["doctor", "whoami", "commands", "explain", "docs", "tests", "spawn", "dist", "wave", "report", "skill-lesson", "closure-rate"]);
|
|
39851
40013
|
var TOP_LEVEL_ORDER = /* @__PURE__ */ new Map();
|
|
@@ -39899,6 +40061,8 @@ var COMMAND_OWNERSHIP = {
|
|
|
39899
40061
|
train: { module_owner: "cli/src/train-commands.ts", consumer: "release-operator" },
|
|
39900
40062
|
suite: { module_owner: "cli/src/suite-commands.ts", consumer: "release-operator" },
|
|
39901
40063
|
// #7264
|
|
40064
|
+
jev: { module_owner: "cli/src/jev-status.ts", consumer: "release-operator" },
|
|
40065
|
+
// #9295
|
|
39902
40066
|
packages: { module_owner: "cli/src/packages-adopt-export.ts", consumer: "agent-workflow" },
|
|
39903
40067
|
// #7833
|
|
39904
40068
|
bootstrap: { module_owner: "cli/src/bootstrap-commands.ts", consumer: "repo-bootstrap" },
|
|
@@ -61027,6 +61191,52 @@ function suiteStatusDeps(github, registry2) {
|
|
|
61027
61191
|
};
|
|
61028
61192
|
}
|
|
61029
61193
|
|
|
61194
|
+
// src/jev-status.ts
|
|
61195
|
+
init_cli_shared();
|
|
61196
|
+
init_fetch_retry();
|
|
61197
|
+
init_client_version();
|
|
61198
|
+
var JEV_NOT_DEPLOYED = "learner status not deployed yet (the Hub has no /ci/jev/status route)";
|
|
61199
|
+
async function readJevStatus(deps, repo) {
|
|
61200
|
+
if (!deps.baseUrl) return { ok: false, reason: "unavailable", detail: "no Hub API URL" };
|
|
61201
|
+
const token = await deps.token().catch(() => void 0);
|
|
61202
|
+
if (!token) return { ok: false, reason: "unavailable", detail: "no Hub session token (run `gh auth login`)" };
|
|
61203
|
+
try {
|
|
61204
|
+
const res = await fetchWithRetry(deps.fetch ?? fetch, `${deps.baseUrl.replace(/\/$/, "")}/ci/jev/status`, {
|
|
61205
|
+
method: "GET",
|
|
61206
|
+
headers: { ...clientVersionHeaders(), Authorization: `Bearer ${token}` }
|
|
61207
|
+
}, { attempts: 2, timeoutMs: deps.timeoutMs ?? 8e3, sleep: deps.retrySleep });
|
|
61208
|
+
if (res.status === 404) return { ok: false, reason: "not-deployed", detail: JEV_NOT_DEPLOYED };
|
|
61209
|
+
if (!res.ok) return { ok: false, reason: "unavailable", detail: `Hub answered HTTP ${res.status}` };
|
|
61210
|
+
const body = await res.json().catch(() => null);
|
|
61211
|
+
const repos = body?.repositories;
|
|
61212
|
+
if (!Array.isArray(repos)) return { ok: false, reason: "unavailable", detail: "Hub answer was not a repo list" };
|
|
61213
|
+
return { ok: true, repos: repo ? repos.filter((r) => r.repository.toLowerCase() === repo.toLowerCase()) : repos };
|
|
61214
|
+
} catch (e) {
|
|
61215
|
+
return { ok: false, reason: "unavailable", detail: e.message };
|
|
61216
|
+
}
|
|
61217
|
+
}
|
|
61218
|
+
var pct = (n) => `${Math.round(n * 1e3) / 10}%`;
|
|
61219
|
+
function formatJevStatus(read) {
|
|
61220
|
+
if (!read.ok) return read.reason === "not-deployed" ? `Jev: ${read.detail}.` : `Jev: learner status unavailable - ${read.detail}.`;
|
|
61221
|
+
if (!read.repos.length) return "Jev: the learner has not learned from any repo yet.";
|
|
61222
|
+
return read.repos.map((r) => {
|
|
61223
|
+
const gain = r.medianFirstFailureGain == null ? "first-failure gain not measured yet" : `first failure ${pct(r.medianFirstFailureGain)} earlier (median)`;
|
|
61224
|
+
const shadow = r.shadow.active ? `skipping on PRs is ON (miss rate ${pct(r.shadow.missRate)} over ${r.shadow.runs} shadow runs)` : `skipping on PRs is OFF (${r.shadow.runs} shadow runs, miss rate ${pct(r.shadow.missRate)}; needs 30 runs at 1% or less)`;
|
|
61225
|
+
return `${r.repository}: learned from ${r.runsLearned} runs, ${r.filesTracked} test files; ${shadow}; ${r.prSkipShare30d == null ? "no PR runs in 30 days" : `${pct(r.prSkipShare30d)} of PR tests skipped in 30 days`}; ${gain}; updated ${r.updatedAt ? new Date(r.updatedAt).toISOString() : "never"}`;
|
|
61226
|
+
}).join("\n");
|
|
61227
|
+
}
|
|
61228
|
+
function registerJevCommands(program3) {
|
|
61229
|
+
const jev = program3.command("jev").description("the Hub-maintained Jev test-ordering learner, read-only (#9295)");
|
|
61230
|
+
jev.command("status").description("per repo: runs learned, whether PR skipping is on, miss rate, skip share, first-failure gain, last update").option("--repo <owner/repo>", "one repo only").option("--json", "structured output").action(async (o) => {
|
|
61231
|
+
try {
|
|
61232
|
+
const read = await readJevStatus(registryClientDeps(await loadConfig()), o.repo);
|
|
61233
|
+
console.log(o.json ? JSON.stringify(read, null, 2) : formatJevStatus(read));
|
|
61234
|
+
} catch (e) {
|
|
61235
|
+
fail(`jev status: ${e.message}`);
|
|
61236
|
+
}
|
|
61237
|
+
});
|
|
61238
|
+
}
|
|
61239
|
+
|
|
61030
61240
|
// src/packages-adopt-export.ts
|
|
61031
61241
|
var import_node_child_process19 = require("node:child_process");
|
|
61032
61242
|
var import_node_fs53 = require("node:fs");
|
|
@@ -69452,6 +69662,7 @@ registerDeployCommands(program2);
|
|
|
69452
69662
|
registerSuiteCommands(program2);
|
|
69453
69663
|
registerIntercomGuestCommands(program2);
|
|
69454
69664
|
registerPackagesCommands(program2);
|
|
69665
|
+
registerJevCommands(program2);
|
|
69455
69666
|
registerDiscoveryCommands(program2);
|
|
69456
69667
|
registerExplainCommand(program2);
|
|
69457
69668
|
registerPrLifecycleCommands(program2);
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
|
@@ -207,12 +207,24 @@ jobs:
|
|
|
207
207
|
run: |
|
|
208
208
|
python3 --version || { echo "::error title=CI runner toolchain::RUNNER NOT PROVISIONED — python3 not on PATH after setup-python. This is the runner, not your diff; no install or test ran. Re-run the job; if it persists the mmi-runner python toolchain needs attention (docs/Guides/gh-runner-runbook.md in MMI-Hub)."; exit 1; }
|
|
209
209
|
- run: {{GATE_INSTALL_CMD}}
|
|
210
|
-
if: ${{ steps.development-gate.outputs.reuse != 'true' }}
|
|
210
|
+
if: ${{ steps.development-gate.outputs.reuse != 'true' }}{{GATE_JEV_FETCH_YAML}}
|
|
211
211
|
# #3178: the check runs under the org wall-clock budget — a hung suite dies at the ceiling instead
|
|
212
212
|
# of squatting a runner lane for GitHub's 6h default. ci-audit + the release train enforce this step.
|
|
213
|
+
# #9293: PRs fail fast, merge_group and tags run everything. pytest reads PYTEST_ADDOPTS natively; a
|
|
214
|
+
# Node check script opts in with MMI_FAIL_FAST (`vitest run ${MMI_FAIL_FAST:+--bail=1}`, or
|
|
215
|
+
# `--fail-fast` on the org node runner). #9295: on PRs the Jev plan step exports JEV_PYTEST_ARGS
|
|
216
|
+
# (`--ignore=<path>` per skipped file, folded into PYTEST_ADDOPTS) and JEV_VITEST_ARGS; a Node check script
|
|
217
|
+
# opts in to the skips with `vitest run ${MMI_FAIL_FAST:+--bail=1} $MMI_JEV_SKIP_ARGS`. The merge queue
|
|
218
|
+
# never skips. The Jev fetch/plan/outcomes steps around this one (#9295) render
|
|
219
|
+
# only once bootstrap carries a blessed jev-failures pin; they are continue-on-error and never fail it. The
|
|
220
|
+
# outcomes step runs under always() (pass or fail).
|
|
213
221
|
- uses: mutmutco/MMI-Hub/.github/actions/run-with-budget@{{GATE_BUDGET_SHA}}
|
|
214
222
|
if: ${{ steps.development-gate.outputs.reuse != 'true' }}
|
|
223
|
+
env:
|
|
224
|
+
MMI_FAIL_FAST: ${{ github.event_name == 'pull_request' && '1' || '' }}
|
|
225
|
+
PYTEST_ADDOPTS: ${{ github.event_name == 'pull_request' && format('--maxfail=1 {0}', env.JEV_PYTEST_ARGS) || '' }}
|
|
226
|
+
MMI_JEV_SKIP_ARGS: ${{ github.event_name == 'pull_request' && env.JEV_VITEST_ARGS || '' }}
|
|
215
227
|
with:
|
|
216
228
|
command: {{GATE_CMD}}
|
|
217
229
|
max-seconds: {{GATE_MAX_SECONDS}}
|
|
218
|
-
working-directory: {{GATE_WORKDIR}}{{GATE_EXTRA_STEPS_YAML}}
|
|
230
|
+
working-directory: {{GATE_WORKDIR}}{{GATE_EXTRA_STEPS_YAML}}{{GATE_JEV_REPORT_YAML}}
|
|
@@ -78,10 +78,15 @@ jobs:
|
|
|
78
78
|
# Suite only: generic product gates must not load or require design-agent content.
|
|
79
79
|
- name: Check kit agent-file drift
|
|
80
80
|
if: ${{ steps.development-gate.outputs.reuse != 'true' }}
|
|
81
|
-
uses: mutmutco/MMI-Hub/.github/actions/check-kit-agent-files@{{KIT_AGENT_FILES_SHA}} # #9161: own pin — this action postdates the shared runner pin
|
|
81
|
+
uses: mutmutco/MMI-Hub/.github/actions/check-kit-agent-files@{{KIT_AGENT_FILES_SHA}} # #9161: own pin — this action postdates the shared runner pin{{GATE_JEV_FETCH_YAML}}
|
|
82
|
+
# #9293: PRs fail fast (the module check reads MMI_FAIL_FAST); merge_group and tags run everything.
|
|
83
|
+
# #9295: a module check opts in to Jev PR-only skips with `vitest run $MMI_JEV_SKIP_ARGS` (set on PRs only).
|
|
82
84
|
- uses: mutmutco/MMI-Hub/.github/actions/run-with-budget@{{GATE_BUDGET_SHA}}
|
|
83
85
|
if: ${{ steps.development-gate.outputs.reuse != 'true' }}
|
|
86
|
+
env:
|
|
87
|
+
MMI_FAIL_FAST: ${{ github.event_name == 'pull_request' && '1' || '' }}
|
|
88
|
+
MMI_JEV_SKIP_ARGS: ${{ github.event_name == 'pull_request' && env.JEV_VITEST_ARGS || '' }}
|
|
84
89
|
with:
|
|
85
90
|
command: npm run typecheck && npm run build && npm --prefix module run check
|
|
86
91
|
max-seconds: {{GATE_MAX_SECONDS}}
|
|
87
|
-
working-directory: .
|
|
92
|
+
working-directory: .{{GATE_JEV_REPORT_YAML}}
|