spec: Astra round 4 findings on video conversion, unedited
Two P1 (interface endpoints without policies; hard deadline depends on the console), two P2 (stopped-task recovery, launch rejection). Final round; goes to Paul.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R4.md+52 −0
CI cancelled — superseded by a newer push — run details
Intent
All sounds good
<task-notification> <task-id>b7tbmzw7r</task-id> <tool-use-id>toolu_01DHvdyh9zN6nGVNvYuEQC8Z</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/8509ad95-d983-414c-9679-b3ef222618ef/tasks/b7tbmzw7r.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 4 (narrow) review" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 9.01 g CO₂e (1,052,615 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-video-conversion, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R4.md b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R4.md| new file mode 100644 |
| index 000000000..5579a7ba6 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R4.md |
| @@ -0,0 +1,52 @@ |
| +Reviewed revision 4 at `0d8eb009`; the worktree’s spec matches that commit. Scope: R-F and R3-1 through R3-4 only. No files were modified. This was a design review; no live AWS tests were run. |
| + |
| +**Findings: 2 P1, 2 P2.** |
| + |
| +1. **P1 — §§5.5–6: the interface endpoints leave an exfiltration path open.** |
| + **Invariant: a compromised codec cannot communicate outside the execution’s permitted transfers.** |
| + |
| + [The network policy](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:347) restricts the S3 endpoint’s principals and resources, but specifies no equivalent policies for the ECR and CloudWatch Logs endpoints. AWS gives an endpoint without a custom policy full service access, subject to the caller’s credentials. [https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch-logs-and-interface-VPC.html](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch-logs-and-interface-VPC.html) |
| + |
| + **The attack is an inference:** a hostile source can carry the attacker’s own AWS credentials. After compromising ffmpeg, it can send source bytes or the five bearer transfers to an attacker-owned log stream through the allowed regional Logs endpoint. Neither the missing task role nor the DNS allow-list blocks that request. This contradicts the confinement claim at [lines 467–475](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:467). |
| + |
| + **Smallest fix:** Require policies on all three interface endpoints that admit only the task execution role and its necessary image-pull/logging operations, with repository and log-group restrictions where supported. Refuse activation unless a drill using an unrelated account’s credentials proves those endpoints reject access. AWS documents ECR endpoint policies for this purpose. [https://docs.aws.amazon.com/AmazonECR/latest/userguide/vpc-endpoints.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/vpc-endpoints.html) |
| + |
| +2. **P1 — §§5.3, 5.5, 7.2: the hard deadline disappears while the console is down.** |
| + **Invariant: hostile execution has an enforced duration bound independent of the compromised codec.** |
| + |
| + [The hard deadline](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:226) depends entirely on the console calling `StopTask`. The other timer is inside [the handler’s container](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:317), which §6 assumes compromised. `StopTask` initiates termination when called; its grace period is not a preinstalled execution deadline. [https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StopTask.html](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StopTask.html) |
| + |
| + Unlike the replaced Lambda timeout, nothing specified stops a hostile task at 15 minutes during a console outage. It can continue consuming resources. If it subsequently exits and its ECS record expires before recovery, the [unknown transition](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:213) charges only 15 minutes despite potentially hours of execution. The running reservation is likewise only 15 minutes. |
| + |
| + **Smallest safe disposition:** Refuse dispatch until a trusted deadline mechanism outside both the codec container and console process is established. Its bound must include termination grace. Prove it with the console stopped and a hostile container that ignores its handler budget; otherwise cut unattended conversion from v1. A longer URL expiry or accounting reservation does not enforce termination. |
| + |
| +3. **P2 — §5.3: `startedBy` recovery can miss a task that already finished.** |
| + **Invariant: losing the launch response does not lose the execution’s result or accounting evidence.** |
| + |
| + [Recovery without a saved ARN](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:217) relies on finding the task by `startedBy`. AWS’s `ListTasks` defaults to desired status `RUNNING`; `startedBy` must be its only filter. Consequently, that lookup does not establish that no completed task exists. [https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html) |
| + |
| + A launch succeeds, the console crashes before saving its ARN, and the task finishes before recovery. The specified lookup can miss it, eventually converting a successful job into `engine_lost`, charging 15 minutes and deleting its outputs—even though ECS still retains the stopped task. |
| + |
| + Replaying `RunTask` needs an explicit contract too: changed overrides conflict with the original token, and token retention is bounded. Re-minting presigned transfers changes those overrides. [https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_Idempotency.html](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_Idempotency.html) |
| + |
| + **Smallest fix:** Explicitly recover both active and stopped tasks—for example, list stopped tasks separately and match their described `startedBy` values. Persist each recovered ARN before settlement. If replay is used, retain the exact original request and bound replay to its valid recovery window. Add the crash-after-launch, finish-before-recovery interleaving to the simulation. |
| + |
| +4. **P2 — §5.3: launch rejection has no uncharged retry transition.** |
| + **Invariant: a definitive failure to create a task does not consume execution allowance.** |
| + |
| + [The only “never started” transition](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:210) requires ECS to report a stopped task without a start time. However, `RunTask` can return failures or reject the request before creating any task. Its response distinguishes placement failures from successfully placed tasks. [https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) |
| + |
| + Such a row has no ARN and can never satisfy that transition. Following the remaining transitions holds its capacity reservation until the deadline, then charges 15 minutes as `engine_lost`. This contradicts [the promised uncharged retry](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:231). |
| + |
| + **Smallest fix:** Add a transaction for definitive launch rejection with no task created: release the reservation, increment `start_failures`, and apply the one-retry rule for retryable start failures. Keep ambiguous transport failures on the recovery path. Test both outcomes separately. |
| + |
| +| Round-3 finding | Disposition | |
| +|---|---| |
| +| R3-1: runtime-protocol takeover | Closed at design level by one Fargate task per execution. | |
| +| R3-2: credentials and DNS exfiltration | Platform-credential and DNS mechanisms addressed; the replacement interface endpoints introduce finding 1. | |
| +| R3-3: capacity released early | Reservation rule repaired; missing-ARN recovery still needs finding 3’s correction. | |
| +| R3-4: store lifetime | Incarnation and retirement rules address the original finding; teardown still depends on reliable stop determination. | |
| + |
| +This is the approved fourth and final round. The P1s require Paul’s cut, simplification or refusal decision; no fifth round is proposed. |
| + |
| +**Verdict: revise.** |
| \ No newline at end of file |