@nathapp/nax 0.27.1 → 0.29.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.
Files changed (383) hide show
  1. package/CHANGELOG.md +13 -2
  2. package/dist/nax.js +72691 -0
  3. package/package.json +12 -4
  4. package/src/cli/config.ts +42 -1
  5. package/src/cli/prompts.ts +18 -6
  6. package/src/config/defaults.ts +2 -0
  7. package/src/config/schemas.ts +11 -0
  8. package/src/config/types.ts +8 -0
  9. package/src/context/builder.ts +10 -1
  10. package/src/pipeline/stages/execution.ts +5 -0
  11. package/src/pipeline/stages/prompt.ts +13 -4
  12. package/src/precheck/checks-warnings.ts +37 -0
  13. package/src/precheck/checks.ts +1 -0
  14. package/src/precheck/index.ts +14 -7
  15. package/src/prompts/builder.ts +178 -0
  16. package/src/prompts/index.ts +2 -0
  17. package/src/prompts/loader.ts +43 -0
  18. package/src/prompts/sections/conventions.ts +15 -0
  19. package/src/prompts/sections/index.ts +11 -0
  20. package/src/prompts/sections/isolation.ts +24 -0
  21. package/src/prompts/sections/role-task.ts +34 -0
  22. package/src/prompts/sections/story.ts +13 -0
  23. package/src/prompts/sections/verdict.ts +70 -0
  24. package/src/prompts/templates/implementer.ts +6 -0
  25. package/src/prompts/templates/single-session.ts +6 -0
  26. package/src/prompts/templates/test-writer.ts +6 -0
  27. package/src/prompts/templates/verifier.ts +6 -0
  28. package/src/prompts/types.ts +21 -0
  29. package/src/review/runner.ts +6 -1
  30. package/src/tdd/session-runner.ts +12 -12
  31. package/src/version.ts +2 -1
  32. package/.claude/rules/01-project-conventions.md +0 -34
  33. package/.claude/rules/02-test-architecture.md +0 -39
  34. package/.claude/rules/03-test-writing.md +0 -58
  35. package/.claude/rules/04-forbidden-patterns.md +0 -29
  36. package/.claude/settings.json +0 -15
  37. package/.githooks/pre-commit +0 -16
  38. package/.gitlab-ci.yml +0 -103
  39. package/.mcp.json +0 -8
  40. package/BRIEF.md +0 -140
  41. package/CLAUDE.md +0 -143
  42. package/US-007-IMPLEMENTATION.md +0 -139
  43. package/biome.json +0 -14
  44. package/bun.lock +0 -163
  45. package/bunfig.toml +0 -12
  46. package/docker-compose.test.yml +0 -15
  47. package/docs/20260216-fix-plan-context-review.md +0 -56
  48. package/docs/20260216-relentless-vs-ngent-comparison.md +0 -208
  49. package/docs/20260216-v02-plan.md +0 -136
  50. package/docs/20260216-v02-review.md +0 -685
  51. package/docs/20260217-dogfood-findings.md +0 -56
  52. package/docs/20260217-p2-plus-plan.md +0 -117
  53. package/docs/20260217-partial-fixes-plan.md +0 -62
  54. package/docs/20260217-plan-analyze-spec.md +0 -117
  55. package/docs/20260217-post-impl-review.md +0 -1137
  56. package/docs/20260217-quick-wins-plan.md +0 -66
  57. package/docs/20260217-split-runner-plan.md +0 -75
  58. package/docs/20260217-v03-impl-plan.md +0 -80
  59. package/docs/20260217-v03-post-impl-review.md +0 -589
  60. package/docs/20260217-v04-impl-plan.md +0 -86
  61. package/docs/20260217-v05-post-impl-review.md +0 -850
  62. package/docs/20260217-v06-post-impl-review.md +0 -817
  63. package/docs/20260218-adr003-port-plan.md +0 -151
  64. package/docs/20260218-review-adr003-verification.md +0 -175
  65. package/docs/20260219-fix-plan-bug16-19.md +0 -79
  66. package/docs/20260219-fix-plan-bug20-22.md +0 -114
  67. package/docs/20260219-plan-llm-routing.md +0 -116
  68. package/docs/20260219-review-bug20-22-fixes.md +0 -135
  69. package/docs/20260219-routing-baseline-keyword.md +0 -63
  70. package/docs/20260220-plan-structured-logging-p1.md +0 -80
  71. package/docs/20260220-plan-structured-logging-p2.md +0 -37
  72. package/docs/20260220-review-llm-routing.md +0 -180
  73. package/docs/20260220-review-post-fix-llm-routing.md +0 -70
  74. package/docs/20260221-fix-plan-relevantfiles-split.md +0 -101
  75. package/docs/20260221-fix-plan-routing-mode.md +0 -125
  76. package/docs/20260221-review-v0.9-implementation.md +0 -379
  77. package/docs/20260222-fix-plan-v091-routing-isolation.md +0 -197
  78. package/docs/20260223-fix-plan-prompt-audit.md +0 -62
  79. package/docs/20260224-nax-roadmap-phases.md +0 -189
  80. package/docs/20260225-phase2-llm-service-layer.md +0 -401
  81. package/docs/20260225-review-v0.10.1.md +0 -187
  82. package/docs/20260303-v010-implementation-plan.md +0 -165
  83. package/docs/20260304-review-nax.md +0 -492
  84. package/docs/CLAUDE.md.bak +0 -191
  85. package/docs/ROADMAP.md +0 -364
  86. package/docs/SPEC-rectification.md +0 -0
  87. package/docs/SPEC.md +0 -324
  88. package/docs/US-001-plugin-loading-verification.md +0 -152
  89. package/docs/adr/ADR-005-implementation-plan.md +0 -655
  90. package/docs/adr/ADR-005-pipeline-re-architecture.md +0 -464
  91. package/docs/architecture-analysis.md +0 -1076
  92. package/docs/bugs/BUG-21-escalation-null-attempts.md +0 -48
  93. package/docs/bugs-from-dogfood-run-c.md +0 -243
  94. package/docs/code-review-20260228.md +0 -612
  95. package/docs/code-review-v0.15.0.md +0 -629
  96. package/docs/hook-lifecycle-test-plan.md +0 -149
  97. package/docs/releases/v0.11.0-and-earlier.md +0 -20
  98. package/docs/releases/v0.12.0.md +0 -15
  99. package/docs/releases/v0.13.0.md +0 -14
  100. package/docs/releases/v0.14.0.md +0 -20
  101. package/docs/releases/v0.14.1.md +0 -36
  102. package/docs/releases/v0.14.2.md +0 -51
  103. package/docs/releases/v0.14.3.md +0 -174
  104. package/docs/releases/v0.14.4.md +0 -94
  105. package/docs/releases/v0.15.0.md +0 -502
  106. package/docs/releases/v0.15.1.md +0 -170
  107. package/docs/releases/v0.15.3.md +0 -193
  108. package/docs/specs/bug-039-orphan-processes.md +0 -131
  109. package/docs/specs/bug-040-review-rectification.md +0 -82
  110. package/docs/specs/bug-041-cross-story-test-isolation.md +0 -88
  111. package/docs/specs/bug-042-verifier-failure-capture.md +0 -117
  112. package/docs/specs/bun-pty-migration.md +0 -171
  113. package/docs/specs/central-run-registry.md +0 -116
  114. package/docs/specs/feat-010-smart-runner-git-history.md +0 -96
  115. package/docs/specs/feat-011-file-context-strategy.md +0 -73
  116. package/docs/specs/feat-012-tdd-writer-tier.md +0 -79
  117. package/docs/specs/feat-013-test-after-review.md +0 -89
  118. package/docs/specs/feat-014-heartbeat-observability.md +0 -127
  119. package/docs/specs/status-file-consolidation.md +0 -93
  120. package/docs/specs/status-file-v0.10.1.md +0 -812
  121. package/docs/specs/trigger-completion.md +0 -145
  122. package/docs/specs/verification-architecture-v2.md +0 -343
  123. package/docs/tdd/strategies.md +0 -97
  124. package/docs/v0.10-global-config.md +0 -206
  125. package/docs/v0.10-plugin-system.md +0 -415
  126. package/docs/v0.10-prompt-optimizer.md +0 -234
  127. package/docs/v0.3-spec.md +0 -244
  128. package/docs/v0.4-spec.md +0 -140
  129. package/docs/v0.5-spec.md +0 -237
  130. package/docs/v0.6-spec.md +0 -371
  131. package/docs/v0.7-spec.md +0 -177
  132. package/docs/v0.8-llm-routing.md +0 -206
  133. package/docs/v0.8-structured-logging.md +0 -132
  134. package/docs/v0.9.3-prompt-audit.md +0 -112
  135. package/examples/plugins/console-reporter/index.test.ts +0 -207
  136. package/examples/plugins/console-reporter/index.ts +0 -110
  137. package/memory/topic/feat-010-baseref.md +0 -28
  138. package/memory/topic/feat-013-test-after-deprecation.md +0 -22
  139. package/nax/config.json +0 -154
  140. package/nax/features/bug-039-medium/prd.json +0 -45
  141. package/nax/features/bugfix-v0171/prd.json +0 -52
  142. package/nax/features/central-run-registry/prd.json +0 -105
  143. package/nax/features/config-management/prd.json +0 -108
  144. package/nax/features/config-management/progress.txt +0 -5
  145. package/nax/features/diagnose/acceptance.test.ts +0 -414
  146. package/nax/features/diagnose/prd.json +0 -41
  147. package/nax/features/nax-compliance/prd.json +0 -52
  148. package/nax/features/nax-compliance/progress.txt +0 -1
  149. package/nax/features/orchestration-fixes/prd.json +0 -89
  150. package/nax/features/orchestration-fixes/progress.txt +0 -1
  151. package/nax/features/plugin-integration/US-007-VERIFICATION.md +0 -259
  152. package/nax/features/plugin-integration/prd.json +0 -208
  153. package/nax/features/plugin-integration/progress.txt +0 -5
  154. package/nax/features/post-rearch-bugfix/prd.json +0 -137
  155. package/nax/features/precheck/prd.json +0 -205
  156. package/nax/features/precheck/progress.txt +0 -15
  157. package/nax/features/review-quality/prd.json +0 -55
  158. package/nax/features/routing-persistence/prd.json +0 -104
  159. package/nax/features/routing-persistence/progress.txt +0 -1
  160. package/nax/features/smart-test-runner/plan.md +0 -7
  161. package/nax/features/smart-test-runner/prd.json +0 -203
  162. package/nax/features/smart-test-runner/progress.txt +0 -13
  163. package/nax/features/smart-test-runner/spec.md +0 -7
  164. package/nax/features/smart-test-runner/tasks.md +0 -8
  165. package/nax/features/status-file-consolidation/prd.json +0 -106
  166. package/nax/features/structured-logging/prd.json +0 -199
  167. package/nax/features/trigger-completion/prd.json +0 -150
  168. package/nax/features/trigger-completion/progress.txt +0 -7
  169. package/nax/features/unlock/prd.json +0 -36
  170. package/nax/features/v0.18.3-execution-reliability/prd.json +0 -80
  171. package/nax/features/v0.18.3-execution-reliability/progress.txt +0 -3
  172. package/nax/features/v0.19.0-hardening/plan.md +0 -7
  173. package/nax/features/v0.19.0-hardening/prd.json +0 -84
  174. package/nax/features/v0.19.0-hardening/progress.txt +0 -7
  175. package/nax/features/v0.19.0-hardening/spec.md +0 -18
  176. package/nax/features/v0.19.0-hardening/tasks.md +0 -8
  177. package/nax/features/verify-v2/prd.json +0 -79
  178. package/nax/features/verify-v2/progress.txt +0 -3
  179. package/nax/status.json +0 -36
  180. package/test/COVERAGE-GAPS.md +0 -333
  181. package/test/e2e/cm-003-default-view.test.ts +0 -195
  182. package/test/e2e/plan-analyze-run.test.ts +0 -902
  183. package/test/helpers/helpers.test.ts +0 -295
  184. package/test/helpers/timeout.ts +0 -42
  185. package/test/integration/US-002-TEST-SUMMARY.md +0 -107
  186. package/test/integration/US-003-TEST-SUMMARY.md +0 -149
  187. package/test/integration/US-004-TEST-SUMMARY.md +0 -106
  188. package/test/integration/US-005-TEST-SUMMARY.md +0 -138
  189. package/test/integration/US-007-TEST-SUMMARY.md +0 -100
  190. package/test/integration/cli/agent-validation.test.ts +0 -439
  191. package/test/integration/cli/cli-config-default-edge-cases.test.ts +0 -223
  192. package/test/integration/cli/cli-config-default-view.test.ts +0 -230
  193. package/test/integration/cli/cli-config-diff.test.ts +0 -461
  194. package/test/integration/cli/cli-config.test.ts +0 -737
  195. package/test/integration/cli/cli-diagnose.test.ts +0 -595
  196. package/test/integration/cli/cli-logs.test.ts +0 -346
  197. package/test/integration/cli/cli-plugins.test.ts +0 -679
  198. package/test/integration/cli/cli-precheck.test.ts +0 -372
  199. package/test/integration/cli/cli-run-headless.test.ts +0 -174
  200. package/test/integration/cli/cli.test.ts +0 -76
  201. package/test/integration/cli/precheck-integration.test.ts +0 -476
  202. package/test/integration/cli/precheck-orchestrator.test.ts +0 -247
  203. package/test/integration/cli/precheck.test.ts +0 -806
  204. package/test/integration/config/config-loader.test.ts +0 -266
  205. package/test/integration/config/config.test.ts +0 -444
  206. package/test/integration/config/merger.test.ts +0 -466
  207. package/test/integration/config/paths.test.ts +0 -52
  208. package/test/integration/config/security-loader.test.ts +0 -83
  209. package/test/integration/context/context-integration.test.ts +0 -703
  210. package/test/integration/context/context-path-security.test.ts +0 -173
  211. package/test/integration/context/context-provider-injection.test.ts +0 -507
  212. package/test/integration/context/context-verification-integration.test.ts +0 -296
  213. package/test/integration/context/s5-greenfield-fallback.test.ts +0 -298
  214. package/test/integration/execution/execution-isolation.test.ts +0 -143
  215. package/test/integration/execution/execution.test.ts +0 -634
  216. package/test/integration/execution/feature-status-write.test.ts +0 -302
  217. package/test/integration/execution/parallel.test.ts +0 -251
  218. package/test/integration/execution/prd-pause.test.ts +0 -205
  219. package/test/integration/execution/prd-resolvers.test.ts +0 -186
  220. package/test/integration/execution/progress.test.ts +0 -34
  221. package/test/integration/execution/runner-batching.test.ts +0 -682
  222. package/test/integration/execution/runner-config-plugins.test.ts +0 -462
  223. package/test/integration/execution/runner-escalation.test.ts +0 -561
  224. package/test/integration/execution/runner-fixes.test.ts +0 -400
  225. package/test/integration/execution/runner-plugin-integration.test.ts +0 -544
  226. package/test/integration/execution/runner-queue-and-attempts.test.ts +0 -476
  227. package/test/integration/execution/status-file-integration.test.ts +0 -289
  228. package/test/integration/execution/status-file.test.ts +0 -380
  229. package/test/integration/execution/status-writer.test.ts +0 -447
  230. package/test/integration/execution/story-id-in-events.test.ts +0 -274
  231. package/test/integration/interaction/interaction-chain-pipeline.test.ts +0 -476
  232. package/test/integration/pipeline/hooks.test.ts +0 -363
  233. package/test/integration/pipeline/pipeline-acceptance.test.ts +0 -303
  234. package/test/integration/pipeline/pipeline-events.test.ts +0 -476
  235. package/test/integration/pipeline/pipeline.test.ts +0 -660
  236. package/test/integration/pipeline/reporter-lifecycle.test.ts +0 -862
  237. package/test/integration/pipeline/verify-stage.test.ts +0 -286
  238. package/test/integration/plan/analyze-integration.test.ts +0 -262
  239. package/test/integration/plan/analyze-scanner.test.ts +0 -132
  240. package/test/integration/plan/logger.test.ts +0 -461
  241. package/test/integration/plan/plan.test.ts +0 -157
  242. package/test/integration/plugins/config-integration.test.ts +0 -173
  243. package/test/integration/plugins/config-resolution.test.ts +0 -523
  244. package/test/integration/plugins/loader.test.ts +0 -644
  245. package/test/integration/plugins/plugins-registry.test.ts +0 -747
  246. package/test/integration/plugins/validator.test.ts +0 -564
  247. package/test/integration/review/review-config-commands.test.ts +0 -320
  248. package/test/integration/review/review-config-schema.test.ts +0 -117
  249. package/test/integration/review/review-plugin-integration.test.ts +0 -729
  250. package/test/integration/review/review.test.ts +0 -150
  251. package/test/integration/routing/plugin-routing-advanced.test.ts +0 -461
  252. package/test/integration/routing/plugin-routing-core.test.ts +0 -527
  253. package/test/integration/routing/routing-stage-bug-021.test.ts +0 -275
  254. package/test/integration/routing/routing-stage-greenfield.test.ts +0 -287
  255. package/test/integration/tdd/tdd-cleanup.test.ts +0 -246
  256. package/test/integration/tdd/tdd-orchestrator-core.test.ts +0 -565
  257. package/test/integration/tdd/tdd-orchestrator-failureCategory.test.ts +0 -355
  258. package/test/integration/tdd/tdd-orchestrator-fallback.test.ts +0 -311
  259. package/test/integration/tdd/tdd-orchestrator-lite.test.ts +0 -289
  260. package/test/integration/tdd/tdd-orchestrator-prompts.test.ts +0 -260
  261. package/test/integration/tdd/tdd-orchestrator-verdict.test.ts +0 -536
  262. package/test/integration/tmp/headless-test/test.jsonl +0 -30
  263. package/test/integration/verification/test-scanner.test.ts +0 -403
  264. package/test/integration/verification/verification-asset-check.test.ts +0 -143
  265. package/test/integration/worktree/manager.test.ts +0 -218
  266. package/test/integration/worktree/worktree-merge.test.ts +0 -341
  267. package/test/manual/logging-formatter-demo.ts +0 -158
  268. package/test/ui/tui-agent-panel.test.tsx +0 -99
  269. package/test/ui/tui-pty-integration.test.tsx +0 -146
  270. package/test/unit/acceptance.test.ts +0 -187
  271. package/test/unit/agent-stderr-capture.test.ts +0 -147
  272. package/test/unit/agents/claude.test.ts +0 -107
  273. package/test/unit/analyze-classifier.test.ts +0 -216
  274. package/test/unit/analyze.test.ts +0 -224
  275. package/test/unit/auto-detect.test.ts +0 -250
  276. package/test/unit/cli-status-project-level.test.ts +0 -283
  277. package/test/unit/cli-status.test.ts +0 -418
  278. package/test/unit/commands/common.test.ts +0 -321
  279. package/test/unit/commands/logs.test.ts +0 -458
  280. package/test/unit/commands/runs.test.ts +0 -303
  281. package/test/unit/commands/unlock.test.ts +0 -320
  282. package/test/unit/config/defaults.test.ts +0 -70
  283. package/test/unit/config/quality-commands-schema.test.ts +0 -72
  284. package/test/unit/config/regression-gate-schema.test.ts +0 -160
  285. package/test/unit/config/smart-runner-flag.test.ts +0 -250
  286. package/test/unit/constitution-generators.test.ts +0 -161
  287. package/test/unit/constitution.test.ts +0 -210
  288. package/test/unit/context/context-autodetect.test.ts +0 -297
  289. package/test/unit/context/context-build.test.ts +0 -575
  290. package/test/unit/context/context-coverage.test.ts +0 -236
  291. package/test/unit/context/context-error.test.ts +0 -93
  292. package/test/unit/context/context-estimate-tokens.test.ts +0 -201
  293. package/test/unit/context/context-format.test.ts +0 -302
  294. package/test/unit/context/context-isolation.test.ts +0 -267
  295. package/test/unit/context/context-sort.test.ts +0 -93
  296. package/test/unit/context/context-story.test.ts +0 -108
  297. package/test/unit/context/prior-failures.test.ts +0 -463
  298. package/test/unit/context.test.ts +0 -1726
  299. package/test/unit/cost.test.ts +0 -231
  300. package/test/unit/crash-recovery.test.ts +0 -309
  301. package/test/unit/escalation.test.ts +0 -127
  302. package/test/unit/execution/lifecycle/run-completion.test.ts +0 -240
  303. package/test/unit/execution/lifecycle/run-regression.test.ts +0 -420
  304. package/test/unit/execution/pid-registry.test.ts +0 -241
  305. package/test/unit/execution/sequential-executor.test.ts +0 -235
  306. package/test/unit/execution/sfc-004-dead-code-cleanup.test.ts +0 -89
  307. package/test/unit/execution/structured-failure.test.ts +0 -415
  308. package/test/unit/execution-logging-stderr.test.ts +0 -157
  309. package/test/unit/execution-stage.test.ts +0 -123
  310. package/test/unit/fix-generator.test.ts +0 -276
  311. package/test/unit/formatters.test.ts +0 -468
  312. package/test/unit/greenfield.test.ts +0 -180
  313. package/test/unit/hooks/shell-security.test.ts +0 -40
  314. package/test/unit/interaction/auto-plugin.test.ts +0 -162
  315. package/test/unit/interaction/human-review-trigger.test.ts +0 -165
  316. package/test/unit/interaction-network-failures.test.ts +0 -390
  317. package/test/unit/interaction-plugins.test.ts +0 -472
  318. package/test/unit/logging/formatter.test.ts +0 -456
  319. package/test/unit/merge.test.ts +0 -269
  320. package/test/unit/metrics/aggregator.test.ts +0 -164
  321. package/test/unit/metrics/tracker.test.ts +0 -186
  322. package/test/unit/metrics.test.ts +0 -276
  323. package/test/unit/optimizer/noop.optimizer.test.ts +0 -125
  324. package/test/unit/optimizer/rule-based.optimizer.test.ts +0 -358
  325. package/test/unit/pipeline/event-bus.test.ts +0 -105
  326. package/test/unit/pipeline/routing-partial-override.test.ts +0 -121
  327. package/test/unit/pipeline/runner-retry.test.ts +0 -89
  328. package/test/unit/pipeline/stages/autofix.test.ts +0 -97
  329. package/test/unit/pipeline/stages/completion-review-gate.test.ts +0 -218
  330. package/test/unit/pipeline/stages/execution-ambiguity.test.ts +0 -311
  331. package/test/unit/pipeline/stages/execution-merge-conflict.test.ts +0 -218
  332. package/test/unit/pipeline/stages/rectify.test.ts +0 -101
  333. package/test/unit/pipeline/stages/regression-stage.test.ts +0 -69
  334. package/test/unit/pipeline/stages/review.test.ts +0 -201
  335. package/test/unit/pipeline/stages/routing-idempotence.test.ts +0 -139
  336. package/test/unit/pipeline/stages/routing-initial-complexity.test.ts +0 -321
  337. package/test/unit/pipeline/stages/routing-persistence.test.ts +0 -380
  338. package/test/unit/pipeline/stages/verify.test.ts +0 -267
  339. package/test/unit/pipeline/subscribers/events-writer.test.ts +0 -227
  340. package/test/unit/pipeline/subscribers/hooks.test.ts +0 -84
  341. package/test/unit/pipeline/subscribers/interaction.test.ts +0 -313
  342. package/test/unit/pipeline/subscribers/registry.test.ts +0 -149
  343. package/test/unit/pipeline/subscribers/reporters.test.ts +0 -90
  344. package/test/unit/pipeline/verify-smart-runner.test.ts +0 -345
  345. package/test/unit/prd-auto-default.test.ts +0 -291
  346. package/test/unit/prd-failure-category.test.ts +0 -177
  347. package/test/unit/prd-get-next-story.test.ts +0 -215
  348. package/test/unit/precheck-checks.test.ts +0 -841
  349. package/test/unit/precheck-story-size-gate.test.ts +0 -288
  350. package/test/unit/precheck-types.test.ts +0 -143
  351. package/test/unit/prompts.test.ts +0 -476
  352. package/test/unit/queue.test.ts +0 -237
  353. package/test/unit/rectification.test.ts +0 -285
  354. package/test/unit/registry.test.ts +0 -288
  355. package/test/unit/review/runner.test.ts +0 -117
  356. package/test/unit/routing/content-hash.test.ts +0 -99
  357. package/test/unit/routing/routing-stability.test.ts +0 -208
  358. package/test/unit/routing/strategies/llm.test.ts +0 -306
  359. package/test/unit/routing-advanced.test.ts +0 -313
  360. package/test/unit/routing-core.test.ts +0 -341
  361. package/test/unit/routing-strategies.test.ts +0 -440
  362. package/test/unit/storyid-events.test.ts +0 -213
  363. package/test/unit/tdd-verdict.test.ts +0 -492
  364. package/test/unit/test-output-parser.test.ts +0 -377
  365. package/test/unit/ui/tui-controls.test.ts +0 -335
  366. package/test/unit/ui/tui-cost-and-pty.test.ts +0 -190
  367. package/test/unit/ui/tui-layout.test.ts +0 -379
  368. package/test/unit/ui/tui-stories.test.ts +0 -333
  369. package/test/unit/unit-isolation.test.ts +0 -135
  370. package/test/unit/utils/git.test.ts +0 -50
  371. package/test/unit/utils/path-security.test.ts +0 -47
  372. package/test/unit/utils-helpers.test.ts +0 -318
  373. package/test/unit/verdict.test.ts +0 -325
  374. package/test/unit/verification/orchestrator-types.test.ts +0 -54
  375. package/test/unit/verification/orchestrator.test.ts +0 -66
  376. package/test/unit/verification/smart-runner-config.test.ts +0 -163
  377. package/test/unit/verification/smart-runner-discovery.test.ts +0 -354
  378. package/test/unit/verification/smart-runner.test.ts +0 -262
  379. package/test/unit/verification/strategies/acceptance.test.ts +0 -33
  380. package/test/unit/verification/strategies/regression.test.ts +0 -87
  381. package/test/unit/verification/strategies/scoped.test.ts +0 -100
  382. package/test/unit/worktree-manager.test.ts +0 -159
  383. package/tsconfig.json +0 -27
