@nathapp/nax 0.28.0 → 0.30.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 (385) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/bin/nax.ts +2 -3
  3. package/dist/nax.js +72753 -0
  4. package/package.json +11 -3
  5. package/src/cli/analyze.ts +2 -7
  6. package/src/cli/config.ts +3 -1
  7. package/src/config/defaults.ts +1 -0
  8. package/src/config/schemas.ts +1 -0
  9. package/src/config/types.ts +1 -0
  10. package/src/context/builder.ts +10 -1
  11. package/src/execution/lifecycle/headless-formatter.ts +2 -4
  12. package/src/prompts/builder.ts +12 -69
  13. package/src/prompts/sections/isolation.ts +38 -8
  14. package/src/prompts/sections/role-task.ts +79 -17
  15. package/src/review/runner.ts +6 -1
  16. package/src/version.ts +2 -1
  17. package/.claude/rules/01-project-conventions.md +0 -34
  18. package/.claude/rules/02-test-architecture.md +0 -39
  19. package/.claude/rules/03-test-writing.md +0 -58
  20. package/.claude/rules/04-forbidden-patterns.md +0 -29
  21. package/.claude/settings.json +0 -15
  22. package/.githooks/pre-commit +0 -16
  23. package/.gitlab-ci.yml +0 -103
  24. package/.mcp.json +0 -8
  25. package/BRIEF.md +0 -140
  26. package/CLAUDE.md +0 -143
  27. package/US-007-IMPLEMENTATION.md +0 -139
  28. package/biome.json +0 -14
  29. package/bun.lock +0 -163
  30. package/bunfig.toml +0 -12
  31. package/docker-compose.test.yml +0 -15
  32. package/docs/20260216-fix-plan-context-review.md +0 -56
  33. package/docs/20260216-relentless-vs-ngent-comparison.md +0 -208
  34. package/docs/20260216-v02-plan.md +0 -136
  35. package/docs/20260216-v02-review.md +0 -685
  36. package/docs/20260217-dogfood-findings.md +0 -56
  37. package/docs/20260217-p2-plus-plan.md +0 -117
  38. package/docs/20260217-partial-fixes-plan.md +0 -62
  39. package/docs/20260217-plan-analyze-spec.md +0 -117
  40. package/docs/20260217-post-impl-review.md +0 -1137
  41. package/docs/20260217-quick-wins-plan.md +0 -66
  42. package/docs/20260217-split-runner-plan.md +0 -75
  43. package/docs/20260217-v03-impl-plan.md +0 -80
  44. package/docs/20260217-v03-post-impl-review.md +0 -589
  45. package/docs/20260217-v04-impl-plan.md +0 -86
  46. package/docs/20260217-v05-post-impl-review.md +0 -850
  47. package/docs/20260217-v06-post-impl-review.md +0 -817
  48. package/docs/20260218-adr003-port-plan.md +0 -151
  49. package/docs/20260218-review-adr003-verification.md +0 -175
  50. package/docs/20260219-fix-plan-bug16-19.md +0 -79
  51. package/docs/20260219-fix-plan-bug20-22.md +0 -114
  52. package/docs/20260219-plan-llm-routing.md +0 -116
  53. package/docs/20260219-review-bug20-22-fixes.md +0 -135
  54. package/docs/20260219-routing-baseline-keyword.md +0 -63
  55. package/docs/20260220-plan-structured-logging-p1.md +0 -80
  56. package/docs/20260220-plan-structured-logging-p2.md +0 -37
  57. package/docs/20260220-review-llm-routing.md +0 -180
  58. package/docs/20260220-review-post-fix-llm-routing.md +0 -70
  59. package/docs/20260221-fix-plan-relevantfiles-split.md +0 -101
  60. package/docs/20260221-fix-plan-routing-mode.md +0 -125
  61. package/docs/20260221-review-v0.9-implementation.md +0 -379
  62. package/docs/20260222-fix-plan-v091-routing-isolation.md +0 -197
  63. package/docs/20260223-fix-plan-prompt-audit.md +0 -62
  64. package/docs/20260224-nax-roadmap-phases.md +0 -189
  65. package/docs/20260225-phase2-llm-service-layer.md +0 -401
  66. package/docs/20260225-review-v0.10.1.md +0 -187
  67. package/docs/20260303-v010-implementation-plan.md +0 -165
  68. package/docs/20260304-review-nax.md +0 -492
  69. package/docs/CLAUDE.md.bak +0 -191
  70. package/docs/ROADMAP.md +0 -390
  71. package/docs/SPEC-rectification.md +0 -0
  72. package/docs/SPEC.md +0 -324
  73. package/docs/US-001-plugin-loading-verification.md +0 -152
  74. package/docs/adr/ADR-005-implementation-plan.md +0 -655
  75. package/docs/adr/ADR-005-pipeline-re-architecture.md +0 -464
  76. package/docs/architecture-analysis.md +0 -1076
  77. package/docs/bugs/BUG-21-escalation-null-attempts.md +0 -48
  78. package/docs/bugs-from-dogfood-run-c.md +0 -243
  79. package/docs/code-review-20260228.md +0 -612
  80. package/docs/code-review-v0.15.0.md +0 -629
  81. package/docs/hook-lifecycle-test-plan.md +0 -149
  82. package/docs/releases/v0.11.0-and-earlier.md +0 -20
  83. package/docs/releases/v0.12.0.md +0 -15
  84. package/docs/releases/v0.13.0.md +0 -14
  85. package/docs/releases/v0.14.0.md +0 -20
  86. package/docs/releases/v0.14.1.md +0 -36
  87. package/docs/releases/v0.14.2.md +0 -51
  88. package/docs/releases/v0.14.3.md +0 -174
  89. package/docs/releases/v0.14.4.md +0 -94
  90. package/docs/releases/v0.15.0.md +0 -502
  91. package/docs/releases/v0.15.1.md +0 -170
  92. package/docs/releases/v0.15.3.md +0 -193
  93. package/docs/specs/bug-039-orphan-processes.md +0 -131
  94. package/docs/specs/bug-040-review-rectification.md +0 -82
  95. package/docs/specs/bug-041-cross-story-test-isolation.md +0 -88
  96. package/docs/specs/bug-042-verifier-failure-capture.md +0 -117
  97. package/docs/specs/bun-pty-migration.md +0 -171
  98. package/docs/specs/central-run-registry.md +0 -116
  99. package/docs/specs/feat-010-smart-runner-git-history.md +0 -96
  100. package/docs/specs/feat-011-file-context-strategy.md +0 -73
  101. package/docs/specs/feat-012-tdd-writer-tier.md +0 -79
  102. package/docs/specs/feat-013-test-after-review.md +0 -89
  103. package/docs/specs/feat-014-heartbeat-observability.md +0 -127
  104. package/docs/specs/status-file-consolidation.md +0 -93
  105. package/docs/specs/status-file-v0.10.1.md +0 -812
  106. package/docs/specs/trigger-completion.md +0 -145
  107. package/docs/specs/verification-architecture-v2.md +0 -343
  108. package/docs/tdd/strategies.md +0 -97
  109. package/docs/v0.10-global-config.md +0 -206
  110. package/docs/v0.10-plugin-system.md +0 -415
  111. package/docs/v0.10-prompt-optimizer.md +0 -234
  112. package/docs/v0.3-spec.md +0 -244
  113. package/docs/v0.4-spec.md +0 -140
  114. package/docs/v0.5-spec.md +0 -237
  115. package/docs/v0.6-spec.md +0 -371
  116. package/docs/v0.7-spec.md +0 -177
  117. package/docs/v0.8-llm-routing.md +0 -206
  118. package/docs/v0.8-structured-logging.md +0 -132
  119. package/docs/v0.9.3-prompt-audit.md +0 -112
  120. package/examples/plugins/console-reporter/index.test.ts +0 -207
  121. package/examples/plugins/console-reporter/index.ts +0 -110
  122. package/memory/topic/feat-010-baseref.md +0 -28
  123. package/memory/topic/feat-013-test-after-deprecation.md +0 -22
  124. package/nax/config.json +0 -154
  125. package/nax/features/bug-039-medium/prd.json +0 -45
  126. package/nax/features/bugfix-v0171/prd.json +0 -52
  127. package/nax/features/central-run-registry/prd.json +0 -105
  128. package/nax/features/config-management/prd.json +0 -108
  129. package/nax/features/config-management/progress.txt +0 -5
  130. package/nax/features/diagnose/acceptance.test.ts +0 -414
  131. package/nax/features/diagnose/prd.json +0 -41
  132. package/nax/features/nax-compliance/prd.json +0 -52
  133. package/nax/features/nax-compliance/progress.txt +0 -1
  134. package/nax/features/orchestration-fixes/prd.json +0 -89
  135. package/nax/features/orchestration-fixes/progress.txt +0 -1
  136. package/nax/features/plugin-integration/US-007-VERIFICATION.md +0 -259
  137. package/nax/features/plugin-integration/prd.json +0 -208
  138. package/nax/features/plugin-integration/progress.txt +0 -5
  139. package/nax/features/post-rearch-bugfix/prd.json +0 -137
  140. package/nax/features/precheck/prd.json +0 -205
  141. package/nax/features/precheck/progress.txt +0 -15
  142. package/nax/features/prompt-builder/prd.json +0 -152
  143. package/nax/features/prompt-builder/progress.txt +0 -3
  144. package/nax/features/review-quality/prd.json +0 -55
  145. package/nax/features/routing-persistence/prd.json +0 -104
  146. package/nax/features/routing-persistence/progress.txt +0 -1
  147. package/nax/features/smart-test-runner/plan.md +0 -7
  148. package/nax/features/smart-test-runner/prd.json +0 -203
  149. package/nax/features/smart-test-runner/progress.txt +0 -13
  150. package/nax/features/smart-test-runner/spec.md +0 -7
  151. package/nax/features/smart-test-runner/tasks.md +0 -8
  152. package/nax/features/status-file-consolidation/prd.json +0 -106
  153. package/nax/features/structured-logging/prd.json +0 -199
  154. package/nax/features/trigger-completion/prd.json +0 -150
  155. package/nax/features/trigger-completion/progress.txt +0 -7
  156. package/nax/features/unlock/prd.json +0 -36
  157. package/nax/features/v0.18.3-execution-reliability/prd.json +0 -80
  158. package/nax/features/v0.18.3-execution-reliability/progress.txt +0 -3
  159. package/nax/features/v0.19.0-hardening/plan.md +0 -7
  160. package/nax/features/v0.19.0-hardening/prd.json +0 -84
  161. package/nax/features/v0.19.0-hardening/progress.txt +0 -7
  162. package/nax/features/v0.19.0-hardening/spec.md +0 -18
  163. package/nax/features/v0.19.0-hardening/tasks.md +0 -8
  164. package/nax/features/verify-v2/prd.json +0 -79
  165. package/nax/features/verify-v2/progress.txt +0 -3
  166. package/nax/status.json +0 -36
  167. package/src/prompts/templates/implementer.ts +0 -6
  168. package/src/prompts/templates/single-session.ts +0 -6
  169. package/src/prompts/templates/test-writer.ts +0 -6
  170. package/src/prompts/templates/verifier.ts +0 -6
  171. package/test/COVERAGE-GAPS.md +0 -333
  172. package/test/e2e/cm-003-default-view.test.ts +0 -195
  173. package/test/e2e/plan-analyze-run.test.ts +0 -902
  174. package/test/helpers/helpers.test.ts +0 -295
  175. package/test/helpers/timeout.ts +0 -42
  176. package/test/integration/US-002-TEST-SUMMARY.md +0 -107
  177. package/test/integration/US-003-TEST-SUMMARY.md +0 -149
  178. package/test/integration/US-004-TEST-SUMMARY.md +0 -106
  179. package/test/integration/US-005-TEST-SUMMARY.md +0 -138
  180. package/test/integration/US-007-TEST-SUMMARY.md +0 -100
  181. package/test/integration/cli/agent-validation.test.ts +0 -439
  182. package/test/integration/cli/cli-config-default-edge-cases.test.ts +0 -223
  183. package/test/integration/cli/cli-config-default-view.test.ts +0 -230
  184. package/test/integration/cli/cli-config-diff.test.ts +0 -461
  185. package/test/integration/cli/cli-config-prompts-explain.test.ts +0 -74
  186. package/test/integration/cli/cli-config.test.ts +0 -737
  187. package/test/integration/cli/cli-diagnose.test.ts +0 -595
  188. package/test/integration/cli/cli-logs.test.ts +0 -346
  189. package/test/integration/cli/cli-plugins.test.ts +0 -679
  190. package/test/integration/cli/cli-precheck.test.ts +0 -372
  191. package/test/integration/cli/cli-run-headless.test.ts +0 -174
  192. package/test/integration/cli/cli.test.ts +0 -76
  193. package/test/integration/cli/precheck-integration.test.ts +0 -476
  194. package/test/integration/cli/precheck-orchestrator.test.ts +0 -247
  195. package/test/integration/cli/precheck.test.ts +0 -806
  196. package/test/integration/config/config-loader.test.ts +0 -266
  197. package/test/integration/config/config.test.ts +0 -444
  198. package/test/integration/config/merger.test.ts +0 -466
  199. package/test/integration/config/paths.test.ts +0 -52
  200. package/test/integration/config/security-loader.test.ts +0 -83
  201. package/test/integration/context/context-integration.test.ts +0 -703
  202. package/test/integration/context/context-path-security.test.ts +0 -173
  203. package/test/integration/context/context-provider-injection.test.ts +0 -507
  204. package/test/integration/context/context-verification-integration.test.ts +0 -296
  205. package/test/integration/context/s5-greenfield-fallback.test.ts +0 -298
  206. package/test/integration/execution/execution-isolation.test.ts +0 -143
  207. package/test/integration/execution/execution.test.ts +0 -634
  208. package/test/integration/execution/feature-status-write.test.ts +0 -302
  209. package/test/integration/execution/parallel.test.ts +0 -251
  210. package/test/integration/execution/prd-pause.test.ts +0 -205
  211. package/test/integration/execution/prd-resolvers.test.ts +0 -186
  212. package/test/integration/execution/progress.test.ts +0 -34
  213. package/test/integration/execution/runner-batching.test.ts +0 -682
  214. package/test/integration/execution/runner-config-plugins.test.ts +0 -462
  215. package/test/integration/execution/runner-escalation.test.ts +0 -561
  216. package/test/integration/execution/runner-fixes.test.ts +0 -400
  217. package/test/integration/execution/runner-plugin-integration.test.ts +0 -544
  218. package/test/integration/execution/runner-queue-and-attempts.test.ts +0 -476
  219. package/test/integration/execution/status-file-integration.test.ts +0 -289
  220. package/test/integration/execution/status-file.test.ts +0 -380
  221. package/test/integration/execution/status-writer.test.ts +0 -447
  222. package/test/integration/execution/story-id-in-events.test.ts +0 -274
  223. package/test/integration/interaction/interaction-chain-pipeline.test.ts +0 -476
  224. package/test/integration/pipeline/hooks.test.ts +0 -363
  225. package/test/integration/pipeline/pipeline-acceptance.test.ts +0 -303
  226. package/test/integration/pipeline/pipeline-events.test.ts +0 -476
  227. package/test/integration/pipeline/pipeline.test.ts +0 -660
  228. package/test/integration/pipeline/reporter-lifecycle.test.ts +0 -862
  229. package/test/integration/pipeline/verify-stage.test.ts +0 -286
  230. package/test/integration/plan/analyze-integration.test.ts +0 -262
  231. package/test/integration/plan/analyze-scanner.test.ts +0 -132
  232. package/test/integration/plan/logger.test.ts +0 -461
  233. package/test/integration/plan/plan.test.ts +0 -157
  234. package/test/integration/plugins/config-integration.test.ts +0 -173
  235. package/test/integration/plugins/config-resolution.test.ts +0 -523
  236. package/test/integration/plugins/loader.test.ts +0 -644
  237. package/test/integration/plugins/plugins-registry.test.ts +0 -747
  238. package/test/integration/plugins/validator.test.ts +0 -564
  239. package/test/integration/prompts/pb-004-migration.test.ts +0 -523
  240. package/test/integration/review/review-config-commands.test.ts +0 -320
  241. package/test/integration/review/review-config-schema.test.ts +0 -117
  242. package/test/integration/review/review-plugin-integration.test.ts +0 -729
  243. package/test/integration/review/review.test.ts +0 -150
  244. package/test/integration/routing/plugin-routing-advanced.test.ts +0 -461
  245. package/test/integration/routing/plugin-routing-core.test.ts +0 -527
  246. package/test/integration/routing/routing-stage-bug-021.test.ts +0 -275
  247. package/test/integration/routing/routing-stage-greenfield.test.ts +0 -287
  248. package/test/integration/tdd/tdd-cleanup.test.ts +0 -246
  249. package/test/integration/tdd/tdd-orchestrator-core.test.ts +0 -565
  250. package/test/integration/tdd/tdd-orchestrator-failureCategory.test.ts +0 -355
  251. package/test/integration/tdd/tdd-orchestrator-fallback.test.ts +0 -311
  252. package/test/integration/tdd/tdd-orchestrator-lite.test.ts +0 -289
  253. package/test/integration/tdd/tdd-orchestrator-prompts.test.ts +0 -260
  254. package/test/integration/tdd/tdd-orchestrator-verdict.test.ts +0 -536
  255. package/test/integration/tmp/headless-test/test.jsonl +0 -30
  256. package/test/integration/verification/test-scanner.test.ts +0 -403
  257. package/test/integration/verification/verification-asset-check.test.ts +0 -143
  258. package/test/integration/worktree/manager.test.ts +0 -218
  259. package/test/integration/worktree/worktree-merge.test.ts +0 -341
  260. package/test/manual/logging-formatter-demo.ts +0 -158
  261. package/test/ui/tui-agent-panel.test.tsx +0 -99
  262. package/test/ui/tui-pty-integration.test.tsx +0 -146
  263. package/test/unit/acceptance.test.ts +0 -187
  264. package/test/unit/agent-stderr-capture.test.ts +0 -147
  265. package/test/unit/agents/claude.test.ts +0 -107
  266. package/test/unit/analyze-classifier.test.ts +0 -216
  267. package/test/unit/analyze.test.ts +0 -224
  268. package/test/unit/auto-detect.test.ts +0 -250
  269. package/test/unit/cli-status-project-level.test.ts +0 -283
  270. package/test/unit/cli-status.test.ts +0 -418
  271. package/test/unit/commands/common.test.ts +0 -321
  272. package/test/unit/commands/logs.test.ts +0 -458
  273. package/test/unit/commands/runs.test.ts +0 -303
  274. package/test/unit/commands/unlock.test.ts +0 -320
  275. package/test/unit/config/defaults.test.ts +0 -70
  276. package/test/unit/config/quality-commands-schema.test.ts +0 -72
  277. package/test/unit/config/regression-gate-schema.test.ts +0 -160
  278. package/test/unit/config/smart-runner-flag.test.ts +0 -250
  279. package/test/unit/constitution-generators.test.ts +0 -161
  280. package/test/unit/constitution.test.ts +0 -210
  281. package/test/unit/context/context-autodetect.test.ts +0 -297
  282. package/test/unit/context/context-build.test.ts +0 -575
  283. package/test/unit/context/context-coverage.test.ts +0 -236
  284. package/test/unit/context/context-error.test.ts +0 -93
  285. package/test/unit/context/context-estimate-tokens.test.ts +0 -201
  286. package/test/unit/context/context-format.test.ts +0 -302
  287. package/test/unit/context/context-isolation.test.ts +0 -267
  288. package/test/unit/context/context-sort.test.ts +0 -93
  289. package/test/unit/context/context-story.test.ts +0 -108
  290. package/test/unit/context/prior-failures.test.ts +0 -463
  291. package/test/unit/context.test.ts +0 -1726
  292. package/test/unit/cost.test.ts +0 -231
  293. package/test/unit/crash-recovery.test.ts +0 -309
  294. package/test/unit/escalation.test.ts +0 -127
  295. package/test/unit/execution/lifecycle/run-completion.test.ts +0 -240
  296. package/test/unit/execution/lifecycle/run-regression.test.ts +0 -420
  297. package/test/unit/execution/pid-registry.test.ts +0 -241
  298. package/test/unit/execution/sequential-executor.test.ts +0 -235
  299. package/test/unit/execution/sfc-004-dead-code-cleanup.test.ts +0 -89
  300. package/test/unit/execution/structured-failure.test.ts +0 -415
  301. package/test/unit/execution-logging-stderr.test.ts +0 -157
  302. package/test/unit/execution-stage.test.ts +0 -123
  303. package/test/unit/fix-generator.test.ts +0 -276
  304. package/test/unit/formatters.test.ts +0 -468
  305. package/test/unit/greenfield.test.ts +0 -180
  306. package/test/unit/hooks/shell-security.test.ts +0 -40
  307. package/test/unit/interaction/auto-plugin.test.ts +0 -162
  308. package/test/unit/interaction/human-review-trigger.test.ts +0 -165
  309. package/test/unit/interaction-network-failures.test.ts +0 -390
  310. package/test/unit/interaction-plugins.test.ts +0 -472
  311. package/test/unit/logging/formatter.test.ts +0 -456
  312. package/test/unit/merge.test.ts +0 -269
  313. package/test/unit/metrics/aggregator.test.ts +0 -164
  314. package/test/unit/metrics/tracker.test.ts +0 -186
  315. package/test/unit/metrics.test.ts +0 -276
  316. package/test/unit/optimizer/noop.optimizer.test.ts +0 -125
  317. package/test/unit/optimizer/rule-based.optimizer.test.ts +0 -358
  318. package/test/unit/pipeline/event-bus.test.ts +0 -105
  319. package/test/unit/pipeline/routing-partial-override.test.ts +0 -121
  320. package/test/unit/pipeline/runner-retry.test.ts +0 -89
  321. package/test/unit/pipeline/stages/autofix.test.ts +0 -97
  322. package/test/unit/pipeline/stages/completion-review-gate.test.ts +0 -218
  323. package/test/unit/pipeline/stages/execution-ambiguity.test.ts +0 -311
  324. package/test/unit/pipeline/stages/execution-merge-conflict.test.ts +0 -218
  325. package/test/unit/pipeline/stages/rectify.test.ts +0 -101
  326. package/test/unit/pipeline/stages/regression-stage.test.ts +0 -69
  327. package/test/unit/pipeline/stages/review.test.ts +0 -201
  328. package/test/unit/pipeline/stages/routing-idempotence.test.ts +0 -139
  329. package/test/unit/pipeline/stages/routing-initial-complexity.test.ts +0 -321
  330. package/test/unit/pipeline/stages/routing-persistence.test.ts +0 -380
  331. package/test/unit/pipeline/stages/verify.test.ts +0 -267
  332. package/test/unit/pipeline/subscribers/events-writer.test.ts +0 -227
  333. package/test/unit/pipeline/subscribers/hooks.test.ts +0 -84
  334. package/test/unit/pipeline/subscribers/interaction.test.ts +0 -313
  335. package/test/unit/pipeline/subscribers/registry.test.ts +0 -149
  336. package/test/unit/pipeline/subscribers/reporters.test.ts +0 -90
  337. package/test/unit/pipeline/verify-smart-runner.test.ts +0 -345
  338. package/test/unit/prd-auto-default.test.ts +0 -291
  339. package/test/unit/prd-failure-category.test.ts +0 -177
  340. package/test/unit/prd-get-next-story.test.ts +0 -215
  341. package/test/unit/precheck/checks-warnings.test.ts +0 -114
  342. package/test/unit/precheck-checks.test.ts +0 -841
  343. package/test/unit/precheck-story-size-gate.test.ts +0 -288
  344. package/test/unit/precheck-types.test.ts +0 -143
  345. package/test/unit/prompts/builder.test.ts +0 -258
  346. package/test/unit/prompts/loader.test.ts +0 -355
  347. package/test/unit/prompts/sections/conventions.test.ts +0 -30
  348. package/test/unit/prompts/sections/isolation.test.ts +0 -35
  349. package/test/unit/prompts/sections/role-task.test.ts +0 -40
  350. package/test/unit/prompts/sections/sections.test.ts +0 -238
  351. package/test/unit/prompts/sections/story.test.ts +0 -45
  352. package/test/unit/prompts/sections/verdict.test.ts +0 -58
  353. package/test/unit/prompts.test.ts +0 -476
  354. package/test/unit/queue.test.ts +0 -237
  355. package/test/unit/rectification.test.ts +0 -285
  356. package/test/unit/registry.test.ts +0 -288
  357. package/test/unit/review/runner.test.ts +0 -117
  358. package/test/unit/routing/content-hash.test.ts +0 -99
  359. package/test/unit/routing/routing-stability.test.ts +0 -208
  360. package/test/unit/routing/strategies/llm.test.ts +0 -306
  361. package/test/unit/routing-advanced.test.ts +0 -313
  362. package/test/unit/routing-core.test.ts +0 -341
  363. package/test/unit/routing-strategies.test.ts +0 -440
  364. package/test/unit/storyid-events.test.ts +0 -213
  365. package/test/unit/tdd-verdict.test.ts +0 -492
  366. package/test/unit/test-output-parser.test.ts +0 -377
  367. package/test/unit/ui/tui-controls.test.ts +0 -335
  368. package/test/unit/ui/tui-cost-and-pty.test.ts +0 -190
  369. package/test/unit/ui/tui-layout.test.ts +0 -379
  370. package/test/unit/ui/tui-stories.test.ts +0 -333
  371. package/test/unit/unit-isolation.test.ts +0 -135
  372. package/test/unit/utils/git.test.ts +0 -50
  373. package/test/unit/utils/path-security.test.ts +0 -47
  374. package/test/unit/utils-helpers.test.ts +0 -318
  375. package/test/unit/verdict.test.ts +0 -325
  376. package/test/unit/verification/orchestrator-types.test.ts +0 -54
  377. package/test/unit/verification/orchestrator.test.ts +0 -66
  378. package/test/unit/verification/smart-runner-config.test.ts +0 -163
  379. package/test/unit/verification/smart-runner-discovery.test.ts +0 -354
  380. package/test/unit/verification/smart-runner.test.ts +0 -262
  381. package/test/unit/verification/strategies/acceptance.test.ts +0 -33
  382. package/test/unit/verification/strategies/regression.test.ts +0 -87
  383. package/test/unit/verification/strategies/scoped.test.ts +0 -100
  384. package/test/unit/worktree-manager.test.ts +0 -159
  385. package/tsconfig.json +0 -27
