spec: A5 a launch never seen to run is not charged; A6 retry refusal
Whole-branch review round 2; Paul chose option A. A5 is rewritten: a definite non-launch is released at once on its own deadline, with no strike when a shutdown stopped it; an ambiguous launch keeps its execution, place and cleanup duty until its engine_lost bound, and an empty ECS answer is never taken as proof no task ran. Past the bound it is charged nothing if no task was ever seen, its full bound if one was. A6 gains P3-5: a settings error found only on a retry leaves conversion off and is logged once. The follow-up note drops its reference to the cut window.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+29
−16
docs/superpowers/notes/media-conversion-followups.md+1 −1docs/superpowers/specs/2026-11-16-video-conversion-design.md+28 −15
CI passed — run details
diff --git a/docs/superpowers/notes/media-conversion-followups.md b/docs/superpowers/notes/media-conversion-followups.md| index 5e9d9fc34..4d3a48910 100644 |
| --- a/docs/superpowers/notes/media-conversion-followups.md |
| +++ b/docs/superpowers/notes/media-conversion-followups.md |
| @@ -6,7 +6,7 @@ starts a review round; each is a later change. |
| - Multipart actions (`s3:AbortMultipartUpload`, `s3:ListMultipartUploadParts`) reach every store's policy on a re-walk, even with conversion off: `internal/objstore/aws.go:209`. |
| - A source deleted after submission reads as possibly infected: a 403 before the grant's expiry is `source_unreadable`, and S3 answers 403, not 404, to a GET of a missing key without `s3:ListBucket`: `internal/mediahandler/download.go:305-309`. |
| - Nothing checks that the deployment (results) bucket is in the engine's region; the module only holds `region` to `store_region`: `infra/modules/media-engine/main.tf:34`. |
| -- The first staleness check in `launch` compares the pass's own `now` with a `dispatched_at` stamped from that same `now`, so it never fires inside one pass; use a fresh reading there: `internal/mediajobs/dispatch.go:330`. (Round 1's no-task window rests on the grant expiry check after it, `dispatch.go:347`, which reads the cloud's clock.) |
| +- The first staleness check in `launch` compares the pass's own `now` with a `dispatched_at` stamped from that same `now`, so it never fires inside one pass; use a fresh reading there: `internal/mediajobs/dispatch.go:335`. |
| - Warn at boot when an engine is set and the default plan's `media_minutes_month` is 0, which means no limit: `cmd/console/media.go:216` (`mediaConfig`), `internal/console/mediawire.go:229` (`mediaAllowance`). |
| - The refusal gate does not check the codec container's environment, so a hand-registered revision could set `CARLOS_MEDIA_FFMPEG` (Task 13): `internal/media/gate.go:109`. |
| - Remove `managed_fleets_inline_retired` once every root has retired the inline copy: `infra/modules/region-host/variables.tf:504`. |
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 311013f1f..921be6468 100644 |
| --- a/docs/superpowers/specs/2026-11-16-video-conversion-design.md |
| +++ b/docs/superpowers/specs/2026-11-16-video-conversion-design.md |
| @@ -967,26 +967,39 @@ id is dropped. |
| (`infra/modules/region-host/main.tf:847-851`). Conversion is a second, |
| switched exception through the conversion role: a HEAD of the source and of |
| the outputs. Store destroy gains the refusal of §5.3. |
| -- **A5, a launch proved never to have run is not charged** (whole-branch |
| - review, 2026-11-19). §5.3 settled every running row with no task as |
| - `engine_lost`, charged the full bound, once an hour had passed. But a |
| - row can be dispatched with no task ever created: a console stopped |
| - between the dispatch commit and `RunTask`, or a launch error that left |
| - no task. Launch refuses to run once the grant's window has passed, and |
| - ECS keeps a stopped task's record for at least |
| - `EngineRecordRetention`. So when recovery finds no task in either the |
| - running or the stopped list, read between dispatch plus the grant |
| - window and dispatch plus `EngineRecordRetention`, no task was created: |
| - the row returns to `queued`, uncharged, and its place is freed. A row |
| - first seen missing after that window is still `engine_lost`. Releasing |
| - a launch that never started no longer depends on the pass still |
| - running. |
| +- **A5, a launch never seen to run is not charged** (whole-branch review, |
| + 2026-11-19; Paul chose option A). Two rules override §5.3 where they |
| + differ. |
| + - **A definite non-launch is released at once.** When the grant fails, or |
| + `RunTask` is never called, or `RunTask` refuses the request, no task |
| + exists. The row goes back to `queued` (or fails as §5.3 says), |
| + uncharged, and its place is freed. The write runs on its own short |
| + deadline, apart from the pass, so a shutdown cannot leave the row |
| + holding its place. When the launch stops because the console is |
| + shutting down, during the grant or before `RunTask`, it does not count |
| + against the row's one retry. |
| + - **An ambiguous launch waits for its bound.** A row whose `RunTask` |
| + answer was lost, or whose console stopped between dispatch and |
| + `RunTask`, keeps its execution id, its place, its reservation and its |
| + cleanup duty until `dispatched_at` + `deadline_s` + the 30-second stop |
| + grace + ECS's record retention. Recovery saves the task's ARN whenever |
| + ECS lists it. An empty answer from ECS is never taken as proof that no |
| + task ran: its lists are eventually consistent, and a task can be |
| + created after the call that asked for it has failed. Past the bound, |
| + the row fails `engine_lost` as before, and its outputs under that |
| + execution are cleaned up as before. What changes is the charge: if no |
| + task was ever seen for that execution (the row has no task ARN when it |
| + settles), it is charged nothing. A row that had a task ARN is charged |
| + its full bound, as before. I3 is amended to match: the one |
| + undercharge it allows is a task that ran without ever being seen. |
| - **A6, a cloud failure at boot is retried** (whole-branch review, |
| 2026-11-19). When the console's settings are valid but the cloud does |
| not answer at boot, the console starts with conversion off and retries |
| the wiring in the background, from 10 seconds doubling to 10 minutes, |
| then starts the pass as a normal boot would. Rows already running are |
| - tracked again without a restart. Settings errors still stop the boot. |
| + tracked again without a restart. Settings errors still stop the boot. A |
| + settings error found only on a retry, once the console is already up, |
| + leaves conversion off and is logged once. |
| ## 12. Decisions for Paul |