spec: video conversion revision 8, Astra round 7 P2s; review closed
Round 7 had no P1 (findings committed unedited), so review stops under stopping rule 1. Its two P2s applied: the deadline container also stops at the grant's absolute expiry less the stop grace, and refuses an already-expired start; grant_expired is reported by a reserved codec exit code when the result PUT has expired with the grant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/specs/2026-11-16-video-conversion-design.md+29 −11docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R7.md+37 −0
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>bc8nqt5y8</task-id> <tool-use-id>toolu_016fHD17Vk14P3MqRoGbZh3W</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/8509ad95-d983-414c-9679-b3ef222618ef/tasks/bc8nqt5y8.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 7 (changes only) review" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 12.7 g CO₂e (1,514,404 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/2026-11-16-video-conversion-design.md b/docs/superpowers/specs/2026-11-16-video-conversion-design.md| index fc16f85d1..603c1415b 100644 |
| --- a/docs/superpowers/specs/2026-11-16-video-conversion-design.md |
| +++ b/docs/superpowers/specs/2026-11-16-video-conversion-design.md |
| @@ -1,14 +1,14 @@ |
| # Media conversion: video and audio in, playable files out |
| -**Date:** 2026-11-16, revision 7 (Astra round 6 and Paul's ruling R-K, §13) |
| -**Status:** draft for a narrow review of those changes. Not approved. |
| +**Date:** 2026-11-16, revision 8 (Astra round 7's P2s, §13) |
| +**Status:** review complete (round 7 had no P1). Awaiting Paul's approval. |
| **Asked for by:** Paul, 2026-11-16. Rulings: amadan discussion 1120. |
| **Builds on:** the PDF service's door, credential, plan cap and fair-use |
| shape (`2026-11-02-pdf-service-design.md`). |
| **Amends:** the media roadmap (`2026-09-07-media-platform-roadmap-design.md`), |
| stage 3's first product and part of stage 5. See §11. |
| -**Review budget:** AGENTS.md "Stopping rules". The three rounds are spent; |
| -round 4 covers only the Fargate change and the round-3 fixes. |
| +**Review budget:** AGENTS.md "Stopping rules". Rounds 4 to 7 were approved |
| +by Paul beyond the three; round 7 had no P1, so review is closed. |
| Marks: **(paul R-F)**, **(paul R-C)** Paul's rulings; **(astra R3-N)**, |
| **(astra R4-N)**, **(astra R5-1)** findings of rounds 3 to 5; **(paul R-A)**, |
| @@ -260,7 +260,7 @@ bytes, preset, bucket, `state`, `execution_id`, `task_arn`, `dispatched_at`, |
| | launch rejected (astra R4-4) | `running`, `RunTask` answers with failures, or with a 4xx, and no task was created | `task_stopped`; `start_failures` + 1; then as "never started" | |
| | never started | `running`, ECS says stopped with no start time | `task_stopped`; `start_failures` + 1; back to `queued` uncharged if the cause is retryable and this is the first, otherwise `failed` (`engine_unavailable`), settled, uncharged | |
| | stopped, success | `running`, exit 0, result read, outputs checked, not retired | `done`; `charged_ms` from ECS; `settled`; `task_stopped`; `cleanup_due` now | |
| -| stopped, failure | `running`, any other stop | `failed`; `charged_ms` from ECS; `settled`; `task_stopped`; `cleanup_due` now | |
| +| stopped, failure | `running`, any other stop | `failed` with the error from the result object if one exists; otherwise from the exit codes ECS reports (astra R7-2): `codec` exit 75 is `grant_expired`, `deadline` exited first is `deadline_exceeded`, anything else is `engine_failed`; `charged_ms` from ECS; `settled`; `task_stopped`; `cleanup_due` now | |
| | unknown | `running`, ECS shows no such task and its record retention has passed | `failed` (`engine_lost`); `charged_ms` the full bound; `settled`; `task_stopped`; `cleanup_due` when the grant expires | |
| | cleanup | `cleanup_due` reached | the result object deleted, and the three outputs unless the row is `done`; `cleanup_due` cleared | |
| | retire | any row of an app, account or store being removed | `retired_at` set; a `queued` row becomes `failed` uncharged; a `running` row's task is stopped and the row settles by the rows above | |
| @@ -407,7 +407,14 @@ roots are outside this tree)**. |
| **The task** has two containers from the same arm64 image, pinned by digest, |
| both essential, each with `stopTimeout` set explicitly to 30 seconds. |
| -- **`deadline` (astra R5-1)** runs `sleep` for the job's deadline and exits. |
| +- **`deadline` (astra R5-1)** sleeps and exits. The console passes it two |
| + values as container overrides: the job's relative deadline and the |
| + grant's absolute expiry. It sleeps until the earlier of its own start plus |
| + the deadline, and the expiry less the 30-second stop grace, and exits at |
| + once if that moment has already passed, so a task that waited in |
| + `PENDING` past its grant never converts (astra R7-1). It reads the time |
| + from the task's clock, which Fargate keeps synchronised |
| + **(unverified; a spike drill)**. |
| ECS documents that when an essential container stops, every other |
| container in the task is stopped |
| (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) |
| @@ -586,7 +593,9 @@ Treat every source as an exploit attempt. |
| broken connection with a `Range` request under the same signed `If-Match`. It |
| enforces the byte cap as it goes **(paul R-X)**. A resume after the grant has |
| expired is refused by the store and fails the execution `grant_expired` |
| -**(paul R-K)**. |
| +**(paul R-K)**. The result PUT has expired with the same grant, so the |
| +handler reports this by exiting with code 75, reserved for it, and writes no |
| +result object **(astra R7-2)**. |
| **Before ffmpeg starts.** The handler reads the first bytes in Go and accepts |
| these families: ISO BMFF (`ftyp`: MP4, MOV, 3GP, M4A) and Matroska/WebM |
| @@ -767,8 +776,11 @@ All figures here are **estimates** until the spike reports. |
| 5. that the override payload fits, that size and storage can be set per run, |
| and the two store behaviours of §5.4; |
| 6. a 30 GiB source: download with a forced reconnect, conversion and upload |
| - inside the hour, and a reconnect after the grant expires failing |
| - `grant_expired`; |
| + inside the hour, and a reconnect after the grant expires ending |
| + `failed`/`grant_expired` through the exit code alone, with ECS runtime |
| + charged and partial outputs cleaned up; and a task held in `PENDING` |
| + until its grant has expired stopping without converting (astra R7-1, |
| + R7-2); |
| 7. whether the single fragmented MP4 plays and seeks progressively in Safari |
| on iOS and macOS, Chrome and Firefox, for video and for audio, and the |
| playlists in Safari and a JavaScript HLS player. If progressive playback |
| @@ -970,8 +982,8 @@ standing key (R-K). |
| ## 13. Review log |
| -Six Astra rounds, findings committed unedited beside this file as |
| -`CODEX-FINDINGS-VIDEO.md` and `-R2.md` to `-R6.md`. Every finding was |
| +Seven Astra rounds, findings committed unedited beside this file as |
| +`CODEX-FINDINGS-VIDEO.md` and `-R2.md` to `-R7.md`. Every finding was |
| accepted; none is open by decision. What each round changed: |
| - **Rounds 1 and 2:** execution ids, immutable per-execution outputs, the |
| @@ -988,6 +1000,12 @@ accepted; none is open by decision. What each round changed: |
| R6-4 classes fixed before the probe, with separate capacity (§7.1, §7.2); |
| R6-5 the peak ceiling takes precedence over the loudness target (§5.1). |
| +- **Round 7:** no P1, so review stopped (stopping rule 1). Its two P2s |
| + were applied without a further round: R7-1 the deadline container also |
| + stops at the grant's absolute expiry (§5.5); R7-2 `grant_expired` is |
| + reported by a reserved exit code when the result PUT has expired (§5.3, |
| + §6). |
| + |
| **Rulings:** R-C, R-F, R-A, R-X and R-K (§4). |
| **Findings not accepted:** none. |
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R7.md b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R7.md| new file mode 100644 |
| index 000000000..fe1ffe99c |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R7.md |
| @@ -0,0 +1,37 @@ |
| +Reviewed `63af7003..6bfbd8f9`, changes only, with necessary surrounding text. The worktree’s spec matches the reviewed revision. No files were modified or live AWS tests run. |
| + |
| +**Findings: 0 P1, 2 P2.** |
| + |
| +1. **P2 — §§5.4–5.5: the execution deadline and grant expiry start from different clocks.** |
| + |
| + **Invariant / fault family: execution stays within its authorised window — deadline family R4-2 → R5-1 → R6-1, extended by R-K.** |
| + |
| + The console mints the grant [before calling `RunTask`](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:268), but [the deadline container](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:410) sleeps for the full relative deadline after startup. Consequently, [the claimed ten-minute margin](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:369) is not guaranteed. |
| + |
| + For example, a grant issued at 12:00 and a timer starting at 12:12 permit execution until 13:02, although new transfers become unauthorised at 13:00. AWS documents pending and activation phases before execution; the spec supplies no upper bound on that delay. This sequence is an inference from those lifecycle semantics. [https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle-explanation.html](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle-explanation.html) |
| + |
| + **Disposition:** retain the single trusted deadline mechanism. Pass the actual grant expiry and enforce the earlier of the relative execution deadline and that expiry, allowing for termination grace. Refuse an already-expired start. Test delayed startup across the expiry boundary; another estimated margin does not close this gap. |
| + |
| +2. **P2 — §§5.4, 6, 7.4: `grant_expired` cannot use the specified error-reporting channel.** |
| + |
| + **Invariant: a failed execution reaches a defined terminal error even when its transfer authority expires.** |
| + |
| + [All five transfers share the one-hour grant](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:360), including the result PUT that carries named errors. When [a resumed download fails after expiry](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:585), the handler also cannot upload its `grant_expired` result. Presigned requests expire with their signing session. [https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html) |
| + |
| + The generic stopped-failure transition can settle the row, but no rule maps this missing-result case to the promised error. The expiry drill therefore lacks an end-to-end reporting contract. |
| + |
| + **Fix:** reserve a codec exit code for `grant_expired` and specify the console’s mapping when no result object exists. ECS exposes each container’s exit code. Test that the reconnect-after-expiry drill produces `failed/grant_expired`, records ECS runtime, and cleans partial outputs without a result PUT. [https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Container.html](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Container.html) |
| + |
| +| R6 finding | Disposition | |
| +|---|---| |
| +| R6-1: codec starts before timer | Closed at design level by `START`, explicit stop timeouts, refusal gate and startup drills. Finding 1 concerns the new absolute grant window. | |
| +| R6-2: caller-key authority | Closed by R-K: the caller user and standing key are removed. | |
| +| R6-3: insufficient reservations | Closed: atomic reservation covers the greater of success and failure charges, including stop grace. | |
| +| R6-4: short-job starvation | Closed: classification precedes dispatch, class queues are separate, and long-class resubmission has a distinct job ID. | |
| +| R6-5: incompatible loudness promises | Closed at design level: peak ceiling takes precedence, quieter output is allowed, and silence is addressed. | |
| + |
| +The provisional sizes and maximums remain subject to the stated pre-build spike; no further finding is raised against those estimates. |
| + |
| +This is the first round without a P1. Apply the P2 corrections without reopening review. Stopping rule 2 remains active for the deadline family; use the existing enforcement point and upfront refusal. |
| + |
| +**Verdict: revise.** |
| \ No newline at end of file |