@@ -1,137 +0,0 @@
1
- {
2
- "project": "nax",
3
- "branchName": "feat/post-rearch-bugfix",
4
- "feature": "post-rearch-bugfix",
5
- "version": "0.22.3",
6
- "description": "Fix all critical and key high-priority bugs found in post-re-architecture code review. Stream deadlocks, unhandled rejections, signal handler safety, lock file reliability, interaction system, parallel executor race, and error swallowing.",
7
- "userStories": [
8
- {
9
- "id": "FIX-C1",
10
- "title": "Fix stream deadlock in acceptance and autofix stages",
11
- "description": "In src/pipeline/stages/acceptance.ts (line ~136) and src/pipeline/stages/autofix.ts (line ~116), the code awaits proc.exited BEFORE reading stdout/stderr. When output exceeds the 64KB OS pipe buffer, the child blocks on write and proc.exited never resolves, causing a silent deadlock. Fix: use Promise.all([proc.exited, new Response(proc.stdout).text(), new Response(proc.stderr).text()]) to read streams concurrently with exit.",
12
- "complexity": "simple",
13
- "status": "pending",
14
- "acceptanceCriteria": [
15
- "acceptance.ts reads stdout/stderr concurrently with proc.exited using Promise.all",
16
- "autofix.ts reads stdout/stderr concurrently with proc.exited using Promise.all",
17
- "No sequential await proc.exited before stream reads in either file",
18
- "Existing tests pass"
19
- ]
20
- },
21
- {
22
- "id": "FIX-C2",
23
- "title": "Fix emitAsync never called for human-in-the-loop interaction",
24
- "description": "In src/execution/pipeline-result-handler.ts (line ~151), human-review:requested is emitted via fire-and-forget emit() instead of emitAsync(). The emitAsync() method in src/pipeline/subscribers/interaction.ts was specifically designed to wait for human response but is never called anywhere. The pipeline races past without waiting for human input. Fix: use await pipelineEventBus.emitAsync() for human-review events.",
25
- "complexity": "medium",
26
- "status": "pending",
27
- "acceptanceCriteria": [
28
- "human-review:requested event uses emitAsync instead of emit",
29
- "Pipeline waits for human response before continuing",
30
- "emitAsync is properly awaited at the call site",
31
- "Existing tests pass"
32
- ]
33
- },
34
- {
35
- "id": "FIX-C5",
36
- "title": "Fix timeoutPromise unhandled rejection in LLM routing",
37
- "description": "In src/routing/strategies/llm.ts, the timeoutPromise created in callLlmOnce() uses reject() but if the timer fires between race resolution and clearTimeout, the rejection is unhandled. Add timeoutPromise.catch(() => {}) right after creation, or restructure to use a clearable pattern that does not reject.",
38
- "complexity": "simple",
39
- "status": "pending",
40
- "acceptanceCriteria": [
41
- "timeoutPromise rejection is always handled (no unhandled rejection possible)",
42
- "Existing BUG-040 tests still pass",
43
- "Add test verifying no unhandled rejection when timeout fires after successful completion"
44
- ]
45
- },
46
- {
47
- "id": "FIX-C3",
48
- "title": "Fix TDZ crash in signal handler — prd accessed before initialization",
49
- "description": "In src/execution/runner.ts around line 123, the crash handler closure references prd which is declared later (~line 134). If SIGTERM arrives during setupRun(), accessing prd throws ReferenceError. Fix: declare let prd: PRD | undefined before the crash handler setup, and add a null guard in the getter: () => prd ? countStories(prd).total : 0.",
50
- "complexity": "simple",
51
- "status": "pending",
52
- "acceptanceCriteria": [
53
- "prd variable declared before crash handler registration",
54
- "Crash handler getter has null guard for prd",
55
- "SIGTERM during setupRun does not throw ReferenceError",
56
- "Existing tests pass"
57
- ]
58
- },
59
- {
60
- "id": "FIX-C6",
61
- "title": "Fix parallel executor shared mutable state race condition",
62
- "description": "In src/execution/parallel.ts around line 191 and 213, results.totalCost += ... and executing.splice(index, 1) are mutated concurrently from parallel promises. The splice inside .finally() can corrupt array indices when two promises resolve in the same microtask batch. Fix: replace executing array with a Set pattern; use executing.delete(p) instead of splice.",
63
- "complexity": "medium",
64
- "status": "pending",
65
- "acceptanceCriteria": [
66
- "executing collection uses Set instead of Array with splice",
67
- "totalCost accumulation is safe against concurrent updates",
68
- "No array index corruption possible when promises resolve simultaneously",
69
- "Existing tests pass"
70
- ]
71
- },
72
- {
73
- "id": "FIX-C7",
74
- "title": "Fix corrupt lock file permanently blocking all runs",
75
- "description": "In src/execution/lock.ts around line 48-79, if JSON.parse(lockContent) throws on a corrupted lock file, the error propagates to the outer catch which returns false, the caller interprets this as another process is running. Fix: wrap JSON.parse in its own try-catch; treat unparseable lock files as stale and delete them.",
76
- "complexity": "simple",
77
- "status": "pending",
78
- "acceptanceCriteria": [
79
- "Corrupt/unparseable lock file is treated as stale and deleted",
80
- "A warning is logged when a corrupt lock file is found",
81
- "nax can start normally after encountering a corrupt lock file",
82
- "Existing tests pass"
83
- ]
84
- },
85
- {
86
- "id": "FIX-C8",
87
- "title": "Fix empty catch in drainWithDeadline swallowing all errors",
88
- "description": "In src/verification/executor.ts around line 36-39, the catch block in drainWithDeadline swallows ALL exceptions including TypeError, OutOfMemoryError etc. Output silently becomes empty string with no diagnostic. Fix: narrow the catch to expected stream-destroyed errors only; log unexpected errors at debug level.",
89
- "complexity": "simple",
90
- "status": "pending",
91
- "acceptanceCriteria": [
92
- "Expected stream errors (after kill) are still silently handled",
93
- "Unexpected errors are logged at debug level",
94
- "Output defaults to empty string on expected stream errors",
95
- "Existing tests pass"
96
- ]
97
- },
98
- {
99
- "id": "FIX-H16",
100
- "title": "Fix lock file not released when setupRun fails",
101
- "description": "In src/execution/lifecycle/run-setup.ts around line 153-193, the lock is acquired during setupRun but if setupRun fails, it is outside the runner main try block so the lock is never released. Fix: ensure lock release in a finally block within setupRun, or move lock acquisition inside the runner try/finally.",
102
- "complexity": "medium",
103
- "status": "pending",
104
- "acceptanceCriteria": [
105
- "Lock file is released when setupRun throws an error",
106
- "Lock file is released on all error paths during setup",
107
- "Existing tests pass"
108
- ]
109
- },
110
- {
111
- "id": "FIX-C4",
112
- "title": "Replace uncancellable Bun.sleep timer in executor",
113
- "description": "In src/verification/executor.ts around line 97-100, Bun.sleep() is used for the timeout promise but cannot be cancelled. When the process exits quickly, the sleep continues for the full timeoutMs. Fix: replace with a clearable setTimeout-based promise pattern, clearing the timer in the success path.",
114
- "complexity": "simple",
115
- "status": "pending",
116
- "acceptanceCriteria": [
117
- "Timeout in executeWithTimeout uses clearable setTimeout not Bun.sleep",
118
- "Timer is cleared when process exits before timeout",
119
- "No timer leak after successful execution",
120
- "Existing tests pass"
121
- ]
122
- },
123
- {
124
- "id": "FIX-H5",
125
- "title": "Add hard deadline to async signal handlers",
126
- "description": "In src/execution/crash-recovery.ts around line 149-170, signal handlers contain multiple await operations. If any hangs, process.exit() is never reached. Fix: add a setTimeout hard deadline (e.g. 10s) at the top of each signal handler that calls process.exit() as a fallback.",
127
- "complexity": "simple",
128
- "status": "pending",
129
- "acceptanceCriteria": [
130
- "SIGTERM handler has a hard deadline timeout (10s) that calls process.exit",
131
- "SIGINT handler has the same hard deadline",
132
- "Hard deadline fires even if async operations hang",
133
- "Existing tests pass"
134
- ]
135
- }
136
- ]
137
- }
@@ -1,205 +0,0 @@
1
- {
2
- "project": "nax",
3
- "feature": "precheck",
4
- "branchName": "feat/precheck",
5
- "createdAt": "2026-02-27T10:00:00Z",
6
- "userStories": [
7
- {
8
- "id": "US-001",
9
- "title": "Precheck types and check implementations",
10
- "description": "Create src/precheck/types.ts with PrecheckResult, CheckStatus, CheckTier types. Create src/precheck/checks.ts with individual check implementations. Tier 1 blockers: git repo exists, working tree clean, no stale lock (>2h), PRD valid (required fields: id, title, description), Claude CLI available, dependencies installed (detect node_modules/target/venv/vendor), test/lint/typecheck commands work (from config, skip if not configured), git user configured. Tier 2 warnings: CLAUDE.md exists, disk space >1GB, pending stories exist, missing optional commands. Each check returns {name, tier, passed, message}. Tier 2 warning: .gitignore exists and covers nax runtime files (nax.lock, nax/features/*/runs/, test/tmp/).",
11
- "acceptanceCriteria": [
12
- "PrecheckResult type includes blockers[] and warnings[] arrays",
13
- "Git repo check uses git rev-parse --git-dir",
14
- "Working tree check uses git status --porcelain",
15
- "Stale lock detection: nax.lock older than 2 hours",
16
- "PRD validation checks id, title, description per story",
17
- "PRD auto-defaults missing optional fields in-memory (tags=[], status=pending, storyPoints=1)",
18
- "Claude CLI check runs claude --version",
19
- "Dependency detection is language-aware (node_modules, target, venv, vendor)",
20
- "Test/lint/typecheck commands read from config.execution",
21
- "Commands set to null/false are skipped silently",
22
- "Disk space warning triggers below 1GB",
23
- ".gitignore warning if missing or does not cover nax.lock, runs/, test/tmp/"
24
- ],
25
- "dependencies": [],
26
- "tags": [
27
- "precheck",
28
- "types"
29
- ],
30
- "status": "passed",
31
- "attempts": 2,
32
- "priorErrors": [
33
- "Attempt 1 failed with model tier: balanced",
34
- "Attempt 2 failed with model tier: balanced",
35
- "Attempt 1 failed with model tier: balanced"
36
- ],
37
- "escalations": [],
38
- "routing": {
39
- "complexity": "complex",
40
- "modelTier": "powerful",
41
- "testStrategy": "three-session-tdd-lite",
42
- "reasoning": "three-session-tdd-lite: complexity:complex, strategy:lite"
43
- }
44
- },
45
- {
46
- "id": "US-002",
47
- "title": "Precheck orchestrator with formatted output",
48
- "description": "Create src/precheck/index.ts. Runs all checks from checks.ts in order. Stops on first Tier 1 blocker (fail-fast). Collects all Tier 2 warnings. Formats human-readable output with emoji indicators (checkmark/cross/warning). Supports --json flag for machine-readable output. Returns summary with counts (checks, passed, failed, warnings).",
49
- "acceptanceCriteria": [
50
- "Runs Tier 1 checks first, stops on first failure",
51
- "Runs all Tier 2 checks even if some warn",
52
- "Human output shows emoji per check result",
53
- "JSON output matches spec schema (passed, blockers, warnings, summary, feature)",
54
- "Exit code 0 for pass, 1 for blocker, 2 for invalid PRD",
55
- "Summary line shows total checks/passed/failed/warnings"
56
- ],
57
- "dependencies": [
58
- "US-001"
59
- ],
60
- "tags": [
61
- "precheck",
62
- "orchestrator"
63
- ],
64
- "status": "passed",
65
- "attempts": 1,
66
- "priorErrors": [
67
- "Attempt 1 failed with model tier: balanced"
68
- ],
69
- "escalations": []
70
- },
71
- {
72
- "id": "US-003",
73
- "title": "CLI nax precheck command with --json flag",
74
- "description": "Create src/commands/precheck.ts, register in CLI (bin/nax.ts). Uses resolveProject() from US-001 of v0.12.0. Supports -f <feature>, -d <dir>, --json flags. Runs precheck orchestrator and displays results. Uses same project resolver as nax status/logs.",
75
- "acceptanceCriteria": [
76
- "Registered as nax precheck subcommand",
77
- "Uses resolveProject() for directory resolution",
78
- "-f flag specifies feature to validate",
79
- "-d flag specifies working directory",
80
- "--json flag outputs machine-readable JSON",
81
- "Without --json shows human-friendly formatted output",
82
- "Exit codes: 0=pass, 1=blocker, 2=invalid PRD"
83
- ],
84
- "dependencies": [
85
- "US-002"
86
- ],
87
- "tags": [
88
- "cli",
89
- "precheck"
90
- ],
91
- "status": "passed",
92
- "attempts": 2,
93
- "priorErrors": [
94
- "Attempt 1 failed with model tier: balanced",
95
- "Attempt 2 failed with model tier: balanced",
96
- "Attempt 1 failed with model tier: balanced"
97
- ],
98
- "escalations": [],
99
- "routing": {
100
- "complexity": "medium",
101
- "modelTier": "powerful",
102
- "testStrategy": "three-session-tdd-lite",
103
- "reasoning": "three-session-tdd-lite: strategy:lite"
104
- },
105
- "passes": true
106
- },
107
- {
108
- "id": "US-004",
109
- "title": "Integrate precheck into nax run",
110
- "description": "Modify src/execution/runner.ts to run precheck before story execution loop. If precheck fails (any Tier 1 blocker), abort run with clear error message pointing to nax precheck for details. Warnings are logged but execution continues. Add --skip-precheck flag to bypass (for advanced users).",
111
- "acceptanceCriteria": [
112
- "Precheck runs automatically before first story",
113
- "Tier 1 blocker aborts run with descriptive error",
114
- "Tier 2 warnings logged but don't block execution",
115
- "--skip-precheck flag bypasses all checks",
116
- "Precheck results included in run JSONL log",
117
- "Failed precheck updates status.json with precheck-failed status"
118
- ],
119
- "dependencies": [
120
- "US-002"
121
- ],
122
- "tags": [
123
- "runner",
124
- "integration"
125
- ],
126
- "status": "passed",
127
- "attempts": 1,
128
- "priorErrors": [
129
- "Attempt 1 failed with model tier: balanced"
130
- ],
131
- "escalations": [],
132
- "passes": true
133
- },
134
- {
135
- "id": "US-005",
136
- "title": "Config-driven review commands replacing hardcoded lint",
137
- "description": "Modify src/pipeline/stages/review/runner.ts to use config-driven command resolution instead of hardcoded 'bun run lint'. Resolution order: 1) explicit config.execution.lintCommand, 2) package.json has 'lint' script -> 'bun run lint', 3) not found -> skip with warning. Same for typecheckCommand. Setting to null explicitly disables. This fixes BUG-005.",
138
- "acceptanceCriteria": [
139
- "Review stage reads lintCommand from config.execution",
140
- "Review stage reads typecheckCommand from config.execution",
141
- "Resolution order: config -> package.json -> skip",
142
- "Setting command to null/false explicitly disables it",
143
- "Missing command logs warning instead of failing",
144
- "Config schema updated with lintCommand and typecheckCommand fields",
145
- "BUG-005 (hardcoded bun run lint) is resolved"
146
- ],
147
- "dependencies": [],
148
- "tags": [
149
- "review",
150
- "config"
151
- ],
152
- "status": "passed",
153
- "attempts": 2,
154
- "priorErrors": [
155
- "Attempt 1 failed with model tier: balanced",
156
- "Attempt 2 failed with model tier: balanced",
157
- "Attempt 1 failed with model tier: balanced"
158
- ],
159
- "escalations": [],
160
- "routing": {
161
- "complexity": "medium",
162
- "modelTier": "powerful",
163
- "testStrategy": "three-session-tdd-lite",
164
- "reasoning": "three-session-tdd-lite: strategy:lite"
165
- }
166
- },
167
- {
168
- "id": "US-006",
169
- "title": "PRD auto-default and router tags fix",
170
- "description": "Fix src/routing/router.ts line ~277 to use tags ?? [] as defensive fallback (prevents crash on missing tags). During precheck and run initialization, auto-default missing optional PRD fields in-memory: tags->[], status->pending, storyPoints->1, acceptanceCriteria->[]. Do not modify the PRD file on disk. This fixes BUG-004 properly at the source.",
171
- "acceptanceCriteria": [
172
- "Router uses tags ?? [] for spread operations",
173
- "PRD loader auto-defaults tags=[] when missing",
174
- "PRD loader auto-defaults status=pending when missing",
175
- "PRD loader auto-defaults storyPoints=1 when missing",
176
- "PRD file on disk is not modified",
177
- "Existing values are preserved (only fills missing)"
178
- ],
179
- "dependencies": [],
180
- "tags": [
181
- "fix",
182
- "prd"
183
- ],
184
- "status": "passed",
185
- "attempts": 2,
186
- "priorErrors": [
187
- "Attempt 1 failed with model tier: balanced",
188
- "Attempt 2 failed with model tier: balanced",
189
- "Attempt 1 failed with model tier: balanced"
190
- ],
191
- "escalations": [],
192
- "routing": {
193
- "complexity": "medium",
194
- "modelTier": "powerful",
195
- "testStrategy": "three-session-tdd-lite",
196
- "reasoning": "three-session-tdd-lite: strategy:lite"
197
- }
198
- }
199
- ],
200
- "analyzeConfig": {
201
- "maxStories": 15,
202
- "granularity": "medium"
203
- },
204
- "updatedAt": "2026-02-27T14:10:37.423Z"
205
- }
@@ -1,15 +0,0 @@
1
- [2026-02-27T11:20:44.967Z] US-001 — FAILED — Precheck types and check implementations — All tiers exhausted
2
- [2026-02-27T11:22:41.995Z] US-005 — FAILED — Config-driven review commands replacing hardcoded lint — All tiers exhausted
3
- [2026-02-27T11:24:08.156Z] US-006 — FAILED — PRD auto-default and router tags fix — All tiers exhausted
4
- [2026-02-27T12:12:00.514Z] US-001 — FAILED — Precheck types and check implementations — All tiers exhausted
5
- [2026-02-27T15:30:00.000Z] US-003 — PASSED — CLI nax precheck command with --json flag — Implementation complete
6
-
7
- Implementation summary:
8
- - Created src/commands/precheck.ts with precheckCommand()
9
- - Registered command in bin/nax.ts with -f, -d, and --json flags
10
- - Uses resolveProject() for directory resolution (same as status/logs)
11
- - Calls runPrecheck() orchestrator from US-002
12
- - Returns proper exit codes: 0=pass, 1=blocker, 2=invalid PRD
13
- - 7 integration tests in test/integration/cli-precheck.test.ts
14
- - All acceptance criteria verified
15
- [2026-02-27T14:00:33.162Z] US-003 — FAILED — CLI nax precheck command with --json flag — All tiers exhausted
@@ -1,152 +0,0 @@
1
- {
2
- "project": "nax-prompt-builder",
3
- "branchName": "feat/prompt-builder",
4
- "feature": "prompt-builder",
5
- "updatedAt": "2026-03-08T07:39:46.206Z",
6
- "userStories": [
7
- {
8
- "id": "PB-001",
9
- "title": "Create PromptBuilder class with layered section architecture",
10
- "description": "Currently nax has 11 scattered prompt-building functions across src/tdd/prompts.ts and src/execution/prompts.ts. There is no unified entry point, no user override support, and adding a new prompt variable requires touching multiple files. Introduce a PromptBuilder class in src/prompts/builder.ts with a fluent API. The builder composes a prompt from ordered sections: (1) Constitution, (2) Role task, (3) User override OR default template body, (4) Story context, (5) Isolation rules, (6) Context markdown, (7) Conventions footer. Each section is a typed unit independently testable. The builder is the single entry point — all existing prompt-building calls are migrated to use it.",
11
- "acceptanceCriteria": [
12
- "src/prompts/builder.ts exports PromptBuilder class with fluent API: PromptBuilder.for(role, options).story(story).context(md).constitution(c).override(path).build()",
13
- "PromptBuilder.build() returns Promise<string> — async to support file loading for overrides",
14
- "Section precedence enforced: constitution first, role task prepended, isolation rules appended, story context always included, conventions footer always last",
15
- "Non-overridable sections (isolation rules, story context, conventions footer) cannot be removed by user override",
16
- "src/prompts/types.ts exports: PromptRole ('test-writer' | 'implementer' | 'verifier' | 'single-session'), PromptSection interface, PromptOptions type",
17
- "Unit tests: verify section order for each role; verify non-overridable sections always present; verify missing override falls through to default template"
18
- ],
19
- "complexity": "medium",
20
- "status": "passed",
21
- "tags": [
22
- "feature",
23
- "prompts",
24
- "architecture"
25
- ],
26
- "attempts": 0,
27
- "priorErrors": [],
28
- "priorFailures": [],
29
- "escalations": [],
30
- "dependencies": [],
31
- "storyPoints": 1,
32
- "routing": {
33
- "complexity": "medium",
34
- "initialComplexity": "medium",
35
- "testStrategy": "three-session-tdd-lite",
36
- "reasoning": "Class design with fluent API, async file loading, section composition/ordering logic, and section non-overridability enforcement.",
37
- "contentHash": "0a1c55a2430989f408b99f7b75a82491fc6606eb736f734386e36c61ccc143c9"
38
- },
39
- "passes": true
40
- },
41
- {
42
- "id": "PB-002",
43
- "title": "Implement typed sections: isolation, role-task, story, verdict, conventions",
44
- "description": "The PromptBuilder needs typed section builders that produce the non-overridable parts of each prompt. Five sections: (1) isolation.ts — generates isolation rules based on strict (no src/ access) or lite (may read src/, create stubs) mode; (2) role-task.ts — generates role definition for standard implementer (make failing tests pass) or lite implementer (write tests and implement); (3) story.ts — formats title, description, acceptance criteria; (4) verdict.ts — verifier verdict JSON schema instructions (non-overridable); (5) conventions.ts — bun test scoping warning and commit conventions.",
45
- "acceptanceCriteria": [
46
- "src/prompts/sections/isolation.ts exports buildIsolationSection(mode: 'strict' | 'lite'): string — strict forbids src/ modification, lite allows reading src/ and creating stubs",
47
- "src/prompts/sections/role-task.ts exports buildRoleTaskSection(variant: 'standard' | 'lite'): string — standard says 'make failing tests pass, do not modify test files', lite says 'write tests first then implement'",
48
- "src/prompts/sections/story.ts exports buildStorySection(story: UserStory): string — formats title, description, numbered acceptance criteria",
49
- "src/prompts/sections/verdict.ts exports buildVerdictSection(story: UserStory): string — identical content to current buildVerifierPrompt verdict instructions",
50
- "src/prompts/sections/conventions.ts exports buildConventionsSection(): string — includes bun test scoping warning and commit message instruction",
51
- "Each section function is pure (no side effects, no file I/O) and independently unit-testable",
52
- "Unit tests: isolation strict does not contain 'MAY read'; isolation lite contains 'MAY read src/'; role-task standard contains 'Do NOT modify test files'; role-task lite contains 'Write tests first'"
53
- ],
54
- "complexity": "simple",
55
- "status": "passed",
56
- "tags": [
57
- "feature",
58
- "prompts",
59
- "sections"
60
- ],
61
- "attempts": 0,
62
- "priorErrors": [],
63
- "priorFailures": [],
64
- "escalations": [],
65
- "dependencies": [],
66
- "storyPoints": 1,
67
- "passes": true
68
- },
69
- {
70
- "id": "PB-003",
71
- "title": "Implement default templates and user override loader",
72
- "description": "Each PromptRole needs a default template forming the overridable body of the prompt. Implement src/prompts/loader.ts which resolves and reads the user override file relative to workdir. If the path is missing or the file does not exist, the loader returns null and the default template is used. The NaxConfig schema gains a new optional prompts block: { overrides: { 'test-writer'?: string, 'implementer'?: string, 'verifier'?: string, 'single-session'?: string } }.",
73
- "acceptanceCriteria": [
74
- "src/prompts/templates/ contains test-writer.ts, implementer.ts, verifier.ts, single-session.ts — each exports a default template string (body section only, no story/isolation/conventions)",
75
- "src/prompts/loader.ts exports loadOverride(role: PromptRole, workdir: string, config: NaxConfig): Promise<string | null>",
76
- "Loader resolves path relative to workdir — e.g. '.nax/prompts/test-writer.md' -> '<workdir>/.nax/prompts/test-writer.md'",
77
- "Loader returns null (not error) when config.prompts is absent, role key is absent, or file does not exist",
78
- "Loader throws with clear message when file path is set but file is unreadable (permissions error)",
79
- "src/config/types.ts NaxConfig gains optional prompts?: { overrides?: Partial<Record<PromptRole, string>> }",
80
- "Unit tests: loader returns null when config.prompts undefined; returns null when file missing; returns content when file exists; throws on permission error"
81
- ],
82
- "complexity": "simple",
83
- "status": "passed",
84
- "tags": [
85
- "feature",
86
- "prompts",
87
- "config",
88
- "loader"
89
- ],
90
- "attempts": 0,
91
- "priorErrors": [],
92
- "priorFailures": [],
93
- "escalations": [],
94
- "dependencies": [],
95
- "storyPoints": 1,
96
- "passes": true
97
- },
98
- {
99
- "id": "PB-004",
100
- "title": "Migrate all existing prompt-building call sites to PromptBuilder",
101
- "description": "Replace the 6 user-facing scattered prompt functions with PromptBuilder calls. Mapping: buildTestWriterPrompt -> PromptBuilder.for('test-writer', { isolation: 'strict' }); buildTestWriterLitePrompt -> PromptBuilder.for('test-writer', { isolation: 'lite' }); buildImplementerPrompt -> PromptBuilder.for('implementer', { variant: 'standard' }); buildImplementerLitePrompt -> PromptBuilder.for('implementer', { variant: 'lite' }); buildVerifierPrompt -> PromptBuilder.for('verifier'); buildSingleSessionPrompt -> PromptBuilder.for('single-session'). Internal prompts (rectification, routing, batch) remain unchanged.",
102
- "acceptanceCriteria": [
103
- "All 6 user-facing prompt functions replaced with PromptBuilder calls in their respective call sites",
104
- "buildImplementerRectificationPrompt, buildRectificationPrompt, buildBatchPrompt (execution), buildRoutingPrompt, buildBatchPrompt (routing) remain unchanged",
105
- "Generated prompt text for each role is semantically equivalent to previous output when no user override is set (no regression)",
106
- "All call sites pass workdir and config so the loader can check for overrides",
107
- "src/tdd/prompts.ts and src/execution/prompts.ts deleted or reduced to re-exports only if referenced by tests",
108
- "Integration test: build each of the 6 roles with no override, verify output contains story title, acceptance criteria, and role-specific instructions"
109
- ],
110
- "complexity": "medium",
111
- "status": "pending",
112
- "tags": [
113
- "feature",
114
- "prompts",
115
- "migration",
116
- "refactor"
117
- ],
118
- "attempts": 0,
119
- "priorErrors": [],
120
- "priorFailures": [],
121
- "escalations": [],
122
- "dependencies": [],
123
- "storyPoints": 1
124
- },
125
- {
126
- "id": "PB-005",
127
- "title": "Document prompts config in nax config --explain and add precheck validation",
128
- "description": "Users need to discover the prompts.overrides config block. Update nax config --explain to document it with example paths. Add a precheck warning (non-blocking) when a configured override file path does not exist at run start — surfaces the issue early rather than silently falling back to the default at runtime.",
129
- "acceptanceCriteria": [
130
- "nax config --explain output includes a 'prompts' section describing overrides for each role with example: '.nax/prompts/test-writer.md'",
131
- "src/precheck/checks-warnings.ts adds check: for each key in config.prompts?.overrides, if resolved file does not exist, emit warning 'Prompt override file not found for role <role>: <resolved-path>'",
132
- "Precheck warning is non-blocking — run continues with default template",
133
- "Precheck skipped when config.prompts absent or overrides empty",
134
- "Unit tests: override path exists -> no warning; override path set but file missing -> warning emitted; config.prompts absent -> no warning"
135
- ],
136
- "complexity": "simple",
137
- "status": "pending",
138
- "tags": [
139
- "feature",
140
- "prompts",
141
- "docs",
142
- "precheck"
143
- ],
144
- "attempts": 0,
145
- "priorErrors": [],
146
- "priorFailures": [],
147
- "escalations": [],
148
- "dependencies": [],
149
- "storyPoints": 1
150
- }
151
- ]
152
- }
@@ -1,3 +0,0 @@
1
- [2026-03-08T07:17:53.244Z] PB-001 — PASSED — Create PromptBuilder class with layered section architecture — Cost: $0.3280
2
- [2026-03-08T07:29:04.611Z] PB-002 — PASSED — Implement typed sections: isolation, role-task, story, verdict, conventions — Cost: $0.1821
3
- [2026-03-08T07:39:44.184Z] PB-003 — PASSED — Implement default templates and user override loader — Cost: $0.2823
@@ -1,55 +0,0 @@
1
- {
2
- "project": "nax-review-quality",
3
- "branchName": "feat/review-quality",
4
- "feature": "review-quality",
5
- "updatedAt": "2026-03-08T03:03:00.000Z",
6
- "userStories": [
7
- {
8
- "id": "RQ-001",
9
- "title": "Assert clean working tree before running review typecheck/lint (BUG-049)",
10
- "description": "The review stage runs bun run typecheck and bun run lint on the working tree, not the committed state. If the agent forgets to git add a file (e.g. types.ts with a new interface field), the uncommitted change is still on disk, typecheck passes against the local working tree, but the committed code has a type error. This was observed in the routing-persistence run: RRP-003 committed contentHash refs in routing.ts without the matching StoryRouting.contentHash field in types.ts — typecheck passed because types.ts was locally modified but not staged. Fix: before running built-in checks in review/runner.ts, assert that the working tree has no uncommitted changes to tracked files (git diff --name-only HEAD returns empty). If dirty, fail the review with a clear message listing the uncommitted files so the agent can stage and commit them.",
11
- "acceptanceCriteria": [
12
- "Before running typecheck or lint in runReview(), call git diff --name-only HEAD (covers both staged and unstaged tracked-file changes)",
13
- "If output is non-empty, return a ReviewResult with success: false and failureReason listing the uncommitted files",
14
- "Log at warn level via getSafeLogger() with stage 'review' and message 'Uncommitted changes detected before review: <files>'",
15
- "If working tree is clean, proceed with typecheck/lint as before — no regression for normal flow",
16
- "Unit tests: dirty working tree (mock git diff) returns review failure before running typecheck; clean working tree allows typecheck to run normally",
17
- "Unit tests: untracked files only (git diff HEAD returns empty) — review proceeds since only tracked changes matter"
18
- ],
19
- "complexity": "simple",
20
- "status": "pending",
21
- "tags": ["bug", "review", "typecheck"]
22
- },
23
- {
24
- "id": "RQ-002",
25
- "title": "Fix checkOptionalCommands precheck to use correct config resolution path (BUG-050)",
26
- "description": "The precheck check checkOptionalCommands() in src/precheck/checks-warnings.ts checks config.execution.lintCommand and config.execution.typecheckCommand — these are legacy fields that no longer exist in the current config schema. The actual runtime resolution chain used by review/runner.ts is: (1) execution.typecheckCommand, (2) review.commands.typecheck, (3) package.json scripts. As a result, the precheck always warns 'Optional commands not configured: lint, typecheck' even when review.commands.typecheck and review.commands.lint are properly set. Fix: update checkOptionalCommands() to resolve via the same priority chain as review/runner.ts:resolveCommand().",
27
- "acceptanceCriteria": [
28
- "checkOptionalCommands() resolves typecheck via: execution.typecheckCommand -> review.commands.typecheck -> package.json typecheck script",
29
- "checkOptionalCommands() resolves lint via: execution.lintCommand -> review.commands.lint -> package.json lint script",
30
- "If config.review.commands.typecheck is set, precheck passes with no warning",
31
- "If neither execution field, review.commands, nor package.json script exists, precheck still warns 'not configured'",
32
- "Unit tests: config with review.commands.typecheck set -> check passes; config with neither -> check warns; config with package.json script -> check passes"
33
- ],
34
- "complexity": "simple",
35
- "status": "pending",
36
- "tags": ["bug", "precheck", "config"]
37
- },
38
- {
39
- "id": "RQ-003",
40
- "title": "Consolidate dead quality.commands.typecheck/lint into review resolution chain (BUG-051)",
41
- "description": "QualityConfig.commands.typecheck and QualityConfig.commands.lint are declared in src/config/types.ts and documented in nax config --explain, but are never read by runtime code. The review runner reads only review.commands.typecheck/lint. Fix: make review/runner.ts:resolveCommand() also check quality.commands as a fallback after review.commands and before package.json. This gives quality.commands.typecheck semantic meaning without a breaking change. Do NOT remove the fields from QualityConfig — backward compatibility.",
42
- "acceptanceCriteria": [
43
- "review/runner.ts:resolveCommand() priority chain for typecheck: (1) execution.typecheckCommand, (2) review.commands.typecheck, (3) quality.commands.typecheck, (4) package.json typecheck script",
44
- "review/runner.ts:resolveCommand() priority chain for lint: (1) execution.lintCommand, (2) review.commands.lint, (3) quality.commands.lint, (4) package.json lint script",
45
- "Setting quality.commands.typecheck in config.json now correctly runs that command in the review stage",
46
- "review.commands.typecheck still takes precedence over quality.commands.typecheck when both are set",
47
- "CLI config --explain description for quality.commands.typecheck updated to note it is used as fallback in review stage",
48
- "Unit tests: quality.commands.typecheck set with review.commands.typecheck absent -> quality command used; both set -> review command takes precedence"
49
- ],
50
- "complexity": "simple",
51
- "status": "pending",
52
- "tags": ["bug", "config", "review"]
53
- }
54
- ]
55
- }