@mutmutco/cli 4.6.10 → 4.6.11

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.
Files changed (2) hide show
  1. package/dist/main.cjs +49 -18
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -13912,6 +13912,15 @@ function issueCommentAppendOnlyRecovery(flag, canonicalPath, argv) {
13912
13912
  corrected
13913
13913
  };
13914
13914
  }
13915
+ function trainPlanRedundantFlagRecovery(flag, canonicalPath, argv) {
13916
+ if (canonicalPath !== "devops release" && canonicalPath !== "devops rcand") return void 0;
13917
+ if (flag !== "--plan" && !flag.startsWith("--plan=")) return void 0;
13918
+ const kept = argv.filter((tok) => tok !== "--plan" && !tok.startsWith("--plan="));
13919
+ return {
13920
+ message: `unknown option '--plan' \u2014 \`${canonicalPath}\` runs the dry-run plan by default when \`--apply\` is absent; planning needs no flag`,
13921
+ corrected: `mmi-cli ${kept.join(" ")}`
13922
+ };
13923
+ }
13915
13924
  var BOARD_CLAIM_OWN_FLAGS = ["--repo", "--for", "--force", "--check", "--allow-partial", "--json"];
13916
13925
  function splitInlineSelectors(argv, flags) {
13917
13926
  const out = [];
@@ -25434,6 +25443,7 @@ var BLESSED_RUN_WITH_BUDGET_SHA = "5ce541add569e54e7ca96de67a768577d3d604e4";
25434
25443
  var BLESSED_RUNNER_GATE_SHA = "a19e9392e5ad9b0675f02e4304d68dd933fad60f";
25435
25444
  var BLESSED_KIT_AGENT_FILES_SHA = "e976df208d891b215844386c1cac0f161946b6fa";
25436
25445
  var BLESSED_JEV_FAILURES_SHA = "d5278c6133318b33727483ddfdfddc8f841e3ef6";
25446
+ var BLESSED_RUNNER_CHOICE_SHA = "";
25437
25447
  var BLESSED_RUNBOOK_GUARD_SHA = "e661e0aedc0e58b73c738bf6cdfeac65e5914584";
25438
25448
  var REMOTE_USE = /^mutmutco\/MMI-Hub\/\.github\/actions\/run-with-budget@(\S+)$/;
25439
25449
  var LOCAL_USE = "./.github/actions/run-with-budget";
@@ -27595,10 +27605,10 @@ var rollout_plan_default = {
27595
27605
  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)."
27596
27606
  },
27597
27607
  baseline: {
27598
- version: "4.6.10",
27599
- tag: "v4.6.10",
27600
- commit: "a4bbe43232e9",
27601
- npm: "@mutmutco/cli@4.6.10"
27608
+ version: "4.6.11",
27609
+ tag: "v4.6.11",
27610
+ commit: "cb31a94c8972",
27611
+ npm: "@mutmutco/cli@4.6.11"
27602
27612
  },
27603
27613
  exitCriterion: "fleet-n-of-n",
27604
27614
  hubOnlyShortcut: "forbidden",
@@ -27615,14 +27625,14 @@ var rollout_plan_default = {
27615
27625
  repo: "mutmutco/mmi-hub",
27616
27626
  role: "canary",
27617
27627
  schedule: "train",
27618
- v3Target: "v4.6.10"
27628
+ v3Target: "v4.6.11"
27619
27629
  }
27620
27630
  ],
27621
27631
  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.",
27622
27632
  rollback: {
27623
27633
  independent: true,
27624
- mechanism: "npm dist-tag latest -> 4.6.10 and redeploy the Hub Lambda from tag v4.6.10 (a4bbe43232e9); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
27625
- v3Target: "v4.6.10 (@mutmutco/cli@4.6.10, tag commit a4bbe43232e9 \u2014 last known-good release carrying the repo-index v4-only contract)"
27634
+ mechanism: "npm dist-tag latest -> 4.6.11 and redeploy the Hub Lambda from tag v4.6.11 (cb31a94c8972); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
27635
+ v3Target: "v4.6.11 (@mutmutco/cli@4.6.11, tag commit cb31a94c8972 \u2014 last known-good release carrying the repo-index v4-only contract)"
27626
27636
  }
27627
27637
  },
