diff --git a/docs/superpowers/plans/2026-11-15-aws-phase6.md b/docs/superpowers/plans/2026-11-15-aws-phase6.md index 90d1ade..bff404f 100644 --- a/docs/superpowers/plans/2026-11-15-aws-phase6.md +++ b/docs/superpowers/plans/2026-11-15-aws-phase6.md @@ -19,7 +19,7 @@ - **Q5. Cost estimate from the Pricing API, cached a day.** `pricing:GetProducts` (Resource `*`; the API has no resource-level permissions) goes into `workspace-user-tasks.json`. Prices come from the `AmazonECS` service code in `us-east-1`, filtered to the region and Fargate vCPU-hours / GB-hours / ephemeral storage GB-hours for x86 and ARM; cached on disk per region for 24 h. Spot isn't in the Pricing API: the UI shows the on-demand figure with "Spot is usually up to 70% cheaper". EFS storage isn't per-hour and isn't estimated. Shown in HostSection (as you configure) and Project Home Overview (while running). Denied or offline → "Estimate unavailable", never an error. - **Q6. Port mappings reuse the auth bridge's tunnel.** `auth_bridge::tunnel` already forwards a host loopback port into the container over socat-over-attach, which works through the agent. Generalise `PortForward::bind` to take a host port and a container port. AWS mappings bind **loopback only** (Docker binds 0.0.0.0; the UI says so), TCP only (UDP refused for AWS projects), opened after connect and closed on stop/exit. No new `/v1/tunnel` client. - **Q7. LLM gateway as a sidecar, opt-in per project.** `AwsWorkspaceConfig.gateway_sidecar: bool`. When on, the task definition adds a non-essential `gateway` container running the app's pinned LiteLLM image (`docker::gateway` registry ref, digest-pinned), with `memoryReservation` 512 MiB; its config YAML and keys arrive as payload keys `TRIPLEC_GATEWAY_CONFIG`, `TRIPLEC_GATEWAY_API_KEY`, `TRIPLEC_GATEWAY_MASTER_KEY` (rendered with the same `render_config` as Docker, keys via `os.environ/…` references) and the container's command writes the config to `/tmp` and starts LiteLLM on `127.0.0.1:4000`. The project must use the OpenAI-compatible backend; the app then points `ANTHROPIC_BASE_URL` at `http://127.0.0.1:4000` and `ANTHROPIC_AUTH_TOKEN` at the master key, regardless of the base URL typed for local use. The task's CPU/memory must leave room: the minimum for a sidecar project is 1 vCPU / 2 GiB (validated). -- **Q8. Lifetime cap is enforced inside the workspace (advisory), set per environment.** Environment module variable `max_workspace_hours` (0 = no cap, default 0) → record field `max_workspace_hours` (record schema stays 1; unknown-field tolerant parser already); `ENVIRONMENT_MODULE_VERSION` 1 → 2 so existing environments show "Update available". The app passes `TRIPLEC_MAX_LIFETIME_MINUTES`; the idle watcher stops the task when it's reached — WIP push first (best effort, 90 s), then stop even if the push failed — with exit status 76 (`StopKind::LifetimeCap`, toast "Stopped: the environment's maximum workspace lifetime"). The UI shows the cap in HostSection. **This is advisory**: a workspace user has sudo inside their own task and could disable it. Server-side enforcement (a scheduled Lambda that stops old tasks) is listed as a follow-up, not built. **← needs your OK in review.** +- **Q8. Lifetime cap is enforced inside the workspace (advisory), set per environment.** Environment module variable `max_workspace_hours` (0 = no cap, default 0) → record field `max_workspace_hours` (record schema stays 1; unknown-field tolerant parser already); `ENVIRONMENT_MODULE_VERSION` 1 → 2 so existing environments show "Update available". The app passes `TRIPLEC_MAX_LIFETIME_MINUTES`; the idle watcher stops the task when it's reached — WIP push first (best effort, 90 s), then stop even if the push failed — with exit status 76 (`StopKind::LifetimeCap`, toast "Stopped: the environment's maximum workspace lifetime"). The UI shows the cap in HostSection. **This is advisory**: a workspace user has sudo inside their own task and could disable it. Server-side enforcement (a scheduled Lambda that stops old tasks) is listed as a follow-up, not built. (Chosen by the user 2026-11-15.) - **Q9. One WIP branch per task run, updated in place.** The branch becomes `triple-c/wip/-` (stamp written by the entrypoint at start into `/run/triple-c/run-id`; Docker/no-task fallback keeps today's per-push stamp); later pushes in the same run overwrite it (`+` refspec — the branch is ours alone), and a push whose tree equals the last one pushed for that repo in this run is skipped (tree hash kept in `/run/triple-c/wip-last/`). ## Global Constraints