@mutmutco/cli 3.139.2 → 3.139.3

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/dist/main.cjs CHANGED
@@ -10746,10 +10746,10 @@ var rollout_plan_default = {
10746
10746
  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)."
10747
10747
  },
10748
10748
  baseline: {
10749
- version: "3.139.2",
10750
- tag: "v3.139.2",
10751
- commit: "1e69c6815490",
10752
- npm: "@mutmutco/cli@3.139.2"
10749
+ version: "3.139.3",
10750
+ tag: "v3.139.3",
10751
+ commit: "19258f64de5f",
10752
+ npm: "@mutmutco/cli@3.139.3"
10753
10753
  },
10754
10754
  exitCriterion: "fleet-n-of-n",
10755
10755
  hubOnlyShortcut: "forbidden",
@@ -10766,14 +10766,14 @@ var rollout_plan_default = {
10766
10766
  repo: "mutmutco/mmi-hub",
10767
10767
  role: "canary",
10768
10768
  schedule: "train",
10769
- v3Target: "v3.139.2"
10769
+ v3Target: "v3.139.3"
10770
10770
  }
10771
10771
  ],
10772
10772
  rollbackTrigger: "Any red inside the post-cut soak window: `devops train gate` FAIL attributable to the v4 doors, Hub endpoint health probe failure, a v3 client refused while the compat window must still admit it (SUPPORTED_MINOR_WINDOW=2, MIN_CLIENT_VERSION 0.0.0 \u2014 D6a), or npm consumer install/doctor failure on the v4 dist.",
10773
10773
  rollback: {
10774
10774
  independent: true,
10775
- mechanism: "npm dist-tag latest -> 3.139.2 and redeploy the Hub Lambda from tag v3.139.2 (1e69c6815490); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
10776
- v3Target: "v3.139.2 (@mutmutco/cli@3.139.2, tag commit 1e69c6815490 \u2014 the preserved latest-v3 distribution, D6b)"
10775
+ mechanism: "npm dist-tag latest -> 3.139.3 and redeploy the Hub Lambda from tag v3.139.3 (19258f64de5f); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
10776
+ v3Target: "v3.139.3 (@mutmutco/cli@3.139.3, tag commit 19258f64de5f \u2014 the preserved latest-v3 distribution, D6b)"
10777
10777
  }
10778
10778
  },
10779
10779
  {
@@ -23268,6 +23268,7 @@ ${chunk.symbol ?? ""}
23268
23268
  ${chunk.blurb ?? ""}`;
23269
23269
  }
23270
23270
  }
23271
+ var V4_EMBED_TIMEOUT_MS = 15 * 6e4;
23271
23272
  function runEmbedder(cwd, chunks, modelDirectory, createdAt) {
23272
23273
  if (!chunks.length) return { embeddings: [] };
23273
23274
  const runner = (0, import_node_path23.join)(cwd, "repo-indexer", "src", "batch.mjs");
@@ -23276,7 +23277,7 @@ function runEmbedder(cwd, chunks, modelDirectory, createdAt) {
23276
23277
  if (!(0, import_node_fs25.existsSync)(file)) return { embeddings: [], reason: "embeddings-unavailable" };
23277
23278
  const request = { texts: chunks.map((chunk) => ({ id: chunk.id, text: embeddingInput(cwd, chunk) })), maxBatch: V4_EMBED_BATCH };
23278
23279
  const env = { ...process.env, ...modelDirectory ? { MMI_REPO_INDEXER_MODEL_DIR: modelDirectory } : {} };
23279
- const result = (0, import_node_child_process13.spawnSync)(process.execPath, [file], { input: JSON.stringify(request), encoding: "utf8", windowsHide: true, timeout: 3e5, maxBuffer: V4_MAX_ARTIFACT_BYTES, env });
23280
+ const result = (0, import_node_child_process13.spawnSync)(process.execPath, [file], { input: JSON.stringify(request), encoding: "utf8", windowsHide: true, timeout: V4_EMBED_TIMEOUT_MS, maxBuffer: V4_MAX_ARTIFACT_BYTES, env });
23280
23281
  if (result.error || result.status !== 0) return { embeddings: [], reason: "embeddings-unavailable" };
23281
23282
  try {
23282
23283
  const response = JSON.parse(result.stdout);
@@ -23350,6 +23351,9 @@ async function buildRepoIndexV4(cwd, repo, opts = {}) {
23350
23351
  `, "utf8");
