@nathapp/nax 0.24.0 → 0.25.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/docs/ROADMAP.md +33 -15
- package/docs/specs/trigger-completion.md +145 -0
- package/nax/features/trigger-completion/prd.json +150 -0
- package/nax/features/trigger-completion/progress.txt +7 -0
- package/nax/status.json +14 -24
- package/package.json +1 -1
- package/src/config/types.ts +3 -1
- package/src/execution/crash-recovery.ts +11 -0
- package/src/execution/executor-types.ts +1 -1
- package/src/execution/lifecycle/run-setup.ts +4 -0
- package/src/execution/sequential-executor.ts +45 -7
- package/src/interaction/plugins/auto.ts +10 -1
- package/src/pipeline/event-bus.ts +14 -1
- package/src/pipeline/stages/completion.ts +20 -0
- package/src/pipeline/stages/execution.ts +62 -0
- package/src/pipeline/stages/review.ts +25 -1
- package/src/pipeline/subscribers/hooks.ts +32 -0
- package/src/pipeline/subscribers/interaction.ts +36 -1
- package/src/routing/router.ts +3 -2
- package/src/routing/strategies/keyword.ts +2 -1
- package/src/routing/strategies/llm-prompts.ts +29 -28
- package/src/utils/git.ts +21 -0
- package/test/integration/routing/plugin-routing-core.test.ts +1 -1
- package/test/unit/execution/sequential-executor.test.ts +235 -0
- package/test/unit/interaction/auto-plugin.test.ts +162 -0
- package/test/unit/interaction-plugins.test.ts +308 -1
- package/test/unit/pipeline/stages/completion-review-gate.test.ts +218 -0
- package/test/unit/pipeline/stages/execution-ambiguity.test.ts +311 -0
- package/test/unit/pipeline/stages/execution-merge-conflict.test.ts +218 -0
- package/test/unit/pipeline/stages/review.test.ts +201 -0
- package/test/unit/pipeline/subscribers/hooks.test.ts +43 -4
- package/test/unit/pipeline/subscribers/interaction.test.ts +284 -2
- package/test/unit/prd-auto-default.test.ts +2 -2
- package/test/unit/routing/routing-stability.test.ts +1 -1
- package/test/unit/routing-core.test.ts +5 -5
- package/test/unit/routing-strategies.test.ts +1 -3
- package/test/unit/utils/git.test.ts +50 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for git utility functions (TC-003)
|
|
3
|
+
*
|
|
4
|
+
* Covers: detectMergeConflict helper
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, expect, test } from "bun:test";
|
|
8
|
+
import { detectMergeConflict } from "../../../src/utils/git";
|
|
9
|
+
|
|
10
|
+
describe("detectMergeConflict", () => {
|
|
11
|
+
test("returns true when output contains uppercase CONFLICT", () => {
|
|
12
|
+
expect(detectMergeConflict("CONFLICT (content): Merge conflict in src/foo.ts")).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("returns true when output contains lowercase conflict", () => {
|
|
16
|
+
expect(detectMergeConflict("Auto-merging failed due to conflict in file")).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("returns true for typical git merge CONFLICT output", () => {
|
|
20
|
+
const output = [
|
|
21
|
+
"Auto-merging src/index.ts",
|
|
22
|
+
"CONFLICT (content): Merge conflict in src/index.ts",
|
|
23
|
+
"Automatic merge failed; fix conflicts and then commit the result.",
|
|
24
|
+
].join("\n");
|
|
25
|
+
expect(detectMergeConflict(output)).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("returns true for git rebase CONFLICT output", () => {
|
|
29
|
+
const output = "CONFLICT (modify/delete): src/bar.ts deleted in HEAD";
|
|
30
|
+
expect(detectMergeConflict(output)).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("returns false when output has no conflict markers", () => {
|
|
34
|
+
expect(detectMergeConflict("All changes committed successfully.")).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("returns false for empty string", () => {
|
|
38
|
+
expect(detectMergeConflict("")).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("returns false for unrelated git output", () => {
|
|
42
|
+
const output = "3 files changed, 10 insertions(+), 2 deletions(-)";
|
|
43
|
+
expect(detectMergeConflict(output)).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("returns true when CONFLICT appears in stderr portion of combined output", () => {
|
|
47
|
+
const combined = "stdout: commit abc123\nstderr: CONFLICT detected in merge";
|
|
48
|
+
expect(detectMergeConflict(combined)).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
});
|