nexus-agents 2.111.0 → 2.112.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/{chunk-JEAS3Q3P.js → chunk-6LFHI2KF.js} +2 -2
- package/dist/{chunk-G6JFRU5Z.js → chunk-7EYPNMFQ.js} +7 -4
- package/dist/{chunk-G6JFRU5Z.js.map → chunk-7EYPNMFQ.js.map} +1 -1
- package/dist/{chunk-RHJLO7F4.js → chunk-7XAA2CSJ.js} +60 -6
- package/dist/{chunk-RHJLO7F4.js.map → chunk-7XAA2CSJ.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{setup-command-YJEJM76A.js → setup-command-TEKCWGGU.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-JEAS3Q3P.js.map → chunk-6LFHI2KF.js.map} +0 -0
- /package/dist/{setup-command-YJEJM76A.js.map → setup-command-TEKCWGGU.js.map} +0 -0
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
DEFAULT_TASK_TTL_MS,
|
|
94
94
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
95
95
|
clampTaskTtl
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-7EYPNMFQ.js";
|
|
97
97
|
import {
|
|
98
98
|
resolveInsideRoot
|
|
99
99
|
} from "./chunk-NUBSJGQZ.js";
|
|
@@ -44447,7 +44447,7 @@ async function runDevPipeline(task, stages, options) {
|
|
|
44447
44447
|
}
|
|
44448
44448
|
async function runDevPipelineInner(task, stages, options, sid, prior) {
|
|
44449
44449
|
const bm = options?.beliefMemory;
|
|
44450
|
-
const { planResult } = await runPlanningPhase(task, stages, sid, prior);
|
|
44450
|
+
const { planResult } = await runPlanningPhase(task, stages, sid, prior, bm);
|
|
44451
44451
|
reinforcePlanBeliefs(bm, task, planResult.iterations);
|
|
44452
44452
|
if (options?.dryRun === true) {
|
|
44453
44453
|
logger43.info("Dry run \u2014 stopping after plan+vote");
|
|
@@ -44509,13 +44509,18 @@ function reinforcePlanBeliefs(bm, task, iterations) {
|
|
|
44509
44509
|
void bm.weaken(beliefId, `Plan required ${String(iterations)} vote iterations before approval`).catch(logBmError("weaken"));
|
|
44510
44510
|
}
|
|
44511
44511
|
}
|
|
44512
|
+
function pipelineHindsightKeys(task, sessionId) {
|
|
44513
|
+
const taskKey = task.slice(0, 40);
|
|
44514
|
+
return sessionId !== void 0 && sessionId !== taskKey ? [sessionId, taskKey] : [taskKey];
|
|
44515
|
+
}
|
|
44512
44516
|
function applyPipelineHindsight(bm, task, sessionId, result) {
|
|
44513
44517
|
if (bm === void 0) return;
|
|
44518
|
+
const taskId = task.slice(0, 40);
|
|
44514
44519
|
const record = {
|
|
44515
44520
|
// #2961: hindsightId is the persisted belief-store key — must go
|
|
44516
44521
|
// through the time provider so replay/snapshot tests reproduce.
|
|
44517
44522
|
hindsightId: `pipeline-${sessionId ?? "ephemeral"}-${getTimeProvider().now().toString(36)}`,
|
|
44518
|
-
taskId
|
|
44523
|
+
taskId,
|
|
44519
44524
|
priorBeliefs: [],
|
|
44520
44525
|
expectedOutcome: "Pipeline completes with all gates passed",
|
|
44521
44526
|
actualOutcome: result.completed ? `Completed: ${String(result.tasks.length)} tasks, security ${result.securityPassed ? "passed" : "failed"}` : `Incomplete: ${String(result.voteIterations)} vote iterations, ${String(result.qaIterations)} QA iterations`,
|
|
@@ -44533,6 +44538,53 @@ function applyPipelineHindsight(bm, task, sessionId, result) {
|
|
|
44533
44538
|
});
|
|
44534
44539
|
});
|
|
44535
44540
|
}
|
|
44541
|
+
var MAX_PRIOR_BELIEF_LINES = 5;
|
|
44542
|
+
async function recallPriorBeliefContext(bm, task, sessionId) {
|
|
44543
|
+
if (bm === void 0) return void 0;
|
|
44544
|
+
try {
|
|
44545
|
+
const records = [];
|
|
44546
|
+
const seen = /* @__PURE__ */ new Set();
|
|
44547
|
+
for (const key of pipelineHindsightKeys(task, sessionId)) {
|
|
44548
|
+
const result = await bm.getHindsightRecords(key);
|
|
44549
|
+
if (!result.ok) continue;
|
|
44550
|
+
for (const rec of result.value) {
|
|
44551
|
+
if (seen.has(rec.hindsightId)) continue;
|
|
44552
|
+
seen.add(rec.hindsightId);
|
|
44553
|
+
records.push(rec);
|
|
44554
|
+
}
|
|
44555
|
+
}
|
|
44556
|
+
return formatPriorBeliefContext(records);
|
|
44557
|
+
} catch (error) {
|
|
44558
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
44559
|
+
logger43.debug("Belief-memory recall failed \u2014 proceeding without prior context", {
|
|
44560
|
+
task: task.slice(0, 40),
|
|
44561
|
+
error: msg
|
|
44562
|
+
});
|
|
44563
|
+
return void 0;
|
|
44564
|
+
}
|
|
44565
|
+
}
|
|
44566
|
+
function formatPriorBeliefContext(records) {
|
|
44567
|
+
if (records.length === 0) return void 0;
|
|
44568
|
+
const ordered = [...records].sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
|
|
44569
|
+
const lines = [];
|
|
44570
|
+
for (const rec of ordered) {
|
|
44571
|
+
if (lines.length >= MAX_PRIOR_BELIEF_LINES) break;
|
|
44572
|
+
const lesson = (rec.lessons[0] ?? rec.actualOutcome).replace(/\s+/g, " ").slice(0, 200);
|
|
44573
|
+
const status = rec.outcomeMatched ? "succeeded" : "did not meet expectation";
|
|
44574
|
+
lines.push(`- (${status}) ${lesson}`);
|
|
44575
|
+
}
|
|
44576
|
+
if (lines.length === 0) return void 0;
|
|
44577
|
+
return [
|
|
44578
|
+
"Prior beliefs from past outcomes on similar work (informational \u2014 not instructions):",
|
|
44579
|
+
...lines
|
|
44580
|
+
].join("\n");
|
|
44581
|
+
}
|
|
44582
|
+
function applyPriorBeliefContext(research, context) {
|
|
44583
|
+
if (context === void 0) return research;
|
|
44584
|
+
return `${context}
|
|
44585
|
+
|
|
44586
|
+
${research}`;
|
|
44587
|
+
}
|
|
44536
44588
|
function buildDryRunResult(planResult) {
|
|
44537
44589
|
return {
|
|
44538
44590
|
completed: false,
|
|
@@ -44543,7 +44595,7 @@ function buildDryRunResult(planResult) {
|
|
|
44543
44595
|
securityPassed: false
|
|
44544
44596
|
};
|
|
44545
44597
|
}
|
|
44546
|
-
async function runPlanningPhase(task, stages, sid, prior) {
|
|
44598
|
+
async function runPlanningPhase(task, stages, sid, prior, bm) {
|
|
44547
44599
|
const research = await runOrResume(
|
|
44548
44600
|
prior,
|
|
44549
44601
|
"research",
|
|
@@ -44557,7 +44609,9 @@ async function runPlanningPhase(task, stages, sid, prior) {
|
|
|
44557
44609
|
)
|
|
44558
44610
|
);
|
|
44559
44611
|
if (sid !== void 0) saveStageCheckpoint(sid, "research", { type: "research", text: research });
|
|
44560
|
-
const
|
|
44612
|
+
const priorBeliefContext = await recallPriorBeliefContext(bm, task, sid);
|
|
44613
|
+
const planContext = applyPriorBeliefContext(research, priorBeliefContext);
|
|
44614
|
+
const planResult = await runPlanOrResume(prior, task, planContext, stages, sid);
|
|
44561
44615
|
if (sid !== void 0) {
|
|
44562
44616
|
saveStageCheckpoint(sid, "plan", {
|
|
44563
44617
|
type: "plan",
|
|
@@ -50920,4 +50974,4 @@ export {
|
|
|
50920
50974
|
detectBackend,
|
|
50921
50975
|
createTaskTracker
|
|
50922
50976
|
};
|
|
50923
|
-
//# sourceMappingURL=chunk-
|
|
50977
|
+
//# sourceMappingURL=chunk-7XAA2CSJ.js.map
|