carlos / platform Public

spec: video conversion revision 6, deadline container, audio, long files

Astra R5-1 (stopping rule 2): an essential deadline container in each
task bounds execution at deadline plus stop grace; the reaper is a
backstop only. Paul's R-A adds an audio-aac preset (waveform peaks,
-16 LUFS). Paul's R-X widens per-file maximums (video 4 h, audio
12 h); the plan allowance limits and sets each job's deadline, and
the probe refuses what the allowance cannot pay for.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 63af70031d88c4b0c23a376ca41b2ee122f5d501 parent 1a75ffb
1 file changed, +374 −199
  • docs/superpowers/specs/2026-11-16-video-conversion-design.md +374 −199

Intent

Human

on-demand recordings. We can kick livestreaming down the road. I think for e.g. Woodstar, it might be voice notes, but the platform is for app implementors, so in that sense, there probably shouldn't be too much of a limit on what videos and audio files they can process.

Human

<task-notification> <task-id>ad8a1b25ebf69fbf7</task-id> <tool-use-id>toolu_01XYLvwsjYmx72zcdPdJ6obG</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/8509ad95-d983-414c-9679-b3ef222618ef/tasks/ad8a1b25ebf69fbf7.output</output-file> <status>completed</status> <summary>Agent "Fable drafts video conversion design" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Revision 6 is written in place and uncommitted: 966 lines, up from 791. The growth is the audio preset, the allowance and deadline rules, and the deadline container; nothing was cut to make room. The scratch directory is removed. ## Where each change landed - **R5-1 (deadline in one place):** the task now has two essential containers, `codec` and `deadline`, described in §5.5 with the ECS essential-container citation marked for the spike. The deadline bullet in §5.3 defines the full bound as the row's `deadline_s` plus the 30-second stop grace, and "unknown" executions and invariant I3 charge at that bound. The reaper stays as a backstop with the sentence "no bound in this spec rests on its timing". §5.5 says plainly what still rests on Fargate's container isolation: both containers share one microVM and kernel, so a container escape inside the task could reach the timer. The activation gate, spike item 4 and a drill all use a codec container that ignores signals and tries to kill the timer. - **R-A (audio):** `audio-aac` is specified in §5.1: AAC-LC at 48 kHz, mono 64 kbit/s or stereo 128 kbit/s, the same fragmented MP4 and byte-range playlist, a `peaks.json` of exactly 1,000 values, no poster. Loudness is normalised to -16 LUFS with a -1.5 dBTP true peak in two passes, chosen because voice recordings on phones are the first use. §6 adds the MP3, WAV, FLAC and Ogg families and FLAC to the codec list. The audio task is 1 vCPU and 2 GB against video's 4 vCPUs and 8 GB. - **R-X (limits):** §7.1 becomes per-file maximums: video 4 hours and 100 GiB, audio 12 hours and 20 GiB. §7.3 defines the allowance and the deadline, chosen at dispatch as the smallest of a 9-hour platform maximum, a per-preset ceiling and what the remaining allowance pays for. The probe exits `allowance_exceeded` before encoding; a job that still overruns fails `deadline_exceeded`. Failed executions are charged their engine time to the allowance, which replaces the old daily engine-time budget. §5.6 covers multipart for sources above 5 GB, §6 the streamed, resumable download, and §5.1 states that every output stays under the 5 GB single-PUT limit. ## Three things this forced that you did not ask for - **A long-lived IAM key on the console.** A role assumed from the console's instance role lasts one hour at most, so presigned PUTs would expire before a long job finishes. The spec adds a caller user whose only permission is to assume the conversion role, with its access key held as a console secret; sessions then last up to twelve hours. This is unverified and is a spike proof. It is decision 4, with the alternative of no key and every job held to about 50 minutes of engine time. - **Long-job fairness.** Hours-long tasks would hold every dispatch place. The cap is raised to 8, with at most 4 long executions (deadline over 30 minutes) in the deployment and 1 per account. - **The preset is renamed** from `clip-720p` to `video-720p`, since it now covers four-hour video. The source is probed only after it is fully downloaded, so refusing a large file by duration costs the minutes its download took. I left an early head-and-tail probe out. ## Decisions for Paul 1. **The spike:** now also needs an hour or more of video and a browser voice recording, covers the caller user, and includes the deadline-container drill. Recommended as the first task. 2. **The engine's network:** its own small VPC with a DNS allow-list (recommended), or a private subnet of the console's VPC. 3. **No wait for stage 1:** ship on the app's own bucket and serving (recommended), or wait for `kind:media`. 4. **Authority, and one long-lived key (changed):** accept the caller user's access key on the console (recommended), or no key and jobs held to about 50 minutes of engine time, which rules out long video. 5. **Per-file maximums (replaces admission caps):** video 4 hours and 100 GiB, audio 12 hours and 20 GiB, 4K, 60 fps (recommended), or lower until the spike has measured long jobs. 6. **Plan values:** Free 30, Personal 600, Community 1,200, Business 12,000 video minutes, refused at twice the limit, plus a media pack of 1,000 minutes (recommended). I kept the earlier values because I do not know the plan prices; my estimate is at most about 0.6 cents of engine cost per minute. 7. **How audio is counted (new):** one allowance with an audio minute weighing a tenth of a video minute (recommended), or a separate `audio_minutes_month`. 8. **Browser uploads in scope** as `carlos store uploads` (recommended), or native clients only. 9. **Always re-encode, HDR tone-mapped, one poster, audio normalised to -16 LUFS** (recommended), or add the remux path, or make normalisation a request option. 10. **On for every app** with a store and a Service credential (recommended), or a per-app switch. 11. **Codec licences:** accept or have checked before flagship. A question, no recommendation.</result> <usage><subagent_tokens>361828</subagent_tokens><tool_uses>8</tool_uses><duration_ms>395735</duration_ms></usage> </task-notification>

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 4d37fb71c..05777e2a2 100644
--- a/docs/superpowers/specs/2026-11-16-video-conversion-design.md
+++ b/docs/superpowers/specs/2026-11-16-video-conversion-design.md
@@ -1,8 +1,8 @@
-# Video conversion: a phone clip in, a playable video out
+# Media conversion: video and audio in, playable files out
-**Date:** 2026-11-16, revision 5 (Astra round 4's four fixes, approved by
-Paul, §13)
-**Status:** draft for a diff-only review of those fixes. Not approved.
+**Date:** 2026-11-16, revision 6 (Astra round 5, and Paul's rulings R-A and
+R-X, §13)
+**Status:** draft for a narrow review of those changes. Not approved.
**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`).
@@ -12,19 +12,24 @@ stage 3's first product and part of stage 5. See §11.
round 4 covers only the Fargate change and the round-3 fixes.
Marks: **(paul R-F)**, **(paul R-C)** Paul's rulings; **(astra R3-N)**,
-**(astra R4-N)** round-3 and round-4 findings; **(my call)** the author's,
+**(astra R4-N)**, **(astra R5-1)** findings of rounds 3 to 5; **(paul R-A)**,
+**(paul R-X)** his rulings on audio and limits; **(my call)** the author's,
cheap to overturn; **(estimate)** not measured; **(unverified)** not checked
against a source in this tree.
## 1. Intent
A phone hands an app a file that plays nowhere reliably: HEVC in a `.mov`, 4K
-at 60 frames a second, 400 MB, rotation held in metadata. This design makes
-conversion a **platform service**. The app uploads the original straight to
-its own store bucket, asks the console to convert it, and polls. The platform
-writes one H.264/AAC video, an HLS playlist over that same file, and a poster
-into the app's bucket. The app serves them the way it serves its other
-objects.
+at 60 frames a second, rotation held in metadata. A browser hands it a WebM
+voice recording that Safari will not play. This design makes conversion a
+**platform service**. The app uploads the original straight to its own store
+bucket, asks the console to convert it, and polls. For video the platform
+writes one H.264/AAC file, an HLS playlist over that same file, and a poster;
+for audio, one AAC file, its playlist and a waveform. The app serves them the
+way it serves its other objects.
+
+The platform is for people building apps, so the limits on one file are
+generous and the account's plan allowance is what limits use **(paul R-X)**.
First consumer (non-normative): a social app with content-addressed public
media that caps uploads at 8 MiB today and is moving its blobs into a store
@@ -34,31 +39,36 @@ bucket. Nothing here is specific to it.
**Goals**
-- G1. Any app with a store and a Service credential converts a phone clip with
- one HTTP call and a poll. No operator grant, no per-app switch.
-- G2. One rendition: H.264/AAC, at most 720p, never upscaled, in a single
- fragmented MP4 that plays progressively with `Range` and is also an HLS
- stream through a byte-range playlist; plus one JPEG poster.
-- G3. The source goes app to store directly, and browser uploads work (§5.6).
+- G1. Any app with a store and a Service credential converts a video or an
+ audio file with one HTTP call and a poll. No operator grant, no per-app
+ switch.
+- G2. Video: one rendition, H.264/AAC, at most 720p, never upscaled, in a
+ single fragmented MP4 that plays progressively with `Range` and is also an
+ HLS stream through a byte-range playlist; plus one JPEG poster. Audio
+ **(paul R-A)**: one AAC rendition in the same container and playlist form,
+ loudness-normalised, with a waveform and the duration.
+- G3. The source goes app to store directly, and browser uploads work,
+ multipart included (§5.6).
- G4. Bad input is refused up front with a named error: at the door when the
door can know, at the probe otherwise.
-- G5. A plan cap and fair use from the first job, and no engine running while
- no clip is being converted **(paul R-F)**.
+- G5. The plan allowance limits use, not the size of one file **(paul R-X)**,
+ and no engine runs while nothing is being converted **(paul R-F)**.
**Non-goals**
-- **Encrypted media.** The platform cannot convert ciphertext; apps whose
- users encrypt client-side convert on the device. Ciphertext fails the probe
- as `unsupported_container`.
+- **Encrypted media**, video or audio. The platform cannot convert
+ ciphertext; apps whose users encrypt client-side convert on the device.
+ Ciphertext fails the probe as `unsupported_container`.
- **Cancel, delete, retry and re-encode (paul R-C).** The door is POST and
GET. An app that no longer wants a result ignores it.
-- A ladder, AV1 output, DASH, captions, DRM, live, audio-only inputs, serving
- (the roadmap's stage 1), callbacks, environment stores, a client library,
- and stores of unknown provenance (§5.2).
+- **Live streaming (paul R-A: deferred)**, a ladder, AV1 output, DASH,
+ captions, DRM, serving (the roadmap's stage 1), callbacks, environment
+ stores, a client library, and stores of unknown provenance (§5.2). Long
+ video makes the ladder more valuable; the layout keeps room for it (§5.1).
**Anti-goals:** an engine with authority over tenant buckets; conversion of an
-object the scanner has tagged infected; a free account turning the platform
-into an encode farm; job state in more than one place **(paul R-C)**.
+object the scanner has tagged infected; an account spending engine time its
+allowance does not cover; job state in more than one place **(paul R-C)**.
## 3. Where things stand on `main` (15b1ee6b)
@@ -94,7 +104,7 @@ into an encode farm; job state in more than one place **(paul R-C)**.
Paul chose a platform engine over conversion on the device (kept for encrypted
media) and conversion at the edge (minutes of CPU on the box that terminates
-every tenant's TLS). Two rulings of 2026-11-16 stand:
+every tenant's TLS). His rulings of 2026-11-16:
- **R-F: the engine is one ECS Fargate task per execution.** It supersedes
R-L (Lambda), which round 3 showed could not keep a compromised codec away
@@ -102,36 +112,65 @@ every tenant's TLS). Two rulings of 2026-11-16 stand:
not reused, has no runtime API, and can run with no credentials at all.
- **R-C (stopping rule 2): one place for the lifecycle.** No cancel, delete or
requeue; one row per job in the console's database.
+- **R-A: on-demand audio is in scope; live streaming is deferred.**
+- **R-X: no tight per-file limits.** "The platform is for app implementors,
+ so in that sense, there probably shouldn't be too much of a limit on what
+ videos and audio files they can process." The 3-minute, 512 MiB premise of
+ earlier revisions is gone. Per-file caps are generous and the plan
+ allowance is the limiter (§7).
## 5. The design
-### 5.1 The preset and its outputs
+### 5.1 The presets and their outputs
+
+Two presets. Every admitted source is re-encoded **(my call)**.
-One preset, `clip-720p`. Every admitted source is re-encoded **(my call)**.
+**`video-720p`**
- Video: H.264 High, `yuv420p`, at most 1280 by 720 in either orientation,
aspect kept, never upscaled, rotation applied, at most 30 frames a second, a
- keyframe every 2 seconds, constant quality under a ceiling of about 2.5
- Mbit/s. HDR is tone-mapped to SDR.
+ keyframe every 2 seconds, constant quality under a ceiling of 2.5 Mbit/s.
+ HDR is tone-mapped to SDR.
- Audio: AAC-LC stereo, 48 kHz, 128 kbit/s; none if the source has none.
- Container: one fragmented MP4, 4-second fragments, with an HLS version 7
playlist (`EXT-X-MAP`, `EXT-X-BYTERANGE`) over the same file.
- Poster: one JPEG at output size, one second in, or the midpoint of a shorter
clip.
-- Source metadata, location included, is dropped.
-Outputs are immutable and belong to one execution:
-
- derived/<source key>/<etag>/clip-720p/<execution id>/video.mp4
- video.m3u8
- poster.jpg
+**`audio-aac` (paul R-A)**
+
+- Source: an audio file, or the first audio track of a video file.
+- Audio: AAC-LC at 48 kHz; mono at 64 kbit/s when the source is mono,
+ otherwise stereo at 128 kbit/s, with more channels mixed down to stereo.
+- Loudness: normalised to -16 LUFS integrated with a true peak of -1.5 dBTP,
+ in two passes (measure, then one linear gain), so dynamics are untouched.
+ -16 is the usual target for speech heard on phones, and voice recordings
+ are the first use; it is one setting **(my call)**.
+- Container: the same fragmented MP4 and byte-range playlist.
+- Waveform: `peaks.json`, `{"version": 1, "duration_ms": N, "peaks": [...]}`
+ with exactly 1,000 integers from 0 to 255: the peak absolute amplitude of
+ the normalised mono mix in each of 1,000 equal slices of the duration.
+- No poster.
+
+Both drop source metadata, location included. Outputs are immutable and
+belong to one execution:
+
+ derived/<source key>/<etag>/video-720p/<execution id>/video.mp4
+ video.m3u8
+ poster.jpg
+ derived/<source key>/<etag>/audio-aac/<execution id>/audio.mp4
+ audio.m3u8
+ peaks.json
`<etag>` is the source's ETag without quotes
(`internal/objstore/clamav.go:517`). Each PUT is create-only (`If-None-Match:
-*`, signed). A later ladder preset is a sibling of `clip-720p`. The app learns
-the keys from the job (§5.2); no platform code reads the tenant's bucket to
-learn what was converted, and there is no `result.json` **(my call under R-C:
-it added a writer and no authority)**.
+*`, signed). **Every output stays under the 5 GB a single PUT carries (paul
+R-X):** four hours of video at the bitrate ceiling is about 4.7 GB, and twelve
+hours of audio about 0.7 GB; the handler fails `output_too_large` rather than
+exceed it. A later ladder preset is a sibling directory. The app learns the
+keys from the job (§5.2); no platform code reads the tenant's bucket to learn
+what was converted, and there is no `result.json` **(my call under R-C: it
+added a writer and no authority)**.
### 5.2 The door
@@ -143,7 +182,8 @@ through `apiAccountApp`, as the PDF and scan doors do. The credential is the
one an app holds for PDFs or scanning.
POST takes strict JSON, `{"key": "uploads/a1b2.mov"}`, with an optional
-`preset`. Checks run in order and stop at the first failure:
+`preset`: `video-720p` (the default) or `audio-aac`. Checks run in order and
+stop at the first failure:
| Check | Refusal |
|---|---|
@@ -158,7 +198,7 @@ POST takes strict JSON, `{"key": "uploads/a1b2.mov"}`, with an optional
| HEAD of the key: denied (an infected verdict lands here, §5.4) | 409 `source_unreadable` |
| size zero or over the cap (§7.1) | 413 `source_too_large` |
| plan cap (§7.3) | 402 from `capCopy` |
-| fair use or engine-time budget (§7.2) | 429 or 503 with `Retry-After` |
+| fair use (§7.2) | 429 or 503 with `Retry-After` |
A passing request inserts the job row and answers 202 with the job. The store
checks and the insert run under the app's store walk lock
@@ -197,7 +237,8 @@ bucket, so eligibility is established, never inferred from its name.
A console table `media_jobs`, one row per job, changed only in database
transactions. It holds: account, app, store incarnation, job id, key, etag,
bytes, preset, bucket, `state`, `execution_id`, `task_arn`, `dispatched_at`,
-`task_stopped`, `start_failures`, `charged_ms`, `settled`, `source_ms`,
+`deadline_s`, `task_stopped`, `start_failures`, `charged_ms`, `settled`,
+`source_ms`,
`result`, `error`, `cleanup_due`, `retired_at`.
**Transitions.** Each is one transaction.
@@ -205,13 +246,13 @@ bytes, preset, bucket, `state`, `execution_id`, `task_arn`, `dispatched_at`,
| Step | From | To |
|---|---|---|
| submit | no row | `queued` |
-| dispatch | `queued` | `running`; a new random `execution_id`; `dispatched_at`; `task_stopped` false |
+| dispatch | `queued` | `running`; a new random `execution_id`; `dispatched_at`; `deadline_s` (§7.3); `task_stopped` false |
| task recorded | `running` | `task_arn` set |
| 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 |
-| 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 = dispatched_at + 1 h` |
+| 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 |
@@ -231,16 +272,16 @@ bytes, preset, bucket, `state`, `execution_id`, `task_arn`, `dispatched_at`,
`startedBy` is the row's execution id. It saves that ARN before anything
else, then settles by the ordinary rows. It never calls `RunTask` again
for that execution: re-minted transfers would be a different request. If
- neither list has the task once ECS's retention has passed (the full bound
- plus an hour after dispatch), the row is "unknown".
-- **The hard deadline (astra R4-2)** is 15 minutes after ECS created the
- task, and it does not depend on the console. A **reaper**, a scheduled
- function in the module (§5.5), runs every minute and stops every task in
- the cluster older than that. The console calls `StopTask` at the same age
- when it is up. **The full bound** on any execution is therefore 17
- minutes: the deadline, one schedule interval, and the task's 30-second
- stop grace. A running execution is reserved at the full bound, and one
- whose ECS record has expired is charged it.
+ neither list has the task once ECS's retention has passed (the row's full
+ bound plus an hour after dispatch), the row is "unknown".
+- **The deadline (astra R5-1)** is enforced in one place, inside the task
+ and outside the codec: a second essential container that sleeps for the
+ row's `deadline_s` and exits, at which ECS stops the whole task (§5.5). It
+ does not depend on the console, a schedule or the codec. **The full bound**
+ on an execution's run time is `deadline_s` plus the 30-second stop grace. A
+ running execution is reserved at its full bound, and one whose ECS record
+ has expired is charged it. A task stopped this way fails
+ `deadline_exceeded`.
- **Charge.** ECS's stop time minus its start time. ECS keeps a stopped
task's record for about an hour **(unverified)**, so "unknown" arises only
when the console was down longer than that.
@@ -274,7 +315,7 @@ bytes, preset, bucket, `state`, `execution_id`, `task_arn`, `dispatched_at`,
transaction that writes `charged_ms` and the terminal state, and nothing
writes `charged_ms` afterwards.
- **I3. Never undercharged.** `charged_ms` is at least the time ECS reports
- the task ran, or the full bound of 17 minutes when ECS cannot say.
+ the task ran, or the row's full bound when ECS cannot say.
- **I4. Obligations retained.** A row that is unsettled, has `cleanup_due`
set, or has `task_stopped` false is never deleted.
- **I5. One execution.** A `done` row's outputs are the keys of its own
@@ -296,19 +337,29 @@ after every step **(astra R4-3, R4-4)**.
### 5.4 Authority
-- The deployment has one **conversion role**, assumable only by the console's
- role. It allows `GetObject` under the store bucket prefix, `PutObject` under
- `derived/` in those buckets, and `PutObject` under `media-results/` in the
- deployment bucket. It carries two unconditional Denies: reading any object
- tagged infected, and any PUT that sets a scan tag (the rule of
- `aws.go:200-226`). Infected sources are therefore refused whatever the
- store's `Enforce` flag says, at the door's HEAD and at the task's GET.
-- For each execution the console assumes the role for 20 minutes with a
- session policy narrowing it to the one bucket and the one result key, and
- presigns five transfers: a GET for the source with `If-Match: <etag>`
- signed; three create-only PUTs for the outputs; one create-only PUT for the
- result object, `media-results/<execution id>.json`. The credentials never
- leave the console.
+- The deployment has one **conversion role**. It allows `GetObject` under the
+ store bucket prefix, `PutObject` under `derived/` in those buckets, and
+ `PutObject` under `media-results/` in the deployment bucket. It carries two
+ unconditional Denies: reading any object tagged infected, and any PUT that
+ sets a scan tag (the rule of `aws.go:200-226`). Infected sources are
+ therefore refused whatever the store's `Enforce` flag says, at the door's
+ HEAD and at the task's GET.
+- **Who assumes it (paul R-X).** A grant must outlive its job, and jobs now
+ run for hours. A role assumed from another role, which is what the
+ console's instance role would be doing, lasts one hour at most; a role
+ assumed by an IAM user lasts up to twelve **(unverified)**. So the module
+ creates a **caller user** whose only permission is to assume the
+ conversion role, and the console holds its access key as a secret
+ (`CARLOS_MEDIA_CALLER_KEY`), as it holds the scan signing keys. The role's
+ trust policy names that user alone. This is the one long-lived credential
+ the design adds (decision 4).
+- For each execution the console assumes the role for the row's deadline
+ plus 30 minutes, with a session policy narrowing it to the one bucket and
+ the one result key, and presigns five transfers: a GET for the source with
+ `If-Match: <etag>` signed; three create-only PUTs for the outputs; one
+ create-only PUT for the result object,
+ `media-results/<execution id>.json`. The credentials never leave the
+ console. The transfers are valid until the grant expires.
- **The result object (paul R-F)** carries the probe facts, the output sizes
and ETags, the ffmpeg version, or a named error. It lives in the deployment
bucket, where no tenant can write, so an app cannot forge the duration its
@@ -321,8 +372,9 @@ after every step **(astra R4-3, R4-4)**.
through the five transfers.
To prove on dev first **(unverified)**: the tag-conditioned Deny holds for a
-GET and HEAD presigned by the assumed role, and a presigned PUT with a signed
-`If-None-Match: *` is refused when the object exists.
+GET and HEAD presigned by the assumed role; a presigned PUT with a signed
+`If-None-Match: *` is refused when the object exists; and a transfer presigned
+from a nine-hour session is still accepted in its ninth hour.
### 5.5 The engine: one Fargate task per execution (paul R-F)
@@ -330,21 +382,49 @@ GET and HEAD presigned by the assumed role, and a presigned PUT with a signed
image repository, the network below, the conversion role, and the console's
new permissions: assume that role; `RunTask`, `DescribeTasks`, `ListTasks`
and `StopTask` on this cluster and task definition; and `iam:PassRole` for
-the task execution role only. It also creates the **reaper (astra R4-2)**: a
-minimal function on a one-minute schedule whose role allows `ListTasks`,
-`DescribeTasks` and `StopTask` on this cluster and nothing else. It handles no
-tenant input and stops any task older than the hard deadline, by ECS's
-creation time. The module's one output is the console variable
-`CARLOS_MEDIA_ENGINE`. Unset, the door answers 503. The module fails its
-precondition if its region is not the store region; on dev and flagship both
-are `eu-west-1` **(as reported; those roots are outside this tree)**.
-
-**The task.** One container from the arm64 image, pinned by digest, 4 vCPUs
-and 8 GB, non-root, a read-only root filesystem, every capability dropped, and
-the task's ephemeral storage as its only writable space. That storage bounds a
-job's bytes and files; filling it ends that task alone. The handler downloads,
-probes, converts (§6), uploads, writes the result object and exits. It stops
-itself 10 minutes after it starts.
+the task execution role only. It also creates the caller user (§5.4) and the
+**reaper**: a minimal function on a one-minute schedule whose role allows
+`ListTasks`, `DescribeTasks` and `StopTask` on this cluster and nothing else.
+It handles no tenant input and stops any task older than the platform's
+maximum deadline plus ten minutes. It is a backstop against a task that never
+starts or a deadline container that fails to launch; **no bound in this spec
+rests on its timing (astra R5-1)**. The module's one output is the console
+variable `CARLOS_MEDIA_ENGINE`. Unset, the door answers 503. The module fails
+its precondition if its region is not the store region; on dev and flagship
+both are `eu-west-1` **(as reported; those roots are outside this tree)**.
+
+**The task** has two containers from the same arm64 image, pinned by digest,
+both essential.
+
+- **`codec`** runs the handler: it downloads, probes, converts (§6), uploads,
+ writes the result object and exits. Non-root, a read-only root filesystem,
+ every capability dropped, and the task's ephemeral storage as its only
+ writable space. That storage bounds a job's bytes and files; filling it
+ ends that task alone.
+- **`deadline` (astra R5-1)** runs `sleep` for the job's deadline and exits.
+ 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)
+ **(unverified; a spike drill)**. The console sets the sleep per job as a
+ container override on `deadline`, which nothing inside the task can change.
+
+`codec` cannot reach the timer: it is non-root with no capabilities, so it
+cannot signal another container's processes or set the clock; the two
+containers have separate process namespaces (the task does not set `pidMode:
+task`) and separate filesystems, and share no volume; `deadline` listens on
+nothing; and each container has its own CPU and memory reservation, so `codec`
+cannot starve it. **What still rests on Fargate's container isolation:** the
+two containers share one microVM and one kernel. An exploit that escapes the
+`codec` container inside that microVM could reach the timer. The microVM
+boundary to other tasks is unaffected, and such a task is still ended by the
+reaper and charged from ECS's times.
+
+**Size and storage per preset (paul R-A, R-X).** `video-720p`: 4 vCPUs and 8
+GB. `audio-aac`: 1 vCPU and 2 GB. Ephemeral storage is the default 20 GiB, or
+the source size plus 8 GiB when that is more, set per job. The console passes
+all three as task overrides **(unverified that Fargate accepts them per
+run)**; otherwise the module defines one task definition per preset and
+storage tier.
**Isolation (closes astra R3-1).** AWS documents that each Fargate task has
its own isolation boundary and does not share the underlying kernel, CPU,
@@ -367,7 +447,7 @@ override. Overrides are limited to 8,192 characters **(unverified)**, so the
payload sends the session token, bucket and output prefix once; the builder
proves the longest admitted key fits. Overrides can be read by any principal
in the account allowed to describe tasks, and appear in its audit trail. The
-transfers expire with the 20-minute grant, and the handler never logs them.
+transfers expire with the grant, and the handler never logs them.
**Network.** The module creates a small VPC of its own with no internet
gateway and no NAT **(my call: R-F said the console's VPC, but the DNS rule
@@ -394,8 +474,9 @@ four endpoints therefore name their principals:
**Activation gate:** conversion stays off in a deployment until requests
signed with an unrelated account's credentials have been shown to be refused
-at all four endpoints, and until the reaper has stopped a container that
-ignores its budget while the console is stopped.
+at all four endpoints, and until the deadline container has ended a task
+whose `codec` container ignores every signal and tries to signal or kill the
+timer, with the console stopped **(astra R5-1)**.
**DNS (astra R3-2).** A security group cannot stop queries to the VPC
resolver. A Route 53 Resolver DNS Firewall rule on this VPC allows the S3,
@@ -433,19 +514,24 @@ working".
`s3:ListMultipartUploadParts` for that store. The builder checks the
permissions boundary allows both.
-A single presigned PUT carries up to 5 GB **(unverified)**, far above the
-source cap, so multipart is optional; v1 makes it safe and documents the
-recipe. Native apps need no CORS.
+**Large files (paul R-X).** A single presigned PUT carries up to 5 GB
+**(unverified)**; above that an upload must be multipart, and for anything
+over a few hundred megabytes from a phone it should be. The app's server
+starts the upload, presigns each part, and completes it with the part ETags
+the browser read back, which is why `ETag` is exposed and the two multipart
+actions are granted. The docs page carries the recipe. A multipart object's
+ETag is not a content hash; conversion treats every ETag as an opaque version,
+so nothing changes. Native apps need no CORS.
### 5.7 CLI, docs, and an app end to end
- carlos media convert <key> --app shop [--wait]
+ carlos media convert <key> --app shop [--preset audio-aac] [--wait]
carlos media status <id> --app shop
carlos system media status
-A docs page `docs/site/video.md`, `docs/site/cli.md` headings for every verb,
-a plans-page row, and one residency sentence: conversion happens in the
-store's region. Its walkthrough, for app `shop` on `shop.example.com`:
+A docs page `docs/site/media-conversion.md`, `docs/site/cli.md` headings for
+every verb, a plans-page row, and one residency sentence: conversion happens
+in the store's region. Its walkthrough, for app `shop` on `shop.example.com`:
```
# once
@@ -476,30 +562,36 @@ too. Every user-facing string goes through copy review before it is written.
Treat every source as an exploit attempt.
-**Before ffmpeg starts.** The handler enforces the byte cap while downloading.
-It reads the first bytes in Go and accepts two families: ISO BMFF (`ftyp`:
-MP4, MOV, 3GP) and Matroska/WebM (EBML). Anything else is
-`unsupported_container` and ffmpeg never runs.
+**Download.** The handler streams the source to disk in one GET, resuming a
+broken connection with a `Range` request under the same signed `If-Match`. It
+enforces the byte cap as it goes **(paul R-X)**.
+
+**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
+(EBML) for both presets; for `audio-aac` also MP3, WAV, FLAC and Ogg **(paul
+R-A)**. Anything else is `unsupported_container` and ffmpeg never runs.
**Probe before transcode.** `ffprobe` runs with the demuxer forced to the
-sniffed family. The handler takes the first video and first audio stream,
-ignores every other stream, and checks:
+sniffed family. The handler takes the first video and first audio stream
+(`audio-aac`: the first audio stream only), ignores every other stream, and
+checks, exiting before any encoding:
| Condition | Error |
|---|---|
-| no video stream | `no_video` |
+| `video-720p`: no video stream. `audio-aac`: no audio stream | `no_video`, `no_audio` |
| video codec not H.264, HEVC, VP8, VP9 or AV1 | `unsupported_video_codec` |
-| audio codec not AAC, Opus, Vorbis, MP3 or 16-bit PCM | `unsupported_audio_codec` |
+| audio codec not AAC, Opus, Vorbis, MP3, FLAC or PCM | `unsupported_audio_codec` |
| a side over 4096, or more pixels than 3840x2160 | `source_dimensions` |
| over 60 frames a second | `source_frame_rate` |
-| longer than the duration cap | `source_too_long` |
-| probe fails or exceeds 30 s | `unreadable` |
+| longer than the preset's maximum duration (§7.1) | `source_too_long` |
+| longer than the allowance granted to this job, or predicted not to finish before the deadline (§7.3) | `allowance_exceeded` |
+| probe fails or exceeds 60 s | `unreadable` |
**The command.** ffmpeg and ffprobe are child processes with a fixed input
path, never the tenant's key: `-nostdin`, `-protocol_whitelist file`, the
-demuxer forced, a decoder allow-list matching the table, only the two chosen
-streams mapped, `-t` at the duration cap, and a wall-time budget inside the
-handler's 10 minutes. Over it the job fails `too_slow`.
+demuxer forced, a decoder allow-list matching the table, only the chosen
+streams mapped, and `-t` at the duration the job was granted. The deadline
+container, not the handler, is what ends a run that overstays (§5.5).
**Collecting outputs.** The handler touches the output directory only after
the child and every descendant are dead. It opens the three expected names
@@ -516,92 +608,136 @@ role's presigned requests. The registry and logs endpoints admit only the task
execution role, which it does not hold, so credentials smuggled in with the
source open nothing **(astra R4-1)**. It has no credentials of the platform's,
no route or name resolution beyond the three AWS services, no console, no
-other box, no later execution to wait for, and at most the full bound of 17
-minutes to run **(astra R4-2)**. Its worst outcome is bad output and a false
+other box, no later execution to wait for, and no more time than the job's
+deadline plus the stop grace, short of escaping its container inside the
+task's microVM **(astra R5-1)**. Its worst outcome is bad output and a false
result for the one job whose input attacked it; the engine time is still
charged from ECS.
## 7. Limits, metering and sizing
-### 7.1 Admission caps
+### 7.1 Per-file maximums (paul R-X)
-| Cap | Value | Why |
-|---|---|---|
-| Source size | 512 MiB | Three minutes of 1080p H.264 from a phone is about 390 MB and of 4K30 HEVC about 510 MB **(unverified, from a phone maker's published per-minute sizes)** |
-| Duration | 180 s | "Short clips from a phone" |
-| Dimensions | 3840x2160 | What phones record |
-| Frame rate | 60 | Slow-motion capture is out of scope |
-
-All are settings (`CARLOS_MEDIA_LIMITS`). **The handler's budget is 10 minutes
-and the hard deadline 15 minutes after the task is created (my call)**: every
-admitted
-clip must download, convert and upload within the budget, and the spike
-confirms that the slowest admitted input does. If one does not, the caps come
-down.
+Generous on purpose. The allowance (§7.3) is the limiter.
+
+| | `video-720p` | `audio-aac` | Why |
+|---|---|---|---|
+| Duration | 4 hours | 12 hours | A film or a long recording; keeps every output under 5 GB |
+| Source size | 100 GiB | 20 GiB | Four hours of 4K30 phone video is about 40 GB; Fargate storage goes to 200 GiB, less outputs and headroom |
+| Dimensions | 3840x2160 | | What cameras record |
+| Frame rate | 60 | | |
+
+All are settings (`CARLOS_MEDIA_LIMITS`), **my call** on the numbers. The
+source is probed after it is downloaded, so refusing a large file by duration
+costs the minutes its download took.
### 7.2 Fair use (every deployment)
**(my call on the numbers.)**
-- **Dispatch cap (astra R3-3):** at most 4 tasks, counted as rows with a
+- **Dispatch cap (astra R3-3):** at most 8 tasks, counted as rows with a
dispatched execution and `task_stopped` false. A row frees its place only
when ECS confirms its task stopped, never by reaching a terminal state.
- Per account: at most 2 such rows, and 20 queued or running (429); 30
submissions a minute, burst 10 (429).
-- **Engine-time budget:** 60 minutes a UTC day of `charged_ms` on executions
- that did not end `done`, counting a running execution at the full bound of
-17 minutes. Over
- it, the door refuses with 429 `execution_budget` and the pass leaves that
- account's queued rows until the next UTC day.
+- **Long jobs (paul R-X):** an execution whose deadline is over 30 minutes is
+ long. At most 1 per account and 4 in the deployment run at once, so hours
+ of film never hold every place and a clip is not queued behind them.
- Deployment-wide, at most 200 queued: 503.
-The console's `allowWrite` limit does not apply, as for PDF.
-
-### 7.3 Plan cap and metering
-
-A new `plans.Limits` field, `MediaMinutesMonth` (`media_minutes_month`),
-handled exactly as `pdf_renders_month`: monthly, a warning at the limit, a 402
-from `capCopy` at twice the limit, ops accounts exempt, zero meaning no limit,
-a new `capID`. Proposed values, in the PDF row's proportions (decision 6):
-Free 30, Personal 600, Community 1,200, Business 12,000. No media pack in v1.
-
-Both measures are queries over `media_jobs`: the plan cap sums `source_ms` of
-`done` rows in the UTC month, and the engine-time budget sums `charged_ms` of
-the others. The check runs at submission, so an account can overshoot by its
-queue. Outputs count as the tenant's storage (roadmap ruling 6).
+The console's `allowWrite` limit does not apply, as for PDF. The engine-time
+budget of earlier revisions is gone: failed executions are charged to the
+allowance instead (§7.3).
+
+### 7.3 The allowance, and how a deadline is chosen (paul R-X)
+
+**The allowance.** A new `plans.Limits` field, `MediaMinutesMonth`
+(`media_minutes_month`), handled exactly as `pdf_renders_month`: monthly, a
+warning at the limit, a 402 from `capCopy` at twice the limit, ops accounts
+exempt, zero meaning no limit, a new `capID`. A deployment with no catalog
+uses one per-account figure from `CARLOS_MEDIA_LIMITS` in its place.
+
+**What is charged.** Every figure is a query over `media_jobs`.
+
+- A `done` job: its source duration, times the preset's weight.
+- Any other settled execution: its engine time (`charged_ms`), times the
+ weight. A failure costs what it ran.
+- A running execution: reserved at its full bound, times the weight.
+- **Weights (paul R-A):** `video-720p` 1, `audio-aac` 0.1. One allowance in
+ video minutes, with an hour of audio costing six of them (decision 7).
+
+**Remaining**, `R`, is twice the limit, less what is charged and reserved this
+UTC month. A preset's weight `w` turns it into minutes of that preset, `R/w`.
+
+**The deadline** is fixed by the console at dispatch, before anything is known
+about the source but its size, as the smallest of:
+
+1. the platform maximum, 9 hours;
+2. the preset's ceiling: time to move the file both ways at a conservative
+ rate, plus the preset's maximum duration times its worst-case speed factor
+ (from the spike; assumed 2 for video and 0.1 for audio). About 9 hours for
+ video and 2 for audio;
+3. what the allowance can pay for: `R/w`.
+
+With it the console passes the job's **granted duration**: the smaller of the
+preset's maximum duration and `R/w`.
+
+- If `R/w` is under 5 minutes, the row waits while the account has another
+ execution running, and otherwise fails `allowance_exceeded`, uncharged.
+- **The probe refuses early.** A source longer than the granted duration, or
+ one whose duration times the measured factor for its kind does not fit the
+ time left, exits `allowance_exceeded` before encoding, charged only the
+ minutes used so far.
+- A job that still overruns is stopped by the deadline container and fails
+ `deadline_exceeded`.
+
+So no execution can cost more than the allowance had left: success costs at
+most the granted duration, and failure at most the deadline and its stop
+grace.
+
+Proposed plan values (decision 6): Free 30, Personal 600, Community 1,200,
+Business 12,000 video minutes a month, and a **media pack** of 1,000 minutes
+for accounts that convert long video. Outputs count as the tenant's storage
+(roadmap ruling 6).
### 7.4 Task size, cost and the spike
All figures here are **estimates** until the spike reports.
-- **Size.** 4 arm64 vCPUs and 8 GB, with Fargate's default 20 GiB of
- ephemeral storage. Fargate goes to 16 vCPUs if the spike wants more.
- **Time.** A task takes 30 to 60 seconds to start. A three-minute 1080p30
- phone clip then converts in 30 to 90 seconds; from 4K30 HEVC, 2 to 4
- minutes; with HDR tone-mapping, unknown.
-- **Cost.** About 0.003 US dollars a task-minute **(unverified)**: under a
- cent for a typical clip, about two cents for the slowest admitted one, 5 to
- 10 dollars for a thousand clips a month. Fixed: the three interface
- endpoints, about 24 dollars a month, or about 16 without logs. The reaper's
- 43,200 runs a month cost cents. Nothing else while idle.
+ phone clip then converts in 30 to 90 seconds on 4 vCPUs. Long video runs
+ at roughly half to twice real time depending on the source. Audio runs at
+ twenty times real time or better on 1 vCPU.
+- **Cost.** A video task is about 0.003 US dollars a minute and an audio
+ task about 0.0007 **(unverified)**. That is under a cent for a clip, 30
+ cents to a dollar for a four-hour film, and under a cent for an hour of
+ audio; at most about 0.6 cents per video minute of allowance. Storage
+ above 20 GiB adds cents an hour. Fixed: the three interface endpoints,
+ about 24 dollars a month, or about 16 without logs. The reaper's runs
+ cost cents. Nothing else while idle.
**The spike precedes the build** (decision 1). On a dev cluster it shows:
-1. start time, wall time and peak memory per clip at two task sizes and two
- or three x264 presets, against the 10-minute budget;
+1. start time, wall time and peak memory at two task sizes and two or three
+ x264 presets, for phone clips and for an hour of 1080p and of 4K, giving
+ the speed factors §7.3 uses; and the same for an hour of audio;
2. whether tone-mapping fits; if not, HDR is refused with a named error;
3. the isolation and credential claims of §5.5: no credential from the
environment, the credentials endpoint, the metadata endpoints or the
instance metadata address; no name resolved and no host reached outside
the allowed three; nothing shared between two tasks;
4. the two activation gates of §5.5: all four endpoints refuse an unrelated
- account's credentials, and the reaper stops a container that ignores its
- budget while the console is stopped, within the full bound;
-5. that the override payload fits, and the two store behaviours of §5.4;
-6. whether the single fragmented MP4 plays and seeks progressively in Safari
- on iOS and macOS, Chrome and Firefox, and the playlist in Safari and a
- JavaScript HLS player. If progressive playback fails anywhere, the
- fallback is a second, ordinary faststart MP4, and G2 is amended.
+ account's credentials, and the deadline container ends a task whose
+ `codec` container ignores every signal and tries to signal or kill the
+ timer, with the console stopped, within the deadline plus the stop grace;
+5. that the override payload fits, that size and storage can be set per run,
+ and the three store behaviours of §5.4;
+6. a 50 GiB source: download with a forced reconnect, conversion, and upload;
+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
+ fails anywhere, the fallback is a second, ordinary faststart MP4, and G2
+ is amended.
## 8. Provider boundary
@@ -622,7 +758,7 @@ one-shot container on a box the console can reach, with the equivalent
sandbox: a fresh container per execution, no credentials, size-limited
scratch, memory and time limits, and a network that reaches only the store.
Its hard deadline is the runner's own timeout on that container, such as
-systemd's `RuntimeMaxSec`, in place of the reaper.
+systemd's `RuntimeMaxSec`, in place of the deadline container.
## 9. Rollout and acceptance gates
@@ -662,8 +798,10 @@ live wherever `CARLOS_MEDIA_ENGINE` is set.
- A task with a bad image digest fails to start twice and the job ends
`engine_unavailable`, uncharged; so does a `RunTask` the service rejects,
tested separately from an ambiguous transport error, which takes the
- recovery path. With the console stopped, a task that ignores its budget is
- stopped by the reaper within 17 minutes.
+ recovery path.
+- With the console stopped, a task whose `codec` container ignores every
+ signal and tries to signal or kill the timer is ended by the deadline
+ container within the deadline plus the stop grace **(astra R5-1)**.
- From inside a task, requests signed with an unrelated account's
credentials are refused at the S3, registry API, registry Docker and logs
endpoints.
@@ -674,17 +812,26 @@ live wherever `CARLOS_MEDIA_ENGINE` is set.
after destroy and recreate, the same key and bytes make a new job.
- An app purged with one job queued and one running: both are retired, the
task stopped, charged and cleaned; a new app of that name sees neither.
-- An account whose clips all time out is refused `execution_budget` after 60
- minutes of them. A 600 MB file, a 4-minute clip and an account at twice
- its plan cap are each refused. Of two accounts, one submitting 20 clips
- and one submitting one, the single clip runs within the first three.
+- An account with 10 minutes of allowance left submits a one-hour video: it
+ exits `allowance_exceeded` at the probe, charged only its minutes so far.
+ One whose jobs all overrun is stopped at each deadline and can never be
+ charged past twice its limit. A source over the size maximum, one over the
+ duration maximum and an account at twice its limit are each refused.
+- Two accounts, one submitting 20 clips and one submitting one: the single
+ clip runs within the first three. With four long videos running, a clip
+ still starts at once.
+- A 20 GiB source uploaded in parts converts. A WebM voice recording, an
+ MP3, a WAV and the audio track of a video each convert with `audio-aac`,
+ measure -16 LUFS within a tolerance, and yield 1,000 peaks.
**Then playback:** a two-minute 1080p phone clip, uploaded from a browser on
`shop.example.com`, plays from `video.mp4` reached through a redirect to a
presigned GET in Safari on iOS, Chrome and Firefox, and from `video.m3u8`
proxied on the app's origin in Safari and a JavaScript HLS player, within a
-time the spike sets (expected under two minutes, task start included).
-Repeating the submission returns the same job and converts nothing.
+time the spike sets (expected under two minutes, task start included). A
+browser voice recording converted with `audio-aac` plays from `audio.mp4` and
+`audio.m3u8` the same way. Repeating a submission returns the same job and
+converts nothing.
## 10. Left to the builder
@@ -702,8 +849,10 @@ id is dropped.
- **Stage 3, single rendition:** replaced by this design. Kept: a polled
result and eligibility by region. Changed: the door's path and verb; every
- source re-encoded to a 720p cap; one poster; no audio products; job state
- in the console's database, not under the app's bucket prefix.
+ source re-encoded to a 720p cap; one poster; job state in the console's
+ database, not under the app's bucket prefix. Its audio product (a waveform
+ and the duration) is included as `audio-aac` **(paul R-A)**; the ladder
+ and live streaming stay later stages.
- **Ruling 7 moves (paul R-F):** the worker is a Fargate task per execution,
not `carlos-media.service` on the Ireland `t4g.medium`.
- **§3's codec-helper rule** (a hardened systemd scope, no network) is met
@@ -726,15 +875,17 @@ the outputs. Store destroy gains the refusal of §5.3.
## 12. Decisions for Paul
-Already ruled: a platform engine, Fargate (R-F), the lifecycle cut (R-C).
-
-1. **The spike.** It needs real clips from Paul (4K60 HDR in Dolby Vision or
- HLG, portrait with rotation, variable frame rate, an ordinary 1080p
- clip); his scoped approval to create in the dev account, for its
- duration, an ECS cluster and task definition, an image repository, the
- engine VPC with its endpoints and DNS rule, the reaper and its schedule,
- and the conversion role; the isolation and credential checks and the two
- activation gates of §7.4; and Safari checks on a real
+Already ruled: a platform engine, Fargate (R-F), the lifecycle cut (R-C),
+audio in and live deferred (R-A), generous per-file limits (R-X).
+
+1. **The spike.** It needs real files from Paul (4K60 HDR in Dolby Vision or
+ HLG, portrait with rotation, variable frame rate, an ordinary 1080p clip,
+ an hour or more of video, a browser voice recording); his scoped approval
+ to create in the dev account, for its duration, an ECS cluster and task
+ definition, an image repository, the engine VPC with its endpoints and
+ DNS rule, the reaper, the conversion role and its caller user; the
+ isolation and credential checks and the two activation gates of §7.4,
+ the deadline-container drill among them; and Safari checks on a real
iPhone by Paul or on the tito-studio Mac. Recommend approving it as the
first task.
2. **The engine's network:** a small VPC of its own, which lets a DNS
@@ -743,22 +894,34 @@ Already ruled: a platform engine, Fargate (R-F), the lifecycle cut (R-C).
3. **No wait for stage 1** (moves ruling 11, narrows ruling 6): ship on the
app's own bucket and serving, or wait for `kind:media`. Recommend
shipping.
-4. **Authority:** a conversion role assumed per execution that always
- refuses infected sources, even in stores with enforcement off, or the
- console's own role presigning. Recommend the conversion role.
-5. **Admission caps:** (a) 180 s, 512 MiB, 4K, 60 fps; (b) 300 s and 1 GiB;
- (c) 60 s and 200 MB. Recommend (a), if the spike shows it fits the
- budget.
+4. **Authority, and one long-lived key (new with R-X).** A conversion role
+ assumed per execution that always refuses infected sources, even in
+ stores with enforcement off. Hours-long jobs need grants that last hours,
+ which needs an IAM user's access key held by the console as a secret.
+ (a) accept that key; (b) no key, the console's own role assumes the
+ conversion role, and every job is held to about 50 minutes of engine
+ time, which rules out long video. Recommend (a).
+5. **Per-file maximums:** video 4 hours and 100 GiB, audio 12 hours and
+ 20 GiB, 4K, 60 fps. Or lower them until the spike has measured long
+ jobs. Recommend these, with the allowance as the limiter.
6. **Plan values:** `media_minutes_month` at Free 30, Personal 600,
- Community 1,200, Business 12,000, refused at twice the limit, no media
- pack; or no cap until usage is measured. Recommend the cap.
-7. **Browser uploads in scope** as `carlos store uploads`, a member verb, or
+ Community 1,200, Business 12,000 video minutes, refused at twice the
+ limit, plus a media pack of 1,000 minutes. At most about 0.6 cents of
+ engine cost per minute **(estimate)**. Or other values, or no pack.
+ Recommend these values and the pack.
+7. **How audio is counted (new with R-A):** (a) one allowance, with an audio
+ minute weighing a tenth of a video minute; (b) a separate
+ `audio_minutes_month`. Recommend (a): one number on the plans page, one
+ cap and one refusal path, and audio costs well under a tenth of video to
+ run.
+8. **Browser uploads in scope** as `carlos store uploads`, a member verb, or
native clients only for now. Recommend in scope.
-8. **Always re-encode, HDR tone-mapped, one JPEG poster**, or add the
- roadmap's remux path. Recommend always re-encode.
-9. **On for every app** with a store and a Service credential, as PDFs are,
- or a per-app switch. Recommend on for every app.
-10. **Codec licences.** The engine encodes H.264 and AAC with Debian's
+9. **Always re-encode, HDR tone-mapped, one JPEG poster, audio normalised to
+ -16 LUFS**, or add the roadmap's remux path, or make normalisation a
+ request option. Recommend as written.
+10. **On for every app** with a store and a Service credential, as PDFs
+ are, or a per-app switch. Recommend on for every app.
+11. **Codec licences.** The engine encodes H.264 and AAC with Debian's
ffmpeg. Accept that position or have it checked before flagship. A
question, not a recommendation.
@@ -788,4 +951,16 @@ with Paul's approval:
before settlement, no `RunTask` replay (§5.3).
- **R4-4** launch rejection: its own uncharged transition (§5.3).
+**Round 5** (`CODEX-FINDINGS-VIDEO-R5.md`, 1 P1; R4-1, R4-3 and R4-4 closed):
+
+- **R5-1** the reaper's timing is not a bound: the deadline is now a second
+ essential container in the task, so ECS ends the task at the deadline
+ whatever the console or any schedule does. The reaper is a backstop and
+ the 17-minute figure of R4-2 is gone (§5.3, §5.5, §6).
+
+**Rulings applied in revision 6:** R-A adds the `audio-aac` preset (§5.1, §6,
+§7); R-X replaces the short-clip caps with per-file maximums, a per-job
+deadline chosen from the allowance, long-lived grants and large-file
+transfers (§5.4, §5.6, §7).
+
**Findings not accepted:** none.