@mutmutco/codex-plugin 4.5.93 → 4.5.94

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mmi",
3
- "version": "4.5.93",
3
+ "version": "4.5.94",
4
4
  "mmiCompat": "4.x",
5
5
  "description": "MMI workflow skills and org gates delivery.",
6
6
  "author": {
package/cli/dist/main.cjs CHANGED
@@ -6347,6 +6347,9 @@ async function pollRestPrChecks(prNumber, repo, gh2 = defaultGhApi, requiredCont
6347
6347
  const { relevant } = partitionByRequired(entries, requiredContexts);
6348
6348
  return derivePollState(relevant);
6349
6349
  }
6350
+ async function pollRestCommitChecks(sha, repo, gh2 = defaultGhApi) {
6351
+ return derivePollState(partitionByRequired(await fetchHeadCheckEntries(sha, repo, gh2), null).relevant);
6352
+ }
6350
6353
  async function pollRestPrMergeable(prNumber, repo, gh2 = defaultGhApi) {
6351
6354
  try {
6352
6355
  return (await fetchRestPrSnapshot(prNumber, repo, gh2)).mergeable;
@@ -17252,10 +17255,10 @@ var rollout_plan_default = {
17252
17255
  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)."
17253
17256
  },
17254
17257
  baseline: {
17255
- version: "4.5.93",
17256
- tag: "v4.5.93",
17257
- commit: "f0c54c59980d",
17258
- npm: "@mutmutco/cli@4.5.93"
17258
+ version: "4.5.94",
17259
+ tag: "v4.5.94",
17260
+ commit: "f01a89cb9110",
17261
+ npm: "@mutmutco/cli@4.5.94"
17259
17262
  },
17260
17263
  exitCriterion: "fleet-n-of-n",
17261
17264
  hubOnlyShortcut: "forbidden",
@@ -17272,14 +17275,14 @@ var rollout_plan_default = {
17272
17275
  repo: "mutmutco/mmi-hub",
17273
17276
  role: "canary",
17274
17277
  schedule: "train",
17275
- v3Target: "v4.5.93"
17278
+ v3Target: "v4.5.94"
17276
17279
  }
17277
17280
  ],
17278
17281
  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.",
17279
17282
  rollback: {
17280
17283
  independent: true,
17281
- mechanism: "npm dist-tag latest -> 4.5.93 and redeploy the Hub Lambda from tag v4.5.93 (f0c54c59980d); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
17282
- v3Target: "v4.5.93 (@mutmutco/cli@4.5.93, tag commit f0c54c59980d \u2014 last known-good release carrying the repo-index v4-only contract)"
17284
+ mechanism: "npm dist-tag latest -> 4.5.94 and redeploy the Hub Lambda from tag v4.5.94 (f01a89cb9110); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
17285
+ v3Target: "v4.5.94 (@mutmutco/cli@4.5.94, tag commit f01a89cb9110 \u2014 last known-good release carrying the repo-index v4-only contract)"
17283
17286
  }
17284
17287
  },
17285
17288
  {
@@ -45202,6 +45205,30 @@ ${list}`);
45202
45205
  if (wait.checksUrl) lines2.push(`${context}: PR checks: ${wait.checksUrl}`);
45203
45206
  return lines2;
45204
45207
  }
45208
+ function printChecksWaitResult(label, result, json) {
45209
+ if (json) printLine(JSON.stringify(result));
45210
+ else if (result.status === "conflicting") {
45211
+ printLine(`${label}: conflicting \u2014 ${result.reason}`);
45212
+ } else if (result.status === "timeout") {
45213
+ const stuckQueuing = /no-checks-reported/i.test(result.detail ?? "");
45214
+ printLine(
45215
+ `${label}: timeout \u2014 waited ${Math.round((result.waitedMs ?? 0) / 6e4)}m, last state: ${result.detail ?? "pending"}. No check failed; re-run to keep waiting, or pass --timeout <minutes>.` + (stuckQueuing ? " Tip: check-runs never appeared \u2014 if `gh api repos/<owner>/<repo>/actions/runs?head_sha=<sha>` shows total_count=0, see docs/Guides/gh-runner-runbook.md \xA7 Zero workflow runs; otherwise mmi-live may be saturated or Actions may be failing before checkout (docs/Guides/gh-runner-runbook.md)." : "")
45216
+ );
45217
+ } else if (result.status === "rate-limited") {
45218
+ printLine(`${label}: rate-limited \u2014 ${result.reason ?? "REST pool below floor"}. No check failed; re-run after the pool resets.`);
45219
+ } else if (result.detail === "runner-infra") {
45220
+ printLine(`${label}: failure (runner infrastructure, NOT a test failure) \u2014 ${result.reason}`);
45221
+ } else if (result.detail === "stale-head") {
45222
+ printLine(`${label}: failure (stale PR head, NOT a test failure) \u2014 ${result.reason}`);
45223
+ } else if (result.detail === "zero-runs") {
45224
+ printLine(`${label}: failure (zero workflow runs delivered, NOT pending checks) \u2014 ${result.reason}`);
45225
+ } else {
45226
+ printLine(`${label}: ${result.status}${result.reason ? ` \u2014 ${result.reason}` : ""}${result.detail ? ` (${result.detail})` : ""}`);
45227
+ for (const line of failedChecksReceiptLines(label, result)) printLine(line);
45228
+ }
45229
+ if (result.status === "failure" || result.status === "conflicting") process.exitCode = 1;
45230
+ if (result.status === "timeout" || result.status === "rate-limited") process.exitCode = PR_CHECKS_TIMEOUT_EXIT_CODE;
45231
+ }
45205
45232
  async function waitLoopHeadWorkflowRunCount(label, prNumber, repo) {
45206
45233
  let snapshot;
45207
45234
  try {
@@ -45267,28 +45294,7 @@ ${list}`);
45267
45294
  // an agent harness kills it on its own (shorter) deadline before the verdict ever prints (#2940).