27628
27638
  {
@@ -32195,17 +32205,30 @@ function classifyRunnerCost(selector) {
32195
32205
  }
32196
32206
  var STANDARD_HOSTED_ALLOWLIST = [
32197
32207
  ["mutmutco/MMI-Hub", ".github/workflows/launcher-build.yml", "build", "windows-latest"],
32198
- ["mutmutco/Jerv-JervCode", ".github/workflows/release-archives.yml", "release-platform-arm64", "windows-11-arm"],
32199
- // #9571 (MM-Work#8894 chooser): owned mmi-heavy first, included ubuntu-latest only on a deep backlog.
32200
- ["mutmutco/MMI-Hub", ".github/workflows/gate.yml", "cli-part", "hosted-spill"]
32208
+ ["mutmutco/Jerv-JervCode", ".github/workflows/release-archives.yml", "release-platform-arm64", "windows-11-arm"]
32201
32209
  ];
32202
- var HOSTED_SPILL_RE = /^\$\{\{\s*(?:matrix\.[\w-]+\s*==\s*'[\w-]+'\s*&&\s*'([^']+)'\s*\|\|\s*)?fromJSON\(needs\.[\w-]+\.outputs\.heavy_runs_on\s*\|\|\s*('[^']+')\)\s*\}\}$/;
32210
+ var HOSTED_SPILL_RE = /^\$\{\{\s*(?:matrix\.[\w-]+\s*==\s*'[\w-]+'\s*&&\s*'([^']+)'\s*\|\|\s*)?fromJSON\(needs\.([\w-]+)\.outputs\.(\w+_runs_on)\s*\|\|\s*('[^']+')\)\s*\}\}$/;
32211
+ var RUNNER_CHOICE_ACTION = "mutmutco/MMI-Hub/.github/actions/runner-choice";
32212
+ function runnerChoiceProduces(job, decider, output, source) {
32213
+ const needs = job.needs;
32214
+ if (!(needs === decider || Array.isArray(needs) && needs.includes(decider))) return false;
32215
+ const producer = source.jobs.get(decider);
32216
+ if (!record(producer) || !record(producer.outputs) || !Array.isArray(producer.steps)) return false;
32217
+ const step = /^\$\{\{\s*steps\.([\w-]+)\.outputs\.runs-on\s*\}\}$/.exec(String(producer.outputs[output] ?? ""))?.[1];
32218
+ const steps = producer.steps.filter((s) => record(s) && s.id === step);
32219
+ if (steps.length !== 1 || !record(steps[0])) return false;
32220
+ const { uses } = steps[0], inputs = steps[0].with ?? {};
32221
+ const pinned = /^[0-9a-f]{40}$/.test(source.blessedSha) && uses === `${RUNNER_CHOICE_ACTION}@${source.blessedSha}`;
32222
+ if (!pinned && !(source.repo === "mutmutco/MMI-Hub" && uses === "./.github/actions/runner-choice")) return false;
32223
+ const hosted = record(inputs) ? inputs.hosted ?? "ubuntu-latest" : void 0;
32224
+ return typeof hosted === "string" && STANDARD_HOSTED_LABEL_RE.test(hosted);
32225
+ }
32203
32226
  function standardHostedLabelFor(repo, path2, jobId) {
32204
32227
  if (repo === "mutmutco/Jerv-Hub") return ["ubuntu-latest", "windows-latest", "macos-14"];
32205
32228
  return STANDARD_HOSTED_ALLOWLIST.find(([r, p, j]) => r === repo && p === path2 && j === jobId)?.[3];
32206
32229
  }
32207
32230
  var record = (value) => Boolean(value && typeof value === "object" && !Array.isArray(value));
32208
- function classifyJobRunnerCost(job, allowance2) {
32231
+ function classifyJobRunnerCost(job, allowance2, source) {
32209
32232
  if (!record(job) || !Object.hasOwn(job, "runs-on")) return "unknown";
32210
32233
  const selector = job["runs-on"];
32211
32234
  const raw = typeof selector === "string" ? selector.trim() : Array.isArray(selector) && selector.length && selector.every((label) => typeof label === "string") ? JSON.stringify(selector) : "";
@@ -32214,8 +32237,8 @@ function classifyJobRunnerCost(job, allowance2) {
32214
32237
  if (approved(raw) || allowance2 === "windows-11-arm" && raw === allowance2) return "standard-hosted";
32215
32238
  const fallback = /^\$\{\{\s*vars\.MMI_RUNNER_FALLBACK\s*==\s*'hosted'\s*&&\s*'([^']+)'\s*\|\|\s*(fromJSON\('[^']+'\))\s*\}\}$/.exec(raw);
32216
32239
  if (fallback && approved(fallback[1]) && classifyRunnerCost("${{ " + fallback[2] + " }}") === "self-hosted") return "standard-hosted";
