savepoint 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/.claude/settings.local.json +12 -1
  2. package/.github/workflows/ci.yml +20 -0
  3. package/.golangci.yml +11 -0
  4. package/.savepoint/Design.md +40 -38
  5. package/.savepoint/{audit/v1.1/E02-cross-platform-compatibility/proposals.md → releases/v1.1/epics/E02-cross-platform-compatibility/E02-Audit.md} +48 -38
  6. package/.savepoint/releases/v1.1/epics/E03-ui-visual-refinement/E03-Audit.md +195 -0
  7. package/.savepoint/releases/v1.1/epics/E03-ui-visual-refinement/E03-Detail.md +14 -1
  8. package/.savepoint/releases/v1.1/epics/E03-ui-visual-refinement/tasks/T006-forced-256-color-profile.md +3 -3
  9. package/.savepoint/{audit/v1.1/E04-epic-navigation/proposals.md → releases/v1.1/epics/E04-epic-navigation/E04-Audit.md} +65 -54
  10. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/E05-Audit.md +237 -0
  11. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/E05-Detail.md +25 -16
  12. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T001-update-agents-md.md +17 -6
  13. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T002-update-router-md.md +15 -5
  14. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T003-update-design-md.md +19 -5
  15. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T004-implement-m-hotkey.md +11 -1
  16. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T005-update-help-overlay.md +9 -6
  17. package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T006-tests-and-quality-gates.md +29 -13
  18. package/.savepoint/releases/v1.1/epics/E06-audit-command/E06-Audit.md +56 -0
  19. package/.savepoint/releases/v1.1/epics/E06-audit-command/E06-Detail.md +63 -0
  20. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T005-proposals.md +44 -0
  21. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T007-apply-close.md +35 -0
  22. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T009-integration.md +40 -0
  23. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T010-audit-file-migration.md +45 -0
  24. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T011-model-tab-state.md +26 -0
  25. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T012-epic-audit-render.md +33 -0
  26. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T013-handle-tab-keys.md +34 -0
  27. package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T014-tab-indicator.md +33 -0
  28. package/.savepoint/releases/v1.1/epics/E07-init-command/E07-Audit.md +336 -0
  29. package/.savepoint/releases/v1.1/epics/E07-init-command/E07-Detail.md +61 -0
  30. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T001-cli-entrypoint.md +37 -0
  31. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T002-target-validation.md +28 -0
  32. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T003-scaffold-writer.md +46 -0
  33. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T004-atomic-writes.md +27 -0
  34. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T005-magic-prompt.md +25 -0
  35. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T006-clipboard.md +26 -0
  36. package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T007-integration-test.md +26 -0
  37. package/.savepoint/releases/v1.1/epics/E08-board-command/E08-Audit.md +333 -0
  38. package/.savepoint/releases/v1.1/epics/E08-board-command/E08-Detail.md +68 -0
  39. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T001-cli-entrypoint.md +26 -0
  40. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T002-non-tty-fallback.md +27 -0
  41. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T003-tui-app-shell.md +28 -0
  42. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T004-board-model.md +29 -0
  43. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T005-detail-pane.md +27 -0
  44. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T006-status-transitions.md +29 -0
  45. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T007-theme-fallbacks.md +29 -0
  46. package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T008-integration-test.md +27 -0
  47. package/.savepoint/releases/v1.1/epics/E09-doctor-command/E09-Audit.md +207 -0
  48. package/.savepoint/releases/v1.1/epics/E09-doctor-command/E09-Detail.md +65 -0
  49. package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T001-cli-entrypoint.md +24 -0
  50. package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T002-config-router-validation.md +28 -0
  51. package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T003-structure-checks.md +29 -0
  52. package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T004-dependency-checks.md +27 -0
  53. package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T005-audit-orphan-checks.md +28 -0
  54. package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T006-quality-gates-report.md +31 -0
  55. package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/E11-Detail.md +36 -0
  56. package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T001-debug-logging.md +25 -0
  57. package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T002-increase-debounce.md +21 -0
  58. package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T003-error-handling.md +22 -0
  59. package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T004-test-verify.md +29 -0
  60. package/.savepoint/releases/v1.1/epics/E12-validation-fix/E12-Audit.md +444 -0
  61. package/.savepoint/releases/v1.1/epics/E12-validation-fix/E12-Detail.md +45 -0
  62. package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T001-default-phase.md +35 -0
  63. package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T002-default-status.md +19 -0
  64. package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T003-better-errors.md +29 -0
  65. package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T004-validate-on-write.md +25 -0
  66. package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T005-tests.md +37 -0
  67. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/E13-Audit.md +118 -0
  68. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/E13-Detail.md +73 -0
  69. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T001-safe-cleanup.md +66 -0
  70. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T002-bug-fixes.md +35 -0
  71. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T003-centralize-duplication.md +60 -0
  72. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T004-infrastructure.md +33 -0
  73. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T005-decompose-update.md +37 -0
  74. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T006-async-io.md +40 -0
  75. package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T007-test-coverage.md +37 -0
  76. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/E14-Audit.md +267 -0
  77. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/E14-Detail.md +54 -0
  78. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T001-group-model.md +39 -0
  79. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T002-data-interfaces.md +42 -0
  80. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T003-discover-orphans.md +33 -0
  81. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T004-epic-panel-headings.md +35 -0
  82. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T005-shell-tokenization.md +27 -0
  83. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T006-unify-enums.md +29 -0
  84. package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T007-testutil-package.md +28 -0
  85. package/.savepoint/releases/v1.1/epics/E15-hardening/E15-Audit.md +272 -0
  86. package/.savepoint/releases/v1.1/epics/E15-hardening/E15-Detail.md +60 -0
  87. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T001-benchmarks.md +31 -0
  88. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T002-fuzz-targets.md +34 -0
  89. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T003-debug-flag.md +30 -0
  90. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T004-dist-checksums.md +27 -0
  91. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T005-windows-targets.md +28 -0
  92. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T006-abbreviation-splitting.md +26 -0
  93. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T007-root-test-allowlist.md +33 -0
  94. package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T008-ci-and-release-automation.md +46 -0
  95. package/.savepoint/releases/v1.1/epics/_archived/T001-cli-entrypoint.md +25 -0
  96. package/.savepoint/releases/v1.1/epics/_archived/T002-quality-gates.md +27 -0
  97. package/.savepoint/releases/v1.1/epics/_archived/T003-snapshot.md +27 -0
  98. package/.savepoint/releases/v1.1/epics/_archived/T004-ai-reconcile.md +29 -0
  99. package/.savepoint/releases/v1.1/epics/_archived/T006-tui-review.md +31 -0
  100. package/.savepoint/releases/v1.1/epics/_archived/T008-skip-handling.md +34 -0
  101. package/.savepoint/releases/v1.1/v1.1-PRD.md +67 -7
  102. package/.savepoint/router.md +10 -17
  103. package/AGENTS.md +39 -24
  104. package/Makefile +3 -1
  105. package/README.md +0 -1
  106. package/agent-skills/savepoint-audit/SKILL.md +86 -34
  107. package/agent-skills/savepoint-build-task/SKILL.md +7 -2
  108. package/agent-skills/savepoint-create-plan/SKILL.md +7 -2
  109. package/agent-skills/savepoint-create-task/SKILL.md +44 -31
  110. package/agent-skills/savepoint-draft-prd/SKILL.md +7 -2
  111. package/agent-skills/savepoint-system-design/SKILL.md +7 -2
  112. package/agent_skills_test.go +91 -0
  113. package/cmd/board.go +59 -0
  114. package/cmd/board_test.go +137 -0
  115. package/cmd/doctor.go +53 -0
  116. package/cmd/doctor_test.go +146 -0
  117. package/cmd/init.go +63 -0
  118. package/cmd/init_test.go +104 -0
  119. package/internal/board/board.go +44 -36
  120. package/internal/board/board_test.go +27 -82
  121. package/internal/board/card.go +43 -23
  122. package/internal/board/card_test.go +74 -5
  123. package/internal/board/column.go +75 -15
  124. package/internal/board/column_test.go +76 -2
  125. package/internal/board/debug.go +26 -0
  126. package/internal/board/debug_test.go +108 -0
  127. package/internal/board/detail.go +33 -47
  128. package/internal/board/detail_test.go +48 -0
  129. package/internal/board/epic_panel.go +120 -22
  130. package/internal/board/epic_panel_test.go +302 -17
  131. package/internal/board/help.go +1 -0
  132. package/internal/board/help_test.go +1 -0
  133. package/internal/board/integration_test.go +266 -0
  134. package/internal/board/interfaces.go +65 -0
  135. package/internal/board/interfaces_test.go +114 -0
  136. package/internal/board/io.go +93 -0
  137. package/internal/board/model.go +79 -118
  138. package/internal/board/plain.go +88 -0
  139. package/internal/board/plain_test.go +117 -0
  140. package/internal/board/release.go +1 -9
  141. package/internal/board/release_test.go +6 -6
  142. package/internal/board/status.go +4 -4
  143. package/internal/board/theme.go +24 -0
  144. package/internal/board/theme_test.go +31 -0
  145. package/internal/board/transitions.go +113 -88
  146. package/internal/board/transitions_test.go +164 -141
  147. package/internal/board/tui.go +32 -0
  148. package/internal/board/update.go +344 -215
  149. package/internal/board/update_test.go +326 -18
  150. package/internal/board/util.go +76 -0
  151. package/internal/board/view.go +31 -28
  152. package/internal/board/view_test.go +74 -2
  153. package/internal/board/watch.go +41 -5
  154. package/internal/buildtool/main.go +45 -15
  155. package/internal/buildtool/main_test.go +224 -0
  156. package/internal/data/config.go +17 -3
  157. package/internal/data/config_test.go +49 -0
  158. package/internal/data/discover.go +26 -0
  159. package/internal/data/discover_test.go +34 -10
  160. package/internal/data/errors.go +4 -0
  161. package/internal/data/fuzz_test.go +75 -0
  162. package/internal/data/lifecycle.go +13 -6
  163. package/internal/data/lifecycle_test.go +14 -11
  164. package/internal/data/parser.go +22 -6
  165. package/internal/data/parser_test.go +31 -7
  166. package/internal/data/task.go +0 -9
  167. package/internal/data/testdata/fuzz/FuzzSplitFrontmatterBody/68eb66b0fe91e7e3 +2 -0
  168. package/internal/data/write.go +88 -11
  169. package/internal/data/write_test.go +167 -0
  170. package/internal/doctor/checks.go +567 -0
  171. package/internal/doctor/checks_test.go +716 -0
  172. package/internal/doctor/gates.go +193 -0
  173. package/internal/doctor/gates_test.go +166 -0
  174. package/internal/doctor/interfaces.go +64 -0
  175. package/internal/doctor/interfaces_test.go +104 -0
  176. package/internal/doctor/repairs.go +80 -0
  177. package/internal/doctor/repairs_test.go +81 -0
  178. package/internal/doctor/report.go +157 -0
  179. package/internal/doctor/report_test.go +89 -0
  180. package/internal/init/clipboard.go +146 -0
  181. package/internal/init/clipboard_test.go +74 -0
  182. package/internal/init/install.go +16 -0
  183. package/internal/init/integration_test.go +197 -0
  184. package/internal/init/prompt.go +14 -0
  185. package/internal/init/prompt_test.go +77 -0
  186. package/internal/init/scaffold.go +59 -0
  187. package/internal/init/scaffold_test.go +179 -0
  188. package/internal/init/template_freshness_test.go +56 -0
  189. package/internal/init/validate.go +85 -0
  190. package/internal/init/validate_test.go +141 -0
  191. package/internal/init/write.go +73 -0
  192. package/internal/init/write_test.go +91 -0
  193. package/internal/styles/styles_test.go +133 -0
  194. package/internal/testutil/fixture.go +113 -0
  195. package/internal/testutil/fs.go +26 -0
  196. package/main.go +120 -4
  197. package/package.json +2 -2
  198. package/project-audit/audit_report_glm_5.1.md +411 -0
  199. package/project-audit/audit_report_opus_4.6.md +406 -0
  200. package/project-audit/consolidated-audit-report.md +456 -0
  201. package/templates/project/.savepoint/Design.md +2 -2
  202. package/templates/project/.savepoint/router.md +10 -10
  203. package/templates/project/AGENTS.md +33 -21
  204. package/templates/project/agent-skills/savepoint-audit/SKILL.md +87 -0
  205. package/templates/project/agent-skills/savepoint-build-task/SKILL.md +44 -0
  206. package/templates/project/agent-skills/savepoint-create-plan/SKILL.md +33 -0
  207. package/templates/project/agent-skills/savepoint-create-task/SKILL.md +44 -0
  208. package/templates/project/agent-skills/savepoint-draft-prd/SKILL.md +37 -0
  209. package/templates/project/agent-skills/savepoint-system-design/SKILL.md +38 -0
  210. package/templates/prompts/audit-reconciliation.prompt.md +33 -28
  211. package/templates/prompts/design.prompt.md +3 -1
  212. package/.savepoint/audit/v1/E01/proposals.md +0 -168
  213. package/.savepoint/audit/v1/E01/snapshot.md +0 -78
  214. package/.savepoint/audit/v1/E01-go-setup/proposals.md +0 -166
  215. package/.savepoint/audit/v1/E01-go-setup/snapshot.md +0 -71
  216. package/.savepoint/audit/v1/E01-scaffolding/proposals/AGENTS.md +0 -66
  217. package/.savepoint/audit/v1/E01-scaffolding/proposals/Design.md +0 -210
  218. package/.savepoint/audit/v1/E01-scaffolding/proposals/epic-Design.md +0 -117
  219. package/.savepoint/audit/v1/E01-scaffolding/proposals/quality-review.md +0 -101
  220. package/.savepoint/audit/v1/E01-scaffolding/snapshot.md +0 -54
  221. package/.savepoint/audit/v1/E02-data-model/snapshot.md +0 -128
  222. package/.savepoint/audit/v1/E02-data-readers/proposals.md +0 -123
  223. package/.savepoint/audit/v1/E02-data-readers/snapshot.md +0 -54
  224. package/.savepoint/audit/v1/E03-board-tui-core/proposals.md +0 -146
  225. package/.savepoint/audit/v1/E03-board-tui-core/snapshot.md +0 -57
  226. package/.savepoint/audit/v1/E03-cli-foundation/snapshot.md +0 -106
  227. package/.savepoint/audit/v1/E04-board-components/proposals.md +0 -118
  228. package/.savepoint/audit/v1/E04-board-components/snapshot.md +0 -77
  229. package/.savepoint/audit/v1/E04-templates-and-prompts/snapshot.md +0 -115
  230. package/.savepoint/audit/v1/E05-init-command/snapshot.md +0 -125
  231. package/.savepoint/audit/v1/E05-phase-transitions/proposals.md +0 -83
  232. package/.savepoint/audit/v1/E05-phase-transitions/snapshot.md +0 -36
  233. package/.savepoint/audit/v1/E06-atari-noir-layout/proposals.md +0 -130
  234. package/.savepoint/audit/v1/E06-atari-noir-layout/snapshot.md +0 -84
  235. package/.savepoint/audit/v1/E06-tui-board/snapshot.md +0 -64
  236. package/.savepoint/audit/v1/E07-audit-pipeline/snapshot.md +0 -165
  237. package/.savepoint/audit/v1/E08-board-workflow-cleanup/snapshot.md +0 -65
  238. package/.savepoint/audit/v1.1/E02-cross-platform-compatibility/snapshot.md +0 -41
  239. package/.savepoint/audit/v1.1/E04-epic-navigation/snapshot.md +0 -48
  240. package/ink-cli-ui-design.zip +0 -0
  241. package/savepoint +0 -0
  242. package/savepoint.exe +0 -0
@@ -0,0 +1,207 @@
1
+ ---
2
+ type: audit-findings
3
+ audited: 2026-05-03
4
+ ---
5
+ # Audit Findings: E09 Doctor Command
6
+
7
+ ## Main Findings
8
+
9
+ Applied audit proposals for E09. The `doctor` structure check now validates the active `{release}-PRD.md` layout instead of the obsolete `PRD.md` filename, and the related tests and repair suggestion were updated. During verification, the repair switch was also tightened so the specific release PRD hint is not shadowed by the generic release-directory hint.
10
+
11
+ Design.md, AGENTS.md, and E09-Detail.md now document the implemented doctor command and `internal/doctor/` module. E09 is marked audited and Design.md `last_audited` points to `v1.1/E09-doctor-command`.
12
+
13
+ Residual process note: the E09 task files still lack the required `## Context Files` sections. That does not block the applied code fix, but it should be corrected in future task authoring.
14
+
15
+ Verification after apply: `go build ./...` and `go test ./...` passed. `make build && make test` remains unavailable in this environment because `make` is not installed.
16
+
17
+ ## Code Style Review
18
+
19
+ - [x] One job per file
20
+ - [x] One-sentence functions
21
+ - [x] Test branches
22
+ - [x] Types are documentation
23
+ - [x] Build, don't speculate
24
+ - [x] Errors at boundaries
25
+ - [x] One source of truth
26
+ - [x] Comments explain WHY
27
+ - [x] Content in data files
28
+ - [x] Small diffs - the implementation fix was narrowly scoped; the remaining context-section note is process cleanup, not product code risk.
29
+
30
+ ## Proposed Changes
31
+
32
+ ### Target File
33
+ internal/doctor/checks.go
34
+
35
+ ### Replace
36
+ ```go
37
+ for _, release := range releases {
38
+ checkReleasePRD(release.Path, &problems)
39
+ ```
40
+
41
+ ### With
42
+ ```go
43
+ for _, release := range releases {
44
+ checkReleasePRD(release.Path, release.ID, &problems)
45
+ ```
46
+
47
+ ### Target File
48
+ internal/doctor/checks.go
49
+
50
+ ### Replace
51
+ ```go
52
+ func checkReleasePRD(releasePath string, problems *[]Problem) {
53
+ prdPath := filepath.Join(releasePath, "PRD.md")
54
+ ```
55
+
56
+ ### With
57
+ ```go
58
+ func checkReleasePRD(releasePath string, releaseID string, problems *[]Problem) {
59
+ prdPath := filepath.Join(releasePath, releaseID+"-PRD.md")
60
+ ```
61
+
62
+ ### Target File
63
+ internal/doctor/checks.go
64
+
65
+ ### Replace
66
+ ```go
67
+ *problems = append(*problems, Problem{File: prdPath, Message: "release PRD.md not found"})
68
+ ```
69
+
70
+ ### With
71
+ ```go
72
+ *problems = append(*problems, Problem{File: prdPath, Message: "release PRD file not found"})
73
+ ```
74
+
75
+ ### Target File
76
+ internal/doctor/repairs.go
77
+
78
+ ### Replace
79
+ ```go
80
+ case contains(p.Message, "PRD.md not found"):
81
+ return "Create a PRD.md with frontmatter for the release"
82
+ ```
83
+
84
+ ### With
85
+ ```go
86
+ case contains(p.Message, "release PRD file not found"):
87
+ return "Create a {release}-PRD.md file with frontmatter for the release"
88
+ ```
89
+
90
+ ### Target File
91
+ internal/doctor/checks_test.go
92
+
93
+ ### Replace
94
+ ```go
95
+ writeFile(t, filepath.Join(releasePath, "PRD.md"), "---\ntype: project-prd\nstatus: active\n---\n\n# Release\n")
96
+ ```
97
+
98
+ ### With
99
+ ```go
100
+ writeFile(t, filepath.Join(releasePath, filepath.Base(releasePath)+"-PRD.md"), "---\ntype: project-prd\nstatus: active\n---\n\n# Release\n")
101
+ ```
102
+
103
+ ### Target File
104
+ internal/doctor/report_test.go
105
+
106
+ ### Replace
107
+ ```go
108
+ writeFile(t, filepath.Join(releasePath, "PRD.md"), "---\ntype: project-prd\nstatus: active\n---\n\n# Release\n")
109
+ ```
110
+
111
+ ### With
112
+ ```go
113
+ writeFile(t, filepath.Join(releasePath, "v1-PRD.md"), "---\ntype: project-prd\nstatus: active\n---\n\n# Release\n")
114
+ ```
115
+
116
+ ### Target File
117
+ .savepoint/Design.md
118
+
119
+ ### Replace
120
+ ```md
121
+ - **Board command** (`savepoint board`, and bare `savepoint`) reads project state, renders the Atari-Noir TUI board when stdout is a TTY, falls back to a deterministic plain table in non-TTY mode, supports `--release`/`--epic` filtering, detail overlays, task status transitions with mtime-guarded writes, release/epic-scoped router priority markers, fsnotify-based task auto-refresh (epic E06), header Next Activity display, height-aware column/detail viewport scrolling, stable focused/unfocused column border geometry (v1.1 E01), dedicated phase-colored Next Activity line below the header, sentence-boundary checklist rendering in task details, shared status glyph mapping for task cards and the epic sidebar, a forced ANSI256 Lipgloss color profile for board startup (v1.1 E03), a focusable wide-screen epic sidebar with purple epic focus, epic detail overlays, and status glyphs loaded from epic detail frontmatter (v1.1 E04), and an epic Detail/Audit tab switch that renders user-facing audit findings from `{epic}/E##-Audit.md` (v1.1 E06).
122
+ ```
123
+
124
+ ### With
125
+ ```md
126
+ - **Board command** (`savepoint board`, and bare `savepoint`) reads project state, renders the Atari-Noir TUI board when stdout is a TTY, falls back to a deterministic plain table in non-TTY mode, supports `--release`/`--epic` filtering, detail overlays, task status transitions with mtime-guarded writes, release/epic-scoped router priority markers, fsnotify-based task auto-refresh (epic E06), header Next Activity display, height-aware column/detail viewport scrolling, stable focused/unfocused column border geometry (v1.1 E01), dedicated phase-colored Next Activity line below the header, sentence-boundary checklist rendering in task details, shared status glyph mapping for task cards and the epic sidebar, a forced ANSI256 Lipgloss color profile for board startup (v1.1 E03), a focusable wide-screen epic sidebar with purple epic focus, epic detail overlays, and status glyphs loaded from epic detail frontmatter (v1.1 E04), and an epic Detail/Audit tab switch that renders user-facing audit findings from `{epic}/E##-Audit.md` (v1.1 E06).
127
+ - **Doctor command** (`savepoint doctor`, `savepoint doctor --epic E##`) runs read-only integrity diagnostics for config, router state, release/epic/task structure, frontmatter validity, acceptance criteria presence, dependencies, duplicate task IDs, stale audit files, orphaned task IDs, and configured quality gates. It prints a human-readable report with repair suggestions and exits 0 when clean, 1 when problems are diagnosed, and 2 for internal or invocation failures.
128
+ ```
129
+
130
+ ### Target File
131
+ .savepoint/Design.md
132
+
133
+ ### Replace
134
+ ```md
135
+ | `cmd/` | CLI command arg parsing and dispatch for init and board |
136
+ ```
137
+
138
+ ### With
139
+ ```md
140
+ | `cmd/` | CLI command arg parsing and dispatch for init, board, and doctor |
141
+ ```
142
+
143
+ ### Target File
144
+ .savepoint/Design.md
145
+
146
+ ### Replace
147
+ ```md
148
+ | `internal/board/` | TUI board, overlays, epic sidebar, Next Activity line, router priority key, detail checklist rendering, status glyphs, forced color profile |
149
+ | `internal/buildtool/` | Makefile helper, cross-compile, archives |
150
+ ```
151
+
152
+ ### With
153
+ ```md
154
+ | `internal/board/` | TUI board, overlays, epic sidebar, Next Activity line, router priority key, detail checklist rendering, status glyphs, forced color profile |
155
+ | `internal/buildtool/` | Makefile helper, cross-compile, archives |
156
+ | `internal/doctor/` | Read-only project diagnostics, integrity checks, quality gate execution, report formatting, repair suggestions |
157
+ ```
158
+
159
+ ### Target File
160
+ AGENTS.md
161
+
162
+ ### Replace
163
+ ```md
164
+ | `cmd/` | CLI command arg parsing and dispatch for init and board |
165
+ ```
166
+
167
+ ### With
168
+ ```md
169
+ | `cmd/` | CLI command arg parsing and dispatch for init, board, and doctor |
170
+ ```
171
+
172
+ ### Target File
173
+ AGENTS.md
174
+
175
+ ### Replace
176
+ ```md
177
+ | `internal/board/` | TUI board, overlays, epic sidebar, Next Activity line, router priority key, detail checklist rendering, status glyphs, forced color profile |
178
+ | `internal/buildtool/` | Makefile helper, cross-compile, archives |
179
+ ```
180
+
181
+ ### With
182
+ ```md
183
+ | `internal/board/` | TUI board, overlays, epic sidebar, Next Activity line, router priority key, detail checklist rendering, status glyphs, forced color profile |
184
+ | `internal/buildtool/` | Makefile helper, cross-compile, archives |
185
+ | `internal/doctor/` | Read-only project diagnostics, integrity checks, quality gate execution, report formatting, repair suggestions |
186
+ ```
187
+
188
+ ### Target File
189
+ .savepoint/releases/v1.1/epics/E09-doctor-command/E09-Detail.md
190
+
191
+ ### Replace
192
+ ```md
193
+ ## Boundaries
194
+ ```
195
+
196
+ ### With
197
+ ```md
198
+ ## Implemented As
199
+
200
+ - `cmd/doctor.go` parses `doctor [--epic <epic>]`, reports help, rejects unsupported arguments, and delegates execution through an injected runner.
201
+ - `main.go` wires `savepoint doctor` to `internal/doctor.RunAllChecks` and preserves the required 0/1/2 exit-code contract.
202
+ - `internal/doctor/checks.go` implements config, router, structure, dependency, duplicate ID, audit-state, and orphan diagnostics.
203
+ - `internal/doctor/gates.go`, `report.go`, and `repairs.go` run configured quality gates, format human-readable reports, and attach repair suggestions.
204
+ - Tests live in `cmd/doctor_test.go` and `internal/doctor/*_test.go`.
205
+
206
+ ## Boundaries
207
+ ```
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: epic-design
3
+ status: audited
4
+ ---
5
+
6
+ # E09: Doctor Command
7
+
8
+ ## Purpose
9
+
10
+ Implement `savepoint doctor`, the diagnostic command for corrupted or inconsistent Savepoint projects. Doctor reports problems and suggested repairs, but does not make destructive changes automatically.
11
+
12
+ ## Interface
13
+
14
+ ```bash
15
+ savepoint doctor # run all checks
16
+ savepoint doctor --epic E03 # check specific epic
17
+ ```
18
+
19
+ ## What this epic adds
20
+
21
+ - Integrity checks: config, router state, release/epic/task structure
22
+ - YAML/frontmatter validation: detect corrupt YAML
23
+ - Task acceptance criteria check: verify AC present
24
+ - Dependency checks: missing deps, cycles, duplicate IDs
25
+ - Audit state check: proposals without audit-pending flag
26
+ - Orphan detection: tasks in nonexistent epics
27
+ - Ad-hoc quality gate runner
28
+ - Human-readable diagnostic output
29
+ - Repair suggestions for common failure modes
30
+ - Exit codes: clean (0), diagnosed problems (1), internal failure (2)
31
+
32
+ ## Components
33
+
34
+ | Module | Purpose |
35
+ |--------|---------|
36
+ | `cmd/doctor.go` | CLI registration, arg parsing |
37
+ | `internal/doctor/checks.go` | Individual integrity checks |
38
+ | `internal/doctor/report.go` | Diagnostic report formatting |
39
+ | `internal/doctor/repairs.go` | Suggested repair text |
40
+ | `internal/doctor/gates.go` | Ad-hoc quality gate runner |
41
+
42
+ ## Implemented As
43
+
44
+ - `cmd/doctor.go` parses `doctor [--epic <epic>]`, reports help, rejects unsupported arguments, and delegates execution through an injected runner.
45
+ - `main.go` wires `savepoint doctor` to `internal/doctor.RunAllChecks` and preserves the required 0/1/2 exit-code contract.
46
+ - `internal/doctor/checks.go` implements config, router, structure, dependency, duplicate ID, audit-state, and orphan diagnostics.
47
+ - `internal/doctor/gates.go`, `report.go`, and `repairs.go` run configured quality gates, format human-readable reports, and attach repair suggestions.
48
+ - Tests live in `cmd/doctor_test.go` and `internal/doctor/*_test.go`.
49
+
50
+ ## Boundaries
51
+
52
+ **In scope:**
53
+ - Detect corrupt YAML/frontmatter
54
+ - Detect missing config
55
+ - Detect missing dependencies and dependency cycles
56
+ - Detect duplicate task IDs
57
+ - Detect tasks in nonexistent epics
58
+ - Detect audit proposals without matching audit-pending state
59
+ - Run configured quality gates on demand
60
+
61
+ **Out of scope:**
62
+ - Auto-moving orphaned tasks without user action
63
+ - Repairing files destructively
64
+ - Launching the TUI
65
+ - Calling AI APIs
@@ -0,0 +1,24 @@
1
+ ---
2
+ id: E09-doctor-command/T001-cli-entrypoint
3
+ status: done
4
+ objective: "Create CLI entrypoint for savepoint doctor command"
5
+ depends_on: []
6
+ ---
7
+
8
+ # T001: CLI Entrypoint
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - `savepoint doctor --help` shows usage: `doctor [--epic <epic>]`
13
+ - `savepoint doctor` runs all checks
14
+ - `savepoint doctor --epic E03` runs checks for specific epic
15
+ - Exit codes: 0 = clean, 1 = diagnosed problems, 2 = internal error
16
+
17
+ ## Implementation Plan
18
+
19
+ - [x] Add `cmd/doctor.go` with CLI arg parsing
20
+ - [x] Wire doctor command into main.go dispatch
21
+ - [x] Implement arg validation (--epic)
22
+ - [x] Implement exit code logic (0/1/2)
23
+ - [x] Test `savepoint doctor --help` output
24
+ - [x] Run `make build && make test`
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: E09-doctor-command/T002-config-router-validation
3
+ status: done
4
+ objective: "Validate config.yml and router state"
5
+ depends_on: ["E09-doctor-command/T001-cli-entrypoint"]
6
+ ---
7
+
8
+ # T002: Config + Router Validation
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - Config.yml exists and is valid YAML
13
+ - Config has required fields: quality_gates, theme
14
+ - Router state is valid (valid state name, release, epic)
15
+ - Router state matches actual release/epic directories
16
+
17
+ ## Implementation Plan
18
+
19
+ - [x] Add `internal/doctor/checks.go`
20
+ - [x] Implement `CheckConfig(root) error`
21
+ - [x] Validate config.yml exists and parses
22
+ - [x] Validate required fields present
23
+ - [x] Implement `CheckRouter(root, epicFilter) error`
24
+ - [x] Validate router state is valid YAML
25
+ - [x] Validate state name is one of: pre-implementation, epic-design, epic-task-breakdown, task-building, audit-pending
26
+ - [x] Validate release/epic directories exist
27
+ - [x] Test validation on valid and invalid projects
28
+ - [x] Run `make build && make test`
@@ -0,0 +1,29 @@
1
+ ---
2
+ id: E09-doctor-command/T003-structure-checks
3
+ status: done
4
+ objective: "Validate release/epic/task structure and YAML"
5
+ depends_on: ["E09-doctor-command/T002-config-router-validation"]
6
+ ---
7
+
8
+ # T003: Structure Checks
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - Release directories exist and contain release PRD
13
+ - Epic directories exist and contain E##-Detail.md
14
+ - Task files are valid markdown with YAML frontmatter
15
+ - Corrupt YAML/frontmatter detected with file:line info
16
+ - Task acceptance criteria present and non-empty
17
+
18
+ ## Implementation Plan
19
+
20
+ - [x] Add to `internal/doctor/checks.go`
21
+ - [x] Implement `CheckStructure(root, epicFilter)` returning `[]Problem`
22
+ - [x] Walk release directories, validate release PRD
23
+ - [x] Walk epic directories, validate E##-Detail.md
24
+ - [x] Walk task files, parse frontmatter
25
+ - [x] Validate each task has: id, status, objective, depends_on
26
+ - [x] Check acceptance criteria present in task body
27
+ - [x] Detect corrupt YAML with file:line location
28
+ - [x] Test structure validation on valid and invalid projects
29
+ - [x] Run `make build && make test`
@@ -0,0 +1,27 @@
1
+ ---
2
+ id: E09-doctor-command/T004-dependency-checks
3
+ status: done
4
+ objective: "Validate dependencies for missing deps, cycles, duplicates"
5
+ depends_on: ["E09-doctor-command/T003-structure-checks"]
6
+ ---
7
+
8
+ # T004: Dependency Checks
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - Missing dependencies detected (depends_on points to non-existent task)
13
+ - Dependency cycles detected (A→B→C→A)
14
+ - Duplicate task IDs detected
15
+ - Clear error messages for each failure
16
+
17
+ ## Implementation Plan
18
+
19
+ - [x] Add to `internal/doctor/checks.go`
20
+ - [x] Implement `CheckDependencies(root, epicFilter) error`
21
+ - [x] Collect all task IDs from release
22
+ - [x] Check each depends_on references existing task
23
+ - [x] Build dependency graph, detect cycles (DFS)
24
+ - [x] Detect duplicate task IDs (same ID in multiple files)
25
+ - [x] Return clear error messages for each issue
26
+ - [x] Test dependency validation on valid and invalid projects
27
+ - [x] Run `make build && make test`
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: E09-doctor-command/T005-audit-orphan-checks
3
+ status: done
4
+ objective: "Validate audit state and detect orphaned tasks"
5
+ depends_on: ["E09-doctor-command/T004-dependency-checks"]
6
+ ---
7
+
8
+ # T005: Audit + Orphan Checks
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - Audit proposals without matching audit-pending state detected
13
+ - Orphaned tasks detected (tasks in nonexistent epics)
14
+ - Orphaned tasks reported with suggestion to move to .savepoint/orphans/
15
+ - Audit log shows previous audit results
16
+
17
+ ## Implementation Plan
18
+
19
+ - [x] Add to `internal/doctor/checks.go`
20
+ - [x] Implement `CheckAuditState(root) []Problem`
21
+ - [x] Find all audit proposal directories
22
+ - [x] Check router state is audit-pending for corresponding epic
23
+ - [x] Warn if proposals exist without audit-pending state
24
+ - [x] Implement `CheckOrphans(root) []Problem`
25
+ - [x] Find tasks whose epic directory doesn't exist
26
+ - [x] Report orphaned tasks with move suggestion
27
+ - [x] Test audit and orphan detection
28
+ - [x] Run `make build && make test`
@@ -0,0 +1,31 @@
1
+ ---
2
+ id: E09-doctor-command/T006-quality-gates-report
3
+ status: done
4
+ objective: "Run quality gates on demand and format diagnostic report"
5
+ depends_on: ["E09-doctor-command/T005-audit-orphan-checks"]
6
+ ---
7
+
8
+ # T006: Quality Gates + Report
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - Run configured lint, typecheck, test commands from config
13
+ - Report pass/fail status for each gate
14
+ - Format all diagnostics into human-readable report
15
+ - Include file paths and actionable fix suggestions
16
+ - Return appropriate exit code
17
+
18
+ ## Implementation Plan
19
+
20
+ - [x] Add `internal/doctor/gates.go`
21
+ - [x] Implement `RunQualityGates(root) []GateResult`
22
+ - [x] Read config quality_gates
23
+ - [x] Execute each command, capture output
24
+ - [x] Report pass/fail for each gate
25
+ - [x] Add `internal/doctor/report.go`
26
+ - [x] Collect all check results
27
+ - [x] Format into human-readable report
28
+ - [x] Add repair suggestions from internal/doctor/repairs.go
29
+ - [x] Return exit code: 0 if all clean, 1 if problems found
30
+ - [x] Test doctor on valid and invalid projects
31
+ - [x] Run `make build && make test`
@@ -0,0 +1,36 @@
1
+ ---
2
+ type: epic-design
3
+ status: audited
4
+ ---
5
+
6
+ # E11: Board Auto-Refresh Fix
7
+
8
+ ## Purpose
9
+
10
+ Fix the TUI board so it auto-refreshes when task files change on disk. The watch mechanism exists but isn't triggering reloads on file changes.
11
+
12
+ ## What this epic adds
13
+
14
+ - Debug logging to trace where the refresh fails
15
+ - Increased debounce timer for reliable event detection
16
+ - Error handling for silent watcher failures
17
+ - Verified auto-refresh on file changes
18
+
19
+ ## Components
20
+
21
+ | Module | Purpose |
22
+ |--------|---------|
23
+ | `internal/board/watch.go` | Debug logs, increased debounce, error handling |
24
+ | `internal/board/update.go` | Debug logs for reload flow |
25
+
26
+ ## Boundaries
27
+
28
+ **In scope:**
29
+ - Debug logging to identify failure point
30
+ - Fix debounce timing
31
+ - Fix error handling
32
+ - Verify refresh works
33
+
34
+ **Out of scope:**
35
+ - No new UI features
36
+ - No new core functionality
@@ -0,0 +1,25 @@
1
+ ---
2
+ id: E11-board-refresh-fix/T001-debug-logging
3
+ status: done
4
+ objective: Add debug logging to watch.go to trace where refresh fails
5
+ depends_on: []
6
+ ---
7
+
8
+ # T001: Debug Logging
9
+
10
+ ## Acceptance Criteria
11
+
12
+ - [ ] Print when watchFiles() starts watching
13
+ - [ ] Print when event received from watcher
14
+ - [ ] Print when fileChangeMsg received in update.go
15
+ - [ ] Print any errors from watcher Errors channel
16
+ - [ ] Print when reloadTasks() is called
17
+
18
+ ## Implementation Plan
19
+
20
+ - [ ] In `watch.go` - add fmt.Printf at start of watchFiles()
21
+ - [ ] In `watch.go` - add fmt.Printf for each event received
22
+ - [ ] In `watch.go` - add fmt.Printf for watcher errors
23
+ - [ ] In `update.go` - add fmt.Printf when fileChangeMsg received
24
+ - [ ] In `watch.go` - add fmt.Printf when reloadTasks() called
25
+ - [ ] Run board, make file change, observe logs
@@ -0,0 +1,21 @@
1
+ ---
2
+ id: E11-board-refresh-fix/T002-increase-debounce
3
+ status: done
4
+ objective: Increase debounce timer from 100ms to 500ms for reliable detection
5
+ depends_on:
6
+ - E11-board-refresh-fix/T001-debug-logging
7
+ ---
8
+
9
+ # T002: Increase Debounce
10
+
11
+ ## Acceptance Criteria
12
+
13
+ - [ ] Change timer from 100ms to 500ms
14
+ - [ ] Verify board still works
15
+
16
+ ## Implementation Plan
17
+
18
+ - [ ] In `internal/board/watch.go` line 31:
19
+ - FROM: `timer := time.NewTimer(100 * time.Millisecond)`
20
+ - TO: `timer := time.NewTimer(500 * time.Millisecond)`
21
+ - [ ] Run `make build` to verify
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: E11-board-refresh-fix/T003-error-handling
3
+ status: done
4
+ objective: Add error handling instead of silent returns in watcher
5
+ depends_on:
6
+ - E11-board-refresh-fix/T001-debug-logging
7
+ ---
8
+
9
+ # T003: Error Handling
10
+
11
+ ## Acceptance Criteria
12
+
13
+ - [ ] Log instead of silent return on channel close
14
+ - [ ] Log watcher errors that are currently ignored
15
+ - [ ] Log any reload failures
16
+
17
+ ## Implementation Plan
18
+
19
+ - [ ] In `watch.go` - replace `if !ok { return nil }` with error log
20
+ - [ ] In `watch.go` - add logging for `w.Errors` channel events
21
+ - [ ] In `reloadTasks()` - add error handling for loadBoardData failure
22
+ - [ ] Run tests
@@ -0,0 +1,29 @@
1
+ ---
2
+ id: E11-board-refresh-fix/T004-test-verify
3
+ status: done
4
+ objective: Test and verify board refreshes on file change
5
+ depends_on:
6
+ - E11-board-refresh-fix/T001-debug-logging
7
+ - E11-board-refresh-fix/T002-increase-debounce
8
+ - E11-board-refresh-fix/T003-error-handling
9
+ ---
10
+
11
+ # T004: Test & Verify
12
+
13
+ ## Acceptance Criteria
14
+
15
+ - [ ] Board starts with debug logs visible
16
+ - [ ] Create new task file while board running
17
+ - [ ] Board auto-refreshes within 1 second
18
+ - [ ] New task appears in Planned column
19
+
20
+ ## Implementation Plan
21
+
22
+ - [ ] Start board from terminal
23
+ - [ ] Verify debug log output shows watchFiles() started
24
+ - [ ] Create test task file: `echo "---" > E06/tasks/T999-test.md`
25
+ - [ ] Wait 2 seconds for debounce + reload
26
+ - [ ] Verify task appears in board
27
+ - [ ] Or: debug log shows fileChangeMsg received
28
+ - [ ] Clean up test file
29
+ - [ ] Run `make build && make test`