@@ -1,191 +0,0 @@
1
- # @nathapp/nax — AI Coding Agent Orchestrator
2
-
3
- Standalone CLI (Bun + TypeScript) that orchestrates AI coding agents with smart model routing, three-session TDD, and lifecycle hooks. NOT an OpenClaw skill — independent npm package.
4
-
5
- **CLI command:** `nax`
6
-
7
- ## Commands
8
-
9
- ```bash
10
- bun test # Run all tests (bun:test)
11
- bun run typecheck # TypeScript type checking (tsc --noEmit)
12
- bun run lint # Biome linter (src/ bin/)
13
- bun run dev # Run CLI locally
14
- bun run build # Bundle for distribution
15
- ```
16
-
17
- ## Architecture
18
-
19
- ```
20
- bin/nax.ts # CLI entry point (commander)
21
- src/
22
- agents/ # AgentAdapter interface + implementations (claude.ts)
23
- cli/ # CLI commands (init, run, features, agents, status)
24
- config/ # NaxConfig schema + layered loader + validation (global → project)
25
- execution/ # Main orchestration loop (the core)
26
- hooks/ # Lifecycle hooks (hooks.json → shell commands + NAX_* env)
27
- pipeline/ # Pipeline orchestration utilities
28
- prd/ # PRD/user-story loader, ordering, completion tracking
29
- queue/ # Queue manager for multi-agent parallel execution
30
- routing/ # Complexity classifier + test strategy decision tree
31
- tdd/ # Three-session TDD types + file isolation checker + orchestrator
32
- test/ # Bun test files (*.test.ts)
33
- ```
34
-
35
- ### Key Concepts
36
-
37
- - **Complexity Routing**: Tasks classified as simple/medium/complex/expert → mapped to model tiers (cheap/standard/premium)
38
- - **Three-Session TDD**: Session 1 (test-writer, only test files) → Session 2 (implementer, only source files) → Session 3 (verifier, auto-approves legitimate fixes)
39
- - **Isolation Enforcement**: Git diff verification between TDD sessions — test-writer can't touch source, implementer can't touch tests
40
- - **Hook System**: `hooks.json` maps lifecycle events (on-start, on-complete, on-pause, on-error, on-story-start, on-story-end) to shell commands
41
- - **Layered Config**: `~/.nax/config.json` (global) merged with `<project>/nax/config.json` (project overrides)
42
-
43
- ### Pipeline Architecture (v0.3 target)
44
-
45
- The execution loop should be refactored from a monolithic `run()` into composable pipeline stages. This enables adding/removing/reordering stages without editing a 600+ line function.
46
-
47
- ```typescript
48
- // src/pipeline/types.ts
49
- interface PipelineStage {
50
- name: string; // unique stage identifier
51
- enabled: (ctx: PipelineContext) => boolean; // skip if false
52
- execute: (ctx: PipelineContext) => Promise<StageResult>; // do the work
53
- }
54
-
55
- interface PipelineContext {
56
- config: NaxConfig;
57
- prd: PRD;
58
- story: UserStory; // current story (or batch leader)
59
- stories: UserStory[]; // batch (length 1 for single)
60
- routing: RoutingResult;
61
- workdir: string;
62
- featureDir?: string;
63
- hooks: HooksConfig;
64
- // accumulated through stages
65
- constitution?: string;
66
- contextMarkdown?: string;
67
- prompt?: string;
68
- agentResult?: AgentResult;
69
- reviewResult?: ReviewResult;
70
- }
71
-
72
- type StageResult =
73
- | { action: 'continue' } // proceed to next stage
74
- | { action: 'skip'; reason: string } // skip this story
75
- | { action: 'fail'; reason: string } // mark story failed
76
- | { action: 'escalate' } // retry with higher tier
77
- | { action: 'pause'; reason: string } // pause execution (queue command)
78
- ```
79
-
80
- **Default pipeline stages (in order):**
81
- ```typescript
82
- const defaultPipeline: PipelineStage[] = [
83
- queueCheckStage, // check for PAUSE/ABORT/SKIP commands
84
- routingStage, // classify complexity → model tier
85
- constitutionStage, // load & inject project constitution
86
- contextStage, // build file context from relevant sources
87
- promptStage, // assemble final prompt from story + context + constitution
88
- executionStage, // spawn agent session (single, batch, or TDD)
89
- verifyStage, // check agent output, tests pass
90
- reviewStage, // post-impl quality gate (typecheck/lint/test)
91
- completionStage, // mark story done, fire hooks, log progress
92
- ];
93
- ```
94
-
95
- **Design rules:**
96
- - Each stage is a separate file: `src/pipeline/stages/<name>.ts`
97
- - Stages communicate via `PipelineContext` — no side-channel state
98
- - The pipeline runner (`src/pipeline/runner.ts`) iterates stages, handles StageResult actions
99
- - The outer loop (load PRD → pick story → run pipeline → repeat) stays in `src/execution/runner.ts` but delegates per-story work to the pipeline
100
- - Hooks fire inside stages (e.g., `completionStage` fires `on-story-complete`), not in the outer loop
101
- - Config can override stage order or disable stages: `config.pipeline.stages`
102
-
103
- ## Code Style
104
-
105
- - Bun-native APIs preferred (Bun.file, Bun.write, Bun.spawn, Bun.sleep)
106
- - Each module directory: `types.ts` (interfaces), implementation files, `index.ts` (barrel exports)
107
- - Immutable patterns — avoid mutation
108
- - No classes unless wrapping stateful adapters (like ClaudeCodeAdapter)
109
- - Functional style for pure logic (routing, classification, isolation checks)
110
- - Biome for formatting and linting
111
-
112
- ## Testing
113
-
114
- - Test framework: `bun:test` (describe/test/expect)
115
- - Test files: `test/*.test.ts`
116
- - Test naming: `test/<module>.test.ts`
117
- - All routing/classification logic must have unit tests
118
- - Isolation checker must have unit tests
119
- - Run `bun test` before committing — all tests must pass
120
-
121
- ## File Conventions
122
-
123
- - Max ~400 lines per file, split if larger
124
- - Types/interfaces in dedicated `types.ts` per module
125
- - Barrel exports via `index.ts` — import from module path, not deep paths
126
- - Config defaults co-located with schema (`DEFAULT_CONFIG` in `schema.ts`)
127
-
128
- ## Current Status (v0.2.0-dev)
129
-
130
- **Tests:** 222 passing across 16 files, 504 assertions
131
- **Last Review:** 2026-02-17 — Grade B+ (82/100) — see `docs/20260217-post-impl-review.md`
132
-
133
- ### Implemented (v0.1 → v0.2)
134
- - [x] Agent adapter interface + Claude Code implementation
135
- - [x] Config schema + layered loader + validation
136
- - [x] Hook lifecycle system + **command injection prevention** (SEC-1 ✅)
137
- - [x] Complexity-based routing + test strategy decision tree
138
- - [x] TDD isolation checker + three-session TDD orchestrator
139
- - [x] PRD loader/saver with dependency-aware ordering
140
- - [x] Execution runner with cost tracking
141
- - [x] Queue manager + **PAUSE/ABORT/SKIP commands** (v0.2 Phase 2 ✅)
142
- - [x] CLI: init, run, analyze, features create/list, agents, status
143
- - [x] **Story-scoped context extraction from PRD** (v0.2 Phase 1 ✅)
144
- - [x] **Explicit 3-tier escalation chain** fast→balanced→powerful (v0.2 Phase 3 ✅)
145
- - [x] **Story batching for simple stories** with --no-batch flag (v0.2 Phase 4 ✅)
146
- - [x] **Path validation + bounds checking** (SEC-2 ✅) — `src/config/path-security.ts`
147
- - [x] **Agent installation check + retry with exponential backoff** (BUG-1 partial ✅)
148
- - [x] **Atomic queue file handling** — rename-before-read pattern (BUG-2 ✅)
149
- - [x] **PRD size limits** — `maxStoriesPerFeature` config + validation (MEM-1 partial ✅)
150
- - [x] **Improved cost estimation** — structured output parsing + confidence (BUG-3 partial ✅)
151
- - [x] **Story dependency validation** in analyze command (BUG-6 ✅)
152
- - [x] **Hook timeout messages** — clear timeout vs failure distinction (BUG-5 ✅)
153
-
154
- ### Remaining Issues (from review, by priority)
155
-
156
- #### P1 — Reliability
157
- - [ ] **MEM-1 (partial):** Lazy loading for large PRDs not implemented — only size limit validation exists. No memory pressure detection or streaming JSON parsing.
158
- - [ ] **PERF-1:** O(n²) batch story selection — not yet optimized with pre-computed eligible stories.
159
- - [ ] **BUG-3 (partial):** Cost estimation still falls back to duration-based guessing when structured output unavailable. No per-story confidence scores.
160
-
161
- #### P2 — Quality
162
- - [ ] **ENH-1:** JSDoc coverage ~40% — `src/agents/claude.ts` (1 JSDoc), `bin/nax.ts` (1 JSDoc) are underserved. Most exported functions in runner.ts have docs but `routeTask()`, `buildContext()`, `runThreeSessionTdd()` lack usage examples.
163
- - [ ] **TYPE-1:** Config loader still uses `as unknown as` double-casting (2 instances). No Zod runtime validation.
164
- - [ ] **BUG-4:** Batch failure still escalates only first story. No config option for batch-wide escalation.
165
- - [ ] **ENH-2:** No agent capability negotiation — adapters don't declare supported tiers/features.
166
- - [ ] **PERF-2:** PRD reloaded every iteration — no dirty flag optimization.
167
- - [ ] **ENH-3:** Context builder doesn't load file content — stories only, no source code context.
168
-
169
- #### P3 — Polish
170
- - [ ] **STYLE-1:** `runner.ts` is 901 lines (was 779, grew with fixes). Needs splitting into prompts/batching/queue-handler/escalation modules.
171
- - [ ] **ENH-4:** No progress bar or ETA display — only line-by-line iteration logging.
172
- - [ ] **TYPE-2:** `QueueCommand` still mixed string literals + object — not discriminated union.
173
- - [ ] **ENH-5:** No dry-run mode for three-session TDD.
174
- - [ ] **PERF-3:** Token estimation still uses `Math.ceil(text.length / 3)` — no improved heuristic.
175
-
176
- #### P4 — Consistency
177
- - [ ] **STYLE-2:** Inconsistent error handling patterns (throw vs return null vs log warning).
178
- - [ ] **STYLE-3:** Magic numbers not extracted as named constants.
179
-
180
- ## Git
181
-
182
- - Conventional commits: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`, `chore:`
183
- - Run `bun test && bun run typecheck` before committing
184
- - Keep commits atomic — one logical change per commit
185
-
186
- ## Important
187
-
188
- - This is a Bun project — do NOT use Node.js APIs when Bun equivalents exist
189
- - Agent adapters spawn external processes — always handle timeouts and cleanup
190
- - Never hardcode API keys — agents use their own auth (e.g., Claude Code uses ANTHROPIC_API_KEY from env)
191
- - The execution runner has `[TODO]` markers for unimplemented agent spawning — that's the next priority
package/docs/ROADMAP.md DELETED
@@ -1,364 +0,0 @@
1
- # nax Roadmap
2
-
3
- > **Authoritative source** for planned and shipped versions.
4
- > Specs in `memory/` are detailed references. GitLab issues are supplementary.
5
- > Full release notes → `docs/releases/`
6
-
7
- ---
8
-
9
- ## v0.18.0 — Orchestration Quality ✅
10
-
11
- **Theme:** Fix execution bugs and improve orchestration reliability
12
- **Status:** ✅ Shipped (2026-03-03)
13
-
14
- ### Bugfixes (Priority)
15
- - [x] ~~**BUG-016:** Hardcoded 120s timeout in verify stage → read from config~~
16
- - [x] ~~**BUG-017:** `run.complete` not emitted on SIGTERM → emit in crash handler~~
17
- - [x] ~~**BUG-018:** Test-writer spawns on every retry → skip when tests exist (`story.attempts > 0`)~~
18
- - [x] ~~**BUG-019:** Misleading TIMEOUT output preview → separate TIMEOUT vs TEST_FAILURE messaging~~
19
- - [x] ~~**BUG-020:** Missing storyId in JSONL events → audit all emitters~~
20
- - [x] ~~**BUG-021:** `Task classified` log shows raw LLM result, not final routing after cache/config override → log final routing only~~
21
- - [x] ~~**BUG-022:** Story interleaving wastes iterations — after failure, `getNextStory()` picks next pending story instead of retrying the failed one → prioritize current story retries before moving on~~
22
- - [x] ~~**BUG-023:** Agent failure doesn't log exitCode/stderr → add to `execution.Agent session failed` event~~
23
- - [x] ~~**BUG-025:** `needsHumanReview` doesn't trigger interactive plugin in headless mode → wire to interaction chain or suppress the log~~
24
-
25
- ---
26
-
27
- ## v0.18.1 — Type Safety + CI Pipeline ✅
28
-
29
- **Theme:** Fix all TypeScript/lint errors, establish CI pipeline
30
- **Status:** ✅ Shipped (2026-03-03)
31
-
32
- ### TypeScript Fixes (60 errors across 21 files)
33
- - [x] ~~**TS-001:** Fix context module exports (13 errors)~~
34
- - [x] ~~**TS-002:** Fix config/command type safety (12 errors)~~
35
- - [x] ~~**TS-003:** Fix review/verification types (9 errors)~~
36
- - [x] ~~**TS-004:** Fix escalation PRD type construction (4 errors)~~
37
- - [x] ~~**TS-005:** Fix misc types (6 errors)~~
38
- - [x] ~~**LINT-001:** Run biome check --fix + manual review~~
39
-
40
- ### CI Pipeline (new)
41
- - [x] `.gitlab-ci.yml` — stages: test → release → notify
42
- - [x] Image: `nathapp/node-bun:22.21.0-1.3.9-alpine` (test/release), `gkci/node:22.14.0-alpine-ci` (notify)
43
- - [x] `before_script`: apk add git python3 make g++, safe.directory, git identity
44
- - [x] Test env: `NAX_SKIP_PRECHECK=1 bun test test/ --timeout=60000`
45
- - [x] CI skip guards for env-sensitive tests (claude binary, PID checks, subprocess integration)
46
- - [x] Fixed `checkClaudeCLI()` ENOENT crash — try/catch around Bun.spawn
47
- - [x] Release trigger: `[run-release]` in commit message on master
48
- - [x] Runner requirement: 8GB shared runner (`saas-linux-small-amd64`)
49
- - [x] **Result: 1952 pass, 56 skip, 0 fail**
50
-
51
- ---
52
-
53
- ## v0.18.2 — Smart Test Runner + Routing Fix ✅
54
-
55
- **Theme:** Scope verify to changed files only + fix routing override
56
- **Status:** ✅ Shipped (2026-03-03)
57
-
58
- ### Smart Test Runner
59
- - [x] ~~After agent implementation, run `git diff --name-only` to get changed source files~~
60
- - [x] ~~Map source → test files by naming convention (`src/foo/bar.ts` → `test/unit/foo/bar.test.ts`)~~
61
- - [x] ~~Run only related tests for verify (instead of full suite)~~
62
- - [x] ~~Fallback to full suite when mapping yields no test files~~
63
- - [x] ~~Config flag `execution.smartTestRunner: true` (default: true) to opt out~~
64
- - [x] ~~Result: verify drops from ~125s to ~10-20s for typical single-file fixes~~
65
-
66
- ### Bun PTY Migration (BUN-001)
67
- - [x] ~~Replace `node-pty` with `Bun.spawn` (piped stdio) — shipped in v0.18.5~~
68
-
69
-
70
- ---
71
-
72
- ## v0.18.3 — Execution Reliability ✅
73
-
74
- **Theme:** Fix execution pipeline bugs (escalation, routing, review), structured failure context, and Smart Runner enhancement
75
- **Status:** ✅ Shipped (2026-03-04)
76
- **Spec:** [docs/specs/verification-architecture-v2.md](specs/verification-architecture-v2.md) (Phase 1)
77
-
78
- ### Bugfixes — Completed
79
- - [x] **BUG-026:** Regression gate timeout → accept scoped pass + warn (not escalate). Config: `regressionGate.acceptOnTimeout: true`.
80
- - [x] **BUG-028:** Routing cache ignores escalation tier — `clearCacheForStory(storyId)` in `llm.ts`, called on tier escalation in both `preIterationTierCheck()` and `handleTierEscalation()`.
81
-
82
- ### Structured Failure Context — Completed
83
- - [x] **SFC-001:** `StructuredFailure` type with `TestFailureContext[]` + `priorFailures?: StructuredFailure[]` on `UserStory`. Populated on verify, regression, rectification, and escalation failures.
84
- - [x] **SFC-002:** Format `priorFailures` into agent prompt at priority 95 via `createPriorFailuresContext()` in `context/builder.ts`.
85
-
86
- ### Bugfixes — Completed (Round 2)
87
- - [x] **BUG-029:** Escalation resets story to `pending` → bypasses BUG-022 retry priority. After escalation, `getNextStory()` picks the next pending story instead of retrying the escalated one. **Location:** `src/prd/index.ts:getNextStory()`. **Fix:** Recognize escalated-pending stories in Priority 1 (e.g. check `story.routing.modelTier` changed, or use `"retry-pending"` status).
88
- - [x] **BUG-030:** Review lint/typecheck failure → hard `"fail"`, no rectification or retry. `review.ts:92` returns `{ action: "fail" }` → `markStoryFailed()` permanently. Lint errors are auto-fixable but story is killed with zero retry. **Fix:** Return `"escalate"` for lint/typecheck failures (or add review-rectification loop). Reserve `"fail"` for plugin reviewer rejection only.
89
- - [x] **BUG-032:** Routing stage overrides escalated `modelTier` with complexity-derived tier. `routing.ts:43` always runs `complexityToModelTier()` even when `story.routing.modelTier` was set by escalation → escalated tier silently ignored. BUG-013 fix (`applyCachedRouting`) runs too late. **Fix:** Skip `complexityToModelTier()` when `story.routing.modelTier` is explicitly set.
90
-
91
- ### STR-007: Smart Test Runner Enhancement — Completed
92
- - [x] Configurable `testFilePatterns` in config (default: `test/**/*.test.ts`)
93
- - [x] `testFileFallback` config option: `"import-grep"` | `"full-suite"` (default: `"import-grep"`)
94
- - [x] 3-pass test discovery: path-convention → import-grep (grep test files for changed module name) → full-suite
95
- - [x] Config schema update: `execution.smartTestRunner` becomes object `{ enabled, testFilePatterns, fallback }` (backward compat: boolean coerced)
96
-
97
- ---
98
-
99
- ## v0.18.4 — Routing Stability ✅
100
-
101
- **Theme:** Fix routing classifier consistency and LLM routing reliability
102
- **Status:** ✅ Shipped (2026-03-04)
103
-
104
- ### Bugfixes
105
- - [x] **BUG-031:** Keyword fallback classifier gives inconsistent strategy across retries for same story. `priorErrors` text shifts keyword classification. **Fix:** Keyword classifier should only use original story fields; or lock `story.routing.testStrategy` once set.
106
- - [x] **BUG-033:** LLM routing has no retry on timeout — single 15s attempt, then keyword fallback. **Fix:** Add `routing.llm.retries` config (default: 1) with backoff. Raise default timeout to 30s for batch routing.
107
-
108
- ---
109
-
110
- ## v0.18.5 — Bun PTY Migration ✅
111
-
112
- **Theme:** Remove native `node-pty` dependency, Bun-native subprocess for agent sessions
113
- **Status:** ✅ Shipped (2026-03-04)
114
- **Spec:** [docs/specs/bun-pty-migration.md](specs/bun-pty-migration.md)
115
-
116
- ### BUN-001: Replace node-pty with Bun.spawn
117
- - [x] ~~All sub-items complete — `claude.ts` + `usePty.ts` migrated to `Bun.spawn`, `node-pty` removed from `package.json`, CI cleaned up~~
118
-
119
- ---
120
-
121
- ## v0.23.0 — Status File Consolidation ✅
122
-
123
- **Theme:** Auto-write status.json to well-known paths, align readers, remove dead options
124
- **Status:** ✅ Shipped (2026-03-07)
125
- **Spec:** [docs/specs/status-file-consolidation.md](specs/status-file-consolidation.md)
126
- **Pre-requisite for:** v0.24.0 (Central Run Registry)
127
-
128
- ### Stories
129
- - [x] ~~**SFC-001:** Auto-write project-level status — remove `--status-file` flag, always write to `<workdir>/nax/status.json`~~
130
- - [x] ~~**BUG-043:** Fix scoped test command construction + add `testScoped` config with `{{files}}` template~~
131
- - [x] ~~**BUG-044:** Log scoped and full-suite test commands at info level in verify stage~~
132
- - [x] ~~**SFC-002:** Write feature-level status on run end — copy final snapshot to `<workdir>/nax/features/<feature>/status.json`~~
133
- - [x] ~~**SFC-003:** Align status readers — `nax status` + `nax diagnose` read from correct paths~~
134
- - [x] ~~**SFC-004:** Clean up dead code — remove `--status-file` option, `.nax-status.json` references~~
135
-
136
- ---
137
-
138
- ## v0.27.0 — Review Quality ✅ Shipped (2026-03-08)
139
-
140
- **Theme:** Fix review stage reliability — dirty working tree false-positive, stale precheck, dead config fields
141
- **Status:** ✅ Shipped (2026-03-08)
142
- **Spec:** `nax/features/review-quality/prd.json`
143
-
144
- ### Stories
145
- - [x] **RQ-001:** Assert clean working tree before running review typecheck/lint (BUG-049)
146
- - [x] **RQ-002:** Fix `checkOptionalCommands` precheck to use correct config resolution path (BUG-050)
147
- - [x] **RQ-003:** Consolidate dead `quality.commands.typecheck/lint` into review resolution chain (BUG-051)
148
-
149
- ---
150
-
151
- ## v0.26.0 — Routing Persistence ✅ Shipped (2026-03-08)
152
-
153
- - **RRP-001:** Persist initial routing classification to `prd.json` on first classification
154
- - **RRP-002:** Add `initialComplexity` to `StoryRouting` and `StoryMetrics` for accurate reporting
155
- - **RRP-003:** Add `contentHash` to `StoryRouting` for staleness detection — stale cached routing is re-classified
156
- - **RRP-004:** Unit tests for routing persistence, idempotence, staleness, content hash, metrics
157
- - **BUG-052:** Replace `console.warn` with structured JSONL logger in `review/runner.ts` and `optimizer/index.ts`
158
-
159
- ---
160
-
161
- ## v0.25.0 — Trigger Completion ✅ Shipped (2026-03-07)
162
-
163
- **Theme:** Wire all 8 unwired interaction triggers, 3 missing hook events, and add plugin integration tests
164
- **Status:** ✅ Shipped (2026-03-07)
165
- **Spec:** [docs/specs/trigger-completion.md](specs/trigger-completion.md)
166
-
167
- ### Stories
168
- - [x] **TC-001:** Wire `cost-exceeded` + `cost-warning` triggers — fire at 80%/100% of cost limit in sequential-executor.ts
169
- - [x] **TC-002:** Wire `max-retries` trigger — fire on permanent story failure via `story:failed` event in wireInteraction
170
- - [x] **TC-003:** Wire `security-review`, `merge-conflict`, `pre-merge` triggers — review rejection, git conflict detection, pre-completion gate
171
- - [x] **TC-004:** Wire `story-ambiguity` + `review-gate` triggers — ambiguity keyword detection, per-story human checkpoint
172
- - [x] **TC-005:** Wire missing hook events — `on-resume`, `on-session-end`, `on-error` to pipeline events
173
- - [x] **TC-006:** Auto plugin + Telegram + Webhook integration tests — mock LLM/network, cover approve/reject/HMAC flows
174
-
175
- ---
176
-
177
- ## v0.24.0 — Central Run Registry ✅
178
-
179
- **Theme:** Global run index across all projects — single source of truth for all nax run history
180
- **Status:** ✅ Shipped (2026-03-07)
181
- **Spec:** [docs/specs/central-run-registry.md](specs/central-run-registry.md)
182
-
183
- ### Stories
184
- - [x] ~~**CRR-000:** `src/pipeline/subscribers/events-writer.ts` — `wireEventsWriter()`, writes lifecycle events to `~/.nax/events/<project>/events.jsonl` (machine-readable completion signal for watchdog/CI)~~
185
- - [x] ~~**CRR-001:** `src/pipeline/subscribers/registry.ts` — `wireRegistry()` subscriber, listens to `run:started`, writes `~/.nax/runs/<project>-<feature>-<runId>/meta.json` (path pointers only — no data duplication, no symlinks)~~
186
- - [x] ~~**CRR-002:** `src/commands/runs.ts` — `nax runs` CLI, reads `meta.json` → resolves live `status.json` from `statusPath`, displays table (project, feature, status, stories, duration, date). Filters: `--project`, `--last`, `--status`~~
187
- - [x] ~~**CRR-003:** `nax logs --run <runId>` — resolve run from global registry via `eventsDir`, stream logs from any directory~~
188
-
189
- ---
190
-
191
- ## v0.21.0 — Process Reliability & Observability ✅
192
-
193
- **Theme:** Kill orphan processes cleanly, smart-runner precision, test strategy quality
194
- **Status:** ✅ Shipped (2026-03-06)
195
-
196
- ### Shipped
197
- - [x] **BUG-039 (simple):** Timeouts for review/runner.ts lint/typecheck, git.ts, executor.ts timer leak
198
- - [x] **BUG-039 (medium):** runOnce() SIGKILL follow-up + pidRegistry.unregister() in finally; LLM stream drain (stdout/stderr cancel) before proc.kill() on timeout
199
- - [x] **FEAT-010:** baseRef tracking — capture HEAD per attempt, `git diff <baseRef>..HEAD` in smart-runner (precise, no cross-story pollution)
200
- - [x] **FEAT-011:** Path-only context for oversized files (>10KB) — was silently dropped, now agent gets a path hint
201
- - [x] **FEAT-013:** Deprecated `test-after` from auto routing — simple/medium stories now default to `three-session-tdd-lite`
202
- - [x] ~~**BUG-041:**~~ Won't fix — superseded by FEAT-010
203
- - [x] ~~**FEAT-012:**~~ Won't fix — balanced tier sufficient for test-writer
204
-
205
- ### → v0.22.1 Pipeline Re-Architecture ✅ Shipped (2026-03-07)
206
- **ADR:** [docs/adr/ADR-005-pipeline-re-architecture.md](adr/ADR-005-pipeline-re-architecture.md)
207
- **Plan:** [docs/adr/ADR-005-implementation-plan.md](adr/ADR-005-implementation-plan.md)
208
-
209
- **Theme:** Eliminate ad-hoc orchestration, consolidate 4 scattered verification paths into single orchestrator, add event-bus-driven hooks/plugins/interaction, new stages (rectify, autofix, regression), post-run pipeline SSOT.
210
-
211
- - [x] **Phase 1:** VerificationOrchestrator + Pipeline Event Bus (additive, no behavior change)
212
- - [x] **Phase 2:** New stages — `rectify`, `autofix`, `regression` + `retry` stage action
213
- - [x] **Phase 3:** Event-bus subscribers for hooks, reporters, interaction (replace 20+ scattered call sites)
214
- - [x] **Phase 5:** Post-run pipeline SSOT — `deferred-regression` stage, tier escalation into `iteration-runner`, `runAcceptanceLoop` → `runPipeline(postRunPipeline)`
215
-
216
- **Resolved:**
217
- - [x] **BUG-040:** Lint/typecheck auto-repair → `autofix` stage + `quality.commands.lintFix/formatFix`
218
- - [x] **BUG-042:** Verifier failure capture → unified `VerifyResult` with `failures[]` always populated
219
- - [x] **FEAT-014:** Heartbeat observability → Pipeline Event Bus with typed events
220
- - [x] **BUG-026:** Regression gate triggers full retry → targeted `rectify` stage with `retry` action
221
- - [x] **BUG-028:** Routing cache ignores escalation tier → cache key includes tier
222
-
223
- **Test results:** 2264 pass, 12 skip, 1 fail (pre-existing disk space flaky)
224
-
225
- ---
226
-
227
- ## v0.20.0 — Verification Architecture v2 ✅
228
-
229
- **Theme:** Eliminate duplicate test runs, deferred regression gate, structured escalation context
230
- **Status:** ✅ Shipped (2026-03-06)
231
- **Spec:** [docs/specs/verification-architecture-v2.md](specs/verification-architecture-v2.md)
232
-
233
- ### Shipped
234
- - [x] Pipeline verify stage is single test execution point (Smart Test Runner)
235
- - [x] Removed scoped re-test in `post-verify.ts` (duplicate eliminated)
236
- - [x] Review stage: typecheck + lint only — `checks: ["typecheck", "lint"]`
237
- - [x] Deferred regression gate — `src/execution/lifecycle/run-regression.ts`
238
- - [x] Reverse Smart Test Runner mapping: test → source → responsible story
239
- - [x] Targeted rectification per story with full failure context
240
- - [x] `regressionGate.mode: "deferred" | "per-story" | "disabled"` config
241
- - [x] `maxRectificationAttempts` config (default: 2)
242
- - [x] BUG-037: verify output shows last 20 lines (failures, not prechecks)
243
-
244
- ---
245
-
246
- ## v0.19.0 — Hardening & Compliance ✅
247
-
248
- **Theme:** Security hardening, _deps injection pattern, Node.js API removal
249
- **Status:** ✅ Shipped (2026-03-04)
250
- **Spec:** [docs/specs/verification-architecture-v2.md](specs/verification-architecture-v2.md) (Phase 2)
251
-
252
- ### Shipped
253
- - [x] Pipeline verify stage is the single test execution point (Smart Test Runner)
254
- - [x] Remove scoped re-test in `post-verify.ts` (duplicate of pipeline verify)
255
- - [x] Review stage runs typecheck + lint only — remove `review.commands.test` execution
256
- - [x] `priorFailures` injected into escalated agent prompts via `context/builder.ts`
257
- - [x] Reverse file mapping for regression attribution
258
-
259
- ---
260
-
261
- ## Shipped
262
-
263
- | Version | Theme | Date | Details |
264
- |:---|:---|:---|:---|
265
- | v0.26.0 | Routing Persistence | 2026-03-08 | RRP-001–004: persist initial routing, initialComplexity, contentHash staleness detection, unit tests; BUG-052: structured logger in review/optimizer |
266
- | v0.25.0 | Trigger Completion | 2026-03-07 | TC-001–004: run.complete event, crash recovery, headless formatter, trigger completion |
267
- | v0.24.0 | Central Run Registry | 2026-03-07 | CRR-000–003: events writer, registry, nax runs CLI, nax logs --run global resolution |
268
- | v0.23.0 | Status File Consolidation | 2026-03-07 | SFC-001–004: auto-write status.json, feature-level status, align readers, remove dead code; BUG-043/044: testScoped config + command logging |
269
- | v0.18.1 | Type Safety + CI Pipeline | 2026-03-03 | 60 TS errors + 12 lint errors fixed, GitLab CI green (1952/56/0) |
270
- | v0.22.2 | Routing Stability + SFC-001 | 2026-03-07 | BUG-040 floating outputPromise crash on LLM timeout retry; SFC-001 auto-write status.json |
271
- | v0.22.1 | Pipeline Re-Architecture | 2026-03-07 | VerificationOrchestrator, EventBus, new stages (rectify/autofix/regression/deferred-regression), post-run SSOT. 2264 pass |
272
- | v0.20.0 | Verification Architecture v2 | 2026-03-06 | Deferred regression gate, remove duplicate tests, BUG-037 |
273
- | v0.19.0 | Hardening & Compliance | 2026-03-04 | SEC-1 to SEC-5, BUG-1, Node.js API removal, _deps rollout |
274
- | v0.18.5 | Bun PTY Migration | 2026-03-04 | BUN-001: node-pty → Bun.spawn, CI cleanup, flaky test fix |
275
- | v0.18.4 | Routing Stability | 2026-03-04 | BUG-031 keyword drift, BUG-033 LLM retry, pre-commit hook |
276
- | v0.18.3 | Execution Reliability + Smart Runner | 2026-03-04 | BUG-026/028/029/030/032 + SFC-001/002 + STR-007, all items complete |
277
- | v0.18.2 | Smart Test Runner + Routing Fix | 2026-03-03 | FIX-001 + STR-001–006, 2038 pass/11 skip/0 fail |
278
- | v0.18.0 | Orchestration Quality | 2026-03-03 | BUG-016/017/018/019/020/021/022/023/025 all fixed |
279
- | v0.17.0 | Config Management | 2026-03-02 | CM-001 --explain, CM-002 --diff, CM-003 default view |
280
- | v0.16.4 | Bugfixes: Routing + Env Allowlist | 2026-03-02 | BUG-012/013/014 |
281
- | v0.16.1 | Project Context Generator | 2026-03-01 | `nax generate`, auto-inject, multi-language |
282
- | v0.16.0 | Story Size Gate | 2026-03-01 | [releases/v0.16.0.md](releases/v0.16.0.md) |
283
- | v0.15.3 | Constitution Generator + Runner Interaction Wiring | 2026-02-28 | [releases/v0.15.3.md](releases/v0.15.3.md) |
284
- | v0.15.1 | Architectural Compliance + Security Hardening | 2026-02-28 | [releases/v0.15.1.md](releases/v0.15.1.md) |
285
- | v0.15.0 | Interactive Pipeline | 2026-02-28 | [releases/v0.15.0.md](releases/v0.15.0.md) |
286
- | v0.14.4 | Code Audit Cleanup (MEDIUM findings) | 2026-02-28 | [releases/v0.14.4.md](releases/v0.14.4.md) |
287
- | v0.14.3 | Code Audit Fixes (CRITICAL+HIGH+MEDIUM) | 2026-02-28 | [releases/v0.14.3.md](releases/v0.14.3.md) |
288
- | v0.14.2 | E2E Test Hang Fix | 2026-02-28 | [releases/v0.14.2.md](releases/v0.14.2.md) |
289
- | v0.14.1 | nax diagnose CLI | 2026-02-28 | [releases/v0.14.1.md](releases/v0.14.1.md) |
290
- | v0.14.0 | Failure Resilience | 2026-02-28 | [releases/v0.14.0.md](releases/v0.14.0.md) |
291
- | v0.13.0 | Precheck | 2026-02-27 | [releases/v0.13.0.md](releases/v0.13.0.md) |
292
- | v0.12.0 | Structured Logging | 2026-02-27 | [releases/v0.12.0.md](releases/v0.12.0.md) |
293
- | v0.11.0 and earlier | Plugin Integration, LLM Routing, Core Pipeline | 2026-02-27 | [releases/v0.11.0-and-earlier.md](releases/v0.11.0-and-earlier.md) |
294
-
295
- ---
296
-
297
- ## Backlog
298
-
299
- ### Bugs
300
- - [x] ~~BUG-002: Orphan Claude processes~~
301
- - [x] ~~BUG-003: PRD status "done" not skipped~~
302
- - [x] ~~BUG-004: router.ts crashes on missing tags~~
303
- - [x] ~~BUG-005: Hardcoded `bun run lint` in review~~
304
- - [x] ~~BUG-006: Context auto-detection~~
305
- - [x] ~~BUG-008: E2E tests hang with infinite retry~~
306
- - [x] ~~BUG-009: No cross-story regression check~~
307
- - [x] ~~BUG-010: Greenfield TDD no test files~~
308
- - [x] ~~BUG-011: Escalation tier budget not enforced~~
309
- - [x] ~~BUG-012: Greenfield detection ignores pre-existing test files~~
310
- - [x] ~~BUG-013: Escalation routing not applied in iterations~~
311
- - [x] ~~BUG-014: buildAllowedEnv() strips USER/LOGNAME~~
312
- - [x] ~~**BUG-015:** `loadConstitution()` leaks global `~/.nax/constitution.md` into unit tests — fixed via `skipGlobal: true` in all unit tests~~
313
- - [x] ~~**BUG-027:** `runPrecheck()` always prints to stdout — pollutes test output when called programmatically. Shipped in v0.18.2.~~
314
- - [x] ~~**BUG-028:** Routing cache ignores escalation tier — escalated stories re-run at original tier. Shipped in v0.18.3.~~
315
- - [x] ~~**BUG-016:** Hardcoded 120s timeout in pipeline verify stage → fixed in v0.18.0~~
316
- - [x] ~~**BUG-017:** run.complete not emitted on SIGTERM → fixed in v0.18.0~~
317
- - [x] ~~**BUG-018:** Test-writer wastes ~3min/retry when tests already exist → fixed in v0.18.0~~
318
- - [x] ~~**BUG-019:** Misleading TIMEOUT output preview → fixed in v0.18.0~~
319
- - [x] ~~**BUG-020:** Missing storyId in JSONL events → fixed in v0.18.0~~
320
- - [x] ~~**BUG-021:** `Task classified` log shows raw LLM result, not final routing → fixed in v0.18.0~~
321
- - [x] ~~**BUG-022:** Story interleaving — `getNextStory()` round-robins instead of exhausting retries on current story → fixed in v0.18.0~~
322
- - [x] ~~**BUG-023:** Agent failure silent — no exitCode/stderr in JSONL → fixed in v0.18.0~~
323
- - [x] ~~**BUG-025:** `needsHumanReview` not triggering interactive plugin → fixed in v0.18.0~~
324
- - [x] ~~**BUG-029:** Escalation resets story to `pending`. Fixed.~~
325
- - [x] ~~**BUG-030:** Review lint failure resets. Fixed.~~
326
- - [x] ~~**BUG-031:** Keyword fallback classifier inconsistency. Fixed.~~
327
- - [x] ~~**BUG-032:** Routing stage overrides escalated modelTier. Fixed.~~
328
- - [x] ~~**BUG-033:** LLM routing timeout/retry. Fixed.~~
329
- - [x] ~~**BUG-037:** Test output summary (verify stage) tail. Fixed.~~
330
- - [x] ~~**BUG-038:** smart-runner over-matching. Fixed.~~
331
- - [x] ~~**BUG-043:** Scoped test command construction. Fixed.~~
332
- - [x] ~~**BUG-044:** Scoped/full-suite test command logging. Fixed.~~
333
- - [x] ~~**BUG-049:** Review typecheck runs on dirty working tree. Fixed in v0.27.0.~~
334
- - [x] ~~**BUG-050:** `checkOptionalCommands` precheck uses legacy config fields. Fixed in v0.27.0.~~
335
- - [x] ~~**BUG-051:** `quality.commands.typecheck/lint` are dead config. Fixed in v0.27.0.~~
336
- - [x] ~~**BUG-052:** `console.warn` in runtime pipeline code bypasses JSONL logger. Fixed in v0.26.0.~~
337
- - [ ] **BUG-054:** Redundant scoped verify after TDD full-suite gate passes. When rectification gate runs full test suite and passes, the pipeline verify stage re-runs scoped tests (subset). **Fix:** Skip verify if full-suite gate already passed.
338
- - [ ] **BUG-055:** Pipeline skip messages conflate "not needed" with "disabled". `runner.ts:54` logs "skipped (disabled)" for all stages where `enabled()` returns false, even if just because tests passed. **Fix:** Differentiate log message.
339
-
340
- ### Features
341
- - [x] ~~`nax unlock` command~~
342
- - [x] ~~Constitution file support~~
343
- - [x] ~~Per-story testStrategy override — v0.18.1~~
344
- - [x] ~~Smart Test Runner — v0.18.2~~
345
- - [ ] **Central Run Registry** — moved to v0.24.0
346
- - [x] ~~**BUN-001:** Bun PTY Migration — replace `node-pty` with `Bun.spawn` (piped stdio). Shipped in v0.18.5.~~
347
- - [ ] **CI-001:** CI Memory Optimization — parallel test sharding for 1GB runners
348
- - [ ] **CI-001:** CI Memory Optimization — parallel test sharding to pass on 1GB runners (currently requires 8GB). Evaluate `bun test --shard` when stable.
349
- - [ ] Cost tracking dashboard
350
- - [ ] npm publish setup
351
- - [ ] `nax diagnose --ai` flag (LLM-assisted, future TBD)
352
- - [ ] **Auto-decompose oversized stories** — When story size gate triggers, offer via interaction chain to auto-decompose using `nax analyse`.
353
- - [ ] **AST-based context file detection** — replace keyword-matching with import/symbol graph analysis. Target: v0.19+
354
- - [ ] VitePress documentation site — full CLI reference, hosted as standalone docs (pre-publish requirement)
355
-
356
- ---
357
-
358
- ## Versioning
359
-
360
- Sequential canary → stable: `v0.12.0-canary.0` → `canary.N` → `v0.12.0`
361
- Canary: `npm publish --tag canary`
362
- Stable: `npm publish` (latest)
363
-
364
- *Last updated: 2026-03-08 (v0.27.0 shipped — Review Quality)*
File without changes