32217
- const spill = allowance2 === "hosted-spill" ? HOSTED_SPILL_RE.exec(raw) : null;
32218
- if (spill) return (!spill[1] || spill[1] === "ubuntu-latest") && classifyRunnerCost(`\${{ fromJSON(${spill[2]}) }}`) === "self-hosted" ? "standard-hosted" : "unknown";
32240
+ const spill = HOSTED_SPILL_RE.exec(raw);
32241
+ if (spill && source && (!spill[1] || STANDARD_HOSTED_LABEL_RE.test(spill[1])) && classifyRunnerCost(`\${{ fromJSON(${spill[4]}) }}`) === "self-hosted" && runnerChoiceProduces(job, spill[2], spill[3], source)) return "standard-hosted";
32219
32242
  const direct = classifyRunnerCost(raw);
32220
32243
  const matrix = /^\$\{\{\s*matrix\.([\w-]+)(?:\.([\w-]+))?\s*\}\}$/.exec(raw);
32221
32244
  if (!matrix || direct === "hosted") return direct;
@@ -32270,16 +32293,24 @@ function parseRunnerJobs(source) {
32270
32293
  for (const { key, value: job } of jobs.items) {
32271
32294
  if (!(0, import_yaml.isScalar)(key) || typeof key.value !== "string" || !literalMap(job)) return void 0;
32272
32295
  const projected = /* @__PURE__ */ Object.create(null);
32273
- for (const field of ["runs-on", "uses", "strategy"]) {
32296
+ for (const field of ["runs-on", "uses", "strategy", "needs", "outputs", "steps"]) {
32274
32297
  if (!job.has(field)) continue;
32298
+ const optional = field === "needs" || field === "outputs" || field === "steps";
32275
32299
  const value = job.get(field, true);
32276
- if (value !== null && !(0, import_yaml.isNode)(value)) return void 0;
32300
+ if (value !== null && !(0, import_yaml.isNode)(value)) {
32301
+ if (optional) continue;
32302
+ return void 0;
32303
+ }
32277
32304
  (0, import_yaml.visit)(value, (_key, node) => {
32278
32305
  if (!literal(node) || (0, import_yaml.isPair)(node) && (0, import_yaml.isScalar)(node.key) && node.key.value === "<<") {
32279
32306
  invalid = true;
32280
32307
  return import_yaml.visit.BREAK;
32281
32308
  }
32282
32309
  });
32310
+ if (invalid && optional) {
32311
+ invalid = false;
32312
+ continue;
32313
+ }
32283
32314
  if (invalid) return void 0;
32284
32315
  projected[field] = value === null ? null : value.toJS(doc, { maxAliasCount: 0 });
32285
32316
  }
@@ -32416,7 +32447,7 @@ function classifyRunnerWorkflows(files) {
32416
32447
  const uses = hasCallee && typeof job.uses === "string" && !Object.hasOwn(job, "runs-on") ? job.uses : void 0;
32417
32448
  const target = uses && resolveCallee(file, uses);
32418
32449
  if (target && known.has(locationOf(target)) && resolved(file, /* @__PURE__ */ new Set())) return [];
32419
- const cost = hasCallee ? "unknown" : classifyJobRunnerCost(job, standardHostedLabelFor(file.repo, file.path, id));
32450
+ const cost = hasCallee ? "unknown" : classifyJobRunnerCost(job, standardHostedLabelFor(file.repo, file.path, id), { repo: file.repo, jobs, blessedSha: BLESSED_RUNNER_CHOICE_SHA });
32420
32451
  return [{ repo: file.repo, path: file.path, job: id, cost, callee: hasCallee }];
32421
32452
  });
32422
32453
  });
@@ -70107,7 +70138,7 @@ function envelopeAwareWriteErr(str2) {
70107
70138
  const invoked = resolveCommandFromArgv(program2, argv);
70108
70139
  const invokedPath = invoked ? canonicalPathFor(commandPath3(invoked)) ?? commandPath3(invoked) : void 0;
70109
70140
  const canonicalArgv = canonicalArgvFor(argv);
70110
- const claimStatus = invoked ? boardClaimStatusFlagRecovery(flag, invokedPath, canonicalArgv) ?? issueCommentAppendOnlyRecovery(flag, invokedPath, canonicalArgv) : void 0;
70141
+ const claimStatus = invoked ? boardClaimStatusFlagRecovery(flag, invokedPath, canonicalArgv) ?? issueCommentAppendOnlyRecovery(flag, invokedPath, canonicalArgv) ?? trainPlanRedundantFlagRecovery(flag, invokedPath, canonicalArgv) : void 0;
70111
70142
  if (claimStatus) {
70112
70143
  if (argvWantsJson3()) {
70113
70144
  process.stderr.write(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.6.10",
3
+ "version": "4.6.11",
4
4
  "description": "MMI Future CLI — the org dev toolbox and shared cross-IDE engine for every registry-declared MMI coding surface.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",