@nathapp/nax 0.67.14 → 0.67.15
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/nax.js +43 -26
- package/package.json +1 -1
package/dist/nax.js
CHANGED
|
@@ -52720,6 +52720,12 @@ var init_context2 = __esm(() => {
|
|
|
52720
52720
|
});
|
|
52721
52721
|
|
|
52722
52722
|
// src/execution/story-orchestrator.ts
|
|
52723
|
+
function formatPhaseResultMessage(opName, success2) {
|
|
52724
|
+
if (opName === "greenfield-gate") {
|
|
52725
|
+
return success2 ? "Greenfield-gate: pre-existing tests detected (not greenfield) \u2014 proceeding with normal TDD" : "Greenfield-gate: no pre-existing tests \u2014 greenfield run, pausing TDD test-writer";
|
|
52726
|
+
}
|
|
52727
|
+
return success2 ? `Phase passed: ${opName}` : `Phase failed: ${opName}`;
|
|
52728
|
+
}
|
|
52723
52729
|
function isSlot(value) {
|
|
52724
52730
|
return value !== null && typeof value === "object" && "op" in value && "input" in value && typeof value.op?.kind === "string";
|
|
52725
52731
|
}
|
|
@@ -52832,19 +52838,18 @@ function collectRectificationPhases(state) {
|
|
|
52832
52838
|
].filter((phase) => phase !== undefined);
|
|
52833
52839
|
}
|
|
52834
52840
|
function phasesToRevalidate(strategiesRun, allPhases) {
|
|
52835
|
-
const sourceFiltered = allPhases.filter((p) => p.kind !== "verifier");
|
|
52836
52841
|
if (!strategiesRun || strategiesRun.length === 0)
|
|
52837
|
-
return
|
|
52842
|
+
return allPhases;
|
|
52838
52843
|
const unknown2 = strategiesRun.some((name) => STRATEGY_TO_REVALIDATION_PHASES[name] === undefined);
|
|
52839
52844
|
if (unknown2)
|
|
52840
|
-
return
|
|
52845
|
+
return allPhases;
|
|
52841
52846
|
const needed = new Set;
|
|
52842
52847
|
for (const name of strategiesRun) {
|
|
52843
52848
|
for (const kind of STRATEGY_TO_REVALIDATION_PHASES[name] ?? []) {
|
|
52844
52849
|
needed.add(kind);
|
|
52845
52850
|
}
|
|
52846
52851
|
}
|
|
52847
|
-
return
|
|
52852
|
+
return allPhases.filter((p) => needed.has(p.kind));
|
|
52848
52853
|
}
|
|
52849
52854
|
function toReviewDecisionPayload(opName, output) {
|
|
52850
52855
|
if (output === null || output === undefined || typeof output !== "object")
|
|
@@ -52928,10 +52933,11 @@ function logDeterministicPhaseOutcome(storyId, opName, output, durationMs, isTdd
|
|
|
52928
52933
|
data.findingsCount = findingsCount;
|
|
52929
52934
|
if (status !== undefined)
|
|
52930
52935
|
data.status = status;
|
|
52936
|
+
const message = formatPhaseResultMessage(opName, success2);
|
|
52931
52937
|
if (success2) {
|
|
52932
|
-
logger?.info("story-orchestrator",
|
|
52938
|
+
logger?.info("story-orchestrator", message, data);
|
|
52933
52939
|
} else {
|
|
52934
|
-
logger?.warn("story-orchestrator",
|
|
52940
|
+
logger?.warn("story-orchestrator", message, data);
|
|
52935
52941
|
}
|
|
52936
52942
|
}
|
|
52937
52943
|
function logUnifiedReviewPhaseResult(storyId, opName, output) {
|
|
@@ -53106,7 +53112,12 @@ async function runRectification(ctx, state, phaseCosts, phaseOutputs) {
|
|
|
53106
53112
|
}
|
|
53107
53113
|
};
|
|
53108
53114
|
const cycleResult = await _storyOrchestratorDeps.runFixCycle(cycle, ctx, "story-orchestrator-rectification", { callOp: wrappedCallOp });
|
|
53109
|
-
phaseOutputs.rectification = {
|
|
53115
|
+
phaseOutputs.rectification = {
|
|
53116
|
+
success: cycleResult.exitReason === "resolved",
|
|
53117
|
+
iterationCount: cycleResult.iterations.length,
|
|
53118
|
+
exitReason: cycleResult.exitReason,
|
|
53119
|
+
finalFindingsCount: cycleResult.finalFindings.length
|
|
53120
|
+
};
|
|
53110
53121
|
const rectLogger = getSafeLogger();
|
|
53111
53122
|
const rectSummary = {
|
|
53112
53123
|
storyId: ctx.storyId,
|
|
@@ -53160,13 +53171,6 @@ class ExecutionPlan {
|
|
|
53160
53171
|
const phaseOutputs = {};
|
|
53161
53172
|
const startedAt = Date.now();
|
|
53162
53173
|
const logger = getSafeLogger();
|
|
53163
|
-
const verifierPresent = this.state.verifier !== undefined;
|
|
53164
|
-
const rectificationExempt = this.state.rectification ? [
|
|
53165
|
-
...this.state.fullSuiteGate ? [this.state.fullSuiteGate.slot.op.name] : [],
|
|
53166
|
-
...this.state.verifier ? [this.state.verifier.slot.op.name] : []
|
|
53167
|
-
] : [];
|
|
53168
|
-
const verifierExempt = verifierPresent && this.state.fullSuiteGate ? [this.state.fullSuiteGate.slot.op.name] : [];
|
|
53169
|
-
const shortCircuitExempt = new Set([...rectificationExempt, ...verifierExempt]);
|
|
53170
53174
|
for (const phase of collectOrderedPhases(this.state)) {
|
|
53171
53175
|
try {
|
|
53172
53176
|
await runPhase(this.ctx, phase.slot, phaseCosts, phaseOutputs, this.isThreeSession);
|
|
@@ -53179,13 +53183,11 @@ class ExecutionPlan {
|
|
|
53179
53183
|
throw error48;
|
|
53180
53184
|
}
|
|
53181
53185
|
if (!phasePassed(phase.slot.op.name, phaseOutputs[phase.slot.op.name], this.ctx.storyId)) {
|
|
53182
|
-
|
|
53183
|
-
|
|
53184
|
-
|
|
53185
|
-
|
|
53186
|
-
|
|
53187
|
-
break;
|
|
53188
|
-
}
|
|
53186
|
+
logger?.warn("story-orchestrator", "Short-circuiting on phase failure", {
|
|
53187
|
+
storyId: this.ctx.storyId,
|
|
53188
|
+
phase: phase.slot.op.name
|
|
53189
|
+
});
|
|
53190
|
+
break;
|
|
53189
53191
|
}
|
|
53190
53192
|
}
|
|
53191
53193
|
const rectResult = await runRectification(this.ctx, this.state, phaseCosts, phaseOutputs);
|
|
@@ -53340,12 +53342,27 @@ var init_story_orchestrator = __esm(() => {
|
|
|
53340
53342
|
"lint-check",
|
|
53341
53343
|
"typecheck-check",
|
|
53342
53344
|
"full-suite-gate",
|
|
53345
|
+
"verifier",
|
|
53343
53346
|
"verify-scoped",
|
|
53344
53347
|
"semantic-review",
|
|
53345
53348
|
"adversarial-review"
|
|
53346
53349
|
],
|
|
53347
|
-
"autofix-test-writer": [
|
|
53348
|
-
|
|
53350
|
+
"autofix-test-writer": [
|
|
53351
|
+
"lint-check",
|
|
53352
|
+
"typecheck-check",
|
|
53353
|
+
"full-suite-gate",
|
|
53354
|
+
"verifier",
|
|
53355
|
+
"verify-scoped",
|
|
53356
|
+
"adversarial-review"
|
|
53357
|
+
],
|
|
53358
|
+
"full-suite-rectify": [
|
|
53359
|
+
"lint-check",
|
|
53360
|
+
"typecheck-check",
|
|
53361
|
+
"full-suite-gate",
|
|
53362
|
+
"verifier",
|
|
53363
|
+
"verify-scoped",
|
|
53364
|
+
"semantic-review"
|
|
53365
|
+
]
|
|
53349
53366
|
};
|
|
53350
53367
|
});
|
|
53351
53368
|
|
|
@@ -57683,7 +57700,7 @@ var package_default;
|
|
|
57683
57700
|
var init_package = __esm(() => {
|
|
57684
57701
|
package_default = {
|
|
57685
57702
|
name: "@nathapp/nax",
|
|
57686
|
-
version: "0.67.
|
|
57703
|
+
version: "0.67.15",
|
|
57687
57704
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
57688
57705
|
type: "module",
|
|
57689
57706
|
bin: {
|
|
@@ -57778,8 +57795,8 @@ var init_version = __esm(() => {
|
|
|
57778
57795
|
NAX_VERSION = package_default.version;
|
|
57779
57796
|
NAX_COMMIT = (() => {
|
|
57780
57797
|
try {
|
|
57781
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
57782
|
-
return "
|
|
57798
|
+
if (/^[0-9a-f]{6,10}$/.test("035dd857"))
|
|
57799
|
+
return "035dd857";
|
|
57783
57800
|
} catch {}
|
|
57784
57801
|
try {
|
|
57785
57802
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|