Files and storage
The two upload flows are currently different. MERGED, NOT DEPLOYED — standards reserve a pending row, upload bytes, then complete the row. Answer attachments upload bytes first and insert their row afterwards; a later failure can leave an orphan. A:apps/api/src/standards/standards.controller.ts:137-154 A:apps/api/src/questionnaires/responses.controller.ts:173-184
The diagram is the merged standards flow only. All bytes pass through the API. Keys today are platform/standards/{file} and tenants/{tenant}/answers/{file}. File names are metadata, not key components. Local storage uses .local-files when the bucket is unset. A:apps/api/src/standards/store.ts:24-77 A:apps/api/src/questionnaires/responses.controller.ts:62-64,190-210
LIVE ON STAGING — documents are versioned and KMS-encrypted with a noncurrent-version 30-day lifecycle. The API has Get/Put permissions and no observed delete permission. Cleanup and purge schedules exist, but this does not prove successful retention runs. E:evidence-aws.md:28,43-44,55
APPROVED, IN BUILD — P2.23/P2.24 changes answer uploads to reserve → scoped upload → complete. Pending rows stay invisible. A reservation holds an attachment slot for one hour; abandoned rows are swept after one day. Client/session tags, user SourceIdentity and short-lived credentials bind access to the DB-derived prefix. A:.set/work/P2.23.md:48-99,174-195 A:.set/work/decisions-2026-10-26.md:30-34,52-60
| Retention or maintenance | Status | Rule |
|---|---|---|
| Standards cleanup | MERGED, NOT DEPLOYED | Removed files/frameworks older than 30 days and pending files older than a day are candidates; all object versions are deleted before metadata erasure. A:apps/api/src/standards/purge.ts:1-100 |
| Restore-point retention | MERGED, NOT DEPLOYED | One-year expiry; runtime DELETE revoked by follow-up migration. A:apps/api/drizzle/tenant/0018_restore_points.sql:33-35 A:apps/api/drizzle/tenant/0019_restore_delete_revoked.sql:1 A:apps/api/src/db/migrations/runner.ts:456-457 |
| Answer-file sweep | APPROVED, IN BUILD | Pending >1 day; removed files after the one-year restore window. Planned purge tripwire and tombstones. A:.set/work/decisions-2026-10-26.md:8,55-58 A:.set/work/P2.23.md:200-270 |
| One-time mover | APPROVED, IN BUILD | Manual plan/copy/strays/delete-old/reverse passes; manifest records exact versions and checksums. Soak 7 days, then delete markers leave 30-day recoverability. These periods apply only to the move. A:.set/work/P2.23.md:117-151 A:.set/work/decisions-2026-10-26.md:58 |
| Deletion tripwire | APPROVED, IN BUILD | Ron approved 200 objects / 10%; design review refines the population and approval procedure. Never treat those two numbers as a verified runtime guard. A:.set/work/decisions-2026-10-26.md:55 A:.set/work/P2.23.md:200-270,398-400 |
Source conflict: AWS evidence says the bucket denies object IO except the API role while a cleanup task and role exist. Do not infer that cleanup successfully deletes versions; obtain an actual successful run and exact applied bucket policy. E:evidence-aws.md:30,43-44,55 Terraform's newer policy is only a definition.
NOT VERIFIED — deployed broker, completed move, strays removed, version recovery drill, purge success and VPC-only denial tests. Verify each in the app/AWS evidence packs before changing its label.
LIVE ON STAGING — the app pack confirms the bucket has no VPC-endpoint denial, no scoped file roles exist, and the purge task has no FILES_BUCKET. APPROVED, IN BUILD — wave-2 storage and job code is recorded on separate branches at 2e61ef7 and 09a62aa. It remains outside the integrated app snapshot. E:evidence.md:17,29,32-35