@mutmutco/cli 3.107.2 → 3.107.4

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 +28 -10
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -22495,7 +22495,7 @@ async function runHotfixStart(deps, options) {
22495
22495
  if (!sources.some((s) => s.sha === resolved.sha)) sources.push(resolved);
22496
22496
  }
22497
22497
  const label = sources.map((s) => s.label).join(", ");
22498
- const foldPaths = deployModel === "hub-serverless" || deployModel === "registry-publish" ? await resolveFoldPaths(deps, deployModel) : [];
22498
+ const foldPaths = await resolveFoldPaths(deps, deployModel);
22499
22499
  const pickTolerated = deployModel === "hub-serverless" || deployModel === "registry-publish" ? [...foldPaths, ...HOTFIX_SKILL_TOLERATED_ROOTS] : foldPaths;
22500
22500
  if (deployModel === "hub-serverless") {
22501
22501
  await deps.run("node", ["scripts/release-distribution.mjs", "verify-deps"]);
@@ -22539,15 +22539,15 @@ async function runHotfixStart(deps, options) {
22539
22539
  } else {
22540
22540
  notes.push("distribution prepare produced no changes \u2014 nothing extra committed");
22541
22541
  }
22542
- } else if (deployModel === "registry-publish" && foldPaths.length > 0) {
22542
+ } else if (foldPaths.length > 0) {
22543
22543
  const foldNote = await foldReleaseVersion(deps, deployModel, tag, foldPaths);
22544
22544
  notes.push(foldNote);
22545
22545
  } else {
22546
- notes.push(`distribution bump skipped (deployModel=${deployModel})`);
22546
+ notes.push(`version fold skipped (deployModel=${deployModel} carries no version manifest \u2014 the tag is the version)`);
22547
22547
  }
22548
22548
  await deps.run("git", ["push", "-u", "origin", branch]);
22549
22549
  }