45268
45295
  progress: ({ state, elapsedMs, remainingMs }) => console.warn(`pr checks-wait: ${state} \u2014 ${Math.round(elapsedMs / 1e3)}s elapsed, ${Math.round(remainingMs / 6e4)}m left`)
45269
45296
  });
45270
- if (o.json) printLine(JSON.stringify(result));
45271
- else if (result.status === "conflicting") {
45272
- printLine(`pr checks-wait: conflicting \u2014 ${result.reason}`);
45273
- } else if (result.status === "timeout") {
45274
- const stuckQueuing = /no-checks-reported/i.test(result.detail ?? "");
45275
- printLine(
45276
- `pr checks-wait: timeout \u2014 waited ${Math.round((result.waitedMs ?? 0) / 6e4)}m, last state: ${result.detail ?? "pending"}. No check failed; re-run to keep waiting, or pass --timeout <minutes>.` + (stuckQueuing ? " Tip: check-runs never appeared \u2014 if `gh api repos/<owner>/<repo>/actions/runs?head_sha=<sha>` shows total_count=0, see docs/Guides/gh-runner-runbook.md \xA7 Zero workflow runs; otherwise mmi-live may be saturated or Actions may be failing before checkout (docs/Guides/gh-runner-runbook.md)." : "")
45277
- );
45278
- } else if (result.status === "rate-limited") {
45279
- printLine(`pr checks-wait: rate-limited \u2014 ${result.reason ?? "REST pool below floor"}. No check failed; re-run after the pool resets.`);
45280
- } else if (result.detail === "runner-infra") {
45281
- printLine(`pr checks-wait: failure (runner infrastructure, NOT a test failure) \u2014 ${result.reason}`);
45282
- } else if (result.detail === "stale-head") {
45283
- printLine(`pr checks-wait: failure (stale PR head, NOT a test failure) \u2014 ${result.reason}`);
45284
- } else if (result.detail === "zero-runs") {
45285
- printLine(`pr checks-wait: failure (zero workflow runs delivered, NOT pending checks) \u2014 ${result.reason}`);
45286
- } else {
45287
- printLine(`pr checks-wait: ${result.status}${result.reason ? ` \u2014 ${result.reason}` : ""}${result.detail ? ` (${result.detail})` : ""}`);
45288
- for (const line of failedChecksReceiptLines("pr checks-wait", result)) printLine(line);
45289
- }
45290
- if (result.status === "failure" || result.status === "conflicting") process.exitCode = 1;
45291
- if (result.status === "timeout" || result.status === "rate-limited") process.exitCode = PR_CHECKS_TIMEOUT_EXIT_CODE;
45297
+ printChecksWaitResult("pr checks-wait", result, o.json);
45292
45298
  });
