feat: add SQLite database corruption guardrails

- Add PRAGMA quick_check on startup with warning log if corrupted
- Add corruption sentinel helpers for structured error detection
- Add backup retention (keep last 7, auto-cleanup after daily backup)
- Add GET /api/v1/health/db endpoint for orchestrator health checks

Prevents silent data loss and enables proactive corruption detection.
This commit is contained in:
GitHub Actions
2025-12-17 16:53:38 +00:00
parent bd0dfd5487
commit b015284165
14 changed files with 1369 additions and 205 deletions
+4 -2
View File
@@ -18,12 +18,13 @@ repos:
files: "Dockerfile.*"
pass_filenames: true
- id: go-test-coverage
name: Go Test Coverage
name: Go Test Coverage (Manual)
entry: scripts/go-test-coverage.sh
language: script
files: '\.go$'
pass_filenames: false
verbose: true
stages: [manual] # Only runs when explicitly called
- id: go-vet
name: Go Vet
entry: bash -c 'cd backend && go vet ./...'
@@ -85,11 +86,12 @@ repos:
pass_filenames: false
stages: [manual] # Only runs when explicitly called
- id: frontend-type-check
name: Frontend TypeScript Check
name: Frontend TypeScript Check (Manual)
entry: bash -c 'cd frontend && npm run type-check'
language: system
files: '^frontend/.*\.(ts|tsx)$'
pass_filenames: false
stages: [manual] # Only runs when explicitly called
- id: frontend-lint
name: Frontend Lint (Fix)
entry: bash -c 'cd frontend && npm run lint -- --fix'