@mutmutco/codex-plugin 4.5.194 → 4.5.196
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/.codex-plugin/plugin.json +1 -1
- package/cli/dist/main.cjs +45 -16
- package/cli/package.json +1 -1
- package/package.json +1 -1
package/cli/dist/main.cjs
CHANGED
|
@@ -6837,11 +6837,11 @@ var import_node_fs15 = require("node:fs");
|
|
|
6837
6837
|
var import_node_path12 = require("node:path");
|
|
6838
6838
|
var PLAN_ADVISORY_AGE_MS = 30 * 24 * 36e5;
|
|
6839
6839
|
var ROOT_SCRATCH_STALE_MS = 24 * 36e5;
|
|
6840
|
-
function executeScratchGc(repoRoot2, opts, now = Date.now()) {
|
|
6841
|
-
const snap = collectScratchSnapshot(repoRoot2);
|
|
6840
|
+
function executeScratchGc(repoRoot2, opts, now = Date.now(), deps = {}) {
|
|
6841
|
+
const snap = collectScratchSnapshot(repoRoot2, deps);
|
|
6842
6842
|
const plan = planScratchGc(snap, now);
|
|
6843
6843
|
if (!opts.apply) return { plan };
|
|
6844
|
-
return { plan, applied: applyScratchGc(plan, repoRoot2, now) };
|
|
6844
|
+
return { plan, applied: applyScratchGc(plan, repoRoot2, now, deps) };
|
|
6845
6845
|
}
|
|
6846
6846
|
function buildPrMergeScratchHousekeeping(repoRoot2, deps = {}) {
|
|
6847
6847
|
const runScratchGc = deps.runScratchGc ?? executeScratchGc;
|
|
@@ -6954,7 +6954,8 @@ function treeOlderThan(root, now, floor) {
|
|
|
6954
6954
|
}
|
|
6955
6955
|
return true;
|
|
6956
6956
|
}
|
|
6957
|
-
function applyScratchGc(plan, repoRoot2, now = Date.now()) {
|
|
6957
|
+
function applyScratchGc(plan, repoRoot2, now = Date.now(), deps = {}) {
|
|
6958
|
+
const trackedStatus = deps.trackedStatus ?? trackedPathStatus;
|
|
6958
6959
|
const result = { pruned: [], skipped: 0, bytes: 0 };
|
|
6959
6960
|
let repoAnchor;
|
|
6960
6961
|
try {
|
|
@@ -6969,7 +6970,7 @@ function applyScratchGc(plan, repoRoot2, now = Date.now()) {
|
|
|
6969
6970
|
result.skipped += 1;
|
|
6970
6971
|
continue;
|
|
6971
6972
|
}
|
|
6972
|
-
if (
|
|
6973
|
+
if (trackedStatus(c, real, repoAnchor) !== false) {
|
|
6973
6974
|
result.skipped += 1;
|
|
6974
6975
|
continue;
|
|
6975
6976
|
}
|
|
@@ -7017,14 +7018,27 @@ function trackedPathStatus(c, realPath, repoAnchor) {
|
|
|
7017
7018
|
const rel = (0, import_node_path12.relative)(repoAnchor, realPath).replace(/\\/g, "/");
|
|
7018
7019
|
if (!rel || rel.startsWith("../") || rel === "..") return null;
|
|
7019
7020
|
const gitPath = c.kind === "dir" ? `${rel.replace(/\/+$/, "")}/` : rel;
|
|
7021
|
+
let hasDotGit = false;
|
|
7022
|
+
try {
|
|
7023
|
+
(0, import_node_fs15.lstatSync)((0, import_node_path12.join)(repoAnchor, ".git"));
|
|
7024
|
+
hasDotGit = true;
|
|
7025
|
+
} catch {
|
|
7026
|
+
hasDotGit = false;
|
|
7027
|
+
}
|
|
7020
7028
|
try {
|
|
7021
7029
|
(0, import_node_child_process4.execFileSync)("git", ["-C", repoAnchor, "rev-parse", "--is-inside-work-tree"], {
|
|
7022
7030
|
windowsHide: true,
|
|
7023
|
-
|
|
7031
|
+
encoding: "utf8",
|
|
7032
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
7024
7033
|
timeout: 1e4
|
|
7025
7034
|
});
|
|
7026
|
-
} catch {
|
|
7027
|
-
return
|
|
7035
|
+
} catch (e) {
|
|
7036
|
+
if (hasDotGit) return null;
|
|
7037
|
+
const err = e;
|
|
7038
|
+
if (err.killed || err.signal || err.code === "ETIMEDOUT" || err.code === "ENOENT") return null;
|
|
7039
|
+
const stderr = typeof err.stderr === "string" ? err.stderr : Buffer.isBuffer(err.stderr) ? err.stderr.toString("utf8") : "";
|
|
7040
|
+
if (/not a git repository|cannot change to/i.test(stderr)) return false;
|
|
7041
|
+
return null;
|
|
7028
7042
|
}
|
|
7029
7043
|
try {
|
|
7030
7044
|
const out = (0, import_node_child_process4.execFileSync)("git", ["-C", repoAnchor, "ls-files", "-z", "--", gitPath], {
|
|
@@ -7065,9 +7079,19 @@ function rootScratchDirSnapshot(root, readdir2, stat4) {
|
|
|
7065
7079
|
return null;
|
|
7066
7080
|
}
|
|
7067
7081
|
}
|
|
7082
|
+
function resolveRealPathOrRaw(p, realpath) {
|
|
7083
|
+
try {
|
|
7084
|
+
return realpath(p);
|
|
7085
|
+
} catch {
|
|
7086
|
+
return p;
|
|
7087
|
+
}
|
|
7088
|
+
}
|
|
7068
7089
|
function collectScratchSnapshot(repoRoot2, deps = {}) {
|
|
7069
7090
|
const readdir2 = deps.readdir ?? import_node_fs15.readdirSync;
|
|
7070
7091
|
const stat4 = deps.stat ?? import_node_fs15.statSync;
|
|
7092
|
+
const realpath = deps.realpath ?? import_node_fs15.realpathSync;
|
|
7093
|
+
const trackedStatus = deps.trackedStatus ?? trackedPathStatus;
|
|
7094
|
+
const repoAnchor = resolveRealPathOrRaw(repoRoot2, realpath).replace(/\\/g, "/").replace(/\/+$/, "");
|
|
7071
7095
|
const plansRoot = (0, import_node_path12.join)(repoRoot2, "plans");
|
|
7072
7096
|
const rootScratchFiles = [];
|
|
7073
7097
|
try {
|
|
@@ -7078,7 +7102,12 @@ function collectScratchSnapshot(repoRoot2, deps = {}) {
|
|
|
7078
7102
|
continue;
|
|
7079
7103
|
}
|
|
7080
7104
|
const full = (0, import_node_path12.join)(repoRoot2, ent.name);
|
|
7105
|
+
const kind = isDir ? "dir" : "file";
|
|
7081
7106
|
try {
|
|
7107
|
+
const realFull = resolveRealPathOrRaw(full, realpath).replace(/\\/g, "/");
|
|
7108
|
+
if (trackedStatus({ kind, path: full }, realFull, repoAnchor) === true) {
|
|
7109
|
+
continue;
|
|
7110
|
+
}
|
|
7082
7111
|
if (isDir) {
|
|
7083
7112
|
const snap = rootScratchDirSnapshot(full, readdir2, stat4);
|
|
7084
7113
|
if (snap) rootScratchFiles.push({ path: full, dir: repoRoot2, name: ent.name, mtimeMs: snap.mtimeMs, bytes: snap.bytes, kind: "dir" });
|
|
@@ -19250,10 +19279,10 @@ var rollout_plan_default = {
|
|
|
19250
19279
|
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)."
|
|
19251
19280
|
},
|
|
19252
19281
|
baseline: {
|
|
19253
|
-
version: "4.5.
|
|
19254
|
-
tag: "v4.5.
|
|
19255
|
-
commit: "
|
|
19256
|
-
npm: "@mutmutco/cli@4.5.
|
|
19282
|
+
version: "4.5.196",
|
|
19283
|
+
tag: "v4.5.196",
|
|
19284
|
+
commit: "b0a1e2a76ba0",
|
|
19285
|
+
npm: "@mutmutco/cli@4.5.196"
|
|
19257
19286
|
},
|
|
19258
19287
|
exitCriterion: "fleet-n-of-n",
|
|
19259
19288
|
hubOnlyShortcut: "forbidden",
|
|
@@ -19270,14 +19299,14 @@ var rollout_plan_default = {
|
|
|
19270
19299
|
repo: "mutmutco/mmi-hub",
|
|
19271
19300
|
role: "canary",
|
|
19272
19301
|
schedule: "train",
|
|
19273
|
-
v3Target: "v4.5.
|
|
19302
|
+
v3Target: "v4.5.196"
|
|
19274
19303
|
}
|
|
19275
19304
|
],
|
|
19276
19305
|
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.",
|
|
19277
19306
|
rollback: {
|
|
19278
19307
|
independent: true,
|
|
19279
|
-
mechanism: "npm dist-tag latest -> 4.5.
|
|
19280
|
-
v3Target: "v4.5.
|
|
19308
|
+
mechanism: "npm dist-tag latest -> 4.5.196 and redeploy the Hub Lambda from tag v4.5.196 (b0a1e2a76ba0); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
|
|
19309
|
+
v3Target: "v4.5.196 (@mutmutco/cli@4.5.196, tag commit b0a1e2a76ba0 \u2014 last known-good release carrying the repo-index v4-only contract)"
|
|
19281
19310
|
}
|
|
19282
19311
|
},
|
|
19283
19312
|
{
|
|
@@ -42889,7 +42918,7 @@ function evaluatePrMergeHousekeeping(report, context, force = false) {
|
|
|
42889
42918
|
const detail = failed2 ? `scratch housekeeping failed${scratch?.error ? `: ${scratch.error}` : ""}` : `${prunable} prunable + ${unprunable} un-prunable scratch item(s) remain after cleanup`;
|
|
42890
42919
|
return {
|
|
42891
42920
|
blocked: true,
|
|
42892
|
-
reason: `${context} housekeeping blocked merge: ${detail}. Run
|
|
42921
|
+
reason: `${context} housekeeping blocked merge: ${detail}. Run \`mmi-cli doctor --apply\` to prune aged repo-root scratch (or \`mmi-cli doctor --verbose\` to inspect what could not be removed), then retry \u2014 or re-run \`mmi-cli devops ${context} --force\` to acknowledge an unresolved scratch block without cleaning it and proceed anyway. (Kept advisory plans/ scratch never blocks: it is gitignored and can never reach origin.)`
|
|
42893
42922
|
};
|
|
42894
42923
|
}
|
|
42895
42924
|
function assertPrMergeHousekeepingClean(startingPath, context, options = {}) {
|
package/cli/package.json
CHANGED