45293
45299
  pr.command("review-check <number>").description("read-only trusted review verdict check for an exact PR head").requiredOption("--repo <owner/repo>", "target repository").requiredOption("--head <sha>", "exact expected head SHA").option("--json", "machine-readable output").action(async (number, o) => {
45294
45300
  const result = await checkPrReview(number, o.repo, o.head);
@@ -45950,6 +45956,37 @@ ${list}`);
45950
45956
  }
45951
45957
  process.exitCode = (partialCleanup.length ? 1 : void 0) ?? prMergeLocalCleanupExitCode(localCleanup) ?? postMergeReconExitCode({ boardAdvance, crossRepoFilingIssue }) ?? process.exitCode;
45952
45958
  });
45959
+ return (ci2) => {
45960
+ ci2.command("checks-wait").description(`bounded wait for ALL check runs and commit statuses on one commit SHA \u2014 replaces raw \`gh run watch\` / \`gh pr checks --watch\` loops, which charge a request per tick and exhausted the shared 5,000/hr token (#7843). REST-only polling with ETag-cached reads and a pool floor (#3024); fails early on a confirmed zero-workflow-runs commit (#5400). Default budget ${PR_CHECKS_TIMEOUT_MS / 6e4}m; --timeout raises it. Exit 1 = a check FAILED or GitHub delivered zero runs; exit ${PR_CHECKS_TIMEOUT_EXIT_CODE} = the wait window expired or the API pool ran dry (re-arm)`).requiredOption("--sha <sha>", "full 40-hex commit SHA to wait on").option("--json", "machine-readable output").option("--repo <owner/repo>", "target repo (defaults to the current repo)").option("--timeout <minutes>", `wait budget in minutes (default ${PR_CHECKS_TIMEOUT_MS / 6e4})`).action(async (o) => {
45961
+ if (!/^[0-9a-f]{40}$/i.test(o.sha)) return fail("ci checks-wait: --sha must be a full 40-hex commit SHA");
45962
+ let timeoutMs;
45963
+ if (o.timeout !== void 0) {
45964
+ const minutes = Number(o.timeout);
45965
+ if (!Number.isFinite(minutes) || minutes <= 0) return fail("ci checks-wait: --timeout must be a positive number of minutes");
45966
+ timeoutMs = Math.round(minutes * 6e4);
45967
+ }
45968
+ const repo = await requireRepo(o.repo);
45969
+ const sha = o.sha.toLowerCase();
45970
+ const result = await waitForPrChecks({
45971
+ resolvePolicy: () => resolveMergeCiPolicyForCheckout(o.repo),
45972
+ pollChecks: () => pollRestCommitChecks(sha, repo),
45973
+ pollRateLimit: () => waitLoopCorePool("ci checks-wait"),
45974
+ checksUrl: `https://github.com/${repo}/commit/${sha}/checks`,
45975
+ checksDiagnosticCommand: `gh api repos/${repo}/commits/${sha}/check-runs`,
45976
+ pollHeadWorkflowRunCount: async () => {
45977
+ const read = await countHeadWorkflowRuns(sha, repo);
45978
+ if (read.state === "ok") return read.count;
45979
+ console.warn(`ci checks-wait: zero-runs probe FAILED (${read.error}) \u2014 not treating as delivery failure this cycle`);
45980
+ return null;
45981
+ },
45982
+ sleep: (ms) => new Promise((resolve7) => setTimeout(resolve7, ms)),
45983
+ log: (message2) => console.warn(message2),
45984
+ timeoutMs: timeoutMs ?? PR_CHECKS_TIMEOUT_MS,
45985
+ progress: ({ state, elapsedMs, remainingMs }) => console.warn(`ci checks-wait: ${state} \u2014 ${Math.round(elapsedMs / 1e3)}s elapsed, ${Math.round(remainingMs / 6e4)}m left`)
45986
+ });
45987
+ printChecksWaitResult("ci checks-wait", result, o.json);
45988
+ });
45989
+ };
45953
45990
  }
45954
45991
 
45955
45992
  // src/command-register-train-operations.ts
@@ -54494,7 +54531,7 @@ oauth.command("verify").description("probe Google authorize with an arbitrary po
54494
54531
  }
54495
54532
  if (mismatches.length) process.exitCode = 1;
54496
54533
  });
54497
- registerCollaborationCommands(program2);
54534
+ var registerCiChecksWait = registerCollaborationCommands(program2);
54498
54535
  function ciAuditDeps2() {
54499
54536
  const cfgPromise = loadConfig();
54500
54537
  const root = hubRoot2();
@@ -54546,6 +54583,7 @@ ci.command("audit").description("read-only fleet scan: gate workflow, ruleset co
54546
54583
  else console.log(renderCiAuditText(report));
54547
54584
  if (!report.ok) process.exitCode = 1;
54548
54585
  });
54586
+ registerCiChecksWait(ci);
54549
54587
  ci.command("reconcile").description("audit + optionally apply merge settings and product ruleset activation (master-admin)").option("--json", "machine-readable output").option("--repo <owner/repo>", "reconcile one repo instead of the full registry").option("--apply", "PATCH merge settings + activate product ruleset when missing (master role required); activation is skipped while the repo's gate has never passed (#3694)").option("--park-ruleset", "stop the product ruleset enforcing without deleting it \u2014 keeps its required contexts (master role required)").action(async (o) => {
54550
54588
  if (o.apply && o.parkRuleset) {
54551
54589
  return fail("ci reconcile: --apply and --park-ruleset ask for opposite things; pass one");
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.5.93",
3
+ "version": "4.5.94",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/codex-plugin",
3
- "version": "4.5.93",
3
+ "version": "4.5.94",
4
4
  "description": "MMI workflow skills and org gates delivery.",
5
5
  "author": {
6
6
  "name": "MMI Future",