23351
23352
  return envelope;
23352
23353
  }
23354
+ function repoIndexV4StorePath(cwd) {
23355
+ return statePath(cwd);
23356
+ }
23353
23357
 
23354
23358
  // src/repo-index-v4/shards.ts
23355
23359
  var V4_STAGE_MAX_BODY_BYTES = 750 * 1024;
@@ -32424,7 +32428,7 @@ var surfaces_default = {
32424
32428
  ownership: {
32425
32429
  trust: "host",
32426
32430
  cache: "host",
32427
- repair: "mmi-cli"
32431
+ repair: "mmi-hub"
32428
32432
  },
32429
32433
  certification: {
32430
32434
  hostCommand: "claude",
@@ -32559,7 +32563,7 @@ var surfaces_default = {
32559
32563
  ownership: {
32560
32564
  trust: "operator",
32561
32565
  cache: "host",
32562
- repair: "mmi-cli"
32566
+ repair: "mmi-hub"
32563
32567
  },
32564
32568
  certification: {
32565
32569
  hostCommand: "codex",
@@ -32820,8 +32824,8 @@ var surfaces_default = {
32820
32824
  },
32821
32825
  ownership: {
32822
32826
  trust: "host",
32823
- cache: "mmi-cli",
32824
- repair: "mmi-cli"
32827
+ cache: "mmi-hub",
32828
+ repair: "mmi-hub"
32825
32829
  },
32826
32830
  certification: {
32827
32831
  hostCommand: "cursor-agent",
@@ -32932,7 +32936,7 @@ var surfaces_default = {
32932
32936
  ownership: {
32933
32937
  trust: "host",
32934
32938
  cache: "host",
32935
- repair: "mmi-cli"
32939
+ repair: "mmi-hub"
32936
32940
  },
32937
32941
  certification: {
32938
32942
  hostCommand: "kilo",
@@ -33050,7 +33054,7 @@ var surfaces_default = {
33050
33054
  ownership: {
33051
33055
  trust: "host",
33052
33056
  cache: "host",
33053
- repair: "mmi-cli"
33057
+ repair: "mmi-hub"
33054
33058
  },
33055
33059
  certification: {
33056
33060
  hostCommand: "jervcode",
@@ -34178,19 +34182,14 @@ function checkPluginCache(input) {
34178
34182
  parts.push(`${input.staging.length} orphaned staging dir(s)${size}`);
34179
34183
  }
34180
34184
  return {
34181
- ok: false,
34185
+ ok: true,
34186
+ warn: true,
34182
34187
  id: "plugin-cache",
34183
34188
  label: "plugin cache",
34184
- // #3485: deliberately NOT `reportOnly`, and not in the closed set docs/doctor-contract.md enumerates.
34185
- // A checker argued it qualifies because no `doctor --apply` clears it; I tagged it, then reverted.
34186
- // `mmi-cli plugin prune --apply` clears it in one command and a re-run goes green, so this is an
34187
- // ordinary red the operator is expected to act on. "The doctor cannot heal it automatically" was never
34188
- // the bar — see the contract for why report-only is a per-row ruling rather than a rule you can apply
34189
- // from here.
34190
- // Lead with the versioned-cache framing when there are stale versions; otherwise report the staging litter
34191
- // on its own so a cache with zero versioned dirs still gets an honest ✗.
34189
+ // Installed-surface convergence belongs to mmi-hub; the host owns its cache lifecycle. Doctor
34190
+ // reports old generations but never races either writer by deleting them.
34192
34191
  detail: input.stale.length ? `${input.cached} versions cached (${parts.join("; ")})` : parts.join("; "),
34193
- fix: "run `mmi-cli plugin prune` to review, then `mmi-cli plugin prune --apply` to delete",
34192
+ fix: "run `mmi-hub status` and `mmi-hub update`; if only superseded cache remains, let the host retire it after all older sessions close",
34194
34193
  verbose: evidence
34195
34194
  };
34196
34195
  }
@@ -34295,24 +34294,34 @@ function checkRepoIndexCloud(probe) {
34295
34294
  probe.builtAt ? `builtAt: ${probe.builtAt}` : "builtAt: n/a",
34296
34295
  typeof probe.fileCount === "number" ? `fileCount: ${probe.fileCount}` : "fileCount: n/a",
34297
34296
  typeof probe.embCount === "number" ? `embCount: ${probe.embCount}` : "embCount: n/a",
34298
- typeof probe.localPresent === "boolean" ? `local cache: ${probe.localPresent ? "present" : "absent"}` : "local cache: n/a"
34297
+ typeof probe.localPresent === "boolean" ? `local v3 cache: ${probe.localPresent ? "present" : "absent"}` : "local v3 cache: n/a",
34298
+ `local v4: ${probe.localV4State ?? "unknown"}${probe.localV4Commit ? ` @ ${probe.localV4Commit.slice(0, 12)}` : ""}${typeof probe.localV4EmbeddingCoverage === "number" ? ` (${Math.round(probe.localV4EmbeddingCoverage * 100)}% embeddings)` : ""}`,
34299
+ `cloud v4: ${probe.cloudV4State ?? "unknown"}${probe.cloudV4Commit ? ` @ ${probe.cloudV4Commit.slice(0, 12)}` : ""}`,
34300
+ `v4 cohort: ${probe.v4ReadPercent ?? 0}%`,
34301
+ `v4 shadows: ${probe.v4ShadowComparisons ?? 0}/${probe.v4ShadowMinimum ?? 50} \u2014 ${probe.v4ShadowCutoverReady ? "cutover-ready" : "not ready"}`,
34302
+ ...Object.entries(probe.v4ShadowErrors ?? {}).map(([kind, count]) => `v4 shadow error ${kind}: ${count}`)
34299
34303
  ];
34300
34304
  switch (probe.kind) {
34301
- case "healthy":
34305
+ case "healthy": {
34306
+ const v4Unready = probe.cloudV4State === "invalid" || probe.cloudV4State === "tombstoned" || probe.cloudV4State === "degraded" && (probe.localV4EmbeddingCoverage ?? 1) < 0.95;
34307
+ const detail = probe.detail ?? `cloud v3 ok${typeof probe.fileCount === "number" ? ` \u2014 ${probe.fileCount} files` : ""}; v4 ${probe.cloudV4State ?? "absent"}, cohort ${probe.v4ReadPercent ?? 0}%`;
34302
34308
  return {
34303
- ok: true,
34309
+ ok: !v4Unready || (probe.v4ReadPercent ?? 0) === 0,
34310
+ ...v4Unready && (probe.v4ReadPercent ?? 0) === 0 ? { warn: true, verified: false } : {},
34304
34311
  id: "repo-index",
34305
34312
  label: "repo-index",
34306
- detail: probe.detail ?? `cloud ok${typeof probe.fileCount === "number" ? ` \u2014 ${probe.fileCount} files` : ""}`,
34313
+ detail,
34314
+ ...v4Unready ? { fix: "run `mmi-hub update`, then dispatch `mmi-cli harbour org schedules run MMI-Hub/repo-index-reconcile`; keep the v4 cohort at 0 until shadows pass" } : {},
34307
34315
  verbose: evidence
34308
34316
  };
34317
+ }
34309
34318
  case "command-absent":
34310
34319
  return {
34311
34320
  ok: false,
34312
34321
  id: "repo-index",
34313
34322
  label: "repo-index",
34314
34323
  detail: "this mmi-cli build has no repo-index command",
34315
- fix: "run `mmi-cli doctor` to heal the global CLI, or `npm install -g @mutmutco/cli`",
34324
+ fix: "run `mmi-hub status`, then `mmi-hub update` to converge the CLI and installed host surfaces",
34316
34325
  verbose: evidence
34317
34326
  };
34318
34327
  case "deploy-lag":
@@ -34331,7 +34340,7 @@ function checkRepoIndexCloud(probe) {
34331
34340
  id: "repo-index",
34332
34341
  label: "repo-index",
34333
34342
  detail: probe.detail ?? "no cloud projection for this repo",
34334
- fix: "run harbour repo-index-reconcile or `mmi-cli oracle repo-index sync-estate --repo <owner/name>`",
34343
+ fix: "dispatch `mmi-cli harbour org schedules run MMI-Hub/repo-index-reconcile` or run the authenticated per-repo sync",
34335
34344
  verbose: evidence
34336
34345
  };
34337
34346
  case "stale":
@@ -34340,7 +34349,7 @@ function checkRepoIndexCloud(probe) {
34340
34349
  id: "repo-index",
34341
34350
  label: "repo-index",
34342
34351
  detail: probe.detail ?? "cloud projection looks stale vs recent pushes",
34343
- fix: "trigger `repo-index-reconcile` (workflow_dispatch) or wait for the 6h harbour tick",
34352
+ fix: "dispatch `mmi-cli harbour org schedules run MMI-Hub/repo-index-reconcile` or wait for the registered 6h schedule",
34344
34353
  verbose: evidence
34345
34354
  };
34346
34355
  case "auth":
@@ -34358,7 +34367,7 @@ function checkRepoIndexCloud(probe) {
34358
34367
  id: "repo-index",
34359
34368
  label: "repo-index",
34360
34369
  detail: probe.detail ?? "Hub API URL not configured",
34361
- fix: "run `mmi-cli doctor` to repair Hub wiring",
34370
+ fix: "run `mmi-hub status` and `mmi-hub update`; Hub URL wiring is installer-owned",
34362
34371
  verbose: evidence
34363
34372
  };
34364
34373
  case "network":
@@ -34578,42 +34587,6 @@ async function runDoctorClean(opts, io, deps) {
34578
34587
  }
34579
34588
  }
34580
34589
  async function runPluginCacheRow() {
34581
- if (applyEnv && deps.prunePluginCache && spendOnce("cache-prune")) {
34582
- const cache = deps.pluginCache();
34583
- if (cache.stale.length === 0 && cache.staging.length === 0) {
34584
- emitNow(checkPluginCache(cache));
34585
- return;
34586
- }
34587
- healIntent(`plugin cache \u2014 pruning ${cache.stale.length} superseded version(s) (guarded)`);
34588
- traceHeal("cache-prune");
34589
- const outcome = deps.prunePluginCache();
34590
- if (outcome.removed.length) markHealChanged();
34591
- const evidence = [
34592
- ...outcome.removed.map((v) => `pruned: ${v}`),
34593
- ...outcome.held.map((h) => `still held: ${h.version} (${h.error}) \u2014 never forced`),
34594
- ...outcome.kept.map((k) => `kept: ${k.version} \u2014 ${k.reason}`)
34595
- ];
34596
- if (outcome.held.length === 0) {
34597
- emitNow({
34598
- id: "plugin-cache",
34599
- ok: true,
34600
- label: "plugin cache",
34601
- detail: outcome.removed.length ? `pruned ${outcome.removed.length} superseded version(s)` : "nothing provably superseded (guards kept every candidate)",
34602
- verbose: evidence
34603
- });
34604
- } else {
34605
- emitNow({
34606
- id: "plugin-cache",
34607
- ok: false,
34608
- reportOnly: true,
34609
- label: "plugin cache",
34610
- detail: `${outcome.removed.length} pruned; ${outcome.held.length} still held by a live session`,
34611
- fix: "close the session holding it and re-run `mmi-cli doctor`",
34612
- verbose: evidence
34613
- });
34614
- }
34615
- return;
34616
- }
34617
34590
  emitNow(checkPluginCache(deps.pluginCache()));
34618
34591
  }
34619
34592
  async function runClaudeBinaryRow() {
@@ -35627,6 +35600,21 @@ function mmiDoctorDeps(opts = {}) {
35627
35600
  // #4156: short-timeout Hub status for the current repo. Fail-soft — never throws to doctor.
35628
35601
  repoIndexCloudState: async (root) => {
35629
35602
  const local = repoIndexStatus(root);
35603
+ let localV4 = { state: "absent" };
35604
+ try {
35605
+ const parsed = JSON.parse((0, import_node_fs42.readFileSync)(repoIndexV4StorePath(root), "utf8"));
35606
+ const state = parsed.status?.state;
35607
+ if (parsed.schemaVersion === 4 && (state === "ready" || state === "degraded")) {
35608
+ const chunks = parsed.manifest?.chunks?.length ?? 0;
35609
+ localV4 = {
35610
+ state,
35611
+ ...typeof parsed.manifest?.commit === "string" ? { commit: parsed.manifest.commit } : {},
35612
+ embeddingCoverage: chunks ? (parsed.manifest?.embeddings?.length ?? 0) / chunks : 1
35613
+ };
35614
+ } else localV4 = { state: "invalid" };
35615
+ } catch {
35616
+ }
35617
+ const localFields = { localPresent: local.present, localV4State: localV4.state, localV4Commit: localV4.commit, localV4EmbeddingCoverage: localV4.embeddingCoverage };
35630
35618
  try {
35631
35619
  const cfg = await loadConfig();
35632
35620
  const repo = inferRepoSlug(root);
@@ -35635,17 +35623,32 @@ function mmiDoctorDeps(opts = {}) {
35635
35623
  timeoutMs: 4e3
35636
35624
  });
35637
35625
  if (isRepoIndexStatusError(st)) {
35638
- if (st.code === "deploy-lag") return { kind: "deploy-lag", repo, localPresent: local.present };
35639
- if (st.code === "auth") return { kind: "auth", repo, localPresent: local.present };
35640
- if (st.code === "config") return { kind: "config", repo, detail: st.error, localPresent: local.present };
35641
- return { kind: "network", repo, detail: st.error, localPresent: local.present };
35626
+ if (st.code === "deploy-lag") return { kind: "deploy-lag", repo, ...localFields };
35627
+ if (st.code === "auth") return { kind: "auth", repo, ...localFields };
35628
+ if (st.code === "config") return { kind: "config", repo, detail: st.error, ...localFields };
35629
+ return { kind: "network", repo, detail: st.error, ...localFields };
35642
35630
  }
35643
35631
  const present = st.present;
35644
35632
  const builtAt = typeof st.builtAt === "string" ? st.builtAt : void 0;
35645
35633
  const fileCount = typeof st.fileCount === "number" ? st.fileCount : void 0;
35646
35634
  const embCount = typeof st.embCount === "number" ? st.embCount : void 0;
35635
+ const v4 = st.v4;
35636
+ const migration = st.v4Migration;
35637
+ const shadow = st.v4Shadow;
35638
+ const shadowThresholds = shadow?.thresholds;
35639
+ const cloudV4State = typeof v4?.state === "string" && ["ready", "degraded", "invalid", "tombstoned"].includes(v4.state) ? v4.state : "absent";
35640
+ const v4Fields = {
35641
+ ...localFields,
35642
+ cloudV4State,
35643
+ ...typeof v4?.commit === "string" ? { cloudV4Commit: v4.commit } : {},
35644
+ v4ReadPercent: typeof migration?.readPercent === "number" ? migration.readPercent : 0,
35645
+ v4ShadowComparisons: typeof shadow?.comparisonCount === "number" ? shadow.comparisonCount : 0,
35646
+ v4ShadowMinimum: typeof shadowThresholds?.minimumComparisons === "number" ? shadowThresholds.minimumComparisons : 50,
35647
+ v4ShadowCutoverReady: shadow?.cutoverReady === true,
35648
+ v4ShadowErrors: shadow?.errors && typeof shadow.errors === "object" ? shadow.errors : {}
35649
+ };
35647
35650
  if (present === false) {
35648
- return { kind: "missing-projection", repo, localPresent: local.present, fileCount: 0, embCount: 0 };
35651
+ return { kind: "missing-projection", repo, ...v4Fields, fileCount: 0, embCount: 0 };
35649
35652
  }
35650
35653
  if (builtAt) {
35651
35654
  const ageMs = Date.now() - Date.parse(builtAt);
@@ -35656,7 +35659,7 @@ function mmiDoctorDeps(opts = {}) {
35656
35659
  builtAt,
35657
35660
  fileCount,
35658
35661
  embCount,
35659
- localPresent: local.present,
35662
+ ...v4Fields,
35660
35663
  detail: `projection builtAt ${builtAt} (>48h old)`
35661
35664
  };
35662
35665
  }
@@ -35667,13 +35670,13 @@ function mmiDoctorDeps(opts = {}) {
35667
35670
  builtAt,
35668
35671
  fileCount,
35669
35672
  embCount,
35670
- localPresent: local.present
35673
+ ...v4Fields
35671
35674
  };
35672
35675
  } catch (e) {
35673
35676
  return {
35674
35677
  kind: "network",
35675
35678
  detail: e instanceof Error ? e.message : String(e),
35676
- localPresent: local.present
35679
+ ...localFields
35677
35680
  };
35678
35681
  }
35679
35682
  }
@@ -430,6 +430,7 @@ ${chunk.symbol ?? ""}
430
430
  ${chunk.blurb ?? ""}`;
431
431
  }
432
432
  }
433
+ var V4_EMBED_TIMEOUT_MS = 15 * 6e4;
433
434
  function runEmbedder(cwd, chunks, modelDirectory, createdAt) {
434
435
  if (!chunks.length) return { embeddings: [] };
435
436
  const runner = (0, import_node_path4.join)(cwd, "repo-indexer", "src", "batch.mjs");
@@ -438,7 +439,7 @@ function runEmbedder(cwd, chunks, modelDirectory, createdAt) {
438
439
  if (!(0, import_node_fs3.existsSync)(file)) return { embeddings: [], reason: "embeddings-unavailable" };
439
440
  const request = { texts: chunks.map((chunk) => ({ id: chunk.id, text: embeddingInput(cwd, chunk) })), maxBatch: V4_EMBED_BATCH };
440
441
  const env = { ...process.env, ...modelDirectory ? { MMI_REPO_INDEXER_MODEL_DIR: modelDirectory } : {} };
441
- const result = (0, import_node_child_process3.spawnSync)(process.execPath, [file], { input: JSON.stringify(request), encoding: "utf8", windowsHide: true, timeout: 3e5, maxBuffer: V4_MAX_ARTIFACT_BYTES, env });
442
+ const result = (0, import_node_child_process3.spawnSync)(process.execPath, [file], { input: JSON.stringify(request), encoding: "utf8", windowsHide: true, timeout: V4_EMBED_TIMEOUT_MS, maxBuffer: V4_MAX_ARTIFACT_BYTES, env });
442
443
  if (result.error || result.status !== 0) return { embeddings: [], reason: "embeddings-unavailable" };
443
444
  try {
444
445
  const response = JSON.parse(result.stdout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "3.139.2",
3
+ "version": "3.139.3",
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",