@nathapp/nax 0.67.5 → 0.67.7

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.
Files changed (2) hide show
  1. package/dist/nax.js +26 -6
  2. package/package.json +1 -1
package/dist/nax.js CHANGED
@@ -52096,7 +52096,12 @@ async function runRectification(ctx, state, phaseCosts, phaseOutputs) {
52096
52096
  storyId: ctx.storyId
52097
52097
  });
52098
52098
  }
52099
- const exhaustedReasons = new Set(["max-attempts-total", "max-attempts-per-strategy", "bail-when"]);
52099
+ const exhaustedReasons = new Set([
52100
+ "max-attempts-total",
52101
+ "max-attempts-per-strategy",
52102
+ "bail-when",
52103
+ "no-strategy"
52104
+ ]);
52100
52105
  if (exhaustedReasons.has(cycleResult.exitReason) && cycleResult.finalFindings.length > 0) {
52101
52106
  return { rectificationExhausted: true, unfixedFindings: cycleResult.finalFindings };
52102
52107
  }
@@ -52634,6 +52639,9 @@ async function closeAllRunSessions(sessionManager, agentGetFn, opts) {
52634
52639
  }
52635
52640
 
52636
52641
  // src/execution/post-run.ts
52642
+ function shouldRollbackTddFailure(tddMode, failureCategory) {
52643
+ return tddMode?.rollbackEnabled === true && failureCategory === "isolation-violation";
52644
+ }
52637
52645
  function extractPauseReason(phaseOutputs) {
52638
52646
  for (const output of Object.values(phaseOutputs)) {
52639
52647
  if (output !== null && typeof output === "object") {
@@ -52816,8 +52824,11 @@ async function decideStageAction(ctx, planResult, inspection, opts) {
52816
52824
  const logger = getLogger();
52817
52825
  const isTdd = opts.tddMode !== null;
52818
52826
  const isLiteMode = opts.tddMode?.isLite ?? false;
52819
- const shouldRollback = opts.tddMode?.rollbackEnabled === true;
52827
+ const shouldRollback = shouldRollbackTddFailure(opts.tddMode, inspection.failureCategory);
52820
52828
  const { agentResult, selfVerificationFailed, pauseReason, failureCategory, needsHumanReview, combinedOutput } = inspection;
52829
+ if (isTdd && !planResult.success) {
52830
+ ctx.tddFailureCategory = failureCategory;
52831
+ }
52821
52832
  if (planResult.rectificationExhausted && planResult.unfixedFindings && planResult.unfixedFindings.length > 0) {
52822
52833
  const sources = new Set(planResult.unfixedFindings.map((f) => f.source));
52823
52834
  const allMechanical = [...sources].every((s) => s === "lint" || s === "typecheck");
@@ -52827,6 +52838,16 @@ async function decideStageAction(ctx, planResult, inspection, opts) {
52827
52838
  });
52828
52839
  return { action: "continue" };
52829
52840
  }
52841
+ if (!(isTdd && shouldRollback)) {
52842
+ const findingSources = [...sources].filter((source) => typeof source === "string");
52843
+ logger.error("execution", "Rectification exhausted with unfixed findings", {
52844
+ storyId: ctx.story.id,
52845
+ findingsCount: planResult.unfixedFindings.length,
52846
+ findingSources
52847
+ });
52848
+ await cleanupSessionOnFailure(ctx);
52849
+ return { action: "escalate", reason: "Rectification exhausted with unfixed findings" };
52850
+ }
52830
52851
  }
52831
52852
  if (selfVerificationFailed) {
52832
52853
  logger.warn("execution", "Self-verification reported explicit failure", {
@@ -52862,7 +52883,6 @@ Reason: ${pauseReason}`,
52862
52883
  return { action: "pause", reason: pauseReason };
52863
52884
  }
52864
52885
  if (isTdd && !planResult.success) {
52865
- ctx.tddFailureCategory = failureCategory;
52866
52886
  if (shouldRollback && opts.initialRef) {
52867
52887
  try {
52868
52888
  await _postRunDeps.rollbackToRef(ctx.workdir, opts.initialRef);
@@ -56733,7 +56753,7 @@ var package_default;
56733
56753
  var init_package = __esm(() => {
56734
56754
  package_default = {
56735
56755
  name: "@nathapp/nax",
56736
- version: "0.67.5",
56756
+ version: "0.67.7",
56737
56757
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
56738
56758
  type: "module",
56739
56759
  bin: {
@@ -56828,8 +56848,8 @@ var init_version = __esm(() => {
56828
56848
  NAX_VERSION = package_default.version;
56829
56849
  NAX_COMMIT = (() => {
56830
56850
  try {
56831
- if (/^[0-9a-f]{6,10}$/.test("bd8ffe1a"))
56832
- return "bd8ffe1a";
56851
+ if (/^[0-9a-f]{6,10}$/.test("1c26c38d"))
56852
+ return "1c26c38d";
56833
56853
  } catch {}
56834
56854
  try {
56835
56855
  const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nax",
3
- "version": "0.67.5",
3
+ "version": "0.67.7",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {