@nathapp/nax 0.45.0 → 0.46.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/CHANGELOG.md +19 -0
- package/bin/nax.ts +7 -6
- package/dist/nax.js +181 -124
- package/package.json +1 -1
- package/src/agents/acp/adapter.ts +34 -6
- package/src/agents/acp/index.ts +0 -2
- package/src/agents/acp/parser.ts +57 -104
- package/src/agents/acp/spawn-client.ts +2 -1
- package/src/agents/{claude.ts → claude/adapter.ts} +15 -12
- package/src/agents/{claude-complete.ts → claude/complete.ts} +3 -3
- package/src/agents/{cost.ts → claude/cost.ts} +1 -1
- package/src/agents/{claude-execution.ts → claude/execution.ts} +5 -5
- package/src/agents/claude/index.ts +3 -0
- package/src/agents/{claude-interactive.ts → claude/interactive.ts} +4 -4
- package/src/agents/{claude-plan.ts → claude/plan.ts} +12 -9
- package/src/agents/index.ts +5 -5
- package/src/agents/registry.ts +5 -5
- package/src/agents/{claude-decompose.ts → shared/decompose.ts} +2 -2
- package/src/agents/{model-resolution.ts → shared/model-resolution.ts} +2 -2
- package/src/agents/{types-extended.ts → shared/types-extended.ts} +4 -4
- package/src/agents/{validation.ts → shared/validation.ts} +2 -2
- package/src/agents/{version-detection.ts → shared/version-detection.ts} +3 -3
- package/src/agents/types.ts +8 -4
- package/src/cli/agents.ts +1 -1
- package/src/pipeline/stages/acceptance.ts +5 -8
- package/src/pipeline/stages/regression.ts +2 -0
- package/src/pipeline/stages/verify.ts +5 -10
- package/src/precheck/checks-agents.ts +1 -1
- package/src/utils/log-test-output.ts +25 -0
- /package/src/agents/{adapters/aider.ts → aider/adapter.ts} +0 -0
- /package/src/agents/{adapters/codex.ts → codex/adapter.ts} +0 -0
- /package/src/agents/{adapters/gemini.ts → gemini/adapter.ts} +0 -0
- /package/src/agents/{adapters/opencode.ts → opencode/adapter.ts} +0 -0
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
import path from "node:path";
|
|
28
28
|
import { getLogger } from "../../logger";
|
|
29
29
|
import { countStories } from "../../prd";
|
|
30
|
+
import { logTestOutput } from "../../utils/log-test-output";
|
|
30
31
|
import type { PipelineContext, PipelineStage, StageResult } from "../types";
|
|
31
32
|
|
|
32
33
|
/**
|
|
@@ -163,10 +164,8 @@ export const acceptanceStage: PipelineStage = {
|
|
|
163
164
|
|
|
164
165
|
// Non-zero exit but no AC failures parsed at all — test crashed (syntax error, import failure, etc.)
|
|
165
166
|
if (failedACs.length === 0 && exitCode !== 0) {
|
|
166
|
-
logger.error("acceptance", "Tests errored with no AC failures parsed", {
|
|
167
|
-
|
|
168
|
-
output,
|
|
169
|
-
});
|
|
167
|
+
logger.error("acceptance", "Tests errored with no AC failures parsed", { exitCode });
|
|
168
|
+
logTestOutput(logger, "acceptance", output);
|
|
170
169
|
|
|
171
170
|
ctx.acceptanceFailures = {
|
|
172
171
|
failedACs: ["AC-ERROR"],
|
|
@@ -190,10 +189,8 @@ export const acceptanceStage: PipelineStage = {
|
|
|
190
189
|
});
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
logger.error("acceptance", "Acceptance tests failed", {
|
|
194
|
-
|
|
195
|
-
output,
|
|
196
|
-
});
|
|
192
|
+
logger.error("acceptance", "Acceptance tests failed", { failedACs: actualFailures });
|
|
193
|
+
logTestOutput(logger, "acceptance", output);
|
|
197
194
|
|
|
198
195
|
// Store failed ACs and test output in context for fix generation
|
|
199
196
|
ctx.acceptanceFailures = {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { getLogger } from "../../logger";
|
|
17
|
+
import { logTestOutput } from "../../utils/log-test-output";
|
|
17
18
|
import { verificationOrchestrator } from "../../verification/orchestrator";
|
|
18
19
|
import type { VerifyContext } from "../../verification/orchestrator-types";
|
|
19
20
|
import { pipelineEventBus } from "../event-bus";
|
|
@@ -71,6 +72,7 @@ export const regressionStage: PipelineStage = {
|
|
|
71
72
|
storyId: ctx.story.id,
|
|
72
73
|
failCount: result.failCount,
|
|
73
74
|
});
|
|
75
|
+
logTestOutput(logger, "regression", result.rawOutput, { storyId: ctx.story.id });
|
|
74
76
|
|
|
75
77
|
pipelineEventBus.emit({
|
|
76
78
|
type: "regression:detected",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import type { SmartTestRunnerConfig } from "../../config/types";
|
|
13
13
|
import { getLogger } from "../../logger";
|
|
14
|
+
import { logTestOutput } from "../../utils/log-test-output";
|
|
14
15
|
import { detectRuntimeCrash } from "../../verification/crash-detector";
|
|
15
16
|
import type { VerifyStatus } from "../../verification/orchestrator-types";
|
|
16
17
|
import { regression } from "../../verification/runners";
|
|
@@ -173,16 +174,10 @@ export const verifyStage: PipelineStage = {
|
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
// Log
|
|
177
|
-
// BUG-037:
|
|
178
|
-
if (result.
|
|
179
|
-
|
|
180
|
-
if (outputLines.length > 0) {
|
|
181
|
-
logger.debug("verify", "Test output preview", {
|
|
182
|
-
storyId: ctx.story.id,
|
|
183
|
-
output: outputLines.join("\n"),
|
|
184
|
-
});
|
|
185
|
-
}
|
|
177
|
+
// Log tail of output at debug level for context (ENH-001)
|
|
178
|
+
// BUG-037: Use .slice(-20) to show failures, not prechecks
|
|
179
|
+
if (result.status !== "TIMEOUT") {
|
|
180
|
+
logTestOutput(logger, "verify", result.output, { storyId: ctx.story.id });
|
|
186
181
|
}
|
|
187
182
|
|
|
188
183
|
return {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Logger } from "../logger";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Log test output consistently across all pipeline stages.
|
|
5
|
+
*
|
|
6
|
+
* Summary (exitCode, storyId) is logged at the caller's level (error/warn).
|
|
7
|
+
* Raw output is logged at debug level only — last `tailLines` lines.
|
|
8
|
+
*
|
|
9
|
+
* `storyId` is optional: works for per-story verify/acceptance AND for
|
|
10
|
+
* deferred runs (deferred acceptance, deferred regression) with no story context.
|
|
11
|
+
*/
|
|
12
|
+
export function logTestOutput(
|
|
13
|
+
logger: Logger | null | undefined,
|
|
14
|
+
stage: string,
|
|
15
|
+
output: string | undefined,
|
|
16
|
+
opts: { storyId?: string; tailLines?: number } = {},
|
|
17
|
+
): void {
|
|
18
|
+
if (!logger || !output) return;
|
|
19
|
+
const tailLines = opts.tailLines ?? 20;
|
|
20
|
+
const lines = output.split("\n").slice(-tailLines).join("\n");
|
|
21
|
+
logger.debug(stage, "Test output (tail)", {
|
|
22
|
+
...(opts.storyId !== undefined && { storyId: opts.storyId }),
|
|
23
|
+
output: lines,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|