DC-059: mark done in BACKLOG + DC-PRODUCTION-GRADE-BACKLOG
CI / Test & Lint (push) Has been cancelled
CI / Security audit (push) Has been cancelled

This commit is contained in:
Hermes
2026-08-08 15:40:18 -07:00
parent a667de7920
commit f9eaa324dd
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ If an item is too big for one tick, implement a sub-part, push that, and note pr
## P1 — Architecture & Input Validation
- [ ] **P1-1: Add Joi validation library**`npm install joi`. Create `src/utilities/validate.js` exporting `validateBody(schema)` middleware. Apply to destructive routes first: `routes/backups.js` (schedule/create/update/restore/delete), `routes/apps/deploy.js`, `routes/apps/restore.js`, `routes/config/assets.js`.
- [x] **P1-1: Add Joi validation library** Done in commit a667de7 (DC-059, codex-graded B). `npm install joi@^18`, `src/utilities/validate.js` exporting `validateBody(schema, opts)` middleware + 9 schemas (backupConfigUpdate, backupScheduleCreate, backupRestore, backupRestoreFile, appDeploy, appRestore, appRevert, assetUpload, logoUpload). Every exported schema has direct unit tests (41 total in `__tests__/unit/validate.test.js`) covering middleware semantics — not just `schema.validate`. Applied to 8 destructive routes: backups (schedule/restore/config), apps (deploy/restore/revert), assets (upload/logo). Used Joi's authoritative CIDR validator (rejects malformed IPv6 like `::::/64` that the previous hex/colon regex would have accepted). 1539/1539 Jest tests pass (was 1498, +41 new). ESLint warnings unchanged (416 total, all pre-existing — zero new introduced).
- [ ] **P1-2: Console→logger sweep (update-manager.js)** — Replace all 49 `console.*` calls in `src/managers/update-manager.js` with structured logger calls. `const log = require('../utils/logging')` then `log.info/warn/error(tag, msg, meta)`.
- [ ] **P1-3: Console→logger sweep (backup-manager.js)** — Replace all 36 `console.*` calls in `src/utilities/backup-manager.js` with structured logger.
- [ ] **P1-4: Console→logger sweep (resource-monitor.js)** — Replace all 32 `console.*` calls in `src/managers/resource-monitor.js` with structured logger.