fix: code hardening from senior dev audit #40

Merged
lerko merged 6 commits from fix/audit-phase1-hardening into main 2026-05-21 01:04:31 +00:00
Showing only changes of commit ceb29fdd7b - Show all commits
+16 -16
View File
@@ -1,27 +1,27 @@
# Code Hardening — Senior Dev Audit Fixes # Code Hardening — Senior Dev Audit Fixes
## Phase 1: Quick Wins (safety + correctness) ## Phase 1: Quick Wins (safety + correctness)
- [ ] Cap API list limit at 200 - [x] Cap API list limit at 200
- [ ] Fix markdown XSS — add DOMPurify to sanitize marked output - [x] Fix markdown XSS — add DOMPurify to sanitize marked output
- [ ] Add missing DB indexes (deleted_at, modified_at) via v4 migration - [x] Add missing DB indexes (deleted_at, modified_at) via v4 migration
- [ ] Fix v2 migration error handling (swallowed ALTER TABLE errors) - [x] Fix v2 migration error handling (swallowed ALTER TABLE errors)
- [ ] Fix ~/.nib directory permissions (0o755 → 0o700) - [x] Fix ~/.nib directory permissions (0o755 → 0o700)
## Phase 2: CI Pipeline ## Phase 2: CI Pipeline
- [ ] Gitea Actions workflow: test + lint on PR - [x] Gitea Actions workflow: test + lint on PR
## Phase 3: context.Context in Store ## Phase 3: context.Context in Store
- [ ] Thread context.Context through all Store methods - [x] Thread context.Context through all Store methods
- [ ] Use context in API handlers (from r.Context()) - [x] Use context in API handlers (from r.Context())
- [ ] Use context in CLI commands (cobra context) - [x] Use context in CLI commands (cobra context)
## Phase 4: cmd/ Tests ## Phase 4: cmd/ Tests
- [ ] Test add command - [x] Test add command
- [ ] Test ls command - [x] Test ls command
- [ ] Test promote/demote commands - [x] Test promote/demote commands
- [ ] Test delete command - [x] Test delete command
- [ ] Test absorb command - [x] Test absorb command
## Phase 5: Backup/Export ## Phase 5: Backup/Export
- [ ] nib export — dump entities to JSON - [x] nib export — dump entities to JSON
- [ ] nib backup — safe SQLite backup (handles WAL) - [x] nib backup — safe SQLite backup (handles WAL)