spec: Astra round 6 findings on video conversion, unedited
Three P1 (deadline container start ordering, the long-lived caller key, allowance reservation), two P2 (short jobs classed long, loudness precedence). Goes to Paul.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R6.md+64 −0
CI failed — run details
Intent
<task-notification> <task-id>bzp02f83e</task-id> <tool-use-id>toolu_01FyvxSguoLo58vZCE686Cfn</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/8509ad95-d983-414c-9679-b3ef222618ef/tasks/bzp02f83e.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 6 (changes only) review" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 12.2 g CO₂e (1,437,872 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-R6.md b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R6.md| new file mode 100644 |
| index 000000000..b789353ab |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R6.md |
| @@ -0,0 +1,64 @@ |
| +Reviewed `0e7e991d..63af7003`, changes only, with necessary surrounding text. The worktree’s spec matches the reviewed revision. No files were modified or live AWS tests run. Discussion 1120 was unreachable; round history was read from the local findings files. |
| + |
| +**Findings: 3 P1, 2 P2.** |
| + |
| +1. **P1 — §5.5: the codec can start before its deadline is active.** |
| + |
| + **Invariant / fault family: execution is bounded independently of the console and compromised codec — R4-2 → R5-1.** |
| + |
| + The [two-container definition](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:396) makes both containers essential but specifies no startup dependency. Essential status supplies a stop rule; it does not require the timer to start first. AWS provides `dependsOn` with `START` for that ordering. [https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) |
| + |
| + Consequently, the design permits codec execution while timer startup is delayed. If the timer never starts, [the stated fallback](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:386) is the reaper whose timing already failed R5. This gap requires no container escape. |
| + |
| + **Disposition:** retain the refusal gate: dispatch must reject task definitions that allow codec startup before the deadline container is running. Require startup ordering, an explicit 30-second stop timeout, and drills covering delayed and failed timer startup. |
| + |
| + Once active, the timer removes the console/scheduler dependency for ordinary codec compromise. It still trusts Fargate’s process isolation, scheduling, kernel and essential-container termination. A kernel escape remains outside that guarantee; the reaper cannot restore a strict bound. |
| + |
| +2. **P1 — §5.4: leaking the caller key grants deployment-wide conversion authority.** |
| + |
| + **Invariant: possession of the new long-lived key outside the console must not grant unrestricted cross-tenant storage access.** |
| + |
| + [Lines 340–362](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:340) restrict the caller to `AssumeRole`, but the console voluntarily supplies the session policy. Session policies are optional. An attacker holding the key can omit it and receive the conversion role’s full permissions. [https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) |
| + |
| + The resulting authority includes reading known, non-infected object keys across eligible stores and writing or overwriting `derived/` objects and deployment result objects. The signed create-only header is also voluntary when the attacker holds role credentials. The engine endpoint policy does not constrain requests made elsewhere. |
| + |
| + **Smallest restriction:** bind role assumption in the trust policy to the console’s approved network origin, such as its fixed egress addresses. Prove that the caller key cannot assume the role from outside that origin. This contains an exported-key leak; it does not contain compromise of the console itself. Restricting where already-issued sessions may be used requires a separate data-access condition. [https://aws.amazon.com/blogs/security/how-to-use-trust-policies-with-iam-roles/](https://aws.amazon.com/blogs/security/how-to-use-trust-policies-with-iam-roles/) |
| + |
| +3. **P1 — §7.3: reservations do not cover every possible settlement charge.** |
| + |
| + **Invariant: concurrent executions cannot spend the same remaining allowance.** |
| + |
| + [The charging rules](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:660) reserve engine time but charge successful jobs by source duration. Audio can therefore settle for substantially more than its reservation. |
| + |
| + For example, an account with 20 allowance minutes can receive a 200-minute audio grant. Under the stated two-hour engine ceiling, its reservation is about 12 allowance minutes. A two-minute video can start concurrently as the account’s short execution. Both succeeding costs 22 allowance minutes, although only 20 remained. Each row can settle exactly once and still violate the allowance limit. |
| + |
| + Independently, [the deadline formula](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:672) permits `deadline = R/w` without subtracting the stop grace. A deadline failure can itself exceed the remaining allowance. |
| + |
| + **Fix:** atomically reserve the greater of the maximum success charge and maximum failure charge: |
| + `w × max(granted_duration, deadline + stop_grace)`, with consistent units. Choose both grants so this reservation fits `R`. Add concurrent audio/video settlement and grace-boundary cases to the existing simulation. Preserve ECS runtime in `charged_ms`; do not cap recorded usage to conceal an overspend. |
| + |
| +4. **P2 — §§7.2–7.3: short clips are classified as long jobs.** |
| + |
| + **Invariant: long conversions leave dispatch capacity available to short clips.** |
| + |
| + [Long means a deadline above 30 minutes](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:643), but dispatch computes that deadline from the preset’s **maximum** duration before probing the source. With sufficient allowance, even a tiny video receives an hours-long deadline. |
| + |
| + Four long executions therefore block that clip despite four unused dispatch slots, contradicting [the acceptance drill](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:820). |
| + |
| + **Fix:** establish an enforceable short-job class before dispatch—for example, an explicit short execution budget with its own granted duration and probe refusal. Schedule eligible rows by class so an account’s blocked long row does not hide an eligible short row. |
| + |
| +5. **P2 — §5.1: the audio normalization promises cannot all hold.** |
| + |
| + **Invariant: every admitted audio input has a defined, achievable output contract.** |
| + |
| + [Lines 145–146](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:145) promise −16 LUFS, a −1.5 dBTP peak ceiling and unchanged dynamics using one linear gain. Consider audio measuring −30 LUFS with a −3 dBTP peak: reaching −16 LUFS requires +14 dB, which breaks the peak ceiling. |
| + |
| + FFmpeg’s `loudnorm` falls back to dynamic normalization when linear gain cannot satisfy its constraints, breaking the unchanged-dynamics promise. [https://ffmpeg.org/ffmpeg-filters.html#loudnorm](https://ffmpeg.org/ffmpeg-filters.html#loudnorm) |
| + |
| + **Fix:** define precedence. To preserve dynamics, cap gain at the peak ceiling and permit quieter output; specify silent-input behavior and amend the universal −16 LUFS acceptance test. |
| + |
| +The multipart-source recipe, opaque ETag treatment, resumable GET and explicit output-size refusal introduce no further finding. Presigned URLs cannot authorize new requests after their signing session expires; an existing download may continue, but reconnection after expiry fails. The stated grant lifetime supports long jobs only within that boundary. [https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html) |
| + |
| +Stopping rule 2 remains active for the R4/R5 deadline invariant. Apply the refusal gate rather than another timing estimate; no additional review round is proposed. |
| + |
| +**Verdict: revise.** |
| \ No newline at end of file |