carlos / platform Public

review: Astra findings for media-results-cleanup, round 2

READY AFTER FIXES. Round 1's four findings resolved, P1-1 as A8's
stated residual. Two P2s: the simulation loses given-up executions once
cleanup clears them from the row; code and test comments still claim a
finality A8 no longer does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 180dbf2a31bebcc43b3f0246739212ea10f81a8c parent 8bc5035
1 file changed, +32 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-media-results-cleanup-R2.md +32 −0
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-media-results-cleanup-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-media-results-cleanup-R2.md
new file mode 100644
index 000000000..6ef521e04
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-media-results-cleanup-R2.md
@@ -0,0 +1,32 @@
+- **R1 P1-1 — Resolved as a blocker by accepting A8’s narrower guarantee.** Late completion remains possible; this is an accepted residual, not a code fix.
+- **R1 P1-2 — Resolved.** Console tests now check retention before the grant bound and deletion afterward.
+- **R1 P2-3 — Resolved.** Abandoned executions retain durable cleanup duties through retry, retirement and pruning.
+- **R1 P2-4 — Resolved.** A8 distinguishes expiration eligibility from asynchronous deletion and removes the maximum-duration promise.
+
+Reviewed commit `8bc5035a00c2243cbf59344ebd76387611f520be`. No P1 findings.
+
+1. **P2 — Simulation loses abandoned executions immediately after cleanup.**
+
+ `actLeakedPut` requires an execution to match a current row’s `execution_id` or `prior_execution` at [actions_test.go:669](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/internal/sim/mediajobs/actions_test.go:669). Cleanup clears `prior_execution` at [retire.go:178](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/internal/mediajobs/retire.go:178). R1 also skips output checks when that row association disappears at [invariants_test.go:604](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/internal/sim/mediajobs/invariants_test.go:604).
+
+ **Failure scenario:** a regression cleans an abandoned execution before its grant expires. After cleanup clears the prior identity, the simulation cannot attempt another leaked PUT for it. Even an independently recreated output escapes R1’s checks. The simulation therefore misses the resurrection it claims to detect.
+
+ **Fix:** retain execution-to-object metadata independently of live rows, in deterministic grant order. Keep cleaned executions eligible for leaked PUT attempts and check their recorded output keys after cleanup and pruning. Add a witness demonstrating detection of premature prior cleanup.
+
+ **Fault family:** cleanup verification must survive execution replacement and removal.
+
+2. **P2 — Cleanup guarantees still contradict A8’s accepted residual.**
+
+ [dispatch.go:305](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/internal/mediajobs/dispatch.go:305) says cleanup is final and nothing can recreate an object. [jobs_test.go:1210](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/internal/mediajobs/jobs_test.go:1210) repeats that guarantee. Both contradict [A8:1135](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/docs/superpowers/specs/2026-11-16-video-conversion-design.md:1135).
+
+ **Failure scenario:** an upload starts before expiry, cleanup clears the duty, and the upload completes afterward. The atomic fake does not exercise that interleaving, so passing tests do not establish finality.
+
+ **Fix:** describe the bound as preventing **new requests**, qualify R1 as covering the model’s atomic PUTs, and explicitly reference the late-completion residual. Remove unconditional finality claims.
+
+ **Fault family:** cleanup guarantees must distinguish request expiry from upload completion.
+
+I accept the residual because late results have lifecycle cleanup, while late outputs remain confined to their execution’s prefix in the tenant bucket, which the app already has permission to write ([aws.go:202](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/media-results-cleanup/internal/objstore/aws.go:202)). This does not establish bounded physical deletion: S3 expiration checks and lifecycle timing have the limitations documented at [https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html) and [https://docs.aws.amazon.com/AmazonS3/latest/userguide/troubleshoot-lifecycle.html](https://docs.aws.amazon.com/AmazonS3/latest/userguide/troubleshoot-lifecycle.html).
+
+No P3 findings. Census and rollout rulings remain unchanged. `git diff --check` passed. No files changed, tests run, or AWS API calls made. Apply the P2 fixes without reopening review.
+
+**READY AFTER FIXES**
\ No newline at end of file