carlos / platform Public

Ruling 2026-11-16: conversions run on Lambda, not a standing c7g box open

On branch design-video-conversion

Paul asked whether the c7g box could sleep when idle, or whether a Lambda would suit occasional use better. He agreed to Lambda ("Sounds good").

Decided:

  • On AWS, the engine is an arm64 container image with ffmpeg, invoked once per execution. It runs in the console's VPC with an S3 gateway endpoint and no internet route, and its execution role has no S3 authority: it works only through the presigned transfers the console mints. The console invokes it synchronously, so the result is the return value and no callback path is needed.
  • Isolation per execution is the Lambda microVM with its own ephemeral /tmp. This replaces the shared-box slots, the per-slot filesystem and the helper unit.
  • Provider boundary: a deployment without AWS runs the same image as a one-shot container on a box.
  • Revision 2's lifecycle carries over unchanged: execution ids, create-only per-execution outputs, the CAS commit, metering and caps.

Revision 3 folds this in with Astra's round-2 findings. That leaves one review round.

Round 2 (Astra) returned revise: one P1 (scratch slot reuse after an agent restart, gone with Lambda) and five P2s. Four of the P2s repeat round-1 families (queue discovery, accounting, the execution budget, abandoned-output cleanup), so stopping rule 2 applied.

Paul's ruling, 2026-11-16 ("Yes go ahead"):

  • Cut cancel, terminal DELETE and requeue from v1. An app that no longer wants a result ignores it.
  • The whole job lifecycle is one console-database row changed only in transactions: state, current execution, reservation, settled flag, cleanup due time. The plan's first build task is a randomized interleaving simulation of submit, dispatch, return, crash, console restart, cleanup and app purge.
  • Accounting: the console times each synchronous Lambda invoke. A console restart mid-invoke charges the full Lambda timeout.
  • Adopted buckets: refuse up front. New stores record minted provenance; existing stores qualify after a one-time verification.

Round 3 (Astra) returned revise: two P1s in Lambda isolation (a compromised codec in a reused execution environment can drive the Runtime API and take the next invocation, which may be another tenant's; the execution-role credentials and an open DNS path), and two P2s (lost invokes free concurrency early; store destroy does not retire conversion rows). The three-round budget is spent.

Paul's ruling, 2026-11-16 ("Fargate seems fine. A, with a narrow fourth round"):

  • R-F: the engine is one ECS Fargate task per execution (arm64, the same image). Each task is its own microVM and is never reused. No Runtime API, no task role, no AWS credentials in the container. The console stores the task ARN in the job row and reads task state from ECS, so a console restart re-reads the job and does not lose it. Same VPC posture: S3 gateway endpoint, no internet route, interface endpoints for the image pull (estimated about $15 a month). Startup is about 30 to 60 s (estimate).
  • R-L is superseded by R-F. R-C stands.
  • Fix R3-3 and R3-4 too.
  • A fourth Astra round is approved, scoped to the Fargate change and the R3 fixes only.

Round 5 (Astra, diff only): R4-1, R4-3 and R4-4 closed. One P1 in the R4-2 family: the reaper's EventBridge schedule does not bound execution time. Stopping rule 2 applied. Opus offered the fix of enforcing the deadline in one place, an essential deadline container in each task (ECS stops the task when it exits; the codec container cannot reach it), with the reaper as a backstop. Paul raised no objection.

Paul's rulings, 2026-11-16:

  • R-A: on-demand audio is in scope (an audio-aac preset with a waveform and loudness normalisation). Live streaming is deferred.
  • R-X: "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." Per-file caps become generous, the plan allowance is the real limit, and each job's deadline is set from the remaining allowance. v1 stays a single rendition.

Revision 6 folds these in; a narrow review of the changes follows.

Round 6 (Astra, changes only) found three P1s and two P2s:

  • P1: the deadline container has no start ordering;
  • P1: a leaked long-lived caller key grants unrestricted cross-tenant conversion authority;
  • P1: an allowance reservation can be smaller than the settlement;
  • P2: short clips are classed as long jobs;
  • P2: loudness precedence.

Paul's ruling R-K, 2026-11-16 ("Sure. no key."): no long-lived key. The console assumes the conversion role from its instance role, so transfers last at most an hour. Each execution fits a platform engine window of about 50 minutes, long sources get bigger tasks, and the spike sets the per-file maximums. This closes R6-2. Revision 7 applies R-K and the other four fixes.

Paul approved the design (revision 8) on 2026-11-16 ("approved."), taking every recommendation in §12. For decision 11, conversion is fine for dev and the spike, and H.264/AAC licensing gets checked before flagship charges for conversion. Review closed after round 7, which had no P1. Next: the build plan, whose first tasks are the spike and the lifecycle simulation.

Plans round 2 (Astra): F1 (endpoint proof) and F12 (host-claim) recurred, so stopping rule 2 applied. Paul took Opus's picks on 2026-11-16 ("Happy with picks"):

  • F1: one shared endpoint drill with independent controls. The foreign registry token is minted outside the VPC, and the identical request runs under the restrictive, then a temporarily permissive, then the restored policy. Nothing asserts on error text. Conversion stays off until the drill passes.
  • F12: spec amendment A1. Host-claim consoles refuse conversion and uploads until that mode is removed.
  • Charging: Opus's max(duration, runtime) floor is reverted. It overcharged honest slow encodes. Spec amendment A2 keeps duration charging with a 0..grant bound and states the self-underreport risk. Plan 2's P2s land without another round. A narrow round 3 checks only the shared drill in plans 1 and 3.