Step 8: Polish — lint, clock abstraction, e2e test.

- golangci-lint config with errcheck, govet, staticcheck, errorlint
- Fix all lint issues (unchecked error returns in cleanup paths, De Morgan)
- Inject jonboulle/clockwork into Garden for deterministic timestamps
- Add manifest.NewWithTime() for clock-aware initialization
- E2e lifecycle test: init → add → checkpoint → modify → status → restore → verify
- Update CLAUDE.md, PROJECT_PLAN.md, PROGRESS.md

Phase 1 (local) is now complete. All 9 CLI commands implemented and tested.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 22:03:53 -07:00
parent 08e24b44e0
commit d1a6e533a4
11 changed files with 200 additions and 37 deletions

View File

@@ -23,7 +23,7 @@ func validHash(s string) bool {
return false
}
for _, c := range s {
if !((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')) {
if (c < '0' || c > '9') && (c < 'a' || c > 'f') {
return false
}
}
@@ -74,17 +74,17 @@ func (s *Store) Write(data []byte) (string, error) {
tmpName := tmp.Name()
if _, err := tmp.Write(data); err != nil {
tmp.Close()
os.Remove(tmpName)
_ = tmp.Close()
_ = os.Remove(tmpName)
return "", fmt.Errorf("store: write temp file: %w", err)
}
if err := tmp.Close(); err != nil {
os.Remove(tmpName)
_ = os.Remove(tmpName)
return "", fmt.Errorf("store: close temp file: %w", err)
}
if err := os.Rename(tmpName, p); err != nil {
os.Remove(tmpName)
_ = os.Remove(tmpName)
return "", fmt.Errorf("store: rename blob into place: %w", err)
}