harnessed 4.38.0 → 4.40.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/dist/cli.mjs +249 -15
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/manifests/SCHEMA.md +2 -2
- package/manifests/optional/chrome-devtools-mcp.yaml +2 -2
- package/manifests/optional/codegraph.yaml +2 -2
- package/manifests/optional/ecc.yaml +60 -17
- package/manifests/skill-packs/design-taste-frontend.yaml +2 -2
- package/manifests/skill-packs/gsd.yaml +2 -2
- package/manifests/skill-packs/gstack.yaml +2 -2
- package/manifests/skill-packs/mattpocock-skills.yaml +2 -2
- package/manifests/skill-packs/planning-with-files.yaml +2 -2
- package/manifests/skill-packs/ui-ux-pro-max.yaml +21 -7
- package/manifests/tools/ctx7.yaml +7 -3
- package/manifests/tools/exa-mcp.yaml +2 -2
- package/manifests/tools/playwright-test.yaml +10 -4
- package/manifests/tools/superpowers.yaml +2 -2
- package/manifests/tools/tavily-mcp.yaml +2 -2
- package/package.json +1 -1
- package/workflows/capabilities.yaml +110 -110
- package/workflows/defaults.yaml +17 -7
- package/workflows/discuss/phase/workflow.yaml +0 -1
- package/workflows/discuss/strategic/workflow.yaml +0 -2
- package/workflows/discuss/subtask/workflow.yaml +0 -1
- package/workflows/judgments/stage-routing.yaml +10 -0
- package/workflows/judgments/subtask-gate.yaml +24 -1
- package/workflows/plan/architecture/workflow.yaml +0 -1
- package/workflows/plan/phase/workflow.yaml +0 -1
- package/workflows/research/workflow.yaml +0 -6
- package/workflows/retro/workflow.yaml +0 -1
- package/workflows/task/clarify/SKILL.md +4 -2
- package/workflows/task/clarify/SKILL.zh-Hans.md +4 -3
- package/workflows/task/clarify/workflow.yaml +0 -1
- package/workflows/task/code/workflow.yaml +0 -1
- package/workflows/task/deliver/workflow.yaml +0 -1
- package/workflows/task/test/workflow.yaml +0 -1
- package/workflows/verify/auto/workflow.yaml +10 -1
- package/workflows/verify/code-review/workflow.yaml +0 -1
- package/workflows/verify/paranoid/workflow.yaml +0 -1
- package/workflows/verify/progress/workflow.yaml +0 -1
- package/workflows/verify/second-opinion/SKILL.md +89 -0
- package/workflows/verify/second-opinion/SKILL.zh-Hans.md +88 -0
- package/workflows/verify/second-opinion/workflow.yaml +50 -0
- package/workflows/verify/simplify/workflow.yaml +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -38,7 +38,7 @@ var init_package = __esm({
|
|
|
38
38
|
"package.json"() {
|
|
39
39
|
package_default = {
|
|
40
40
|
name: "harnessed",
|
|
41
|
-
version: "4.
|
|
41
|
+
version: "4.40.0",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -5947,14 +5947,30 @@ async function pathExists(p7) {
|
|
|
5947
5947
|
return false;
|
|
5948
5948
|
}
|
|
5949
5949
|
}
|
|
5950
|
-
|
|
5950
|
+
function codexPluginPresent() {
|
|
5951
|
+
try {
|
|
5952
|
+
const r = spawnSync(process.platform === "win32" ? "codex.cmd" : "codex", ["plugin", "list"], {
|
|
5953
|
+
encoding: "utf8",
|
|
5954
|
+
timeout: 1e4,
|
|
5955
|
+
windowsHide: true
|
|
5956
|
+
});
|
|
5957
|
+
if (r.error || r.status !== 0) return false;
|
|
5958
|
+
return /\becc\b/.test(`${r.stdout ?? ""}`);
|
|
5959
|
+
} catch {
|
|
5960
|
+
return false;
|
|
5961
|
+
}
|
|
5962
|
+
}
|
|
5963
|
+
async function checkEcc(deps) {
|
|
5964
|
+
const probeCodexPlugin = deps?.codexPluginPresent ?? codexPluginPresent;
|
|
5951
5965
|
const cdt = await probeChromeDevtools();
|
|
5952
5966
|
const ccInstalled = cdt.ecc;
|
|
5953
5967
|
const codexHome = join(homedir(), ".codex");
|
|
5954
5968
|
const codexPresent = await pathExists(join(codexHome, "config.toml"));
|
|
5955
|
-
const
|
|
5969
|
+
const codexLegacy = codexPresent && await pathExists(join(codexHome, ".cache", "ecc", ".git"));
|
|
5970
|
+
const codexNative = codexPresent && !codexLegacy && probeCodexPlugin();
|
|
5971
|
+
const codexInstalled = codexLegacy || codexNative;
|
|
5956
5972
|
const ccPart = ccInstalled ? "CC: installed (plugin ecc@ecc)" : "CC: not installed";
|
|
5957
|
-
const codexPart = codexPresent ? codexInstalled ? "codex: installed (~/.codex/.cache/ecc sync clone)" : "codex: not installed" : "codex: not present (no ~/.codex/config.toml)";
|
|
5973
|
+
const codexPart = codexPresent ? codexInstalled ? codexNative ? "codex: installed (native plugin ecc@ecc)" : "codex: installed (legacy ~/.codex/.cache/ecc sync clone \u2014 upstream deprecated it in 2.2; migrate with `node scripts/ecc.js uninstall --legacy-codex-sync` then `codex plugin marketplace add affaan-m/ECC && codex plugin add ecc@ecc`)" : "codex: not installed" : "codex: not present (no ~/.codex/config.toml)";
|
|
5958
5974
|
if (ccInstalled) {
|
|
5959
5975
|
const leftovers = [];
|
|
5960
5976
|
const fixes = [];
|
|
@@ -6052,6 +6068,138 @@ var init_check_inject_invalidate = __esm({
|
|
|
6052
6068
|
}
|
|
6053
6069
|
});
|
|
6054
6070
|
|
|
6071
|
+
// src/cli/lib/check-plugin-staleness.ts
|
|
6072
|
+
var check_plugin_staleness_exports = {};
|
|
6073
|
+
__export(check_plugin_staleness_exports, {
|
|
6074
|
+
checkPluginStaleness: () => checkPluginStaleness
|
|
6075
|
+
});
|
|
6076
|
+
function defaultDeps3() {
|
|
6077
|
+
return {
|
|
6078
|
+
assetsRoot: getAssetsRoot(),
|
|
6079
|
+
registryPath: getPluginsRegistry(),
|
|
6080
|
+
readText: (p7) => {
|
|
6081
|
+
try {
|
|
6082
|
+
return readFileSync(p7, "utf8");
|
|
6083
|
+
} catch {
|
|
6084
|
+
return null;
|
|
6085
|
+
}
|
|
6086
|
+
},
|
|
6087
|
+
listDir: (p7) => {
|
|
6088
|
+
try {
|
|
6089
|
+
return readdirSync(p7);
|
|
6090
|
+
} catch {
|
|
6091
|
+
return null;
|
|
6092
|
+
}
|
|
6093
|
+
},
|
|
6094
|
+
isDir: (p7) => {
|
|
6095
|
+
try {
|
|
6096
|
+
return statSync(p7).isDirectory();
|
|
6097
|
+
} catch {
|
|
6098
|
+
return false;
|
|
6099
|
+
}
|
|
6100
|
+
}
|
|
6101
|
+
};
|
|
6102
|
+
}
|
|
6103
|
+
function collectPluginManifests(deps) {
|
|
6104
|
+
const out = [];
|
|
6105
|
+
const root = join(deps.assetsRoot, "manifests");
|
|
6106
|
+
const walk = (dir) => {
|
|
6107
|
+
const entries = deps.listDir(dir);
|
|
6108
|
+
if (entries === null) return;
|
|
6109
|
+
for (const entry of entries) {
|
|
6110
|
+
const full = join(dir, entry);
|
|
6111
|
+
if (deps.isDir(full)) {
|
|
6112
|
+
walk(full);
|
|
6113
|
+
continue;
|
|
6114
|
+
}
|
|
6115
|
+
if (!entry.endsWith(".yaml") || entry.endsWith(".zh-Hans.yaml")) continue;
|
|
6116
|
+
const raw = deps.readText(full);
|
|
6117
|
+
if (raw === null) continue;
|
|
6118
|
+
let doc;
|
|
6119
|
+
try {
|
|
6120
|
+
doc = parse(raw);
|
|
6121
|
+
} catch {
|
|
6122
|
+
continue;
|
|
6123
|
+
}
|
|
6124
|
+
const d = doc;
|
|
6125
|
+
if (d.spec?.install?.method !== "cc-plugin-marketplace") continue;
|
|
6126
|
+
const name = d.metadata?.name;
|
|
6127
|
+
const recorded = d.spec?.upstream_health?.last_known_good_version;
|
|
6128
|
+
if (typeof name !== "string" || typeof recorded !== "string") continue;
|
|
6129
|
+
out.push({ name, recorded });
|
|
6130
|
+
}
|
|
6131
|
+
};
|
|
6132
|
+
walk(root);
|
|
6133
|
+
return out;
|
|
6134
|
+
}
|
|
6135
|
+
function readInstalledVersions(deps, registryPath) {
|
|
6136
|
+
const raw = deps.readText(registryPath);
|
|
6137
|
+
if (raw === null) return null;
|
|
6138
|
+
let parsed;
|
|
6139
|
+
try {
|
|
6140
|
+
parsed = JSON.parse(raw);
|
|
6141
|
+
} catch {
|
|
6142
|
+
return null;
|
|
6143
|
+
}
|
|
6144
|
+
const plugins = parsed.plugins;
|
|
6145
|
+
if (!plugins || typeof plugins !== "object") return null;
|
|
6146
|
+
const map = /* @__PURE__ */ new Map();
|
|
6147
|
+
for (const [key, value] of Object.entries(plugins)) {
|
|
6148
|
+
const pluginName = key.split("@")[0];
|
|
6149
|
+
if (!pluginName || !Array.isArray(value)) continue;
|
|
6150
|
+
for (const entry of value) {
|
|
6151
|
+
const v = entry?.version;
|
|
6152
|
+
if (typeof v === "string" && v.length > 0) {
|
|
6153
|
+
map.set(pluginName, v);
|
|
6154
|
+
break;
|
|
6155
|
+
}
|
|
6156
|
+
}
|
|
6157
|
+
}
|
|
6158
|
+
return map;
|
|
6159
|
+
}
|
|
6160
|
+
function checkPluginStaleness(overrides) {
|
|
6161
|
+
const deps = { ...defaultDeps3(), ...overrides };
|
|
6162
|
+
if (deps.registryPath === null) {
|
|
6163
|
+
return { name: NAME4, status: "pass", message: "no plugin registry on this harness" };
|
|
6164
|
+
}
|
|
6165
|
+
const installed = readInstalledVersions(deps, deps.registryPath);
|
|
6166
|
+
if (installed === null) {
|
|
6167
|
+
return { name: NAME4, status: "pass", message: "plugin registry unreadable \u2014 skipped" };
|
|
6168
|
+
}
|
|
6169
|
+
const manifests = collectPluginManifests(deps);
|
|
6170
|
+
const behind = [];
|
|
6171
|
+
let compared = 0;
|
|
6172
|
+
for (const m of manifests) {
|
|
6173
|
+
const have = installed.get(m.name);
|
|
6174
|
+
if (have === void 0) continue;
|
|
6175
|
+
compared += 1;
|
|
6176
|
+
if (compareVersions(have, m.recorded) === "behind") {
|
|
6177
|
+
behind.push(`${m.name} ${have} \u2192 ${m.recorded}`);
|
|
6178
|
+
}
|
|
6179
|
+
}
|
|
6180
|
+
if (compared === 0) {
|
|
6181
|
+
return { name: NAME4, status: "pass", message: "no marketplace plugins installed" };
|
|
6182
|
+
}
|
|
6183
|
+
if (behind.length === 0) {
|
|
6184
|
+
return { name: NAME4, status: "pass", message: `${compared} marketplace plugin(s) current` };
|
|
6185
|
+
}
|
|
6186
|
+
return {
|
|
6187
|
+
name: NAME4,
|
|
6188
|
+
status: "warn",
|
|
6189
|
+
message: `${behind.length}/${compared} marketplace plugin(s) behind the version harnessed verified: ${behind.join(", ")} \u2014 \`claude plugin install\` pins a version at install time and never re-resolves`,
|
|
6190
|
+
fix: `claude plugin update ${behind.map((b) => b.split(" ")[0]).join(" && claude plugin update ")}`
|
|
6191
|
+
};
|
|
6192
|
+
}
|
|
6193
|
+
var NAME4;
|
|
6194
|
+
var init_check_plugin_staleness = __esm({
|
|
6195
|
+
"src/cli/lib/check-plugin-staleness.ts"() {
|
|
6196
|
+
init_assetsRoot();
|
|
6197
|
+
init_platform();
|
|
6198
|
+
init_version_check();
|
|
6199
|
+
NAME4 = "plugin install freshness";
|
|
6200
|
+
}
|
|
6201
|
+
});
|
|
6202
|
+
|
|
6055
6203
|
// src/cli/lib/doctor-registry.ts
|
|
6056
6204
|
var CHECKS;
|
|
6057
6205
|
var init_doctor_registry = __esm({
|
|
@@ -6107,7 +6255,13 @@ var init_doctor_registry = __esm({
|
|
|
6107
6255
|
// 4.38.0 — half-installed per-turn injection (warn-only): perturn-inject
|
|
6108
6256
|
// without perturn-inject-invalidate keeps skipping <project-context> after a
|
|
6109
6257
|
// compact/clear has already dropped the copy it is skipping on behalf of.
|
|
6110
|
-
async () => (await Promise.resolve().then(() => (init_check_inject_invalidate(), check_inject_invalidate_exports))).checkInjectInvalidate()
|
|
6258
|
+
async () => (await Promise.resolve().then(() => (init_check_inject_invalidate(), check_inject_invalidate_exports))).checkInjectInvalidate(),
|
|
6259
|
+
// Phase 56 — silently stale marketplace plugins (warn-only): `claude plugin
|
|
6260
|
+
// install` pins a version into a versioned cache dir and never re-resolves, so
|
|
6261
|
+
// the four cc-plugin-marketplace components drift behind without any signal.
|
|
6262
|
+
// The only comparison in the codebase between a genuinely DETECTED version and
|
|
6263
|
+
// a recorded one — see the header for why the installer-state layer cannot do it.
|
|
6264
|
+
async () => (await Promise.resolve().then(() => (init_check_plugin_staleness(), check_plugin_staleness_exports))).checkPluginStaleness()
|
|
6111
6265
|
];
|
|
6112
6266
|
}
|
|
6113
6267
|
});
|
|
@@ -6382,6 +6536,13 @@ function buildDefaultGateContext(task, stage) {
|
|
|
6382
6536
|
// `harnessed gates --context-file`, and through `harnessed run`'s awaited
|
|
6383
6537
|
// probe overlay.
|
|
6384
6538
|
chrome_devtools_available: true,
|
|
6539
|
+
// Phase 54 T3 — seeded FALSE, the opposite of the line above and for the
|
|
6540
|
+
// same reason read the other way: this builder is synchronous and cannot
|
|
6541
|
+
// shell out to git, so the honest default is the direction where being
|
|
6542
|
+
// wrong costs least. Unknown must not ADD a review step — a gate that
|
|
6543
|
+
// fires when it cannot justify itself becomes noise, and noise gets
|
|
6544
|
+
// ignored. The measured value arrives via `harnessed facts`.
|
|
6545
|
+
requires_second_opinion: false,
|
|
6385
6546
|
phase: {
|
|
6386
6547
|
stage,
|
|
6387
6548
|
// T2.1 OQ2(c) — withdrawn: gated stage-routing.verify-paranoid-critical,
|
|
@@ -9167,7 +9328,7 @@ var release_preflight_exports = {};
|
|
|
9167
9328
|
__export(release_preflight_exports, {
|
|
9168
9329
|
anyFailed: () => anyFailed,
|
|
9169
9330
|
collectPreflight: () => collectPreflight,
|
|
9170
|
-
defaultDeps: () =>
|
|
9331
|
+
defaultDeps: () => defaultDeps4
|
|
9171
9332
|
});
|
|
9172
9333
|
function unreleasedSection(changelog) {
|
|
9173
9334
|
const start = changelog.indexOf("## [Unreleased]");
|
|
@@ -9222,7 +9383,7 @@ function collectPreflight(deps) {
|
|
|
9222
9383
|
function anyFailed(checks) {
|
|
9223
9384
|
return checks.some((c) => c.status === "fail");
|
|
9224
9385
|
}
|
|
9225
|
-
function
|
|
9386
|
+
function defaultDeps4(cwd) {
|
|
9226
9387
|
let changelog = "";
|
|
9227
9388
|
let version = "";
|
|
9228
9389
|
try {
|
|
@@ -10667,7 +10828,7 @@ init_i18n();
|
|
|
10667
10828
|
init_doctor_registry();
|
|
10668
10829
|
function registerDoctor(program2) {
|
|
10669
10830
|
program2.command("doctor").description(
|
|
10670
|
-
"Preflight checks (Node / MCP scope / jq / Win bash / origin URL / gstack prefix / deprecations / token budget / Agent Teams / planning-with-files / mattpocock-skills / MCP availability / ECC)"
|
|
10831
|
+
"Preflight checks (Node / MCP scope / jq / Win bash / origin URL / gstack prefix / deprecations / token budget / Agent Teams / planning-with-files / mattpocock-skills / MCP availability / ECC / plugin freshness)"
|
|
10671
10832
|
).option("--json", "output JSON instead of human-readable").action(async (opts) => {
|
|
10672
10833
|
const settled = await Promise.allSettled(CHECKS.map((c) => c()));
|
|
10673
10834
|
const results = settled.map(
|
|
@@ -11383,6 +11544,41 @@ function deriveGitFacts(run) {
|
|
|
11383
11544
|
files_touched: sawNames && files.size > 0 ? files.size : null
|
|
11384
11545
|
};
|
|
11385
11546
|
}
|
|
11547
|
+
var NEWLINE_RE = new RegExp(String.fromCharCode(13) + "?" + String.fromCharCode(10));
|
|
11548
|
+
var ORCHESTRATION_SURFACE = [
|
|
11549
|
+
"workflows/judgments/",
|
|
11550
|
+
"workflows/capabilities.yaml",
|
|
11551
|
+
"workflows/role-prompts",
|
|
11552
|
+
"workflows/disciplines/",
|
|
11553
|
+
"workflows/defaults.yaml",
|
|
11554
|
+
"src/workflow/schema/phaseFactContext.ts",
|
|
11555
|
+
"src/workflow/judgmentResolver.ts",
|
|
11556
|
+
"src/workflow/exprBuilder.ts",
|
|
11557
|
+
"src/cli/facts.ts",
|
|
11558
|
+
"src/checkpoint/ledger.ts"
|
|
11559
|
+
];
|
|
11560
|
+
function onOrchestrationSurface(path) {
|
|
11561
|
+
const p7 = path.split(String.fromCharCode(92)).join("/").trim();
|
|
11562
|
+
if (p7 === "") return false;
|
|
11563
|
+
if (/^workflows\/.+\/SKILL(\.[A-Za-z-]+)?\.md$/.test(p7)) return true;
|
|
11564
|
+
return ORCHESTRATION_SURFACE.some((s) => s.endsWith("/") ? p7.startsWith(s) : p7 === s);
|
|
11565
|
+
}
|
|
11566
|
+
function deriveSecondOpinion(run) {
|
|
11567
|
+
const tagOut = run(["describe", "--tags", "--abbrev=0"]);
|
|
11568
|
+
const tag = tagOut === null ? null : tagOut.trim();
|
|
11569
|
+
if (!tag) {
|
|
11570
|
+
return {
|
|
11571
|
+
fires: false,
|
|
11572
|
+
reason: "no release tag found (git describe --tags failed or the repo has no tags)"
|
|
11573
|
+
};
|
|
11574
|
+
}
|
|
11575
|
+
const diff = run(["diff", "--name-only", tag]);
|
|
11576
|
+
if (diff === null) {
|
|
11577
|
+
return { fires: false, reason: `git diff --name-only ${tag} failed` };
|
|
11578
|
+
}
|
|
11579
|
+
const fires = diff.split(NEWLINE_RE).some(onOrchestrationSurface);
|
|
11580
|
+
return { fires, reason: null };
|
|
11581
|
+
}
|
|
11386
11582
|
function defaultGitRun(args) {
|
|
11387
11583
|
try {
|
|
11388
11584
|
return execFileSync("git", args, {
|
|
@@ -11491,6 +11687,9 @@ function buildFactsEnvelope(master, gatedNames, derived) {
|
|
|
11491
11687
|
usage: `Fill every null in \`facts\` with your honest judgement (leave a fact null to accept harnessed's default), write that object to a file, then run: harnessed gates ${master} --task "<locked spec>" --context-file <path>. The output of this command can be passed back verbatim \u2014 the envelope is unwrapped automatically.`
|
|
11492
11688
|
};
|
|
11493
11689
|
}
|
|
11690
|
+
function secondOpinionFromGit() {
|
|
11691
|
+
return deriveSecondOpinion(defaultGitRun);
|
|
11692
|
+
}
|
|
11494
11693
|
async function runFactsPlan(master, raw, deps = defaultRunDeps, gitRun = defaultGitRun, probeCdt = () => probeChromeDevtools()) {
|
|
11495
11694
|
if (!VALID_MASTERS2.has(master)) {
|
|
11496
11695
|
deps.error(
|
|
@@ -11518,6 +11717,7 @@ async function runFactsPlan(master, raw, deps = defaultRunDeps, gitRun = default
|
|
|
11518
11717
|
return;
|
|
11519
11718
|
}
|
|
11520
11719
|
const git = deriveGitFacts(gitRun);
|
|
11720
|
+
const secondOpinion = deriveSecondOpinion(gitRun);
|
|
11521
11721
|
const cdt = await probeCdt();
|
|
11522
11722
|
const derived = {
|
|
11523
11723
|
// `harnessed gates` seeds phase.stage from the master argument, so facts MUST
|
|
@@ -11542,6 +11742,14 @@ async function runFactsPlan(master, raw, deps = defaultRunDeps, gitRun = default
|
|
|
11542
11742
|
chrome_devtools_available: {
|
|
11543
11743
|
value: chromeDevtoolsAvailable(cdt),
|
|
11544
11744
|
source: chromeDevtoolsFactSource(cdt)
|
|
11745
|
+
},
|
|
11746
|
+
// Phase 54 T3 — root-flat, sister chrome_devtools_available above. `source`
|
|
11747
|
+
// doubles as the UNAVAILABLE REASON: when the criterion cannot be computed
|
|
11748
|
+
// the value is false AND the reason says why, so a repo that can never
|
|
11749
|
+
// answer is visibly unavailable rather than quietly never firing.
|
|
11750
|
+
requires_second_opinion: {
|
|
11751
|
+
value: secondOpinion.fires,
|
|
11752
|
+
source: secondOpinion.reason === null ? "git diff --name-only <last release tag> \u2229 orchestration surface (judgments/capabilities/facts/resolver/ledger/disciplines/SKILL.md)" : `criterion unavailable \u2014 ${secondOpinion.reason}`
|
|
11545
11753
|
}
|
|
11546
11754
|
};
|
|
11547
11755
|
const envelope = buildFactsEnvelope(master, gated, derived);
|
|
@@ -12977,7 +13185,7 @@ function isRalphLoopOptIn(phase) {
|
|
|
12977
13185
|
if (fb?.max_iterations_exceeded !== void 0) return true;
|
|
12978
13186
|
return false;
|
|
12979
13187
|
}
|
|
12980
|
-
function resolveMaxIterations(phase, gateContext) {
|
|
13188
|
+
function resolveMaxIterations(phase, gateContext, fromDefaults) {
|
|
12981
13189
|
const fromCli = typeof gateContext.maxIterations === "number" ? gateContext.maxIterations : void 0;
|
|
12982
13190
|
let fromYaml;
|
|
12983
13191
|
if (phase && typeof phase === "object") {
|
|
@@ -12988,7 +13196,8 @@ function resolveMaxIterations(phase, gateContext) {
|
|
|
12988
13196
|
if (Number.isFinite(n) && n > 0) fromYaml = n;
|
|
12989
13197
|
}
|
|
12990
13198
|
}
|
|
12991
|
-
const
|
|
13199
|
+
const fromTable = typeof fromDefaults === "number" && Number.isFinite(fromDefaults) && fromDefaults > 0 ? fromDefaults : void 0;
|
|
13200
|
+
const chosen = fromCli ?? fromYaml ?? fromTable ?? RALPH_DEFAULT_MAX_ITER;
|
|
12992
13201
|
return Math.min(Math.max(1, chosen), RALPH_HARD_UPPER_LIMIT);
|
|
12993
13202
|
}
|
|
12994
13203
|
var _dispatchSkillStub = {
|
|
@@ -13050,11 +13259,31 @@ var _dispatchSkillStub = {
|
|
|
13050
13259
|
};
|
|
13051
13260
|
}
|
|
13052
13261
|
};
|
|
13262
|
+
function loadMaxIterTable(packageRoot) {
|
|
13263
|
+
try {
|
|
13264
|
+
const doc = parse(
|
|
13265
|
+
readFileSync(join(packageRoot, "workflows", "defaults.yaml"), "utf8")
|
|
13266
|
+
);
|
|
13267
|
+
const out = {};
|
|
13268
|
+
for (const [wf, phases] of Object.entries(doc?.ralph_max_iterations ?? {})) {
|
|
13269
|
+
if (!phases || typeof phases !== "object") continue;
|
|
13270
|
+
const row = {};
|
|
13271
|
+
for (const [id, v] of Object.entries(phases)) {
|
|
13272
|
+
if (typeof v === "number" && Number.isFinite(v) && v > 0) row[id] = v;
|
|
13273
|
+
}
|
|
13274
|
+
out[wf] = row;
|
|
13275
|
+
}
|
|
13276
|
+
return out;
|
|
13277
|
+
} catch {
|
|
13278
|
+
return {};
|
|
13279
|
+
}
|
|
13280
|
+
}
|
|
13053
13281
|
async function runWorkflow(yamlPath, vars, opts = {}) {
|
|
13054
13282
|
const parsed = loadPhases(yamlPath, vars);
|
|
13055
13283
|
const yamlDir = dirname(resolve(yamlPath));
|
|
13056
13284
|
const inferredRoot = resolve(yamlDir, "..", "..");
|
|
13057
13285
|
const packageRoot = opts.packageRoot ?? inferredRoot;
|
|
13286
|
+
const maxIterTable = loadMaxIterTable(packageRoot);
|
|
13058
13287
|
const gateContext = { ...opts.gateContext ?? {} };
|
|
13059
13288
|
let rolePrompts = {};
|
|
13060
13289
|
try {
|
|
@@ -13133,7 +13362,7 @@ async function runWorkflow(yamlPath, vars, opts = {}) {
|
|
|
13133
13362
|
}
|
|
13134
13363
|
}
|
|
13135
13364
|
const skillName = "skills" in ph && ph.skills?.[0] || ph.id;
|
|
13136
|
-
const maxIter = resolveMaxIterations(ph, gateContext);
|
|
13365
|
+
const maxIter = resolveMaxIterations(ph, gateContext, maxIterTable[workflowName]?.[ph.id]);
|
|
13137
13366
|
const fallback = "fallback" in ph && ph.fallback?.max_iterations_exceeded ? ph.fallback.max_iterations_exceeded : void 0;
|
|
13138
13367
|
const r = await _dispatchSkillStub.fn(skillName, ph, {
|
|
13139
13368
|
maxIter,
|
|
@@ -13404,8 +13633,8 @@ function registerReleasePreflight(program2) {
|
|
|
13404
13633
|
program2.command("release-preflight").description(
|
|
13405
13634
|
"Read-only release-readiness gate (CHANGELOG / version / git-clean / tag). Exits 1 if not ready."
|
|
13406
13635
|
).action(async () => {
|
|
13407
|
-
const { collectPreflight: collectPreflight2, anyFailed: anyFailed2, defaultDeps:
|
|
13408
|
-
const checks = collectPreflight2(
|
|
13636
|
+
const { collectPreflight: collectPreflight2, anyFailed: anyFailed2, defaultDeps: defaultDeps5 } = await Promise.resolve().then(() => (init_release_preflight(), release_preflight_exports));
|
|
13637
|
+
const checks = collectPreflight2(defaultDeps5(process.cwd()));
|
|
13409
13638
|
console.log("\n release preflight (read-only \u2014 nothing is pushed/published):\n");
|
|
13410
13639
|
for (const c of checks) {
|
|
13411
13640
|
const mark = c.status === "pass" ? "\u2713" : c.status === "warn" ? "\u26A0" : "\u2717";
|
|
@@ -13712,6 +13941,11 @@ function registerRun(program2) {
|
|
|
13712
13941
|
// overlay the MEASURED value (never throws; unknown still resolves true —
|
|
13713
13942
|
// see src/cli/lib/probe-chrome-devtools.ts).
|
|
13714
13943
|
chrome_devtools_available: await isChromeDevtoolsAvailable(),
|
|
13944
|
+
// Phase 54 T3 — same treatment, opposite default: the synchronous builder
|
|
13945
|
+
// seeds `false` (unknown must not add work), so overlay the MEASURED value
|
|
13946
|
+
// here. Never throws — an unavailable criterion resolves false and the
|
|
13947
|
+
// reason surfaces through `harnessed facts` and the per-turn breadcrumb.
|
|
13948
|
+
requires_second_opinion: secondOpinionFromGit().fires,
|
|
13715
13949
|
...raw.model ? { modelOverride: raw.model } : {},
|
|
13716
13950
|
...raw.maxIterations ? { maxIterations: raw.maxIterations } : {},
|
|
13717
13951
|
...raw.staged ? { staged: true } : {},
|
|
@@ -14213,7 +14447,7 @@ var V3_4_3_SIGNATURE_MASTER_RX = /\*\*Preferred path\*\*[\s\S]*dispatch to the p
|
|
|
14213
14447
|
function shouldOverwriteFile(content) {
|
|
14214
14448
|
return HARNESSED_MARKER_RX2.test(content) || V3_4_3_SIGNATURE_SUB_RX.test(content) || V3_4_3_SIGNATURE_MASTER_RX.test(content);
|
|
14215
14449
|
}
|
|
14216
|
-
async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabilities, installedPlugins, installedUserSkills, writer, fileExists2 = existsSync,
|
|
14450
|
+
async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabilities, installedPlugins, installedUserSkills, writer, fileExists2 = existsSync, readFileSync25 = (p7) => readFileSync(p7, "utf8")) {
|
|
14217
14451
|
const results = [];
|
|
14218
14452
|
const aggregatedWarnings = /* @__PURE__ */ new Set();
|
|
14219
14453
|
for (const name of slashNames) {
|
|
@@ -14232,7 +14466,7 @@ async function writeAllCommands(slashNames, commandsDir, rolePrompts, capabiliti
|
|
|
14232
14466
|
if (fileExists2(path)) {
|
|
14233
14467
|
let existing = "";
|
|
14234
14468
|
try {
|
|
14235
|
-
existing =
|
|
14469
|
+
existing = readFileSync25(path);
|
|
14236
14470
|
} catch {
|
|
14237
14471
|
existing = "";
|
|
14238
14472
|
}
|