22550
- const bumpNote = deployModel === "hub-serverless" ? " with the locked distribution bump" : deployModel === "registry-publish" ? " with the package version bump" : "";
22550
+ const bumpNote = deployModel === "hub-serverless" ? " with the locked distribution bump" : foldPaths.length > 0 ? " with the package version bump" : "";
22551
22551
  const prUrl = clean3(await deps.run("gh", [
22552
22552
  "pr",
22553
22553
  "create",
@@ -22610,6 +22610,15 @@ async function watchReleaseRun(deps, ctx, workflow, sha) {
22610
22610
  function devFoldBranch(tag) {
22611
22611
  return `hotfix-fold/${tag}`;
22612
22612
  }
22613
+ function devFoldScratchBranch(tag, deps) {
22614
+ return `${devFoldBranch(tag)}--port-${(deps.now ?? Date.now)().toString(36)}`;
22615
+ }
22616
+ async function reapFoldScratchBranches(deps) {
22617
+ const listed = await deps.run("git", ["branch", "--list", "hotfix-fold/*--port-*", "--format=%(refname:short)"]).catch(() => "");
22618
+ for (const name of listed.split("\n").map((s) => s.trim()).filter(Boolean)) {
22619
+ await deps.run("git", ["branch", "-D", name]).catch(() => void 0);
22620
+ }
22621
+ }
22613
22622
  async function portFoldToDevelopment(deps, ctx, deployModel, tag) {
22614
22623
  const foldPaths = deployModel === "hub-serverless" || deployModel === "registry-publish" ? await resolveFoldPaths(deps, deployModel) : [];
22615
22624
  if (foldPaths.length === 0) return `fold port skipped (deployModel=${deployModel} folds no version manifest)`;
@@ -22633,14 +22642,16 @@ async function portFoldToDevelopment(deps, ctx, deployModel, tag) {
22633
22642
  const existing = JSON.parse(listed || "[]").filter((r) => r.state === "OPEN" || r.state === "MERGED").sort((a, b) => (b.number ?? 0) - (a.number ?? 0))[0];
22634
22643
  if (existing) return `development fold PR #${existing.number} for ${tag} is ${existing.state} \u2014 reused`;
22635
22644
  const previousRef = clean3(await deps.run("git", ["rev-parse", "--abbrev-ref", "HEAD"]));
22645
+ await reapFoldScratchBranches(deps);
22646
+ const scratch = devFoldScratchBranch(tag, deps);
22636
22647
  try {
22637
22648
  await deps.run("git", ["fetch", "origin", "development"]);
22638
- await deps.run("git", ["checkout", "-B", branch, "origin/development"]);
22649
+ await deps.run("git", ["checkout", "-B", scratch, "origin/development"]);
22639
22650
  const durableSource = clean3(await deps.run("git", ["merge-base", "HEAD", "origin/development"]));
22640
22651
  const foldNote = await foldReleaseVersion(deps, deployModel, tag, foldPaths, durableSource, false);
22641
22652
  const committed = clean3(await deps.run("git", ["rev-list", "--count", "origin/development..HEAD"]));
22642
22653
  if (committed === "0") return `development already carries ${tag} \u2014 no fold PR needed (${foldNote})`;
22643
- await deps.run("git", ["push", "-u", "origin", branch]);
22654
+ await deps.run("git", ["push", "origin", `${scratch}:refs/heads/${branch}`]);
22644
22655
  const prUrl = clean3(await deps.run("gh", [
22645
22656
  "pr",
22646
22657
  "create",
@@ -22660,6 +22671,7 @@ Generated by \`mmi-cli hotfix release\` \u2014 no main-parented commit is merged
22660
22671
  return `opened development fold PR ${prUrl} (${foldNote})`;
22661
22672
  } finally {
22662
22673
  if (previousRef && previousRef !== "HEAD") await deps.run("git", ["checkout", previousRef]).catch(() => void 0);
22674
+ await deps.run("git", ["branch", "-D", scratch]).catch(() => void 0);
22663
22675
  }
22664
22676
  }
22665
22677
  async function runHotfixRelease(deps, versionInput, options = {}) {
@@ -22791,7 +22803,7 @@ async function runHotfixRelease(deps, versionInput, options = {}) {
22791
22803
  try {
22792
22804
  foldNote = await portFoldToDevelopment(deps, ctx, deployModel, tag);
22793
22805
  } catch (e) {
22794
- foldNote = `development fold port FAILED: ${e.message ?? e} \u2014 the release stands; port it by hand: git checkout -B ${devFoldBranch(tag)} origin/development && node scripts/release-distribution.mjs prepare ${version}, then open a development-base PR`;
22806
+ foldNote = `development fold port FAILED: ${e.message ?? e} \u2014 the release stands; port it by hand on a fresh branch: git checkout -B ${devFoldBranch(tag)}-manual origin/development && node scripts/release-distribution.mjs prepare ${version}, then push it as the canonical head (git push origin ${devFoldBranch(tag)}-manual:refs/heads/${devFoldBranch(tag)}) and open a development-base PR`;
22795
22807
  }
22796
22808
  return {
22797
22809
  ...ctx,
@@ -32957,6 +32969,7 @@ function registerFleetTrackInventory(program3) {
32957
32969
  // ../infra/src/version-gate.ts
32958
32970
  var HUB_REPO5 = "mutmutco/mmi-hub";
32959
32971
  var NO_RELEASE_UNKNOWN = "no published GitHub Release";
32972
+ var NO_VERSION_LOCK_PREFIX = "no distribution-bom.json or package.json version lock at ";
32960
32973
  function semverEqual(a, b) {
32961
32974
  return versionAtLeast(a, b) && versionAtLeast(b, a);
32962
32975
  }
@@ -32968,16 +32981,18 @@ function semverRelation(a, b) {
32968
32981
  function classifyRow(row) {
32969
32982
  const findings = [];
32970
32983
  const reasons = /* @__PURE__ */ new Set();
32971
- const releaseRequired = row.track !== "trunk";
32984
+ const releaseRequired = row.track !== "trunk" && !row.classifications.includes("no-deploy-surface");
32985
+ const tagIsVersion = Boolean(row.release.version) && row.unknowns.some((u) => u.startsWith(NO_VERSION_LOCK_PREFIX));
32972
32986
  for (const unknown of row.unknowns) {
32973
32987
  if (!releaseRequired && unknown === NO_RELEASE_UNKNOWN) continue;
32988
+ if (tagIsVersion && unknown.startsWith(NO_VERSION_LOCK_PREFIX)) continue;
32974
32989
  reasons.add(unknown);
32975
32990
  }
32976
32991
  const { version, coordinatedVersion, coordinatedSource, tag } = row.release;
32977
32992
  if (releaseRequired && !version && ![...reasons].some((r) => /release/i.test(r))) {
32978
32993
  reasons.add(NO_RELEASE_UNKNOWN);
32979
32994
  }
32980
- if (releaseRequired && version && !coordinatedVersion && ![...reasons].some((r) => /version lock|distribution-bom|package\.json/i.test(r))) {
32995
+ if (releaseRequired && version && !coordinatedVersion && !tagIsVersion && ![...reasons].some((r) => /version lock|distribution-bom|package\.json/i.test(r))) {
32981
32996
  reasons.add(`coordinated version pointer unknown at ${tag ?? "the release tag"}`);
32982
32997
  }
32983
32998
  if (version && coordinatedVersion) {
@@ -33151,6 +33166,9 @@ function buildDeployStatusReport(input) {
33151
33166
  };
33152
33167
  }
33153
33168
  function reconcileRunAgainstStamp(stage, lastRun, deployOk) {
33169
+ if (lastRun && deployOk === void 0 && lastRun.conclusion === "success") {
33170
+ return [`the last deploy run for ${stage} succeeded but DEPLOY#${stage} carries no deploy-state stamp \u2014 the deploy predates the stamping step; a redeploy at the same ref will stamp it.`];
33171
+ }
33154
33172
  if (!lastRun || deployOk === void 0) return [];
33155
33173
  if (lastRun.conclusion === "success" && deployOk === false) {
33156
33174
  return [`the last deploy run for ${stage} succeeded but DEPLOY#${stage} is stamped failed \u2014 the run may postdate the stamp, or it shipped without stamping; trust the stamp and re-check the run before promoting.`];
@@ -33178,7 +33196,7 @@ function formatDeployStatus(r) {
33178
33196
  `last deploy run: ${formatLastRun(r)}`,
33179
33197
  `public URL: ${r.publicUrl ?? "none"}`,
33180
33198
  `health probe: ${r.health ? `${r.health.ok ? "ok" : "failed"}${r.health.status ? ` (HTTP ${r.health.status})` : ""}${r.health.error ? ` \u2014 ${r.health.error}` : ""}` : "not probed"}`,
33181
- `deploy state: ${r.deployOk === void 0 ? "unknown" : r.deployOk ? "ok" : "failed"}`
33199
+ `deploy state: ${r.deployOk === void 0 ? "not stamped" : r.deployOk ? "ok" : "failed"}`
33182
33200
  ];
33183
33201
  if (r.hints.length) {
33184
33202
  lines.push("", "hints:", ...r.hints.map((h) => ` - ${h}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "3.107.2",
3
+ "version": "3.107.4",
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",