@nathapp/nax 0.67.2 → 0.67.3

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 +41 -7
  2. package/package.json +1 -1
package/dist/nax.js CHANGED
@@ -51805,12 +51805,12 @@ async function assertionSiteDiffCheck(workdir, beforeRef, files) {
51805
51805
  }
51806
51806
  return { violated: false };
51807
51807
  }
51808
- async function runIsolationGuard(workdir, beforeRef, config2, packageDir) {
51808
+ async function runIsolationGuard(workdir, beforeRef, config2, packageDir, mode = "strict") {
51809
51809
  if (config2.quality.autofix?.enforceTestWriterIsolation === false) {
51810
51810
  return { violated: false, skipped: true };
51811
51811
  }
51812
51812
  const resolved = await resolveTestFilePatterns(config2, workdir, packageDir);
51813
- const result = await _guardDeps.verifyTestWriterIsolation(workdir, beforeRef, config2.tdd?.testWriterAllowedPaths, resolved.globs);
51813
+ const result = await _guardDeps.verifyTestWriterIsolation(workdir, beforeRef, config2.tdd?.testWriterAllowedPaths, resolved.globs, mode);
51814
51814
  if (!result.passed) {
51815
51815
  return { violated: true, files: result.violations ?? [] };
51816
51816
  }
@@ -52155,7 +52155,7 @@ async function runAgentRectificationV2(ctx, _lintFixCmd, _formatFixCmd, _effecti
52155
52155
  });
52156
52156
  return { unresolved: `assertion_weakening:${assertionResult.file}:${assertionResult.line}` };
52157
52157
  }
52158
- const isolationResult = await _autofixCycleGuardDeps.runIsolationGuard(ctx.workdir, beforeRef, ctx.config, ctx.story.workdir || undefined);
52158
+ const isolationResult = await _autofixCycleGuardDeps.runIsolationGuard(ctx.workdir, beforeRef, ctx.config, ctx.story.workdir || undefined, ctx.routing?.testStrategy === "three-session-tdd-lite" ? "lite" : "strict");
52159
52159
  if (isolationResult.violated) {
52160
52160
  await _autofixCycleGuardDeps.revertDiff(ctx.workdir, isolationResult.files);
52161
52161
  logger.info("autofix-cycle", "test-writer isolation guard violated \u2014 reverted", {
@@ -54211,6 +54211,12 @@ function collectOrderedPhases(state) {
54211
54211
  return [];
54212
54212
  });
54213
54213
  }
54214
+ function phaseExplicitlyPassed(output) {
54215
+ if (output === null || output === undefined || typeof output !== "object")
54216
+ return false;
54217
+ const r = output;
54218
+ return r.success === true || r.passed === true;
54219
+ }
54214
54220
  function phasePassed(opName, output) {
54215
54221
  if (output === null || output === undefined) {
54216
54222
  getSafeLogger()?.warn("story-orchestrator", "Phase produced no output \u2014 treating as pass", {
@@ -54419,7 +54425,17 @@ class ExecutionPlan {
54419
54425
  }
54420
54426
  }
54421
54427
  await runRectification(this.ctx, this.state, phaseCosts, phaseOutputs);
54422
- const success2 = Object.entries(phaseOutputs).every(([name, output]) => phasePassed(name, output));
54428
+ const verifierName = this.state.verifier?.slot.op.name;
54429
+ const gateName = this.state.fullSuiteGate?.slot.op.name;
54430
+ const verifierPassedSsot = verifierName !== undefined && phaseExplicitlyPassed(phaseOutputs[verifierName]);
54431
+ if (verifierPassedSsot && gateName !== undefined && !phasePassed(gateName, phaseOutputs[gateName])) {
54432
+ logger?.warn("story-orchestrator", "Full-suite gate failed but verifier judged story OK \u2014 treating gate failures as unrelated regressions", { storyId: this.ctx.storyId, packageDir: this.ctx.packageDir });
54433
+ }
54434
+ const success2 = Object.entries(phaseOutputs).every(([name, output]) => {
54435
+ if (verifierPassedSsot && name === gateName)
54436
+ return true;
54437
+ return phasePassed(name, output);
54438
+ });
54423
54439
  const totalCostUsd = Object.values(phaseCosts).reduce((sum, cost) => sum + cost, 0);
54424
54440
  return {
54425
54441
  success: success2,
@@ -54935,6 +54951,24 @@ async function applyPostRunInspection(ctx, planResult, opts) {
54935
54951
  }
54936
54952
  const pauseReason = extractPauseReason(planResult.phaseOutputs);
54937
54953
  const failureCategory = isTdd && !planResult.success ? deriveTddFailureCategory(planResult.phaseOutputs) : undefined;
54954
+ if (isTdd && !planResult.success && !failureCategory) {
54955
+ const phaseSignals = {};
54956
+ for (const [name, output] of Object.entries(planResult.phaseOutputs)) {
54957
+ if (output && typeof output === "object") {
54958
+ const r = output;
54959
+ const signal = {};
54960
+ if (typeof r.success === "boolean")
54961
+ signal.success = r.success;
54962
+ if (typeof r.passed === "boolean")
54963
+ signal.passed = r.passed;
54964
+ phaseSignals[name] = signal;
54965
+ }
54966
+ }
54967
+ logger.warn("execution", "TDD plan failed but no failure category derived \u2014 defaulting to pause", {
54968
+ storyId: ctx.story.id,
54969
+ phaseSignals
54970
+ });
54971
+ }
54938
54972
  const tddIsolations = {};
54939
54973
  for (const opName of ["test-writer", "implementer", "verifier"]) {
54940
54974
  const phaseOut = planResult.phaseOutputs[opName];
@@ -59219,7 +59253,7 @@ var package_default;
59219
59253
  var init_package = __esm(() => {
59220
59254
  package_default = {
59221
59255
  name: "@nathapp/nax",
59222
- version: "0.67.2",
59256
+ version: "0.67.3",
59223
59257
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
59224
59258
  type: "module",
59225
59259
  bin: {
@@ -59314,8 +59348,8 @@ var init_version = __esm(() => {
59314
59348
  NAX_VERSION = package_default.version;
59315
59349
  NAX_COMMIT = (() => {
59316
59350
  try {
59317
- if (/^[0-9a-f]{6,10}$/.test("d2b13ea6"))
59318
- return "d2b13ea6";
59351
+ if (/^[0-9a-f]{6,10}$/.test("bcfe96ad"))
59352
+ return "bcfe96ad";
59319
59353
  } catch {}
59320
59354
  try {
59321
59355
  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.2",
3
+ "version": "0.67.3",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {