@nathapp/nax 0.69.3 → 0.69.4

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 +29 -8
  2. package/package.json +1 -1
package/dist/nax.js CHANGED
@@ -25203,8 +25203,22 @@ async function selectScopedTests(input) {
25203
25203
  if (!smartCfg.enabled || !input.storyGitRef || isMonorepoOrchestrator) {
25204
25204
  return { effectiveCommand: input.testCommand, isFullSuite: true, thresholdFallback: false, isMonorepoOrchestrator };
25205
25205
  }
25206
- const nonTestFiles = await _scopedSelectionDeps.getChangedNonTestFiles(input.workdir, input.storyGitRef, undefined, globsToTestRegex(smartCfg.testFilePatterns), input.naxIgnoreIndex);
25207
- const pass1Files = await _scopedSelectionDeps.mapSourceToTests(nonTestFiles, input.workdir);
25206
+ const repoRoot = input.repoRoot ?? input.workdir;
25207
+ const classifyRegex = input.resolvedTestPatterns?.regex ? [...input.resolvedTestPatterns.regex] : globsToTestRegex(smartCfg.testFilePatterns);
25208
+ const mappingGlobs = input.resolvedTestPatterns?.globs ? [...input.resolvedTestPatterns.globs] : smartCfg.testFilePatterns;
25209
+ const changedTestFiles = await _scopedSelectionDeps.getChangedTestFiles(input.workdir, repoRoot, input.storyGitRef, input.packagePrefix, classifyRegex, input.naxIgnoreIndex);
25210
+ if (changedTestFiles.length > threshold) {
25211
+ logger.warn("verify[scoped]", `Changed test file count ${changedTestFiles.length} exceeds threshold ${threshold} \u2014 falling back to full suite`, { storyId: input.storyId });
25212
+ return fullSuite({ scopeTestFallback: true, thresholdFallback: true });
25213
+ }
25214
+ if (changedTestFiles.length > 0) {
25215
+ logger.info("verify[scoped]", `Pass 0: ${changedTestFiles.length} changed test file(s) detected directly`, {
25216
+ storyId: input.storyId
25217
+ });
25218
+ return scoped(changedTestFiles);
25219
+ }
25220
+ const nonTestFiles = await _scopedSelectionDeps.getChangedNonTestFiles(input.workdir, input.storyGitRef, input.packagePrefix, classifyRegex, input.naxIgnoreIndex, repoRoot);
25221
+ const pass1Files = await _scopedSelectionDeps.mapSourceToTests(nonTestFiles, repoRoot, input.packagePrefix, mappingGlobs);
25208
25222
  if (pass1Files.length > threshold) {
25209
25223
  logger.warn("verify[scoped]", `Scoped test file count ${pass1Files.length} exceeds threshold ${threshold} \u2014 falling back to full suite`, { storyId: input.storyId });
25210
25224
  return fullSuite({ scopeTestFallback: true, thresholdFallback: true });
@@ -25218,7 +25232,7 @@ async function selectScopedTests(input) {
25218
25232
  if (smartCfg.fallback !== "import-grep") {
25219
25233
  return fullSuite();
25220
25234
  }
25221
- const pass2Files = await _scopedSelectionDeps.importGrepFallback(nonTestFiles, input.workdir, smartCfg.testFilePatterns);
25235
+ const pass2Files = await _scopedSelectionDeps.importGrepFallback(nonTestFiles, input.workdir, mappingGlobs);
25222
25236
  if (pass2Files.length > threshold) {
25223
25237
  logger.warn("verify[scoped]", `Scoped test file count ${pass2Files.length} exceeds threshold ${threshold} \u2014 falling back to full suite`, { storyId: input.storyId });
25224
25238
  return fullSuite({ scopeTestFallback: true, thresholdFallback: true });
@@ -25243,6 +25257,7 @@ var init_scoped_selection = __esm(() => {
25243
25257
  };
25244
25258
  _scopedSelectionDeps = {
25245
25259
  getChangedNonTestFiles: _smartRunnerDeps.getChangedNonTestFiles,
25260
+ getChangedTestFiles: _smartRunnerDeps.getChangedTestFiles,
25246
25261
  mapSourceToTests: _smartRunnerDeps.mapSourceToTests,
25247
25262
  importGrepFallback: _smartRunnerDeps.importGrepFallback,
25248
25263
  buildSmartTestCommand: _smartRunnerDeps.buildSmartTestCommand
@@ -39685,7 +39700,10 @@ var init_verify_scoped = __esm(() => {
39685
39700
  smartRunnerConfig: quality.execution?.smartTestRunner,
39686
39701
  scopeTestThreshold: quality.quality?.scopeTestThreshold,
39687
39702
  fallbackFullSuiteCommand: quality.quality?.commands?.test,
39688
- naxIgnoreIndex: input.naxIgnoreIndex
39703
+ naxIgnoreIndex: input.naxIgnoreIndex,
39704
+ repoRoot: input.repoRoot,
39705
+ packagePrefix: input.packagePrefix,
39706
+ resolvedTestPatterns: input.resolvedTestPatterns
39689
39707
  });
39690
39708
  if (selection.isFullSuite && regressionMode === "deferred" && !selection.isMonorepoOrchestrator && !selection.thresholdFallback) {
39691
39709
  logger.info("verify[scoped]", "No mapped tests \u2014 deferring to run-end (mode: deferred)", {
@@ -55133,7 +55151,10 @@ async function assemblePlanInputsFromCtx(ctx) {
55133
55151
  storyId: story.id,
55134
55152
  storyGitRef: ctx.storyGitRef,
55135
55153
  naxIgnoreIndex: ctx.naxIgnoreIndex,
55136
- regressionMode: toVerifyScopedMode(ctx.config.execution?.regressionGate?.mode)
55154
+ regressionMode: toVerifyScopedMode(ctx.config.execution?.regressionGate?.mode),
55155
+ repoRoot: ctx.projectDir,
55156
+ packagePrefix: packageDirRelative,
55157
+ resolvedTestPatterns
55137
55158
  } : undefined;
55138
55159
  const lintCheckInput = ctx.config.review?.enabled === true && ctx.config.review.checks?.includes("lint") && ctx.config.quality.commands.lint ? { workdir: ctx.workdir, storyId: story.id } : undefined;
55139
55160
  const typecheckCheckInput = ctx.config.review?.enabled === true && ctx.config.review.checks?.includes("typecheck") && ctx.config.quality.commands.typecheck ? { workdir: ctx.workdir, storyId: story.id } : undefined;
@@ -59551,7 +59572,7 @@ var package_default;
59551
59572
  var init_package = __esm(() => {
59552
59573
  package_default = {
59553
59574
  name: "@nathapp/nax",
59554
- version: "0.69.3",
59575
+ version: "0.69.4",
59555
59576
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
59556
59577
  type: "module",
59557
59578
  bin: {
@@ -59646,8 +59667,8 @@ var init_version = __esm(() => {
59646
59667
  NAX_VERSION = package_default.version;
59647
59668
  NAX_COMMIT = (() => {
59648
59669
  try {
59649
- if (/^[0-9a-f]{6,10}$/.test("7917c240"))
59650
- return "7917c240";
59670
+ if (/^[0-9a-f]{6,10}$/.test("fb1560dd"))
59671
+ return "fb1560dd";
59651
59672
  } catch {}
59652
59673
  try {
59653
59674
  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.69.3",
3
+ "version": "0.69.4",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {