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.
- package/.claude/settings.local.json +12 -1
- package/.github/workflows/ci.yml +20 -0
- package/.golangci.yml +11 -0
- package/.savepoint/Design.md +40 -38
- package/.savepoint/{audit/v1.1/E02-cross-platform-compatibility/proposals.md → releases/v1.1/epics/E02-cross-platform-compatibility/E02-Audit.md} +48 -38
- package/.savepoint/releases/v1.1/epics/E03-ui-visual-refinement/E03-Audit.md +195 -0
- package/.savepoint/releases/v1.1/epics/E03-ui-visual-refinement/E03-Detail.md +14 -1
- package/.savepoint/releases/v1.1/epics/E03-ui-visual-refinement/tasks/T006-forced-256-color-profile.md +3 -3
- package/.savepoint/{audit/v1.1/E04-epic-navigation/proposals.md → releases/v1.1/epics/E04-epic-navigation/E04-Audit.md} +65 -54
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/E05-Audit.md +237 -0
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/E05-Detail.md +25 -16
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T001-update-agents-md.md +17 -6
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T002-update-router-md.md +15 -5
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T003-update-design-md.md +19 -5
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T004-implement-m-hotkey.md +11 -1
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T005-update-help-overlay.md +9 -6
- package/.savepoint/releases/v1.1/epics/E05-tasking-permissions/tasks/T006-tests-and-quality-gates.md +29 -13
- package/.savepoint/releases/v1.1/epics/E06-audit-command/E06-Audit.md +56 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/E06-Detail.md +63 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T005-proposals.md +44 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T007-apply-close.md +35 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T009-integration.md +40 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T010-audit-file-migration.md +45 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T011-model-tab-state.md +26 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T012-epic-audit-render.md +33 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T013-handle-tab-keys.md +34 -0
- package/.savepoint/releases/v1.1/epics/E06-audit-command/tasks/T014-tab-indicator.md +33 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/E07-Audit.md +336 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/E07-Detail.md +61 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T001-cli-entrypoint.md +37 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T002-target-validation.md +28 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T003-scaffold-writer.md +46 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T004-atomic-writes.md +27 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T005-magic-prompt.md +25 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T006-clipboard.md +26 -0
- package/.savepoint/releases/v1.1/epics/E07-init-command/tasks/T007-integration-test.md +26 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/E08-Audit.md +333 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/E08-Detail.md +68 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T001-cli-entrypoint.md +26 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T002-non-tty-fallback.md +27 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T003-tui-app-shell.md +28 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T004-board-model.md +29 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T005-detail-pane.md +27 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T006-status-transitions.md +29 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T007-theme-fallbacks.md +29 -0
- package/.savepoint/releases/v1.1/epics/E08-board-command/tasks/T008-integration-test.md +27 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/E09-Audit.md +207 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/E09-Detail.md +65 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T001-cli-entrypoint.md +24 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T002-config-router-validation.md +28 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T003-structure-checks.md +29 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T004-dependency-checks.md +27 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T005-audit-orphan-checks.md +28 -0
- package/.savepoint/releases/v1.1/epics/E09-doctor-command/tasks/T006-quality-gates-report.md +31 -0
- package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/E11-Detail.md +36 -0
- package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T001-debug-logging.md +25 -0
- package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T002-increase-debounce.md +21 -0
- package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T003-error-handling.md +22 -0
- package/.savepoint/releases/v1.1/epics/E11-board-refresh-fix/tasks/T004-test-verify.md +29 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/E12-Audit.md +444 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/E12-Detail.md +45 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T001-default-phase.md +35 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T002-default-status.md +19 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T003-better-errors.md +29 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T004-validate-on-write.md +25 -0
- package/.savepoint/releases/v1.1/epics/E12-validation-fix/tasks/T005-tests.md +37 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/E13-Audit.md +118 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/E13-Detail.md +73 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T001-safe-cleanup.md +66 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T002-bug-fixes.md +35 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T003-centralize-duplication.md +60 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T004-infrastructure.md +33 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T005-decompose-update.md +37 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T006-async-io.md +40 -0
- package/.savepoint/releases/v1.1/epics/E13-audit-remediation/tasks/T007-test-coverage.md +37 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/E14-Audit.md +267 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/E14-Detail.md +54 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T001-group-model.md +39 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T002-data-interfaces.md +42 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T003-discover-orphans.md +33 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T004-epic-panel-headings.md +35 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T005-shell-tokenization.md +27 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T006-unify-enums.md +29 -0
- package/.savepoint/releases/v1.1/epics/E14-structural-improvements/tasks/T007-testutil-package.md +28 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/E15-Audit.md +272 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/E15-Detail.md +60 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T001-benchmarks.md +31 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T002-fuzz-targets.md +34 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T003-debug-flag.md +30 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T004-dist-checksums.md +27 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T005-windows-targets.md +28 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T006-abbreviation-splitting.md +26 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T007-root-test-allowlist.md +33 -0
- package/.savepoint/releases/v1.1/epics/E15-hardening/tasks/T008-ci-and-release-automation.md +46 -0
- package/.savepoint/releases/v1.1/epics/_archived/T001-cli-entrypoint.md +25 -0
- package/.savepoint/releases/v1.1/epics/_archived/T002-quality-gates.md +27 -0
- package/.savepoint/releases/v1.1/epics/_archived/T003-snapshot.md +27 -0
- package/.savepoint/releases/v1.1/epics/_archived/T004-ai-reconcile.md +29 -0
- package/.savepoint/releases/v1.1/epics/_archived/T006-tui-review.md +31 -0
- package/.savepoint/releases/v1.1/epics/_archived/T008-skip-handling.md +34 -0
- package/.savepoint/releases/v1.1/v1.1-PRD.md +67 -7
- package/.savepoint/router.md +10 -17
- package/AGENTS.md +39 -24
- package/Makefile +3 -1
- package/README.md +0 -1
- package/agent-skills/savepoint-audit/SKILL.md +86 -34
- package/agent-skills/savepoint-build-task/SKILL.md +7 -2
- package/agent-skills/savepoint-create-plan/SKILL.md +7 -2
- package/agent-skills/savepoint-create-task/SKILL.md +44 -31
- package/agent-skills/savepoint-draft-prd/SKILL.md +7 -2
- package/agent-skills/savepoint-system-design/SKILL.md +7 -2
- package/agent_skills_test.go +91 -0
- package/cmd/board.go +59 -0
- package/cmd/board_test.go +137 -0
- package/cmd/doctor.go +53 -0
- package/cmd/doctor_test.go +146 -0
- package/cmd/init.go +63 -0
- package/cmd/init_test.go +104 -0
- package/internal/board/board.go +44 -36
- package/internal/board/board_test.go +27 -82
- package/internal/board/card.go +43 -23
- package/internal/board/card_test.go +74 -5
- package/internal/board/column.go +75 -15
- package/internal/board/column_test.go +76 -2
- package/internal/board/debug.go +26 -0
- package/internal/board/debug_test.go +108 -0
- package/internal/board/detail.go +33 -47
- package/internal/board/detail_test.go +48 -0
- package/internal/board/epic_panel.go +120 -22
- package/internal/board/epic_panel_test.go +302 -17
- package/internal/board/help.go +1 -0
- package/internal/board/help_test.go +1 -0
- package/internal/board/integration_test.go +266 -0
- package/internal/board/interfaces.go +65 -0
- package/internal/board/interfaces_test.go +114 -0
- package/internal/board/io.go +93 -0
- package/internal/board/model.go +79 -118
- package/internal/board/plain.go +88 -0
- package/internal/board/plain_test.go +117 -0
- package/internal/board/release.go +1 -9
- package/internal/board/release_test.go +6 -6
- package/internal/board/status.go +4 -4
- package/internal/board/theme.go +24 -0
- package/internal/board/theme_test.go +31 -0
- package/internal/board/transitions.go +113 -88
- package/internal/board/transitions_test.go +164 -141
- package/internal/board/tui.go +32 -0
- package/internal/board/update.go +344 -215
- package/internal/board/update_test.go +326 -18
- package/internal/board/util.go +76 -0
- package/internal/board/view.go +31 -28
- package/internal/board/view_test.go +74 -2
- package/internal/board/watch.go +41 -5
- package/internal/buildtool/main.go +45 -15
- package/internal/buildtool/main_test.go +224 -0
- package/internal/data/config.go +17 -3
- package/internal/data/config_test.go +49 -0
- package/internal/data/discover.go +26 -0
- package/internal/data/discover_test.go +34 -10
- package/internal/data/errors.go +4 -0
- package/internal/data/fuzz_test.go +75 -0
- package/internal/data/lifecycle.go +13 -6
- package/internal/data/lifecycle_test.go +14 -11
- package/internal/data/parser.go +22 -6
- package/internal/data/parser_test.go +31 -7
- package/internal/data/task.go +0 -9
- package/internal/data/testdata/fuzz/FuzzSplitFrontmatterBody/68eb66b0fe91e7e3 +2 -0
- package/internal/data/write.go +88 -11
- package/internal/data/write_test.go +167 -0
- package/internal/doctor/checks.go +567 -0
- package/internal/doctor/checks_test.go +716 -0
- package/internal/doctor/gates.go +193 -0
- package/internal/doctor/gates_test.go +166 -0
- package/internal/doctor/interfaces.go +64 -0
- package/internal/doctor/interfaces_test.go +104 -0
- package/internal/doctor/repairs.go +80 -0
- package/internal/doctor/repairs_test.go +81 -0
- package/internal/doctor/report.go +157 -0
- package/internal/doctor/report_test.go +89 -0
- package/internal/init/clipboard.go +146 -0
- package/internal/init/clipboard_test.go +74 -0
- package/internal/init/install.go +16 -0
- package/internal/init/integration_test.go +197 -0
- package/internal/init/prompt.go +14 -0
- package/internal/init/prompt_test.go +77 -0
- package/internal/init/scaffold.go +59 -0
- package/internal/init/scaffold_test.go +179 -0
- package/internal/init/template_freshness_test.go +56 -0
- package/internal/init/validate.go +85 -0
- package/internal/init/validate_test.go +141 -0
- package/internal/init/write.go +73 -0
- package/internal/init/write_test.go +91 -0
- package/internal/styles/styles_test.go +133 -0
- package/internal/testutil/fixture.go +113 -0
- package/internal/testutil/fs.go +26 -0
- package/main.go +120 -4
- package/package.json +2 -2
- package/project-audit/audit_report_glm_5.1.md +411 -0
- package/project-audit/audit_report_opus_4.6.md +406 -0
- package/project-audit/consolidated-audit-report.md +456 -0
- package/templates/project/.savepoint/Design.md +2 -2
- package/templates/project/.savepoint/router.md +10 -10
- package/templates/project/AGENTS.md +33 -21
- package/templates/project/agent-skills/savepoint-audit/SKILL.md +87 -0
- package/templates/project/agent-skills/savepoint-build-task/SKILL.md +44 -0
- package/templates/project/agent-skills/savepoint-create-plan/SKILL.md +33 -0
- package/templates/project/agent-skills/savepoint-create-task/SKILL.md +44 -0
- package/templates/project/agent-skills/savepoint-draft-prd/SKILL.md +37 -0
- package/templates/project/agent-skills/savepoint-system-design/SKILL.md +38 -0
- package/templates/prompts/audit-reconciliation.prompt.md +33 -28
- package/templates/prompts/design.prompt.md +3 -1
- package/.savepoint/audit/v1/E01/proposals.md +0 -168
- package/.savepoint/audit/v1/E01/snapshot.md +0 -78
- package/.savepoint/audit/v1/E01-go-setup/proposals.md +0 -166
- package/.savepoint/audit/v1/E01-go-setup/snapshot.md +0 -71
- package/.savepoint/audit/v1/E01-scaffolding/proposals/AGENTS.md +0 -66
- package/.savepoint/audit/v1/E01-scaffolding/proposals/Design.md +0 -210
- package/.savepoint/audit/v1/E01-scaffolding/proposals/epic-Design.md +0 -117
- package/.savepoint/audit/v1/E01-scaffolding/proposals/quality-review.md +0 -101
- package/.savepoint/audit/v1/E01-scaffolding/snapshot.md +0 -54
- package/.savepoint/audit/v1/E02-data-model/snapshot.md +0 -128
- package/.savepoint/audit/v1/E02-data-readers/proposals.md +0 -123
- package/.savepoint/audit/v1/E02-data-readers/snapshot.md +0 -54
- package/.savepoint/audit/v1/E03-board-tui-core/proposals.md +0 -146
- package/.savepoint/audit/v1/E03-board-tui-core/snapshot.md +0 -57
- package/.savepoint/audit/v1/E03-cli-foundation/snapshot.md +0 -106
- package/.savepoint/audit/v1/E04-board-components/proposals.md +0 -118
- package/.savepoint/audit/v1/E04-board-components/snapshot.md +0 -77
- package/.savepoint/audit/v1/E04-templates-and-prompts/snapshot.md +0 -115
- package/.savepoint/audit/v1/E05-init-command/snapshot.md +0 -125
- package/.savepoint/audit/v1/E05-phase-transitions/proposals.md +0 -83
- package/.savepoint/audit/v1/E05-phase-transitions/snapshot.md +0 -36
- package/.savepoint/audit/v1/E06-atari-noir-layout/proposals.md +0 -130
- package/.savepoint/audit/v1/E06-atari-noir-layout/snapshot.md +0 -84
- package/.savepoint/audit/v1/E06-tui-board/snapshot.md +0 -64
- package/.savepoint/audit/v1/E07-audit-pipeline/snapshot.md +0 -165
- package/.savepoint/audit/v1/E08-board-workflow-cleanup/snapshot.md +0 -65
- package/.savepoint/audit/v1.1/E02-cross-platform-compatibility/snapshot.md +0 -41
- package/.savepoint/audit/v1.1/E04-epic-navigation/snapshot.md +0 -48
- package/ink-cli-ui-design.zip +0 -0
- package/savepoint +0 -0
- package/savepoint.exe +0 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# Codebase Audit Report — Savepoint
|
|
2
|
+
|
|
3
|
+
## 1. Executive Summary
|
|
4
|
+
|
|
5
|
+
**Savepoint** is a small, well-structured Go CLI + TUI tool (~133 KB of production code across 42 source files) that implements a file-based project state machine with a kanban-style terminal board. It uses the Charmbracelet stack (Bubble Tea, Lip Gloss) for TUI rendering and YAML frontmatter-based markdown files as its data layer.
|
|
6
|
+
|
|
7
|
+
### What is working well
|
|
8
|
+
|
|
9
|
+
- **File-per-responsibility is followed diligently.** Nearly every `.go` file does one job. The `board/` package is split into `model.go`, `view.go`, `update.go`, `card.go`, `column.go`, etc. This maps to the project's own code-style rules and makes individual files easy to reason about.
|
|
10
|
+
- **Test coverage is strong.** 38 test files totalling ~213 KB — roughly 1.6× the production code. All packages except `buildtool` and `styles` have tests, and integration tests exist for `board` and `init`.
|
|
11
|
+
- **Clean dependency tree.** Only 2 direct dependencies (`bubbletea`, `fsnotify`) plus the Charmbracelet ecosystem for rendering. No framework bloat.
|
|
12
|
+
- **All tests pass.** `go test ./...` reports zero failures.
|
|
13
|
+
- **Data model is honest.** The `data` package cleanly separates parsing, lifecycle validation, writing, and discovery. The frontmatter-based approach is simple and appropriate for the project's scale.
|
|
14
|
+
- **The doctor/diagnostics subsystem is thorough.** Checks config, router, structure, dependencies, orphans, audit state, and quality gates — with actionable repair suggestions.
|
|
15
|
+
|
|
16
|
+
### Biggest risks
|
|
17
|
+
|
|
18
|
+
1. **`update.go` is a 522-line monolith** with the `Update()` method containing a deeply nested key-dispatch switch. It is the hardest file to extend or test in isolation.
|
|
19
|
+
2. **Duplicated YAML-frontmatter read/write/parse logic** appears in `write.go`, `parser.go`, `board.go`, and `checks.go` — each creating `NewParser()` independently and re-implementing body extraction.
|
|
20
|
+
3. **No interfaces used for I/O boundaries.** The `Discover`, `Parser`, `ConfigReader`, `RouterReader` types are all concrete structs with no interfaces, making them impossible to mock without test fixtures on disk.
|
|
21
|
+
4. **Committed binaries** (`savepoint`, `savepoint.exe`, `dist/`) inflate the repository and cause spurious diffs.
|
|
22
|
+
|
|
23
|
+
### Extensibility
|
|
24
|
+
|
|
25
|
+
The project is easy to extend for new checks, overlays, and commands, but harder to extend for new data sources or rendering backends because I/O is baked into concrete functions.
|
|
26
|
+
|
|
27
|
+
### Architecture fit
|
|
28
|
+
|
|
29
|
+
The architecture (flat `internal/` packages, Elm-like TUI model, embedded templates) is well-suited for a small-to-medium CLI tool. No over-engineering is evident.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Severity-Ranked Recommendations
|
|
34
|
+
|
|
35
|
+
### Critical
|
|
36
|
+
|
|
37
|
+
No critical issues were found. The application builds, tests pass, and the data model is consistent.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### High
|
|
42
|
+
|
|
43
|
+
#### H1 — Committed binaries in the repository
|
|
44
|
+
|
|
45
|
+
- **Finding:** `savepoint` (5.5 MB), `savepoint.exe` (6.0 MB), and `ink-cli-ui-design.zip` (15 KB) are tracked in Git.
|
|
46
|
+
- **Why it matters:** Bloats clone size, causes merge noise, and risks accidentally shipping stale binaries.
|
|
47
|
+
- **Evidence:** [.gitignore](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/.gitignore) does not exclude the root binaries. `dist/` is also checked in.
|
|
48
|
+
- **Recommended fix:** Add `savepoint`, `savepoint.exe`, `dist/`, and `*.zip` to `.gitignore`. Run `git rm --cached savepoint savepoint.exe dist/ ink-cli-ui-design.zip`. Build in CI only.
|
|
49
|
+
- **Estimated effort:** Small
|
|
50
|
+
|
|
51
|
+
#### H2 — `update.go` complexity: God-method Update()
|
|
52
|
+
|
|
53
|
+
- **Finding:** [update.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/update.go) is 522 lines. The `Update()` method alone spans lines 19–192 with 4 levels of nesting inside `case tea.KeyMsg`.
|
|
54
|
+
- **Why it matters:** Adding a new keybinding or overlay requires editing a deeply nested switch. Bug surface area grows with each addition.
|
|
55
|
+
- **Evidence:** The space-bar handler (lines 132–158) and backspace handler (lines 159–181) have nearly identical structure — find-task-by-ID, mutate, write, refresh.
|
|
56
|
+
- **Recommended fix:** Extract key handlers into named methods: `handleAdvanceTask()`, `handleRetreatTask()`, `handleSetPriority()`. Extract `updateBoardKeys()` and `updateOverlayKeys()` from the top-level switch.
|
|
57
|
+
- **Estimated effort:** Medium
|
|
58
|
+
|
|
59
|
+
#### H3 — Duplicated frontmatter body-extraction logic
|
|
60
|
+
|
|
61
|
+
- **Finding:** The pattern "extract frontmatter → unmarshal YAML → compute body start offset → reconstruct file" appears in:
|
|
62
|
+
- [write.go:updateFrontmatterField](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/write.go#L40-L83) (lines 40–83)
|
|
63
|
+
- [write.go:WriteTaskStatus](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/write.go#L85-L150) (lines 85–150)
|
|
64
|
+
- The magic `delimLen := 4; bodyStart := delimLen + len(raw) + delimLen` appears in both
|
|
65
|
+
- **Why it matters:** A change to frontmatter format (e.g. supporting `---` on the same line as metadata) must be patched in multiple places. The body-offset calculation is fragile.
|
|
66
|
+
- **Evidence:** Lines 74–79 and 140–145 of `write.go` are identical.
|
|
67
|
+
- **Recommended fix:** Extract a `SplitFrontmatterBody(content string) (yaml string, body string, err error)` function and use it in all write paths.
|
|
68
|
+
- **Estimated effort:** Small
|
|
69
|
+
|
|
70
|
+
#### H4 — No interfaces for data-access types
|
|
71
|
+
|
|
72
|
+
- **Finding:** `Discover`, `Parser`, `ConfigReader`, `RouterReader` are all concrete structs. Every consumer calls `data.NewDiscover()`, `data.NewParser()`, etc. directly.
|
|
73
|
+
- **Why it matters:** Test helpers in `board` and `doctor` must create real filesystem fixtures to test business logic. This is expensive and brittle.
|
|
74
|
+
- **Evidence:** [board.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/board.go) lines 37, 85, 130 all call `data.NewDiscover()` with no injection point. [checks.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/doctor/checks.go) does the same (lines 116, 293, 454, 525).
|
|
75
|
+
- **Recommended fix:** Define interfaces at the consumer side (e.g. `type taskDiscoverer interface { ListReleases(root string) ([]data.ReleaseInfo, error) ... }`). Keep the existing structs as the production implementations. Accept the interface in board/doctor constructors.
|
|
76
|
+
- **Estimated effort:** Medium
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### Medium
|
|
81
|
+
|
|
82
|
+
#### M1 — `Discover` is instantiated repeatedly with no state
|
|
83
|
+
|
|
84
|
+
- **Finding:** `data.NewDiscover()` returns `&Discover{}` — a zero-value struct. It is re-created in `board.go` (twice), `checks.go` (4 times), `main.go` (once).
|
|
85
|
+
- **Why it matters:** Unnecessary allocation noise and a missed opportunity for future caching (e.g., directory memoization).
|
|
86
|
+
- **Evidence:** [discover.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/discover.go) — `Discover` has zero fields.
|
|
87
|
+
- **Recommended fix:** Either make `Discover` methods package-level functions (since there's no state) or make it a singleton / accept it as a dependency.
|
|
88
|
+
- **Estimated effort:** Small
|
|
89
|
+
|
|
90
|
+
#### M2 — `Parser` and `ConfigReader` are similarly stateless singletons
|
|
91
|
+
|
|
92
|
+
- **Finding:** Same pattern as M1. `NewParser()` returns `&Parser{}` — no configuration.
|
|
93
|
+
- **Why it matters:** Code reads as if these types might have configuration, but they don't. This is an accidental abstraction that adds indirection without benefit.
|
|
94
|
+
- **Evidence:** [parser.go:12-14](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/parser.go#L12-L14), [config.go:52-54](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/config.go#L52-L54)
|
|
95
|
+
- **Recommended fix:** Convert to package-level functions unless interfaces are introduced (per H4).
|
|
96
|
+
- **Estimated effort:** Small
|
|
97
|
+
|
|
98
|
+
#### M3 — `newProgramModel()` contains a hardcoded epic slug
|
|
99
|
+
|
|
100
|
+
- **Finding:** [board.go:33](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/board.go#L32-L34) — `NewModel(nil, "v1", "E03-board-tui-core")` is a leftover from development.
|
|
101
|
+
- **Why it matters:** If `newProgramModel()` is ever called without the project-loading path, it shows stale default data.
|
|
102
|
+
- **Evidence:** The function is declared but never called in production (the real path is `newProjectModel`). However it is exported-adjacent and could confuse contributors.
|
|
103
|
+
- **Recommended fix:** Delete `newProgramModel()` or replace the hardcoded values with empty strings.
|
|
104
|
+
- **Estimated effort:** Small
|
|
105
|
+
|
|
106
|
+
#### M4 — `repairs.go` reimplements `strings.Contains`
|
|
107
|
+
|
|
108
|
+
- **Finding:** [repairs.go:50-61](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/doctor/repairs.go#L50-L61) defines custom `contains()` and `indexOf()` functions that do exactly what `strings.Contains` does.
|
|
109
|
+
- **Why it matters:** Standard library duplication is a maintainability red flag and confuses readers.
|
|
110
|
+
- **Evidence:** `func contains(s, substr string) bool` vs `strings.Contains`.
|
|
111
|
+
- **Recommended fix:** Replace with `strings.Contains`.
|
|
112
|
+
- **Estimated effort:** Small
|
|
113
|
+
|
|
114
|
+
#### M5 — `buildtool/main.go` reimplements `strings.TrimSpace`
|
|
115
|
+
|
|
116
|
+
- **Finding:** [buildtool/main.go:211-219](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/buildtool/main.go#L211-L219) defines a custom `trimSpace()` function that trims `\n\r\t `.
|
|
117
|
+
- **Why it matters:** `strings.TrimSpace` exists in the standard library with identical behaviour.
|
|
118
|
+
- **Evidence:** The function is only called once, on line 199.
|
|
119
|
+
- **Recommended fix:** Replace with `strings.TrimSpace(string(output))`.
|
|
120
|
+
- **Estimated effort:** Small
|
|
121
|
+
|
|
122
|
+
#### M6 — `buildtool` has no tests
|
|
123
|
+
|
|
124
|
+
- **Finding:** `internal/buildtool` is the only production package with `[no test files]`.
|
|
125
|
+
- **Why it matters:** Build/dist logic is the kind of code most likely to break silently across platforms.
|
|
126
|
+
- **Evidence:** `go test ./...` output shows `? github.com/opencode/savepoint/internal/buildtool [no test files]`.
|
|
127
|
+
- **Recommended fix:** Add tests for `run()`, `version()`, `splitCommand()`, and `writeTarGz()` at minimum. The `run()` function is already well-structured for testing.
|
|
128
|
+
- **Estimated effort:** Medium
|
|
129
|
+
|
|
130
|
+
#### M7 — `splitCommand` in `gates.go` is a naïve shell tokeniser
|
|
131
|
+
|
|
132
|
+
- **Finding:** [gates.go:101-124](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/doctor/gates.go#L101-L124) handles only double-quote grouping — no escaping, no single quotes, no backslash-escapes.
|
|
133
|
+
- **Why it matters:** Users configuring quality gates with complex commands (e.g., `go test -run "Test Foo"`) may get unexpected tokenisation.
|
|
134
|
+
- **Evidence:** `case c == '"': inQuote = !inQuote` — no escape handling.
|
|
135
|
+
- **Recommended fix:** Document the limitation or use `shellwords` parsing. For this project size, documenting the limitation is sufficient.
|
|
136
|
+
- **Estimated effort:** Small
|
|
137
|
+
|
|
138
|
+
#### M8 — `epicDetailBody` and `epicAuditBody` duplicate frontmatter stripping
|
|
139
|
+
|
|
140
|
+
- **Finding:** Both [epicDetailBody](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/epic_panel.go#L43-L91) and [epicAuditBody](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/epic_panel.go#L118-L168) contain identical YAML frontmatter stripping logic (lines 50–60 and 125–134).
|
|
141
|
+
- **Why it matters:** Duplicated logic that must be changed in lockstep.
|
|
142
|
+
- **Evidence:** Compare lines 51–59 with 126–133 — identical block.
|
|
143
|
+
- **Recommended fix:** Extract a `stripFrontmatter(content string) []string` helper.
|
|
144
|
+
- **Estimated effort:** Small
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### Low
|
|
149
|
+
|
|
150
|
+
#### L1 — `ColumnType` and `TaskStatus` are parallel enumerations for the same concept
|
|
151
|
+
|
|
152
|
+
- **Finding:** [task.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/task.go) defines both `ColumnType` (`planned`, `in_progress`, `done`) and `TaskStatus` (`planned`, `in_progress`, `done`, `audited`). The `Task` struct has both `Column ColumnType` and `Status string`.
|
|
153
|
+
- **Why it matters:** Two representations of the same state create confusion. `syncTaskStatus` in `transitions.go` manually keeps them in sync.
|
|
154
|
+
- **Evidence:** [transitions.go:57-59](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/transitions.go#L57-L59) — `t.Status = string(t.Column)`.
|
|
155
|
+
- **Recommended fix:** Consider unifying into a single `TaskStatus` type and deriving the column from it. Low priority since both are kept in sync.
|
|
156
|
+
- **Estimated effort:** Medium
|
|
157
|
+
|
|
158
|
+
#### L2 — `package.json` exists for npm distribution but `scripts.test` is misleading
|
|
159
|
+
|
|
160
|
+
- **Finding:** [package.json:24](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/package.json#L24) — `"test": "savepoint init"` — this is not a real test.
|
|
161
|
+
- **Why it matters:** Running `npm test` will scaffold a project in the current directory rather than running tests.
|
|
162
|
+
- **Recommended fix:** Change to `"test": "echo \"Run 'make test' for Go tests\""` or remove the scripts section.
|
|
163
|
+
- **Estimated effort:** Small
|
|
164
|
+
|
|
165
|
+
#### L3 — `shortID` and `shortRouterID` are near-duplicates
|
|
166
|
+
|
|
167
|
+
- **Finding:** [card.go:shortID](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/card.go#L119-L127) and [view.go:shortRouterID](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/view.go#L160-L169) extract the same pattern (last segment after `/`, prefix before `-`).
|
|
168
|
+
- **Why it matters:** Minor duplication — both are small helpers but do the same thing.
|
|
169
|
+
- **Recommended fix:** Consolidate into one exported `ShortID(full string) string` function.
|
|
170
|
+
- **Estimated effort:** Small
|
|
171
|
+
|
|
172
|
+
#### L4 — `epicIndex` and `releaseIndex` are identical functions
|
|
173
|
+
|
|
174
|
+
- **Finding:** [epic_panel.go:epicIndex](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/epic_panel.go#L249-L256) and [release.go:releaseIndex](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/release.go#L35-L42) have identical logic — find a string in a slice, return 0 if not found.
|
|
175
|
+
- **Why it matters:** Two functions doing the same thing.
|
|
176
|
+
- **Recommended fix:** Extract `sliceIndex(items []string, target string) int`.
|
|
177
|
+
- **Estimated effort:** Small
|
|
178
|
+
|
|
179
|
+
#### L5 — Unused function `taskLabel` in `column.go`
|
|
180
|
+
|
|
181
|
+
- **Finding:** [column.go:91-96](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/column.go#L91-L96) defines `taskLabel` but it is never called.
|
|
182
|
+
- **Why it matters:** Dead code.
|
|
183
|
+
- **Recommended fix:** Delete it.
|
|
184
|
+
- **Estimated effort:** Small
|
|
185
|
+
|
|
186
|
+
#### L6 — `loadAllTasks` in `board.go` wraps `loadBoardData` but discards 4 return values
|
|
187
|
+
|
|
188
|
+
- **Finding:** [board.go:125-128](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/board.go#L125-L128) — `func loadAllTasks(root string) ([]data.Task, error)` is defined but never called.
|
|
189
|
+
- **Why it matters:** Dead code.
|
|
190
|
+
- **Recommended fix:** Delete it.
|
|
191
|
+
- **Estimated effort:** Small
|
|
192
|
+
|
|
193
|
+
#### L7 — No linter configured
|
|
194
|
+
|
|
195
|
+
- **Finding:** No `.golangci.yml` or linter configuration in the repository.
|
|
196
|
+
- **Why it matters:** Lint could catch many of the issues in this audit automatically (dead code, duplicate functions, etc.).
|
|
197
|
+
- **Recommended fix:** Add a basic `.golangci.yml` with `unused`, `errcheck`, `staticcheck`, and `govet`.
|
|
198
|
+
- **Estimated effort:** Small
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 3. Complexity & Modularity Review
|
|
203
|
+
|
|
204
|
+
### Overly large files or functions
|
|
205
|
+
|
|
206
|
+
| File | Lines | Concern |
|
|
207
|
+
|------|-------|---------|
|
|
208
|
+
| [update.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/update.go) | 522 | `Update()` is 170 lines; `updateOverlay()` is 100 lines |
|
|
209
|
+
| [checks.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/doctor/checks.go) | 586 | Reasonable for a checks aggregator, but could be split by check type |
|
|
210
|
+
| [write.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/data/write.go) | 217 | Two large functions with duplicated body-offset arithmetic |
|
|
211
|
+
|
|
212
|
+
### Tight coupling
|
|
213
|
+
|
|
214
|
+
- **Board → data:** The board package imports `data` for models, parsing, and writing. This is appropriate for a small project.
|
|
215
|
+
- **Board → os:** `model.go` and `update.go` call `os.ReadFile`, `os.Stat`, and `os.WriteFile` directly. This couples business logic to the filesystem. Not a problem today but will make unit tests slower if the board grows.
|
|
216
|
+
|
|
217
|
+
### Repeated logic
|
|
218
|
+
|
|
219
|
+
1. Frontmatter stripping (3 places)
|
|
220
|
+
2. `shortID` extraction (2 places)
|
|
221
|
+
3. `indexOf` / `epicIndex` / `releaseIndex` pattern (3 places)
|
|
222
|
+
4. Space-bar and Backspace handlers in `update.go` (nearly identical structure)
|
|
223
|
+
5. `Discover` instantiation (7 places)
|
|
224
|
+
|
|
225
|
+
### Poor naming
|
|
226
|
+
|
|
227
|
+
None found. Naming is consistently clear and idiomatic Go.
|
|
228
|
+
|
|
229
|
+
### Unclear data flow
|
|
230
|
+
|
|
231
|
+
The `Task.Status` vs `Task.Column` duality is the main source of confusion. `Status` is the string from the YAML, `Column` is the normalised enum, and `syncTaskStatus` bridges them. A newcomer would need to trace this chain.
|
|
232
|
+
|
|
233
|
+
### Components doing too much
|
|
234
|
+
|
|
235
|
+
`update.go`'s `Update()` handles: quit, overlays (epic, release, help, detail, epic-detail), navigation (left, right, up, down, pgup, pgdown), task transitions (space, backspace), router priority (p), epic panel focus switching, and window resize. This should be 3–4 functions.
|
|
236
|
+
|
|
237
|
+
### Missing abstraction
|
|
238
|
+
|
|
239
|
+
A `FrontmatterDocument` type that encapsulates "parse YAML → modify → reserialise with body preserved" would eliminate the duplicated write logic.
|
|
240
|
+
|
|
241
|
+
### Excessive abstraction
|
|
242
|
+
|
|
243
|
+
The `Discover`, `Parser`, `ConfigReader`, and `RouterReader` structs are over-abstracted — they hold no state and exist only as method namespaces. They should be either interfaces (H4) or package-level functions (M2).
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## 4. Architecture Review
|
|
248
|
+
|
|
249
|
+
### Folder organisation ✅
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
savepoint/
|
|
253
|
+
├── cmd/ # CLI arg parsing — clean separation from execution
|
|
254
|
+
├── internal/
|
|
255
|
+
│ ├── board/ # TUI model/view/update — Elm architecture
|
|
256
|
+
│ ├── buildtool/ # Standalone Go binary for build automation
|
|
257
|
+
│ ├── data/ # Models, parsing, writing, discovery
|
|
258
|
+
│ ├── doctor/ # Read-only diagnostics
|
|
259
|
+
│ ├── init/ # Scaffolding
|
|
260
|
+
│ └── styles/ # Centralised palette + styles
|
|
261
|
+
├── templates/ # Embedded scaffold templates
|
|
262
|
+
└── agent-skills/ # Prompt documents for AI agents
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
This structure is clean and appropriate. `cmd/` handles arg parsing, `internal/` contains all logic, templates are embedded. No changes recommended.
|
|
266
|
+
|
|
267
|
+
### Domain boundaries ✅
|
|
268
|
+
|
|
269
|
+
Boundaries are sensible. `data` owns models and persistence, `board` owns presentation, `doctor` owns diagnostics. No circular dependencies.
|
|
270
|
+
|
|
271
|
+
### State management
|
|
272
|
+
|
|
273
|
+
The Bubble Tea `Model` struct has 27 fields. This is on the upper bound of manageable. If the TUI grows, consider grouping related fields into sub-structs (e.g., `EpicPanelState`, `OverlayState`).
|
|
274
|
+
|
|
275
|
+
### API / data layer
|
|
276
|
+
|
|
277
|
+
The data layer is file-based (markdown + YAML frontmatter). This is the right choice for the project's stated design philosophy of "slow down, write things down." No database or network calls exist.
|
|
278
|
+
|
|
279
|
+
### Configuration approach ✅
|
|
280
|
+
|
|
281
|
+
`config.yml` with defaults baked into Go code. Clean and simple.
|
|
282
|
+
|
|
283
|
+
### Error handling strategy
|
|
284
|
+
|
|
285
|
+
Error handling is generally good — errors are wrapped with `fmt.Errorf("context: %w", err)` consistently. One concern: `reloadTasks` in [watch.go:58](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/watch.go#L56-L64) silently swallows all errors by returning `nil`:
|
|
286
|
+
|
|
287
|
+
```go
|
|
288
|
+
tasks, releases, releaseEpics, epicStatuses, err := loadBoardData(root)
|
|
289
|
+
if err != nil {
|
|
290
|
+
return nil // error silently dropped
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
This means a malformed task file will cause the board to silently stop refreshing. Consider emitting an `errorMsg` type instead.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 5. Best-Practice Review
|
|
299
|
+
|
|
300
|
+
### Framework conventions ✅
|
|
301
|
+
|
|
302
|
+
The Bubble Tea Model/Update/View pattern is followed correctly. Messages are properly typed. Commands are returned where appropriate.
|
|
303
|
+
|
|
304
|
+
### Type safety ✅
|
|
305
|
+
|
|
306
|
+
Custom types (`ColumnType`, `ProgressStage`, `OverlayType`, `TaskStatus`) are used appropriately instead of raw strings. The `ColumnType` → `ColumnType` validation in `lifecycle.go` is solid.
|
|
307
|
+
|
|
308
|
+
### Linting/formatting ⚠️
|
|
309
|
+
|
|
310
|
+
No linter is configured. `go fmt` appears to have been run (code is consistently formatted), but static analysis tools like `staticcheck` or `golangci-lint` would catch the dead code and duplication issues found in this audit.
|
|
311
|
+
|
|
312
|
+
### Testing approach ✅
|
|
313
|
+
|
|
314
|
+
Strong test coverage. Tests use filesystem fixtures (temp directories) and verify behaviour end-to-end. The `board` package has both unit tests and integration tests. The test-to-code ratio of ~1.6:1 is excellent.
|
|
315
|
+
|
|
316
|
+
### Dependency management ✅
|
|
317
|
+
|
|
318
|
+
`go.mod` is clean. Only 2 direct dependencies. All indirect deps are from the Charmbracelet ecosystem. `go.sum` is checked in (correct for Go modules).
|
|
319
|
+
|
|
320
|
+
### Build/deployment setup ⚠️
|
|
321
|
+
|
|
322
|
+
The `buildtool` is a self-contained Go binary invoked via `go run ./internal/buildtool`. This is creative but unconventional — most Go projects use `goreleaser` or direct `go build` invocations. The approach works but:
|
|
323
|
+
- No CI configuration is visible (no `.github/workflows/`, no `Makefile` CI target)
|
|
324
|
+
- Binaries are committed to the repo (H1)
|
|
325
|
+
|
|
326
|
+
### Environment variable handling ✅
|
|
327
|
+
|
|
328
|
+
`NO_COLOR` and `COLORTERM` are respected in [theme.go](file:///c:/Users/User/Branding/03-VIBE-LAB/savepoint/internal/board/theme.go). No secrets or sensitive env vars are used.
|
|
329
|
+
|
|
330
|
+
### Logging/debugging practices ⚠️
|
|
331
|
+
|
|
332
|
+
No logging at all. The TUI uses `StatusMessage` for user feedback, but there is no debug log for filesystem operations, parser errors, or watcher events. For a TUI tool, this is borderline acceptable, but a `--verbose` or `--debug` flag that writes to a log file would help troubleshoot issues in the field.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## 6. Refactor Roadmap
|
|
337
|
+
|
|
338
|
+
### Phase 1 — Safe cleanup
|
|
339
|
+
|
|
340
|
+
**Objective:** Remove dead code, fix obvious duplication, improve hygiene.
|
|
341
|
+
|
|
342
|
+
| Task | Risk |
|
|
343
|
+
|------|------|
|
|
344
|
+
| Delete `taskLabel()` from `column.go` | None |
|
|
345
|
+
| Delete `loadAllTasks()` from `board.go` | None |
|
|
346
|
+
| Delete or update `newProgramModel()` in `board.go` | None |
|
|
347
|
+
| Replace custom `contains`/`indexOf` in `repairs.go` with `strings.Contains` | None |
|
|
348
|
+
| Replace custom `trimSpace` in `buildtool/main.go` with `strings.TrimSpace` | None |
|
|
349
|
+
| Add `savepoint`, `savepoint.exe`, `dist/`, `*.zip` to `.gitignore` and remove from tracking | None |
|
|
350
|
+
| Fix `package.json` test script | None |
|
|
351
|
+
| Add `.golangci.yml` with basic linters | None |
|
|
352
|
+
|
|
353
|
+
**Expected benefit:** Cleaner codebase, smaller repo, automated lint catches.
|
|
354
|
+
**Risk level:** Low.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
### Phase 2 — Structural improvements
|
|
359
|
+
|
|
360
|
+
**Objective:** Reduce duplication, improve modularity, make key files easier to extend.
|
|
361
|
+
|
|
362
|
+
| Task | Risk |
|
|
363
|
+
|------|------|
|
|
364
|
+
| Extract `SplitFrontmatterBody()` in `data` package; refactor `write.go` | Low — well-tested |
|
|
365
|
+
| Extract `stripFrontmatter()` helper for `epic_panel.go` | Low |
|
|
366
|
+
| Consolidate `shortID` / `shortRouterID` into one function | Low |
|
|
367
|
+
| Consolidate `epicIndex` / `releaseIndex` into `sliceIndex` | Low |
|
|
368
|
+
| Split `Update()` into `handleBoardKey()`, `handleOverlayKey()`, and named action methods | Medium — many tests depend on exact Update behaviour |
|
|
369
|
+
| Group `Model` fields into sub-structs (`EpicPanelState`, `OverlayState`) | Medium |
|
|
370
|
+
| Convert stateless data types to package-level functions or introduce consumer-defined interfaces | Medium |
|
|
371
|
+
|
|
372
|
+
**Expected benefit:** Easier to add features, reduced duplication, more testable.
|
|
373
|
+
**Risk level:** Medium.
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
### Phase 3 — Hardening
|
|
378
|
+
|
|
379
|
+
**Objective:** Improve error handling, add diagnostic capabilities, fill test gaps.
|
|
380
|
+
|
|
381
|
+
| Task | Risk |
|
|
382
|
+
|------|------|
|
|
383
|
+
| Handle `reloadTasks` errors by emitting an `errorMsg` instead of returning `nil` | Low |
|
|
384
|
+
| Add `buildtool` tests | Low |
|
|
385
|
+
| Add `--verbose` debug logging to a log file | Low |
|
|
386
|
+
| Document `splitCommand` tokenisation limitations | None |
|
|
387
|
+
| Add CI workflow (GitHub Actions) with `make build && make test` | Low |
|
|
388
|
+
| Unify `ColumnType` / `TaskStatus` into a single status model | Medium — data format change |
|
|
389
|
+
|
|
390
|
+
**Expected benefit:** Fewer silent failures, better debugging, CI safety net.
|
|
391
|
+
**Risk level:** Low–Medium.
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## 7. Top 10 Action List
|
|
396
|
+
|
|
397
|
+
- [ ] **1. Add binaries to `.gitignore` and remove from Git tracking** — Severity: High — Files: `.gitignore`, `savepoint`, `savepoint.exe`, `dist/`, `ink-cli-ui-design.zip` — Benefit: Repo shrinks by 12 MB+, eliminates merge noise
|
|
398
|
+
- [ ] **2. Extract `SplitFrontmatterBody()` to deduplicate write logic** — Severity: High — Files: `internal/data/write.go` — Benefit: Single source of truth for frontmatter reconstruction
|
|
399
|
+
- [ ] **3. Split `Update()` into named key-handler methods** — Severity: High — Files: `internal/board/update.go` — Benefit: 170-line method becomes 5–6 focused methods; easier to extend
|
|
400
|
+
- [ ] **4. Delete dead code: `taskLabel()`, `loadAllTasks()`, `newProgramModel()`** — Severity: Low — Files: `internal/board/column.go`, `internal/board/board.go` — Benefit: Less confusion for contributors
|
|
401
|
+
- [ ] **5. Replace custom `contains`/`indexOf`/`trimSpace` with stdlib** — Severity: Medium — Files: `internal/doctor/repairs.go`, `internal/buildtool/main.go` — Benefit: Idiomatic Go, less code to maintain
|
|
402
|
+
- [ ] **6. Extract `stripFrontmatter()` helper for `epic_panel.go`** — Severity: Medium — Files: `internal/board/epic_panel.go` — Benefit: DRY, consistent behaviour
|
|
403
|
+
- [ ] **7. Add `.golangci.yml` linter configuration** — Severity: Medium — Files: project root — Benefit: Automated detection of dead code, unchecked errors, and style issues
|
|
404
|
+
- [ ] **8. Handle `reloadTasks` errors instead of silently swallowing** — Severity: Medium — Files: `internal/board/watch.go` — Benefit: Board surfaces parse errors to the user instead of silently freezing
|
|
405
|
+
- [ ] **9. Add tests for `buildtool`** — Severity: Medium — Files: `internal/buildtool/` — Benefit: Cross-platform build confidence
|
|
406
|
+
- [ ] **10. Consolidate `shortID`/`shortRouterID` and `epicIndex`/`releaseIndex` duplicates** — Severity: Low — Files: `internal/board/card.go`, `internal/board/view.go`, `internal/board/epic_panel.go`, `internal/board/release.go` — Benefit: Single source of truth for slug extraction and list search
|