forgedock 1.52.0 → 1.54.0
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/.claude-plugin/marketplace.json +51 -0
- package/README.md +8 -2
- package/bin/auth/app-manifest.mjs +89 -0
- package/bin/auth/app-manifest.test.mjs +75 -0
- package/bin/auth/app-token.mjs +256 -0
- package/bin/auth/app-token.test.mjs +232 -0
- package/bin/brand.mjs +7 -0
- package/bin/config-history.mjs +151 -0
- package/bin/config-schema.mjs +115 -0
- package/bin/demo.mjs +65 -11
- package/bin/engine/outcome-codes.mjs +9 -3
- package/bin/engine/telemetry-seam.mjs +11 -3
- package/bin/engine/telemetry-seam.test.mjs +17 -0
- package/bin/engine-cli.mjs +110 -36
- package/bin/experiment.mjs +58 -6
- package/bin/first-run.mjs +122 -0
- package/bin/forge-utils.mjs +6 -2
- package/bin/forgedock.mjs +138 -142
- package/bin/help-text.mjs +144 -0
- package/bin/hooks/pre-tool-use.mjs +7 -0
- package/bin/journey.mjs +82 -83
- package/bin/lean/acceptance.mjs +313 -0
- package/bin/lean/acceptance.test.mjs +215 -0
- package/bin/lean/account-watch.mjs +28 -0
- package/bin/lean/account-watch.test.mjs +30 -0
- package/bin/lean/activation.mjs +38 -0
- package/bin/lean/activation.test.mjs +36 -1
- package/bin/lean/basered.mjs +115 -0
- package/bin/lean/basered.test.mjs +66 -0
- package/bin/lean/batch-health.mjs +114 -7
- package/bin/lean/batch-health.test.mjs +87 -1
- package/bin/lean/batch.mjs +41 -2
- package/bin/lean/batch.test.mjs +115 -11
- package/bin/lean/branchlock.mjs +54 -0
- package/bin/lean/branchlock.test.mjs +49 -0
- package/bin/lean/ceiling.mjs +72 -0
- package/bin/lean/ceiling.test.mjs +54 -0
- package/bin/lean/checkpoint-reconcile.mjs +43 -0
- package/bin/lean/checkpoint-reconcile.test.mjs +95 -0
- package/bin/lean/ci-budget.mjs +366 -0
- package/bin/lean/ci-budget.test.mjs +167 -0
- package/bin/lean/conformance.e2e.test.mjs +8 -1
- package/bin/lean/conformance.mjs +269 -38
- package/bin/lean/conformance.test.mjs +280 -7
- package/bin/lean/context.mjs +35 -6
- package/bin/lean/context.test.mjs +27 -1
- package/bin/lean/depcache.mjs +25 -1
- package/bin/lean/depcache.test.mjs +26 -0
- package/bin/lean/e2e.mjs +18 -2
- package/bin/lean/e2e.test.mjs +26 -1
- package/bin/lean/effects.mjs +47 -14
- package/bin/lean/execution.mjs +19 -3
- package/bin/lean/execution.test.mjs +63 -0
- package/bin/lean/facts.mjs +3 -3
- package/bin/lean/facts.test.mjs +5 -0
- package/bin/lean/findinglabel.mjs +16 -0
- package/bin/lean/findinglabel.test.mjs +39 -0
- package/bin/lean/fixround.mjs +14 -0
- package/bin/lean/fixround.test.mjs +25 -2
- package/bin/lean/gh-assoc.test.mjs +2 -1
- package/bin/lean/integration.mjs +100 -9
- package/bin/lean/integration.test.mjs +98 -0
- package/bin/lean/issuewatch-parity.mjs +64 -0
- package/bin/lean/issuewatch-parity.test.mjs +127 -0
- package/bin/lean/issuewatch-release.mjs +6 -2
- package/bin/lean/issuewatch-release.test.mjs +17 -1
- package/bin/lean/issuewatch.mjs +45 -6
- package/bin/lean/issuewatch.test.mjs +3 -2
- package/bin/lean/lanelock.mjs +14 -0
- package/bin/lean/lean.mjs +473 -100
- package/bin/lean/lean.test.mjs +686 -33
- package/bin/lean/light.mjs +48 -7
- package/bin/lean/light.test.mjs +37 -3
- package/bin/lean/limits.test.mjs +142 -9
- package/bin/lean/mechfix.mjs +124 -0
- package/bin/lean/mechfix.test.mjs +75 -0
- package/bin/lean/orchestrate-cancel.test.mjs +143 -0
- package/bin/lean/orchestrate.mjs +116 -28
- package/bin/lean/phaseledger.mjs +47 -5
- package/bin/lean/phaseledger.test.mjs +30 -1
- package/bin/lean/postdeploy-check.test.mjs +39 -0
- package/bin/lean/precheck.mjs +23 -4
- package/bin/lean/precheck.test.mjs +14 -1
- package/bin/lean/prereq.mjs +28 -0
- package/bin/lean/prereq.test.mjs +20 -0
- package/bin/lean/probe.mjs +4 -2
- package/bin/lean/prodparity.mjs +52 -0
- package/bin/lean/prodparity.test.mjs +67 -0
- package/bin/lean/prompts.mjs +77 -19
- package/bin/lean/quota.mjs +39 -0
- package/bin/lean/recovery.test.mjs +11 -1
- package/bin/lean/relaxation.mjs +73 -0
- package/bin/lean/relaxation.test.mjs +54 -0
- package/bin/lean/release-io.test.mjs +42 -0
- package/bin/lean/release-postmerge.mjs +125 -0
- package/bin/lean/release-preflight.mjs +58 -0
- package/bin/lean/release-preflight.test.mjs +114 -0
- package/bin/lean/release-rehearsal.mjs +64 -0
- package/bin/lean/release-rehearsal.test.mjs +93 -0
- package/bin/lean/release-review.e2e.test.mjs +77 -0
- package/bin/lean/release-review.mjs +254 -0
- package/bin/lean/release-review.test.mjs +307 -0
- package/bin/lean/release-snapshot.mjs +188 -0
- package/bin/lean/release-snapshot.test.mjs +190 -0
- package/bin/lean/release.mjs +296 -0
- package/bin/lean/release.test.mjs +387 -0
- package/bin/lean/render.mjs +1 -1
- package/bin/lean/replan.mjs +184 -0
- package/bin/lean/replan.test.mjs +110 -0
- package/bin/lean/resume.mjs +9 -7
- package/bin/lean/resume.test.mjs +16 -0
- package/bin/lean/rotator.mjs +150 -31
- package/bin/lean/rotator.test.mjs +105 -2
- package/bin/lean/sandbox-remote.mjs +9 -2
- package/bin/lean/schedd.mjs +83 -5
- package/bin/lean/schedd.test.mjs +108 -7
- package/bin/lean/selfreview.mjs +94 -0
- package/bin/lean/selfreview.test.mjs +58 -1
- package/bin/lean/selftest-gate.mjs +22 -0
- package/bin/lean/selftest-gate.test.mjs +18 -1
- package/bin/lean/selftest-journey.mjs +234 -0
- package/bin/lean/selftest-journey.test.mjs +130 -0
- package/bin/lean/selftest-live.mjs +2 -1
- package/bin/lean/seqlease.mjs +35 -1
- package/bin/lean/seqlease.test.mjs +15 -0
- package/bin/lean/seqreserve.e2e.test.mjs +135 -0
- package/bin/lean/seqreserve.mjs +73 -0
- package/bin/lean/seqreserve.test.mjs +134 -0
- package/bin/lean/sequence.mjs +35 -6
- package/bin/lean/seqversioned.mjs +147 -0
- package/bin/lean/stagestamp.mjs +28 -0
- package/bin/lean/stagestamp.test.mjs +32 -0
- package/bin/lean/surfaces.mjs +75 -0
- package/bin/lean/surfaces.test.mjs +59 -0
- package/bin/lean/toolplace.mjs +28 -0
- package/bin/lean/toolplace.test.mjs +24 -0
- package/bin/lean/toolstats.mjs +3 -1
- package/bin/lean/toolstats.test.mjs +11 -0
- package/bin/lean/validatebest.mjs +28 -0
- package/bin/lean/validatebest.test.mjs +27 -0
- package/bin/lean/verifier.mjs +3 -2
- package/bin/lean/verify.mjs +2 -1
- package/bin/lean/verify.test.mjs +6 -0
- package/bin/pool/agent.mjs +27 -4
- package/bin/pool/docker.mjs +5 -0
- package/bin/pool/router.mjs +74 -28
- package/bin/prereqs.mjs +111 -0
- package/bin/replay-timelapse.mjs +149 -0
- package/bin/review-staging.mjs +123 -16
- package/bin/review-staging.test.mjs +18 -0
- package/bin/runner.mjs +43 -6
- package/bin/splash-install.mjs +157 -0
- package/bin/stats/aggregate.mjs +8 -1
- package/bin/stats/conformance-outcomes.mjs +289 -0
- package/bin/stats/conformance-outcomes.test.mjs +274 -0
- package/bin/stats/depth.mjs +275 -0
- package/bin/stats/depth.test.mjs +158 -0
- package/bin/stats/efficiency.mjs +26 -5
- package/bin/stats/efficiency.test.mjs +45 -1
- package/bin/stats/experiment.mjs +7 -5
- package/bin/stats/first-review.mjs +77 -0
- package/bin/stats/first-review.test.mjs +36 -0
- package/bin/stats/firstmerge.mjs +40 -0
- package/bin/stats/firstmerge.test.mjs +41 -0
- package/bin/stats/github-source.mjs +53 -15
- package/bin/stats/index.mjs +147 -9
- package/bin/stats/local-source.mjs +12 -0
- package/bin/stats/origin.mjs +80 -0
- package/bin/stats/origin.test.mjs +58 -0
- package/bin/stats/query.mjs +69 -0
- package/bin/stats/render.mjs +3 -1
- package/bin/stats/scoreboard.mjs +137 -0
- package/bin/stats/scoreboard.test.mjs +87 -0
- package/bin/stats/selffiled.mjs +52 -0
- package/bin/stats/selffiled.test.mjs +71 -0
- package/bin/stats/stats.test.mjs +80 -0
- package/bin/tui.mjs +3 -2
- package/commands/bootstrap.md +15 -14
- package/commands/deploy-pr.md +18 -3
- package/commands/forge-stats.md +1 -1
- package/commands/forgedock-ci-setup.md +28 -0
- package/commands/forgedock-init.md +4 -5
- package/commands/issue.md +2 -0
- package/commands/milestone.md +9 -1
- package/commands/orchestrate.md +1 -1
- package/commands/replay.md +2 -0
- package/commands/review-pr-agents/security.md +4 -0
- package/commands/review-pr-staging.md +6 -1
- package/commands/work-on/build.md +4 -6
- package/commands/work-on/close.md +8 -0
- package/docs/CONFIG.md +170 -18
- package/docs/ISSUE-WATCH.md +25 -0
- package/docs/OUTCOME-CODES.md +4 -0
- package/docs/REPLAY.md +9 -0
- package/docs/SELFTEST.md +11 -0
- package/docs/STATS.md +61 -0
- package/docs/TELEMETRY.md +1 -1
- package/docs/eval/README.md +6 -0
- package/docs/eval/adversarial-bench.md +68 -0
- package/docs/eval/corpus/adversarial-v1.json +285 -0
- package/docs/eval/feature-bench.md +42 -0
- package/docs/eval/feature-specs/crud-auth/journeys/notes-crud-isolated.mjs +21 -0
- package/docs/eval/feature-specs/crud-auth/journeys/register-login.mjs +12 -0
- package/docs/eval/feature-specs/crud-auth/spec.md +15 -0
- package/docs/site/start-a-new-project.md +2 -1
- package/package.json +5 -2
- package/plugins/forgedock-splash/.claude-plugin/plugin.json +10 -0
- package/plugins/forgedock-splash/README.md +27 -0
- package/plugins/forgedock-splash/hooks/hooks.json +1 -0
- package/plugins/forgedock-splash/hooks/register.tsx +74 -0
- package/plugins/forgedock-splash/hooks/scene.ts +222 -0
- package/plugins/forgedock-splash/types/index.d.ts +10 -0
- package/pool/README.md +1 -1
- package/pool/image/cs-cred +14 -1
- package/scripts/backfill-finding-labels.mjs +50 -0
- package/scripts/backfill-finding-labels.test.mjs +36 -0
- package/scripts/bench-adversarial.mjs +216 -0
- package/scripts/bench-feature.mjs +170 -0
- package/scripts/bench-lightlane.mjs +2 -2
- package/scripts/bootstrap-create.mjs +2 -2
- package/scripts/bootstrap-validate.mjs +35 -2
- package/scripts/check-spec-size.sh +4 -3
- package/scripts/check-spec-size.test.sh +3 -0
- package/scripts/doctor-pipeline-state.sh +21 -6
- package/scripts/file-deferred-followups.sh +59 -251
- package/scripts/file-deferred-followups.test.sh +85 -206
- package/scripts/followup-route.mjs +12 -0
- package/scripts/owner-route-parity.test.sh +17 -1
- package/scripts/plan-validate-live.mjs +40 -6
- package/scripts/review-pr-side-effects.test.sh +40 -0
- package/scripts/review-pr-staging-scope.test.sh +1 -1
- package/scripts/review-staging-post.sh +23 -0
- package/scripts/review-staging-post.test.sh +8 -0
package/bin/forgedock.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
findMarkdownFiles,
|
|
29
29
|
parseInstallTier,
|
|
30
30
|
writeForgeYaml,
|
|
31
|
-
|
|
31
|
+
backupForgeYaml,
|
|
32
32
|
backfillForgeYaml,
|
|
33
33
|
manualLowConfidenceKeys,
|
|
34
34
|
isEphemeralCachePath,
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
resolveClaudeConfigDir,
|
|
39
39
|
setupAfterRead,
|
|
40
40
|
} from "./journey.mjs";
|
|
41
|
+
import { SPLASH_PLUGIN, splashState, uninstallSplash } from "./splash-install.mjs";
|
|
41
42
|
import {
|
|
42
43
|
deriveWorkflowLabels,
|
|
43
44
|
FINDINGS_LANE_LABEL,
|
|
@@ -66,11 +67,12 @@ import {
|
|
|
66
67
|
getInstalledCommandsDriftStatus,
|
|
67
68
|
} from "./registry.mjs";
|
|
68
69
|
import { renderMark, ember } from "./cinema.mjs";
|
|
70
|
+
import { checkPrereqs, offerInstall } from "./prereqs.mjs";
|
|
69
71
|
import { guideText, guideWidth, useAnsi } from "./guide.mjs";
|
|
72
|
+
import { topLevelHelp, fullHelp } from "./help-text.mjs";
|
|
70
73
|
import {
|
|
71
74
|
renderLogo,
|
|
72
75
|
getLogoTagline,
|
|
73
|
-
box,
|
|
74
76
|
table,
|
|
75
77
|
input,
|
|
76
78
|
confirm,
|
|
@@ -88,7 +90,10 @@ import {
|
|
|
88
90
|
} from "./tui.mjs";
|
|
89
91
|
import { buildMinimalForgeYaml } from "./init-detect.mjs";
|
|
90
92
|
import { checkContext, refreshContextFlow } from "./review-context.mjs";
|
|
93
|
+
import { runConfigCommand } from "./config-history.mjs";
|
|
94
|
+
import { validateForgeYaml } from "./config-schema.mjs";
|
|
91
95
|
import { botTokenStatus } from "./bot-token-status.mjs";
|
|
96
|
+
import { applyAuthEnv, startAuthRefresh, doctorAppAuth } from "./auth/app-token.mjs";
|
|
92
97
|
import {
|
|
93
98
|
parseNameStatusDiff,
|
|
94
99
|
classifyCommandChanges,
|
|
@@ -250,13 +255,14 @@ function isOwnedLinkTarget(dest, src, kind, rel) {
|
|
|
250
255
|
// --minimal is init-only. Subcommands with their own flag parsing (run,
|
|
251
256
|
// run-issue, demo) receive restArgs — everything after the command token.
|
|
252
257
|
const rawArgs = process.argv.slice(2);
|
|
253
|
-
const FLAGS = new Set(["--fast", "--manual", "--verbose", "--minimal", "--extras", "--refresh-context"]);
|
|
258
|
+
const FLAGS = new Set(["--fast", "--manual", "--verbose", "--minimal", "--extras", "--refresh-context", "--no-splash"]);
|
|
254
259
|
const flags = rawArgs.filter((a) => FLAGS.has(a));
|
|
255
260
|
// --global is stripped from positionals/restArgs for backward compatibility
|
|
256
261
|
// with existing invocations, but is otherwise a no-op — see the install-mode
|
|
257
262
|
// path resolution block above (global is now the only install location).
|
|
258
263
|
const positional = rawArgs.filter((a) => !FLAGS.has(a) && a !== "--global");
|
|
259
|
-
|
|
264
|
+
// `setup` is the plain-language name of the guided install (#5303).
|
|
265
|
+
const command = !positional[0] || positional[0] === "setup" ? "install" : positional[0];
|
|
260
266
|
const cmdIdx = rawArgs.findIndex((a) => !FLAGS.has(a) && a !== "--global");
|
|
261
267
|
const restArgs = cmdIdx === -1 ? [] : rawArgs.slice(cmdIdx + 1).filter((a) => a !== "--global");
|
|
262
268
|
|
|
@@ -1084,7 +1090,7 @@ async function initFlow(c) {
|
|
|
1084
1090
|
return refreshContextFlow({
|
|
1085
1091
|
cwd: c.cwd,
|
|
1086
1092
|
out: c.stdout,
|
|
1087
|
-
deps: { interactive: process.stdin.isTTY === true, confirm, backup:
|
|
1093
|
+
deps: { interactive: process.stdin.isTTY === true, confirm, backup: (p) => backupForgeYaml(p, "refresh-context"), write: atomicWriteFile },
|
|
1088
1094
|
});
|
|
1089
1095
|
}
|
|
1090
1096
|
const hasExisting = existsSync(outputPath);
|
|
@@ -1120,12 +1126,12 @@ async function initFlow(c) {
|
|
|
1120
1126
|
// Hard-fail on unresolved identity placeholders when overwriting an
|
|
1121
1127
|
// existing config (forge#1850 spec item 4) — never destroy a working
|
|
1122
1128
|
// forge.yaml in favor of one that can't address a repo.
|
|
1123
|
-
if (
|
|
1129
|
+
if ((draft.project.owner.value === "your-github-org" || draft.project.repo.value === "your-repo-name")) {
|
|
1124
1130
|
c.stdout.write("\n Could not determine the GitHub owner/repo for this project.\n");
|
|
1125
1131
|
c.stdout.write(" Run this inside the target git repository, or use interactive init (npx forgedock init) to edit those fields.\n");
|
|
1126
1132
|
return 1;
|
|
1127
1133
|
}
|
|
1128
|
-
const backup =
|
|
1134
|
+
const backup = backupForgeYaml(outputPath, "init (minimal)");
|
|
1129
1135
|
if (backup) c.stdout.write(` Backed up: forge.yaml → ${backup.backupName}\n`);
|
|
1130
1136
|
const content = buildMinimalForgeYaml({
|
|
1131
1137
|
projectName: draft.project.name.value,
|
|
@@ -1159,12 +1165,12 @@ async function initFlow(c) {
|
|
|
1159
1165
|
};
|
|
1160
1166
|
// Checked on the FINAL accepted values (post-prompt), not the draft —
|
|
1161
1167
|
// the user may have typed over a placeholder default.
|
|
1162
|
-
if (
|
|
1168
|
+
if ((v.owner === "your-github-org" || v.repo === "your-repo-name")) {
|
|
1163
1169
|
c.stdout.write("\n Could not determine the GitHub owner/repo for this project.\n");
|
|
1164
1170
|
c.stdout.write(" Enter real values, or run this inside the target git repository.\n");
|
|
1165
1171
|
return 1;
|
|
1166
1172
|
}
|
|
1167
|
-
const backup =
|
|
1173
|
+
const backup = backupForgeYaml(outputPath, "init");
|
|
1168
1174
|
if (backup) c.stdout.write(` Backed up: forge.yaml → ${backup.backupName}\n`);
|
|
1169
1175
|
const lowKeys = manualLowConfidenceKeys(draft, description, v);
|
|
1170
1176
|
const { todoCount } = writeForgeYaml(v, lowKeys, outputPath);
|
|
@@ -1176,7 +1182,7 @@ async function initFlow(c) {
|
|
|
1176
1182
|
const { draft, description } = await setupAfterRead(c, await read(c));
|
|
1177
1183
|
const reviewed = await review(c, draft, description);
|
|
1178
1184
|
if (!reviewed.aborted) ensureToolStateIgnored(c);
|
|
1179
|
-
celebrate(c, reviewed);
|
|
1185
|
+
if (!reviewed.aborted) celebrate(c, reviewed);
|
|
1180
1186
|
if (!reviewed.aborted) await maybeOfferDemo(c);
|
|
1181
1187
|
return reviewed.aborted ? 1 : 0;
|
|
1182
1188
|
}
|
|
@@ -1436,6 +1442,9 @@ async function uninstall() {
|
|
|
1436
1442
|
}
|
|
1437
1443
|
console.log("");
|
|
1438
1444
|
|
|
1445
|
+
// Startup splash plugin + the local marketplace setup added (#5312).
|
|
1446
|
+
for (const line of uninstallSplash({ home: HOME }).lines) console.log(` ${GREEN}✔${RESET} ${line}`);
|
|
1447
|
+
|
|
1439
1448
|
console.log(`${GREEN}ForgeDock uninstalled.${RESET} No residue remains from this directory.`);
|
|
1440
1449
|
console.log(` Re-install at any time with: ${CYAN}npx forgedock${RESET}`);
|
|
1441
1450
|
console.log("");
|
|
@@ -2366,7 +2375,13 @@ async function labelsSetup(repo, domainLabels = []) {
|
|
|
2366
2375
|
* Returns 0 if all checks pass (warnings allowed), 1 if any hard check fails.
|
|
2367
2376
|
* @param {boolean} [fix] - When true, auto-apply deterministic remediations.
|
|
2368
2377
|
*/
|
|
2369
|
-
|
|
2378
|
+
// Internal/legacy doctor warnings, shown only with `doctor --verbose` (#5302).
|
|
2379
|
+
const INTERNAL_WARNINGS = new Set([
|
|
2380
|
+
"FORGE_HOME env var", "Playwright MCP", "Version-gated features", "CLAUDE.md legacy block",
|
|
2381
|
+
"Resource hygiene", "Persisted toolset home (~/.forge)",
|
|
2382
|
+
]);
|
|
2383
|
+
|
|
2384
|
+
async function doctor(fix = false, verbose = false) {
|
|
2370
2385
|
console.log("");
|
|
2371
2386
|
console.log(`${BOLD}ForgeDock Doctor${RESET} — Installation Health Check`);
|
|
2372
2387
|
console.log("");
|
|
@@ -2412,6 +2427,7 @@ async function doctor(fix = false) {
|
|
|
2412
2427
|
* @param {string} hint
|
|
2413
2428
|
*/
|
|
2414
2429
|
function warn(label, hint) {
|
|
2430
|
+
if (!verbose && (INTERNAL_WARNINGS.has(label) || label.startsWith("Restarts:"))) return;
|
|
2415
2431
|
warnings++;
|
|
2416
2432
|
console.log(` ${YELLOW}⚠${RESET} ${label}`);
|
|
2417
2433
|
console.log(` Note: ${hint}`);
|
|
@@ -2621,35 +2637,22 @@ async function doctor(fix = false) {
|
|
|
2621
2637
|
}
|
|
2622
2638
|
}
|
|
2623
2639
|
|
|
2624
|
-
// ── Check 2:
|
|
2640
|
+
// ── Check 2: prerequisites (Node, git, Claude Code, gh, yq) ───────────────
|
|
2641
|
+
// The same list setup runs (prereqs.mjs, #5302); --fix offers to install what can be installed, with consent.
|
|
2625
2642
|
let ghAvailable = false;
|
|
2626
2643
|
{
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
// gh not installed
|
|
2644
|
+
const quietExec = (cmd, args) => execFileSync(cmd, args, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], timeout: 10000 }).trim();
|
|
2645
|
+
const probe = () => checkPrereqs({ exec: quietExec, nodeVersion: process.versions.node, claudeDir: GLOBAL_CLAUDE_DIR });
|
|
2646
|
+
let results = probe();
|
|
2647
|
+
if (fix && (await offerInstall(results.filter((r) => r.auto), { confirmFn: confirm, write: (t) => process.stdout.write(t) })).length > 0) {
|
|
2648
|
+
fixesApplied++;
|
|
2649
|
+
results = probe();
|
|
2634
2650
|
}
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
fail(
|
|
2638
|
-
} else {
|
|
2639
|
-
try {
|
|
2640
|
-
execSync("gh auth status", { stdio: ["ignore", "pipe", "ignore"] });
|
|
2641
|
-
ghAuthed = true;
|
|
2642
|
-
} catch {
|
|
2643
|
-
// Not authenticated
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
|
-
if (ghAuthed) {
|
|
2647
|
-
pass("gh CLI", "installed and authenticated");
|
|
2648
|
-
ghAvailable = true;
|
|
2649
|
-
} else {
|
|
2650
|
-
fail("gh CLI", "Run: gh auth login");
|
|
2651
|
-
}
|
|
2651
|
+
for (const r of results) {
|
|
2652
|
+
if (r.ok) pass(r.label, r.detail);
|
|
2653
|
+
else fail(r.label, `${r.detail}. ${(r.fix ?? []).join(" or ")}`.trim());
|
|
2652
2654
|
}
|
|
2655
|
+
ghAvailable = results.find((r) => r.id === "gh")?.ok === true;
|
|
2653
2656
|
}
|
|
2654
2657
|
|
|
2655
2658
|
// ── Check 3: git configured ────────────────────────────────────────────────
|
|
@@ -2764,6 +2767,8 @@ async function doctor(fix = false) {
|
|
|
2764
2767
|
}
|
|
2765
2768
|
} catch { /* advisory check: never fail doctor */ }
|
|
2766
2769
|
|
|
2770
|
+
for (const f of validateForgeYaml(content)) (f.level === "error" ? fail : warn)(`forge.yaml ${f.code}`, f.message);
|
|
2771
|
+
|
|
2767
2772
|
const defaultMatch = content.match(/^\s+default:\s+"([^"]*)"/m);
|
|
2768
2773
|
const stagingMatch = content.match(/^\s+staging:\s+"([^"]*)"/m);
|
|
2769
2774
|
if (
|
|
@@ -3129,6 +3134,9 @@ async function doctor(fix = false) {
|
|
|
3129
3134
|
}
|
|
3130
3135
|
}
|
|
3131
3136
|
|
|
3137
|
+
// ── Startup splash plugin (informational, #5312): never a failure ─────────
|
|
3138
|
+
pass("Startup splash", splashState({ home: HOME }) + ` (${SPLASH_PLUGIN}; install: npx forgedock, skip: --no-splash)`);
|
|
3139
|
+
|
|
3132
3140
|
// ── Check 8: FORGE_HOME environment variable (informational) ──────────────
|
|
3133
3141
|
// The journey-based install never exports FORGE_HOME — it isn't required
|
|
3134
3142
|
// for the pipeline to run. It only affects orchestrate's legacy
|
|
@@ -3209,32 +3217,6 @@ async function doctor(fix = false) {
|
|
|
3209
3217
|
}
|
|
3210
3218
|
}
|
|
3211
3219
|
|
|
3212
|
-
// ── Check 10: yq installed ────────────────────────────────────────────────
|
|
3213
|
-
// yq is a hard dependency: pipeline commands (work-on, review-pr, orchestrate)
|
|
3214
|
-
// read forge.yaml via yq. Without it, those commands fail. Fixed literal
|
|
3215
|
-
// command — no interpolation, so no injection surface (cf. #663/#789/#807).
|
|
3216
|
-
{
|
|
3217
|
-
let yqVersion = "";
|
|
3218
|
-
try {
|
|
3219
|
-
yqVersion = execSync("yq --version", {
|
|
3220
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
3221
|
-
encoding: "utf-8",
|
|
3222
|
-
timeout: 5000,
|
|
3223
|
-
}).trim();
|
|
3224
|
-
} catch {
|
|
3225
|
-
// yq not installed or not on PATH
|
|
3226
|
-
}
|
|
3227
|
-
|
|
3228
|
-
if (yqVersion) {
|
|
3229
|
-
pass("yq", yqVersion);
|
|
3230
|
-
} else {
|
|
3231
|
-
fail(
|
|
3232
|
-
"yq",
|
|
3233
|
-
"Install the YAML processor (used to read forge.yaml): https://github.com/mikefarah/yq#install",
|
|
3234
|
-
);
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
|
|
3238
3220
|
// ── Check 11: Claude Code installed + version compatible ───────────────────
|
|
3239
3221
|
// The compatibility floor is the @anthropic-ai/claude-code peerDependency in
|
|
3240
3222
|
// package.json (read dynamically so it never drifts from the declared floor).
|
|
@@ -3318,7 +3300,11 @@ async function doctor(fix = false) {
|
|
|
3318
3300
|
// token) — this check exists so that state is surfaced instead of silent.
|
|
3319
3301
|
// See docs/CONFIG.md "GitHub App Install" and forge#1890.
|
|
3320
3302
|
const botTok = botTokenStatus(); // #4662: lifetime from the refresh stamp; no stamp means no refresher is installed
|
|
3321
|
-
|
|
3303
|
+
const appAuth = await doctorAppAuth(); // #5301: broker/BYO App login: identity, source, rate limit
|
|
3304
|
+
if (appAuth.configured) {
|
|
3305
|
+
if (appAuth.status === "pass") pass("GitHub App / bot token", appAuth.detail);
|
|
3306
|
+
else warn("GitHub App / bot token", appAuth.detail);
|
|
3307
|
+
} else if (botTok.configured) {
|
|
3322
3308
|
const min = (ms) => Math.round(ms / 60000);
|
|
3323
3309
|
const detail = botTok.remainingMs != null ? `${min(botTok.remainingMs)} min left, refreshed ${min(botTok.ageMs)} min ago (${botTok.refreshedAt})` : botTok.reason;
|
|
3324
3310
|
if (botTok.ok) pass("GitHub App / bot token", detail);
|
|
@@ -3385,80 +3371,11 @@ async function doctor(fix = false) {
|
|
|
3385
3371
|
return failures > 0 ? 1 : 0;
|
|
3386
3372
|
}
|
|
3387
3373
|
|
|
3388
|
-
function help() {
|
|
3389
|
-
// splash() already rendered the logo to stderr
|
|
3390
|
-
//
|
|
3391
|
-
const
|
|
3392
|
-
|
|
3393
|
-
["npx forgedock", "Guided setup: install commands + configure repo (default)"],
|
|
3394
|
-
["npx forgedock guide", "How the workflow fits together: core commands, issue -> staging -> main, where a run ends, how to resume"],
|
|
3395
|
-
["npx forgedock install", "Install commands to ~/.claude/"],
|
|
3396
|
-
["npx forgedock init", "Generate forge.yaml config for your project"],
|
|
3397
|
-
["npx forgedock init --minimal", "Generate a minimal forge.yaml (required sections only)"],
|
|
3398
|
-
["npx forgedock enable [dir]", "Activate ForgeDock in a directory"],
|
|
3399
|
-
["npx forgedock disable [dir]", "Opt a directory out of ForgeDock"],
|
|
3400
|
-
["npx forgedock fix-close-reasons <owner/repo> [--milestone <m>] [--apply]", "Re-close issues that were closed not planned but carry workflow:merged or workflow:decomposed (delivered, not dropped) as completed, with a comment; dry run unless --apply; workflow:invalid issues are never touched"],
|
|
3401
|
-
["npx forgedock status [dir]", "Show ForgeDock state for a directory"],
|
|
3402
|
-
["npx forgedock run <cmd> [args]", "Run a command headlessly (local claude CLI or Anthropic API)"],
|
|
3403
|
-
["npx forgedock bootstrap <idea|docs> [--dry-run] [--spike <path>] | --plan <plan.json> [--dry-run]", "Headless /bootstrap: idea to orchestrate-ready backlog (--dry-run previews milestones, titles, DAG and estimated agent cost without GitHub writes); --plan validates and creates (or previews) a plan, and re-running resumes from GitHub"],
|
|
3404
|
-
["npx forgedock run-issue <issue> [--lane <lane>] [--lane-override] [--path core|full] [--retry] [--wait-lease]", "Run the lean core work-on on one issue (default; --path full = legacy multi-phase pipeline; the lane comes from the issue: milestone → milestone/<slug>, else staging; --lane is an assertion, never the default branch) (--retry reopens an engine-error run, or a needs-human run once the label is cleared; --wait-lease waits for a held lease; exit 75 = deferred, lease held)"],
|
|
3405
|
-
["npx forgedock plan validate --live [--repo owner/repo] [--json]", "Re-run the bootstrap dependency-order rules on live GitHub state: each cross-milestone Depends-on edge is ok, held or invalid (exit 1 on invalid)"],
|
|
3406
|
-
["npx forgedock orchestrate <issue...> [--parallel K] [--lane L]", "Run core work-on on several issues with bounded concurrency and Depends-on ordering; each issue on its own lane, cross-lane dependencies reported"],
|
|
3407
|
-
["npx forgedock orchestrate --resume <id> [N...] | --set-parallel <id> K | --set-max-remote <id> N | --set-placement <id> remote|hybrid|local | --add <id> N... | --requeue <id> N... [--reason \"...\"] | --cancel <id> | --hold <id> N... | --release <id> N... | --show-env <id> | --set-env <id> KEY=VAL | --unset-env <id> KEY", "Reattach to a batch hosted by the schedd daemon (a finished one replays its report, an orphaned one is resumed with live lanes re-adopted), change its concurrency live, change its max_remote or placement mode live (remote/hybrid need a batch started with a remote provider; running lanes are not stopped), add issues to a running (or held) batch under its K and DAG, requeue a terminal issue (and the dependents skipped behind it) after an operator decision (refused while it is labelled needs-human or closed; a finished batch is reopened), or stop one batch without stopping schedd (running lanes torn down with their work saved, the rest held for --resume), or hold/release single issues of a batch (a held issue is not admitted until released or named by --resume), or print (secrets redacted), set or unset a batch's pinned lane env (applies to newly launched lanes)"],
|
|
3408
|
-
["npx forgedock triage <issue...> [--lane L] [--dry-run]", "Already-fixed pre-filter: close issues a merged PR or green CI already resolved; print the rest"],
|
|
3409
|
-
["npx forgedock probe [issue...] [--dry-run]", "Run declared acceptance probes for closed issues whose fix is on the default branch; a fail reopens the issue"],
|
|
3410
|
-
["npx forgedock check [--base REF] [--json]", "Run the lane's frozen validate commands and change-scoped pre-PR checks locally in this worktree, as the engine will (no GitHub, no Actions)"],
|
|
3411
|
-
["npx forgedock milestone train <slug...> [--parallel-milestones N] | --resume <id> | --insert <id> <slug> [--before s|--after s] | --show <id>", "Unattended multi-milestone train: one durable state file (order, active set, lifecycle), typed STOP reasons, resumable; never edits forge.yaml"],
|
|
3412
|
-
["npx forgedock guards list [--path p] [--json] | backfill --since <date> [--dry-run]", "Fix guards: list the FORGE:GUARD records (test files + protected hunks of merged fixes) covering a path, or build them for already-merged lean lanes"],
|
|
3413
|
-
["npx forgedock issue-watch run [--name <w>] [--repo owner/repo] [--once] [--dry-run] | status [--name <w>]", "Named, scoped, capped watches (forge.yaml issue_watch.watches) that claim matching open issues into lanes or one long-lived orchestrate batch, or (mode: release) pool them and cut themed releases; see docs/ISSUE-WATCH.md"],
|
|
3414
|
-
["npx forgedock selftest [--static] | --live --repo <owner/sandbox> [--lang node|python] [--pr <N>]", "Live contract harness: drives the real gh, git and orchestrate through a disposable sandbox repo (steps create, add, body, resume, merge, remote, cleanup) plus a static check of every gh --json field list; exits non-zero naming the failed step; --pr posts the FORGE:SELFTEST result the staging->main review requires; see docs/SELFTEST.md"],
|
|
3415
|
-
["npx forgedock prod-watch run [--repo owner/repo] [--once] [--interval <s>] [--dry-run] | status", "Production-side watcher (forge.yaml prod_watch): read-only signal sources -> triage -> governor -> issues, kill-switch file, owner digest; see docs/PROD-WATCH.md"],
|
|
3416
|
-
["npx forgedock limits show | clear <id>|--all", "Show or clear per-account usage-limit holds shared by orchestrate batches"],
|
|
3417
|
-
["npx forgedock decisions list [--stale] [--refresh]", "List anchored decisions (FORGE:DECISION); --stale shows those with an anchor missing on the base"],
|
|
3418
|
-
["npx forgedock sched show | cap <N>|--clear | weight <owner/repo> <N>|--clear", "Show the host lane registry, set the host-wide lane cap shared by orchestrate batches, or set a repo's share of slots within a priority (default equal)"],
|
|
3419
|
-
["npx forgedock schedd [status | watchdog]", "Host scheduler daemon hosting every orchestrate batch (auto-spawned by orchestrate; run in the foreground for a systemd-user unit); status shows its pid, batches and last tick; watchdog restarts a stalled daemon"],
|
|
3420
|
-
["npx forgedock pool router [install] | enroll [--cpus N --mem GB] | status | upgrade [agent] | remove <agent>", "Built-in remote compute pool: run the router (foreground, or install it as a user service), print the one-time install command for a host, list agents, upgrade or remove them"],
|
|
3421
|
-
["npx forgedock gc [--apply] [--older-than 6h] [--docker] [--worktrees] [--branches] [--tmp] [--processes] [--sandboxes]", "Report (dry-run default) and reclaim ForgeDock-owned leftovers: stale lane ledgers, forgedock-labelled containers/volumes, lean-*/agent-* worktrees, abandoned lane branches, ~/.forge/tmp scratch, orphaned lane processes, orphaned lane sandboxes; unowned resources and unpushed work are only reported"],
|
|
3422
|
-
["npx forgedock resume-stalled [--dry-run]", "Fleet stall recovery — re-dispatch expired-lease issues"],
|
|
3423
|
-
["npx forgedock demo", "Set up a risk-free demo repo and print next steps"],
|
|
3424
|
-
["npx forgedock labels [setup] [--repo owner/repo] [--domain a,b,c]", "Bootstrap ForgeDock-managed labels on a GitHub repo, plus optional per-repo domain labels (idempotent)"],
|
|
3425
|
-
["npx forgedock config migrate [dir]", "Backfill missing optional sections into an existing forge.yaml (idempotent)"],
|
|
3426
|
-
["npx forgedock watch [--repo owner/repo]", "Live per-agent orchestration view (Ctrl+C to exit)"],
|
|
3427
|
-
["npx forgedock report [--days 30] [--md] [--json]", "30-day pipeline impact receipts for your repo"],
|
|
3428
|
-
["npx forgedock review-staging [<PR>] [--thorough] [--json]", "Staging->main review pre-dispatch: route marker, open-finding gate, scope, prepare, roster; writes one reviewer brief per domain"],
|
|
3429
|
-
["npx forgedock review-staging [<PR>] --finalize --test-gate-output <file>", "Staging->main review post-dispatch: delivery, test-gate verdict, extract/classify/file-prepare; prints the findings to file"],
|
|
3430
|
-
["npx forgedock review-staging [<PR>] --summary [--filed <N>]...", "Staging->main review Phase 8: verdict and summary comment with the FORGE:GATE_PASS / FORGE:GATE_FAILURE marker"],
|
|
3431
|
-
["npx forgedock stats [--since <ver|date>] [--repo owner/repo] [--json] [--refresh]", "Version-over-version cost/time/flow/review/gate report from GitHub telemetry (no model)"],
|
|
3432
|
-
["npx forgedock doctor", "Check installation health"],
|
|
3433
|
-
["npx forgedock doctor --fix", "Auto-fix deterministic issues (symlinks, hook, labels, legacy block) and reclaim ForgeDock-owned leftovers (forge.yaml hygiene TTLs)"],
|
|
3434
|
-
["npx forgedock doctor --lanes", "Lane preflight: pool token, pool agent version, PATH shim loops, gh --json fields; prints every check pass/fail"],
|
|
3435
|
-
["npx forgedock update", "Pull latest & reinstall"],
|
|
3436
|
-
["npx forgedock uninstall", "Remove commands"],
|
|
3437
|
-
["npx forgedock opencode install", "Install token-efficient native OpenCode commands"],
|
|
3438
|
-
["npx forgedock opencode status", "Check the OpenCode adapter"],
|
|
3439
|
-
["npx forgedock opencode uninstall", "Remove ForgeDock-owned OpenCode files"],
|
|
3440
|
-
["npx forgedock version", "Print the installed version and check for updates"],
|
|
3441
|
-
["npx forgedock help", "Show this help"],
|
|
3442
|
-
];
|
|
3443
|
-
const flagRows = [
|
|
3444
|
-
["Flag", "Description"],
|
|
3445
|
-
["--fast", "Skip animation/motion"],
|
|
3446
|
-
["--manual", "Plain text prompts instead of the review screen (init)"],
|
|
3447
|
-
["--verbose", "Show detection sources for every field (init)"],
|
|
3448
|
-
["--minimal", "Generate a minimal forge.yaml with required sections only (init)"],
|
|
3449
|
-
["--refresh-context", "Regenerate review.context/tech_stack from manifests and show a diff for approval (init)"],
|
|
3450
|
-
["--version, -v", "Print the installed version and check for updates"],
|
|
3451
|
-
];
|
|
3452
|
-
|
|
3453
|
-
// Fit the terminal (100 columns when stdout is not a TTY: CI logs, pipes); the box adds 4.
|
|
3454
|
-
const maxWidth = guideWidth(process.stdout) - 4;
|
|
3455
|
-
process.stdout.write("New to ForgeDock? npx forgedock guide explains the workflow in one screen.\n\n");
|
|
3456
|
-
process.stdout.write(
|
|
3457
|
-
box(table(commands, { header: true, maxWidth }), { title: "Usage" }) + "\n",
|
|
3458
|
-
);
|
|
3459
|
-
process.stdout.write(
|
|
3460
|
-
box(table(flagRows, { header: true, maxWidth }), { title: "Flags" }) + "\n",
|
|
3461
|
-
);
|
|
3374
|
+
function help(all = false) {
|
|
3375
|
+
// splash() already rendered the logo to stderr; the help text itself goes to stdout (it is the requested artifact).
|
|
3376
|
+
// Fit the terminal (100 columns when stdout is not a TTY: CI logs, pipes).
|
|
3377
|
+
const width = guideWidth(process.stdout);
|
|
3378
|
+
process.stdout.write((all ? fullHelp({ width }) : topLevelHelp({ width })) + "\n");
|
|
3462
3379
|
}
|
|
3463
3380
|
|
|
3464
3381
|
/**
|
|
@@ -4000,15 +3917,19 @@ async function watch() {
|
|
|
4000
3917
|
// The journey-routed commands render their own branded marks (hero/compact);
|
|
4001
3918
|
// splash() would double-brand them. Engine-surface commands, help, and
|
|
4002
3919
|
// unknown-command output keep the logo.
|
|
4003
|
-
const SPLASH_COMMANDS = new Set(["run", "bootstrap", "run-issue", "orchestrate", "triage", "probe", "gc", "resume-stalled", "demo", "doctor", "watch", "help", "--help", "-h"]);
|
|
3920
|
+
const SPLASH_COMMANDS = new Set(["run", "bootstrap", "run-issue", "orchestrate", "triage", "probe", "gc", "resume-stalled", "demo", "first-run", "doctor", "watch", "help", "--help", "-h"]);
|
|
4004
3921
|
const KNOWN_COMMANDS = new Set([
|
|
4005
3922
|
"install", "init", "enable", "disable", "status", "uninstall", "update",
|
|
4006
|
-
"run", "bootstrap", "backend-check", "run-issue", "orchestrate", "milestone", "milestone-sync", "fix-close-reasons", "guards", "triage", "probe", "review-staging", "gc", "resume-stalled", "demo", "doctor", "watch", "issue-watch", "prod-watch", "selftest", "labels", "config", "stats", "limits", "decisions", "sched", "schedd", "pool", "check", "guide", "help", "--help", "-h",
|
|
3923
|
+
"run", "bootstrap", "backend-check", "run-issue", "orchestrate", "milestone", "milestone-sync", "fix-close-reasons", "guards", "triage", "probe", "acceptance", "review-staging", "release", "gc", "resume-stalled", "demo", "first-run", "doctor", "auth", "watch", "issue-watch", "prod-watch", "selftest", "labels", "config", "stats", "limits", "decisions", "sched", "schedd", "pool", "check", "guide", "help", "--help", "-h",
|
|
4007
3924
|
"version", "--version", "-v",
|
|
4008
3925
|
]);
|
|
4009
3926
|
if (SPLASH_COMMANDS.has(command) || !KNOWN_COMMANDS.has(command)) splash(command);
|
|
4010
3927
|
|
|
4011
3928
|
let exitCode = 0;
|
|
3929
|
+
// #5301: an App login puts a scoped installation token in this process's env (GH_TOKEN) for child gh calls; no login, no change.
|
|
3930
|
+
if (command !== "auth") await applyAuthEnv();
|
|
3931
|
+
// #5381: installation tokens live 1h; long-running commands re-resolve before expiry so later gh calls and lanes inherit a fresh one.
|
|
3932
|
+
if (["orchestrate", "schedd", "watch", "issue-watch", "prod-watch"].includes(command)) startAuthRefresh();
|
|
4012
3933
|
switch (command) {
|
|
4013
3934
|
case "install": {
|
|
4014
3935
|
const c = ctx();
|
|
@@ -4268,6 +4189,16 @@ switch (command) {
|
|
|
4268
4189
|
}
|
|
4269
4190
|
break;
|
|
4270
4191
|
}
|
|
4192
|
+
case "release": {
|
|
4193
|
+
const { releaseFromCli } = await import("./lean/release.mjs");
|
|
4194
|
+
try {
|
|
4195
|
+
exitCode = await releaseFromCli(restArgs);
|
|
4196
|
+
} catch (err) {
|
|
4197
|
+
process.stderr.write(`${RED}${err.message}${RESET}\n`);
|
|
4198
|
+
exitCode = 1;
|
|
4199
|
+
}
|
|
4200
|
+
break;
|
|
4201
|
+
}
|
|
4271
4202
|
case "issue-watch": {
|
|
4272
4203
|
const { issueWatchFromCli } = await import("./lean/issuewatch.mjs");
|
|
4273
4204
|
try {
|
|
@@ -4405,6 +4336,39 @@ switch (command) {
|
|
|
4405
4336
|
}
|
|
4406
4337
|
break;
|
|
4407
4338
|
}
|
|
4339
|
+
case "ci": {
|
|
4340
|
+
// Actions-minutes budget and CI placement policy (#5278): `forgedock ci budget`.
|
|
4341
|
+
const { ciFromCli } = await import("./lean/ci-budget.mjs");
|
|
4342
|
+
try {
|
|
4343
|
+
exitCode = await ciFromCli(restArgs);
|
|
4344
|
+
} catch (err) {
|
|
4345
|
+
process.stderr.write(`${RED}${err.message}${RESET}\n`);
|
|
4346
|
+
exitCode = 1;
|
|
4347
|
+
}
|
|
4348
|
+
break;
|
|
4349
|
+
}
|
|
4350
|
+
case "acceptance": {
|
|
4351
|
+
// Feature-level acceptance (#5336): `forgedock acceptance check|run|gate`.
|
|
4352
|
+
const { acceptanceFromCli } = await import("./lean/acceptance.mjs");
|
|
4353
|
+
try {
|
|
4354
|
+
exitCode = await acceptanceFromCli(restArgs);
|
|
4355
|
+
} catch (err) {
|
|
4356
|
+
process.stderr.write(`${RED}${err.message}${RESET}\n`);
|
|
4357
|
+
exitCode = 1;
|
|
4358
|
+
}
|
|
4359
|
+
break;
|
|
4360
|
+
}
|
|
4361
|
+
case "replan": {
|
|
4362
|
+
// Re-plan loop (#5342): `forgedock replan apply --amendment N --repo owner/repo`.
|
|
4363
|
+
const { replanFromCli } = await import("./lean/replan.mjs");
|
|
4364
|
+
try {
|
|
4365
|
+
exitCode = await replanFromCli(restArgs);
|
|
4366
|
+
} catch (err) {
|
|
4367
|
+
process.stderr.write(`${RED}${err.message}${RESET}\n`);
|
|
4368
|
+
exitCode = 1;
|
|
4369
|
+
}
|
|
4370
|
+
break;
|
|
4371
|
+
}
|
|
4408
4372
|
case "probe": {
|
|
4409
4373
|
const { probeFromCli } = await import("./engine-cli.mjs");
|
|
4410
4374
|
try {
|
|
@@ -4426,9 +4390,38 @@ switch (command) {
|
|
|
4426
4390
|
}
|
|
4427
4391
|
break;
|
|
4428
4392
|
}
|
|
4393
|
+
case "replay": {
|
|
4394
|
+
const { replayFromCli } = await import("./replay-timelapse.mjs");
|
|
4395
|
+
try {
|
|
4396
|
+
exitCode = await replayFromCli(restArgs);
|
|
4397
|
+
} catch (err) {
|
|
4398
|
+
process.stderr.write(`${RED}${err.message}${RESET}\n`);
|
|
4399
|
+
exitCode = 1;
|
|
4400
|
+
}
|
|
4401
|
+
break;
|
|
4402
|
+
}
|
|
4429
4403
|
case "demo":
|
|
4430
4404
|
await demo();
|
|
4431
4405
|
break;
|
|
4406
|
+
case "first-run": {
|
|
4407
|
+
// #5290: propose/file small issues on this repo and run one to a PR
|
|
4408
|
+
const { runFirstRun } = await import("./first-run.mjs");
|
|
4409
|
+
const { execFileSync } = await import("node:child_process");
|
|
4410
|
+
const { confirm } = await import("./tui.mjs");
|
|
4411
|
+
const { runFromCli } = await import("./engine-cli.mjs");
|
|
4412
|
+
const r = await runFirstRun({
|
|
4413
|
+
exec: (cmd, args) => execFileSync(cmd, args, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 30000 }).trim(),
|
|
4414
|
+
confirmFn: confirm,
|
|
4415
|
+
runIssueFn: (n) => runFromCli([String(n)]),
|
|
4416
|
+
});
|
|
4417
|
+
if (r.status === "error") exitCode = 1;
|
|
4418
|
+
break;
|
|
4419
|
+
}
|
|
4420
|
+
case "auth": {
|
|
4421
|
+
const { authFromCli } = await import("./auth/app-token.mjs");
|
|
4422
|
+
exitCode = await authFromCli(restArgs);
|
|
4423
|
+
break;
|
|
4424
|
+
}
|
|
4432
4425
|
case "doctor":
|
|
4433
4426
|
if (restArgs.includes("--lanes")) {
|
|
4434
4427
|
// #4866: the lane preflight on demand: every check with pass/fail; exit 1 when any fails
|
|
@@ -4439,7 +4432,7 @@ switch (command) {
|
|
|
4439
4432
|
exitCode = checks.every((c) => c.ok) ? 0 : 1;
|
|
4440
4433
|
break;
|
|
4441
4434
|
}
|
|
4442
|
-
exitCode = await doctor(restArgs.includes("--fix"));
|
|
4435
|
+
exitCode = await doctor(restArgs.includes("--fix"), restArgs.includes("--verbose"));
|
|
4443
4436
|
break;
|
|
4444
4437
|
case "report": {
|
|
4445
4438
|
const { runReport } = await import("./report.mjs");
|
|
@@ -4503,11 +4496,14 @@ switch (command) {
|
|
|
4503
4496
|
console.log(`\n Sections already present (unchanged): ${result.alreadyPresent.join(", ") || "none"}`);
|
|
4504
4497
|
console.log(`\n All added sections are commented out — edit forge.yaml to enable the ones you need.`);
|
|
4505
4498
|
}
|
|
4499
|
+
} else if (["history", "diff", "rollback", "record", "import-bak"].includes(subcommand)) {
|
|
4500
|
+
exitCode = runConfigCommand(subcommand, restArgs.slice(1), { cwd: process.cwd() });
|
|
4506
4501
|
} else {
|
|
4507
4502
|
console.log(`${RED}Unknown config subcommand: ${subcommand ?? "(none)"}${RESET}`);
|
|
4508
4503
|
console.log(
|
|
4509
4504
|
`Usage: ${CYAN}npx forgedock config migrate [dir]${RESET}\n` +
|
|
4510
|
-
` Backfills any of the 16 optional forge.yaml sections missing from an existing config (idempotent)
|
|
4505
|
+
` Backfills any of the 16 optional forge.yaml sections missing from an existing config (idempotent).\n` +
|
|
4506
|
+
` ${CYAN}npx forgedock config history | diff <n> | rollback <n> | record [reason] | import-bak [--delete]${RESET}`,
|
|
4511
4507
|
);
|
|
4512
4508
|
exitCode = 1;
|
|
4513
4509
|
}
|
|
@@ -4575,7 +4571,7 @@ switch (command) {
|
|
|
4575
4571
|
case "help":
|
|
4576
4572
|
case "--help":
|
|
4577
4573
|
case "-h":
|
|
4578
|
-
help();
|
|
4574
|
+
help(positional.includes("--all") || process.argv.includes("--all"));
|
|
4579
4575
|
break;
|
|
4580
4576
|
case "guide":
|
|
4581
4577
|
process.stdout.write(guideText({ width: guideWidth(process.stdout), ansi: useAnsi(process.stdout) }) + "\n");
|