@mutmutco/codex-plugin 4.5.158 → 4.5.159
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 +54 -10
- package/cli/package.json +1 -1
- package/package.json +1 -1
package/cli/dist/main.cjs
CHANGED
|
@@ -7068,6 +7068,8 @@ var import_node_crypto5 = require("node:crypto");
|
|
|
7068
7068
|
var APP_ACTOR_ENV = "MMI_ACTOR";
|
|
7069
7069
|
var APP_VAULT_REPO = "mutmutco/MMI-Hub";
|
|
7070
7070
|
var APP_VAULT_KEYS = ["GITHUB_APP_ID", "GITHUB_APP_INSTALLATION_ID", "GITHUB_APP_PRIVATE_KEY"];
|
|
7071
|
+
var APP2_VAULT_KEYS = ["GITHUB_APP2_ID", "GITHUB_APP2_INSTALLATION_ID", "GITHUB_APP2_PRIVATE_KEY"];
|
|
7072
|
+
var APP_POOL_MEMBERS = [APP_VAULT_KEYS, APP2_VAULT_KEYS];
|
|
7071
7073
|
var APP_ELIGIBLE_COMMANDS = /* @__PURE__ */ new Set([
|
|
7072
7074
|
"pr checks-wait",
|
|
7073
7075
|
// #8042: App-native required-only read (`pr checks-required`) — REST check/status rows scoped by
|
|
@@ -7184,10 +7186,52 @@ async function fleetStatusWriteEnv(args) {
|
|
|
7184
7186
|
}
|
|
7185
7187
|
}
|
|
7186
7188
|
async function mintScopedInstallationToken(deps, permissions) {
|
|
7187
|
-
const
|
|
7189
|
+
const start = Math.floor((deps.random ?? Math.random)() * APP_POOL_MEMBERS.length) % APP_POOL_MEMBERS.length;
|
|
7190
|
+
const order = APP_POOL_MEMBERS.map((_, i) => APP_POOL_MEMBERS[(start + i) % APP_POOL_MEMBERS.length]);
|
|
7191
|
+
let firstError;
|
|
7192
|
+
let exhausted;
|
|
7193
|
+
let absent = 0;
|
|
7194
|
+
for (const [i, keys] of order.entries()) {
|
|
7195
|
+
try {
|
|
7196
|
+
const minted = await mintFromMember(deps, permissions, keys);
|
|
7197
|
+
if (i === order.length - 1 || !await allowanceSpent(deps, minted.token)) return minted;
|
|
7198
|
+
exhausted ??= minted;
|
|
7199
|
+
} catch (e) {
|
|
7200
|
+
if (e instanceof AppActorError && e.code === "vault-denied") {
|
|
7201
|
+
absent += 1;
|
|
7202
|
+
continue;
|
|
7203
|
+
}
|
|
7204
|
+
firstError ??= e;
|
|
7205
|
+
}
|
|
7206
|
+
}
|
|
7207
|
+
if (exhausted) return exhausted;
|
|
7208
|
+
if (firstError) throw firstError;
|
|
7209
|
+
if (absent === order.length) {
|
|
7210
|
+
throw new AppActorError(
|
|
7211
|
+
`app actor: vault denied all App credentials (${APP_VAULT_REPO} tier) \u2014 not an automation host, or no vault access`,
|
|
7212
|
+
"vault-denied"
|
|
7213
|
+
);
|
|
7214
|
+
}
|
|
7215
|
+
throw new AppActorError("app actor: no App pool member minted \u2014 automation fails closed");
|
|
7216
|
+
}
|
|
7217
|
+
async function allowanceSpent(deps, token) {
|
|
7218
|
+
try {
|
|
7219
|
+
const res = await deps.fetch("https://api.github.com/rate_limit", {
|
|
7220
|
+
method: "GET",
|
|
7221
|
+
headers: { authorization: `Bearer ${token}`, accept: "application/vnd.github+json", "user-agent": "mmi-cli-app-actor" }
|
|
7222
|
+
});
|
|
7223
|
+
if (!res.ok) return false;
|
|
7224
|
+
const body = await res.json();
|
|
7225
|
+
return body.resources?.core?.remaining === 0 || body.resources?.graphql?.remaining === 0;
|
|
7226
|
+
} catch {
|
|
7227
|
+
return false;
|
|
7228
|
+
}
|
|
7229
|
+
}
|
|
7230
|
+
async function mintFromMember(deps, permissions, keys) {
|
|
7231
|
+
const [appId, installationId, privateKey] = await Promise.all(keys.map((k) => deps.fetchSecret(k)));
|
|
7188
7232
|
if (!appId || !installationId || !privateKey) {
|
|
7189
|
-
const missing =
|
|
7190
|
-
if (missing.length ===
|
|
7233
|
+
const missing = keys.filter((_, i) => ![appId, installationId, privateKey][i]);
|
|
7234
|
+
if (missing.length === keys.length) {
|
|
7191
7235
|
throw new AppActorError(
|
|
7192
7236
|
`app actor: vault denied all App credentials (${APP_VAULT_REPO} tier) \u2014 not an automation host, or no vault access`,
|
|
7193
7237
|
"vault-denied"
|
|
@@ -18776,10 +18820,10 @@ var rollout_plan_default = {
|
|
|
18776
18820
|
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)."
|
|
18777
18821
|
},
|
|
18778
18822
|
baseline: {
|
|
18779
|
-
version: "4.5.
|
|
18780
|
-
tag: "v4.5.
|
|
18781
|
-
commit: "
|
|
18782
|
-
npm: "@mutmutco/cli@4.5.
|
|
18823
|
+
version: "4.5.159",
|
|
18824
|
+
tag: "v4.5.159",
|
|
18825
|
+
commit: "daaf02084d87",
|
|
18826
|
+
npm: "@mutmutco/cli@4.5.159"
|
|
18783
18827
|
},
|
|
18784
18828
|
exitCriterion: "fleet-n-of-n",
|
|
18785
18829
|
hubOnlyShortcut: "forbidden",
|
|
@@ -18796,14 +18840,14 @@ var rollout_plan_default = {
|
|
|
18796
18840
|
repo: "mutmutco/mmi-hub",
|
|
18797
18841
|
role: "canary",
|
|
18798
18842
|
schedule: "train",
|
|
18799
|
-
v3Target: "v4.5.
|
|
18843
|
+
v3Target: "v4.5.159"
|
|
18800
18844
|
}
|
|
18801
18845
|
],
|
|
18802
18846
|
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.",
|
|
18803
18847
|
rollback: {
|
|
18804
18848
|
independent: true,
|
|
18805
|
-
mechanism: "npm dist-tag latest -> 4.5.
|
|
18806
|
-
v3Target: "v4.5.
|
|
18849
|
+
mechanism: "npm dist-tag latest -> 4.5.159 and redeploy the Hub Lambda from tag v4.5.159 (daaf02084d87); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
|
|
18850
|
+
v3Target: "v4.5.159 (@mutmutco/cli@4.5.159, tag commit daaf02084d87 \u2014 last known-good release carrying the repo-index v4-only contract)"
|
|
18807
18851
|
}
|
|
18808
18852
|
},
|
|
18809
18853
|
{
|
package/cli/package.json
CHANGED