harnessed 4.32.12 → 4.32.14
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/bin/harnessed-inject-state.mjs +358 -363
- package/dist/cli.mjs +21 -11
- 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/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.32.
|
|
41
|
+
version: "4.32.14",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -835,6 +835,14 @@ var init_planningScan = __esm({
|
|
|
835
835
|
}
|
|
836
836
|
});
|
|
837
837
|
|
|
838
|
+
// src/checkpoint/subAnchor.ts
|
|
839
|
+
var PARALLEL_MID_ANCHOR;
|
|
840
|
+
var init_subAnchor = __esm({
|
|
841
|
+
"src/checkpoint/subAnchor.ts"() {
|
|
842
|
+
PARALLEL_MID_ANCHOR = 50;
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
|
|
838
846
|
// src/checkpoint/ledger.ts
|
|
839
847
|
var ledger_exports = {};
|
|
840
848
|
__export(ledger_exports, {
|
|
@@ -895,10 +903,9 @@ function findSerialBlockers(entries, sub) {
|
|
|
895
903
|
const counts = target.mode === "serial" ? (e) => e.mode === "serial" || e.mode === "parallel" : (e) => e.mode === "serial";
|
|
896
904
|
return entries.filter((e) => e.sub !== sub && e.status === "pending" && counts(e) && eff(e) < eff(target)).map((e) => e.sub);
|
|
897
905
|
}
|
|
898
|
-
var PARALLEL_MID_ANCHOR;
|
|
899
906
|
var init_ledger = __esm({
|
|
900
907
|
"src/checkpoint/ledger.ts"() {
|
|
901
|
-
|
|
908
|
+
init_subAnchor();
|
|
902
909
|
}
|
|
903
910
|
});
|
|
904
911
|
|
|
@@ -4101,10 +4108,9 @@ async function runMasterOrchestrator(masterName, context, packageRoot, spawnDriv
|
|
|
4101
4108
|
(m) => console.warn(m)
|
|
4102
4109
|
);
|
|
4103
4110
|
emitGateTransparency(masterName, master.delegates_to.length, gateEvalled);
|
|
4104
|
-
const PARALLEL_MID_ANCHOR3 = 50;
|
|
4105
4111
|
const firedClauses = gateEvalled.filter((g) => g.passes).map((g) => g.clause);
|
|
4106
|
-
const serialLeading = firedClauses.filter((c) => c.mode === "serial" && (c.order ?? 0) <
|
|
4107
|
-
const serialTrailing = firedClauses.filter((c) => c.mode === "serial" && (c.order ?? 0) >=
|
|
4112
|
+
const serialLeading = firedClauses.filter((c) => c.mode === "serial" && (c.order ?? 0) < PARALLEL_MID_ANCHOR).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
4113
|
+
const serialTrailing = firedClauses.filter((c) => c.mode === "serial" && (c.order ?? 0) >= PARALLEL_MID_ANCHOR).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
4108
4114
|
const parallelClauses = firedClauses.filter((c) => (c.mode ?? "parallel") === "parallel");
|
|
4109
4115
|
const serialN = serialLeading.length + serialTrailing.length;
|
|
4110
4116
|
const parallelN = parallelClauses.length;
|
|
@@ -4150,6 +4156,7 @@ async function runMasterOrchestrator(masterName, context, packageRoot, spawnDriv
|
|
|
4150
4156
|
}
|
|
4151
4157
|
var init_masterOrchestrator = __esm({
|
|
4152
4158
|
"src/workflow/masterOrchestrator.ts"() {
|
|
4159
|
+
init_subAnchor();
|
|
4153
4160
|
init_exprBuilder();
|
|
4154
4161
|
init_judgmentResolver();
|
|
4155
4162
|
init_workflow();
|
|
@@ -9869,12 +9876,12 @@ function findPhaseContextExcerpt(repoRoot, phase, budget) {
|
|
|
9869
9876
|
}
|
|
9870
9877
|
return null;
|
|
9871
9878
|
}
|
|
9872
|
-
function buildInjection(repoRoot, wf, learningsMd, budget = DEFAULT_INJECT_BUDGET, intent = null, nowMs = Date.now()) {
|
|
9879
|
+
function buildInjection(repoRoot, wf, learningsMd, budget = DEFAULT_INJECT_BUDGET, intent = null, nowMs = Date.now(), opts = {}) {
|
|
9873
9880
|
const ledgerEmpty = (wf?.sub_progress ?? []).length === 0;
|
|
9874
9881
|
const intentBlock = ledgerEmpty ? buildIntentBlock(intent, nowMs) : "";
|
|
9875
9882
|
if (!wf) return intentBlock;
|
|
9876
9883
|
const forward = nextPending(wf.sub_progress ?? []) === null ? forwardPointer(repoRoot, wf) : null;
|
|
9877
|
-
const ws = buildWorkflowStateBlock(wf, forward);
|
|
9884
|
+
const ws = buildWorkflowStateBlock(wf, forward, opts.ledgerAgeMs);
|
|
9878
9885
|
const ledgerSubs = (wf.sub_progress ?? []).map((e) => e.sub);
|
|
9879
9886
|
const rel = selectWithinBudget(
|
|
9880
9887
|
filterRelevantLearnings(parseLearnings(learningsMd), { phase: wf.phase, ledgerSubs }),
|
|
@@ -9882,7 +9889,8 @@ function buildInjection(repoRoot, wf, learningsMd, budget = DEFAULT_INJECT_BUDGE
|
|
|
9882
9889
|
);
|
|
9883
9890
|
const usedTokens = rel.reduce((a, e) => a + tok(e.raw), 0);
|
|
9884
9891
|
const ctx = findPhaseContextExcerpt(repoRoot, wf.phase, Math.max(0, budget - usedTokens));
|
|
9885
|
-
const
|
|
9892
|
+
const pcRaw = buildProjectContextBlock({ learnings: rel, contextExcerpt: ctx ?? void 0 });
|
|
9893
|
+
const pc2 = pcRaw && opts.pcGate ? opts.pcGate(pcRaw) ? pcRaw : "" : pcRaw;
|
|
9886
9894
|
const normal = pc2 ? `${ws}
|
|
9887
9895
|
${pc2}` : ws;
|
|
9888
9896
|
return intentBlock ? `${intentBlock}
|
|
@@ -11151,8 +11159,10 @@ function registerDoctor(program2) {
|
|
|
11151
11159
|
process.exit(hasFail ? 1 : 0);
|
|
11152
11160
|
});
|
|
11153
11161
|
}
|
|
11162
|
+
|
|
11163
|
+
// src/eval/record.ts
|
|
11164
|
+
init_subAnchor();
|
|
11154
11165
|
var SUMMARY_PLACEHOLDER = "<SUMMARY-REDACTED>";
|
|
11155
|
-
var PARALLEL_MID_ANCHOR2 = 50;
|
|
11156
11166
|
function scrubSecretShapes(text) {
|
|
11157
11167
|
return text.replace(
|
|
11158
11168
|
/\b(gh[opusr]_[A-Za-z0-9]{16,}|github_pat_[A-Za-z0-9_]{20,}|sk-[A-Za-z0-9-]{20,}|xox[bap]-[A-Za-z0-9-]{10,}|AKIA[A-Z0-9]{16})\b/g,
|
|
@@ -11169,7 +11179,7 @@ function redactText(text, placeholder, includeText) {
|
|
|
11169
11179
|
}
|
|
11170
11180
|
function effectiveOrder(e) {
|
|
11171
11181
|
if (e.mode === "serial" && typeof e.order === "number") return e.order;
|
|
11172
|
-
return
|
|
11182
|
+
return PARALLEL_MID_ANCHOR;
|
|
11173
11183
|
}
|
|
11174
11184
|
function buildScenarioFromEnvelope(wf, opts = {}) {
|
|
11175
11185
|
const includeText = opts.includeText === true;
|