harnessed 4.23.0 → 4.23.2
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 +142 -60
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/workflows/auto/SKILL.md +1 -1
- package/workflows/auto/SKILL.zh-Hans.md +1 -1
- package/workflows/discuss/auto/SKILL.md +1 -1
- package/workflows/discuss/auto/SKILL.zh-Hans.md +1 -1
- package/workflows/role-prompts.yaml +2 -0
- package/workflows/role-prompts.zh-Hans.yaml +2 -0
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.23.
|
|
41
|
+
version: "4.23.2",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -3470,6 +3470,51 @@ var init_before_spawn = __esm({
|
|
|
3470
3470
|
init_disciplineLoader();
|
|
3471
3471
|
}
|
|
3472
3472
|
});
|
|
3473
|
+
function isUndefinedVariableError(e) {
|
|
3474
|
+
return e instanceof GateEvalError && /undefined variable/i.test(e.message);
|
|
3475
|
+
}
|
|
3476
|
+
function evalGate(expression, context) {
|
|
3477
|
+
try {
|
|
3478
|
+
const parsed = _parserSingleton.parse(expression);
|
|
3479
|
+
const result = parsed.evaluate(context);
|
|
3480
|
+
if (typeof result !== "boolean") {
|
|
3481
|
+
throw new GateEvalError(
|
|
3482
|
+
`Expression must evaluate to boolean, got ${typeof result}`,
|
|
3483
|
+
expression
|
|
3484
|
+
);
|
|
3485
|
+
}
|
|
3486
|
+
return result;
|
|
3487
|
+
} catch (err2) {
|
|
3488
|
+
if (err2 instanceof GateEvalError) throw err2;
|
|
3489
|
+
throw new GateEvalError(`Gate eval failed: ${err2.message}`, expression);
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
var PARSER_OPTIONS, _parserSingleton, GateEvalError;
|
|
3493
|
+
var init_exprBuilder = __esm({
|
|
3494
|
+
"src/workflow/exprBuilder.ts"() {
|
|
3495
|
+
PARSER_OPTIONS = {
|
|
3496
|
+
operators: {
|
|
3497
|
+
add: false,
|
|
3498
|
+
subtract: false,
|
|
3499
|
+
multiply: false,
|
|
3500
|
+
divide: false,
|
|
3501
|
+
logical: true,
|
|
3502
|
+
comparison: true,
|
|
3503
|
+
in: true,
|
|
3504
|
+
assignment: false
|
|
3505
|
+
}
|
|
3506
|
+
};
|
|
3507
|
+
_parserSingleton = new Parser(PARSER_OPTIONS);
|
|
3508
|
+
GateEvalError = class extends Error {
|
|
3509
|
+
constructor(message, expression) {
|
|
3510
|
+
super(message);
|
|
3511
|
+
this.expression = expression;
|
|
3512
|
+
this.name = "GateEvalError";
|
|
3513
|
+
}
|
|
3514
|
+
expression;
|
|
3515
|
+
};
|
|
3516
|
+
}
|
|
3517
|
+
});
|
|
3473
3518
|
var GovernanceStatus, GovernanceV1;
|
|
3474
3519
|
var init_governance = __esm({
|
|
3475
3520
|
"src/workflow/schema/governance.ts"() {
|
|
@@ -3529,48 +3574,6 @@ var init_governance2 = __esm({
|
|
|
3529
3574
|
init_governance();
|
|
3530
3575
|
}
|
|
3531
3576
|
});
|
|
3532
|
-
function evalGate(expression, context) {
|
|
3533
|
-
try {
|
|
3534
|
-
const parsed = _parserSingleton.parse(expression);
|
|
3535
|
-
const result = parsed.evaluate(context);
|
|
3536
|
-
if (typeof result !== "boolean") {
|
|
3537
|
-
throw new GateEvalError(
|
|
3538
|
-
`Expression must evaluate to boolean, got ${typeof result}`,
|
|
3539
|
-
expression
|
|
3540
|
-
);
|
|
3541
|
-
}
|
|
3542
|
-
return result;
|
|
3543
|
-
} catch (err2) {
|
|
3544
|
-
if (err2 instanceof GateEvalError) throw err2;
|
|
3545
|
-
throw new GateEvalError(`Gate eval failed: ${err2.message}`, expression);
|
|
3546
|
-
}
|
|
3547
|
-
}
|
|
3548
|
-
var PARSER_OPTIONS, _parserSingleton, GateEvalError;
|
|
3549
|
-
var init_exprBuilder = __esm({
|
|
3550
|
-
"src/workflow/exprBuilder.ts"() {
|
|
3551
|
-
PARSER_OPTIONS = {
|
|
3552
|
-
operators: {
|
|
3553
|
-
add: false,
|
|
3554
|
-
subtract: false,
|
|
3555
|
-
multiply: false,
|
|
3556
|
-
divide: false,
|
|
3557
|
-
logical: true,
|
|
3558
|
-
comparison: true,
|
|
3559
|
-
in: true,
|
|
3560
|
-
assignment: false
|
|
3561
|
-
}
|
|
3562
|
-
};
|
|
3563
|
-
_parserSingleton = new Parser(PARSER_OPTIONS);
|
|
3564
|
-
GateEvalError = class extends Error {
|
|
3565
|
-
constructor(message, expression) {
|
|
3566
|
-
super(message);
|
|
3567
|
-
this.expression = expression;
|
|
3568
|
-
this.name = "GateEvalError";
|
|
3569
|
-
}
|
|
3570
|
-
expression;
|
|
3571
|
-
};
|
|
3572
|
-
}
|
|
3573
|
-
});
|
|
3574
3577
|
var TriggerInvocation, RequiresCapabilities, JudgmentTrigger, FallbackRule, JudgmentTriggersFile, JudgmentRulesFile, UserOverrideEntry, UserOverridesFile;
|
|
3575
3578
|
var init_judgment = __esm({
|
|
3576
3579
|
"src/workflow/schema/judgment.ts"() {
|
|
@@ -3887,6 +3890,26 @@ var init_sdkSpawn = __esm({
|
|
|
3887
3890
|
};
|
|
3888
3891
|
}
|
|
3889
3892
|
});
|
|
3893
|
+
|
|
3894
|
+
// src/workflow/skipSubs.ts
|
|
3895
|
+
function matchSkipSub(requested, sub, master) {
|
|
3896
|
+
if (requested.has(sub)) return sub;
|
|
3897
|
+
const alias = `${master}-${sub}`;
|
|
3898
|
+
if (requested.has(alias)) return alias;
|
|
3899
|
+
return null;
|
|
3900
|
+
}
|
|
3901
|
+
function warnUnmatchedSkips(requested, matched, master, validSubs, warn) {
|
|
3902
|
+
for (const name of requested) {
|
|
3903
|
+
if (matched.has(name)) continue;
|
|
3904
|
+
warn(
|
|
3905
|
+
`\u26A0\uFE0F --skip-sub "${name}" ignored: not a sub of master ${master}; valid subs: ${validSubs.join(", ")}`
|
|
3906
|
+
);
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3909
|
+
var init_skipSubs = __esm({
|
|
3910
|
+
"src/workflow/skipSubs.ts"() {
|
|
3911
|
+
}
|
|
3912
|
+
});
|
|
3890
3913
|
function resolveMasterYamlPath(masterName, packageRoot) {
|
|
3891
3914
|
return masterName === "auto" ? resolve(packageRoot, "workflows", "auto", "workflow.yaml") : resolve(packageRoot, "workflows", masterName, "auto", "workflow.yaml");
|
|
3892
3915
|
}
|
|
@@ -4025,8 +4048,11 @@ async function runMasterOrchestrator(masterName, context, packageRoot, spawnDriv
|
|
|
4025
4048
|
}
|
|
4026
4049
|
const skipSubs = new Set(Array.isArray(context.skip_subs) ? context.skip_subs : []);
|
|
4027
4050
|
const gateEvalled = [];
|
|
4051
|
+
const matchedSkips = /* @__PURE__ */ new Set();
|
|
4028
4052
|
for (const clause of master.delegates_to) {
|
|
4029
|
-
|
|
4053
|
+
const skipHit = matchSkipSub(skipSubs, clause.sub, masterName);
|
|
4054
|
+
if (skipHit !== null) {
|
|
4055
|
+
matchedSkips.add(skipHit);
|
|
4030
4056
|
gateEvalled.push({
|
|
4031
4057
|
clause,
|
|
4032
4058
|
passes: false,
|
|
@@ -4046,16 +4072,34 @@ async function runMasterOrchestrator(masterName, context, packageRoot, spawnDriv
|
|
|
4046
4072
|
reason: passes ? void 0 : `gate ${clause.gate} = false`
|
|
4047
4073
|
});
|
|
4048
4074
|
} catch (e) {
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4075
|
+
if (isUndefinedVariableError(e)) {
|
|
4076
|
+
console.warn(
|
|
4077
|
+
`\u26A0\uFE0F master ${masterName} sub ${clause.sub} gate ${clause.gate} references a variable missing from the gate context (${e.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
|
|
4078
|
+
);
|
|
4079
|
+
gateEvalled.push({
|
|
4080
|
+
clause,
|
|
4081
|
+
passes: false,
|
|
4082
|
+
reason: `gate ${clause.gate} misconfigured (undefined variable) \u2014 fail-closed, not fired`
|
|
4083
|
+
});
|
|
4084
|
+
} else {
|
|
4085
|
+
console.warn(
|
|
4086
|
+
`\u26A0\uFE0F master ${masterName} sub ${clause.sub} gate ${clause.gate} eval failed (${e.message}); proceeding with sub as if gate fired=true (ADR 0029 fail-soft).`
|
|
4087
|
+
);
|
|
4088
|
+
gateEvalled.push({
|
|
4089
|
+
clause,
|
|
4090
|
+
passes: true,
|
|
4091
|
+
reason: `gate eval error (fail-soft fires=true): ${e.message}`
|
|
4092
|
+
});
|
|
4093
|
+
}
|
|
4057
4094
|
}
|
|
4058
4095
|
}
|
|
4096
|
+
warnUnmatchedSkips(
|
|
4097
|
+
skipSubs,
|
|
4098
|
+
matchedSkips,
|
|
4099
|
+
masterName,
|
|
4100
|
+
master.delegates_to.map((c) => c.sub),
|
|
4101
|
+
(m) => console.warn(m)
|
|
4102
|
+
);
|
|
4059
4103
|
emitGateTransparency(masterName, master.delegates_to.length, gateEvalled);
|
|
4060
4104
|
const PARALLEL_MID_ANCHOR = 50;
|
|
4061
4105
|
const firedClauses = gateEvalled.filter((g) => g.passes).map((g) => g.clause);
|
|
@@ -4106,8 +4150,10 @@ async function runMasterOrchestrator(masterName, context, packageRoot, spawnDriv
|
|
|
4106
4150
|
}
|
|
4107
4151
|
var init_masterOrchestrator = __esm({
|
|
4108
4152
|
"src/workflow/masterOrchestrator.ts"() {
|
|
4153
|
+
init_exprBuilder();
|
|
4109
4154
|
init_judgmentResolver();
|
|
4110
4155
|
init_workflow();
|
|
4156
|
+
init_skipSubs();
|
|
4111
4157
|
init_masterOrchestrator_helpers();
|
|
4112
4158
|
}
|
|
4113
4159
|
});
|
|
@@ -4229,9 +4275,16 @@ async function runWorkflow(yamlPath, vars, opts = {}) {
|
|
|
4229
4275
|
try {
|
|
4230
4276
|
fires = await resolveJudgmentGate(ph.gate, gateContext, packageRoot);
|
|
4231
4277
|
} catch (err2) {
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4278
|
+
if (isUndefinedVariableError(err2)) {
|
|
4279
|
+
console.warn(
|
|
4280
|
+
`\u26A0\uFE0F phase ${ph.id} gate ${ph.gate} references a variable missing from the gate context (${err2.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
|
|
4281
|
+
);
|
|
4282
|
+
fires = false;
|
|
4283
|
+
} else {
|
|
4284
|
+
console.warn(
|
|
4285
|
+
`\u26A0\uFE0F phase ${ph.id} gate ${ph.gate} eval failed (${err2.message}); proceeding with phase as if gate fired=true (ADR 0029 fail-soft).`
|
|
4286
|
+
);
|
|
4287
|
+
}
|
|
4235
4288
|
}
|
|
4236
4289
|
if (!fires) {
|
|
4237
4290
|
skippedPhases.push(ph.id);
|
|
@@ -4311,6 +4364,7 @@ var init_run = __esm({
|
|
|
4311
4364
|
init_before_commit();
|
|
4312
4365
|
init_before_phase_execute();
|
|
4313
4366
|
init_before_spawn();
|
|
4367
|
+
init_exprBuilder();
|
|
4314
4368
|
init_governance2();
|
|
4315
4369
|
init_judgmentResolver();
|
|
4316
4370
|
init_ralphLoop();
|
|
@@ -4472,6 +4526,12 @@ function buildDefaultGateContext(task, stage) {
|
|
|
4472
4526
|
shared_task_list: false,
|
|
4473
4527
|
opposing_hypothesis_debate: false,
|
|
4474
4528
|
fullstack_three_way: false,
|
|
4529
|
+
// 4.23.2 (issue #5) — stage-routing.yaml verify-multispec-critical-release
|
|
4530
|
+
// references the BARE identifier (root-flat schema contract, sister
|
|
4531
|
+
// src/workflow/schema/phaseFactContext.ts). Missing here since the v4.1.2
|
|
4532
|
+
// extraction → eval threw undefined-variable → ADR 0029 fail-soft fired the
|
|
4533
|
+
// 4-specialist multispec team on EVERY verify. Opt-in via --context.
|
|
4534
|
+
is_critical_release: false,
|
|
4475
4535
|
phase: {
|
|
4476
4536
|
stage,
|
|
4477
4537
|
is_critical_module: true,
|
|
@@ -9903,7 +9963,9 @@ function registerExemptGateguard(program2) {
|
|
|
9903
9963
|
|
|
9904
9964
|
// src/cli/gates.ts
|
|
9905
9965
|
init_path_guard();
|
|
9966
|
+
init_exprBuilder();
|
|
9906
9967
|
init_judgmentResolver();
|
|
9968
|
+
init_skipSubs();
|
|
9907
9969
|
init_assetsRoot();
|
|
9908
9970
|
init_gateContext();
|
|
9909
9971
|
var VALID_MASTERS = /* @__PURE__ */ new Set(["auto", "discuss", "plan", "task", "verify", "ship"]);
|
|
@@ -9984,8 +10046,11 @@ function registerGates(program2) {
|
|
|
9984
10046
|
ctx.skip_subs = [...skipSubs];
|
|
9985
10047
|
const fire = [];
|
|
9986
10048
|
const skip = [];
|
|
10049
|
+
const matchedSkips = /* @__PURE__ */ new Set();
|
|
9987
10050
|
for (const clause of clauses) {
|
|
9988
|
-
|
|
10051
|
+
const skipHit = matchSkipSub(skipSubs, clause.sub, master);
|
|
10052
|
+
if (skipHit !== null) {
|
|
10053
|
+
matchedSkips.add(skipHit);
|
|
9989
10054
|
skip.push({
|
|
9990
10055
|
sub: clause.sub,
|
|
9991
10056
|
reason: "skipped via skip_subs (done interactively in main session)"
|
|
@@ -10004,12 +10069,29 @@ function registerGates(program2) {
|
|
|
10004
10069
|
skip.push({ sub: clause.sub, reason: `gate ${clause.gate} = false` });
|
|
10005
10070
|
}
|
|
10006
10071
|
} catch (e) {
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10072
|
+
if (isUndefinedVariableError(e)) {
|
|
10073
|
+
console.warn(
|
|
10074
|
+
`\u26A0\uFE0F master ${master} sub ${clause.sub} gate ${clause.gate} references a variable missing from the gate context (${e.message}). Treating as NOT fired (fail-closed for config errors) \u2014 fix the judgments yaml expression or supply the variable via --context / gateContext defaults.`
|
|
10075
|
+
);
|
|
10076
|
+
skip.push({
|
|
10077
|
+
sub: clause.sub,
|
|
10078
|
+
reason: `gate ${clause.gate} misconfigured (undefined variable) \u2014 fail-closed, not fired`
|
|
10079
|
+
});
|
|
10080
|
+
} else {
|
|
10081
|
+
console.warn(
|
|
10082
|
+
`\u26A0\uFE0F master ${master} sub ${clause.sub} gate ${clause.gate} eval failed (${e.message}); firing sub as if gate=true (ADR 0029 fail-soft).`
|
|
10083
|
+
);
|
|
10084
|
+
fire.push(fireEntry(clause, master));
|
|
10085
|
+
}
|
|
10011
10086
|
}
|
|
10012
10087
|
}
|
|
10088
|
+
warnUnmatchedSkips(
|
|
10089
|
+
skipSubs,
|
|
10090
|
+
matchedSkips,
|
|
10091
|
+
master,
|
|
10092
|
+
clauses.map((c) => c.sub),
|
|
10093
|
+
(m) => console.warn(m)
|
|
10094
|
+
);
|
|
10013
10095
|
let parallelism = { escalate_to_teams: false, reason: null };
|
|
10014
10096
|
try {
|
|
10015
10097
|
const escalate = await resolveJudgmentGate(PARALLELISM_GATE, ctx, packageRoot);
|