Prompt: Attachment Lifecycle Manager (2025-10-17)
View Source
Required Reading
docs/20251017/attachment-lifecycle.mddocs/design/attachments-files.mdlib/codex/files.extest/codex/files_test.exs, test/integration/attachment_pipeline_test.exs
TDD Checklist
- Red – extend tests:
- Add tests ensuring staged entries track
inserted_at and TTL. - Integration test forcing cleanup (manual trigger) removes expired files.
- Telemetry test asserting
[:codex, :attachment, :staged] / :cleaned events. - Metrics test verifying
Codex.Files.metrics/0 returns counts/bytes.
- Green – implement GenServer registry, periodic cleanup, metrics accessor.
- Refactor – update docs, ensure staging helpers reuse registry, run
mix format, mix test, mix codex.verify.