Commit Graph
449 Commits
Author SHA1 Message Date
shadowdaoandClaude Opus 5.5 5b23dc1aec build: build session-manager-plugin from source, not AWS's binaries
Build App (Preview) / compute-version (pull_request) Successful in 5s
Secret Scan / scan (push) Successful in 8s
Secret Scan / scan (pull_request) Successful in 7s
Build App (Preview) / create-release (pull_request) Successful in 2s
Build App (Preview) / build-macos (pull_request) Successful in 6m42s
Build App (Preview) / build-linux (pull_request) Successful in 12m41s
Build App (Preview) / build-windows (pull_request) Successful in 13m57s
Build App (Preview) / test (pull_request) Successful in 23m29s
Build App (Preview) / prune-previews (pull_request) Successful in 3s
AWS ships its prebuilt plugin as "AWS Content" under the AWS Customer
Agreement; the source is Apache-2.0. Replace the binary fetch with
scripts/build-ssm-plugin.sh (any triple, cross-compiles; universal via
lipo) and build-ssm-plugin.ps1 (Windows runner):

- source: tag 1.2.896.0 at commit 6430675a, GitHub archive SHA-256
  checked before extraction;
- Go 1.26.11 from go.dev, published SHA-256 checked before use;
- the repo's own build (GOPATH mode, vendored deps, -s -w,
  sessionmanagerplugin-main) with VERSION stamped to the tag, plus
  -trimpath, no VCS stamp, empty build id, CGO off;
- output must equal a pinned SHA-256 per target (reproducible builds).

Each platform job builds its own targets. Windows: the exe is now ours
and unsigned, so windows-sign.ps1 allowlists it and
windows-verify-signatures.ps1 requires it signed by the installer's own
certificate in the MSI and NSIS. THIRD_PARTY_NOTICES now carries the
source's LICENSE/NOTICE/THIRD-PARTY, the commit, every linked vendored
module's licence and Go's. AWS's GPG key and the AWS-signature checks
are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:12:11 -08:00
shadowdaoandClaude Opus 5.5 39f502dcdf feat(ssm): bundle session-manager-plugin as a sidecar and prefer it
bundle.externalBin ships the plugin beside the app binary (usr/bin in the
AppImage, Contents/MacOS, the Windows install dir) and THIRD_PARTY_NOTICES as
a resource. find_plugin() now resolves TRIPLEC_SSM_PLUGIN, then the bundled
sidecar next to current_exe(), then PATH and AWS's install locations, then
the install hint; the order is unit-tested against temp dirs.

tauri-build fails any build whose externalBin file is missing, so build.rs
writes a marked placeholder in debug builds (cargo test/check, tauri dev)
and refuses a missing file or a placeholder in release builds.
find_plugin() skips the placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 06:43:41 -08:00
shadowdaoandClaude Opus 5.5 05ac6b3e8c build: fetch a pinned, verified AWS session-manager-plugin
scripts/fetch-ssm-plugin.sh (Linux/macOS, incl. universal via lipo) and
scripts/fetch-ssm-plugin.ps1 (Windows) download plugin 1.2.896.0 from AWS's
S3 path into app/src-tauri/binaries/session-manager-plugin-<triple>[.exe],
checking a pinned SHA-256 of each artifact before extraction, AWS's GPG
signature on the Linux .deb (key committed, fingerprint pinned) or AWS's
Authenticode signature on Windows, and a pinned SHA-256 of the binary.

THIRD_PARTY_NOTICES reproduces the plugin's LICENSE (Apache-2.0), NOTICE
and AWS's THIRD-PARTY statement. The binaries directory is never committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 06:43:41 -08:00
shadowdaoandClaude Opus 5.5 05ed1c37a5 fix(aws): phase 7 parked minors
Build App (Preview) / compute-version (pull_request) Successful in 9s
Secret Scan / scan (push) Successful in 21s
Secret Scan / scan (pull_request) Successful in 9s
Build App (Preview) / create-release (pull_request) Successful in 2s
Build Container / build-container (pull_request) Successful in 2m59s
Build App (Preview) / build-macos (pull_request) Successful in 6m17s
Build App (Preview) / build-windows (pull_request) Successful in 12m0s
Build App (Preview) / build-linux (pull_request) Successful in 21m5s
Build App (Preview) / prune-previews (pull_request) Successful in 4s
Build App (Preview) / test (pull_request) Successful in 24m1s
Interrupted-start notice gets its own toast topic and headline; the launch-type switch note only shows after a successful save and is dropped by later saves; README states the CreateLogStream scoping limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 05:24:56 -08:00
shadowdaoandClaude Opus 5.5 d85292ea00 fix(aws): add the EC2 root volume to the cost estimate; name public IPv4
The EC2 estimate adds the 50 GiB gp3 root volume at the region's gp3
GB-month price (Pricing API, cached per region like the instance price;
fixture recorded 2026-11-16). The note says whether it is included and
that a public-mode environment's IPv4 address adds $0.005/hour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:40:12 -08:00
shadowdaoandClaude Opus 5.5 1d1e356fcd fix(aws): EC2 host settings polish
HostSection says what a launch-type switch changed besides the type,
checks the saved reservations against the instance type once on load,
and is re-indented. The EC2 capacity cache keeps none/unusable for one
minute only. RuntimeSection's VPN hint on EC2 speaks of an ECS task on
the user's instance. Joining over an incomplete onboarding with no
record warns that None removes half-built EC2 capacity, and starts from
the capacity last chosen in this run when there is one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:37:07 -08:00
shadowdaoandClaude Opus 5.5 77db6028d0 fix(aws): write logs only into the user's own streams; no log rights on the instance role
The instance role (reachable from a Docker-access project's host-network
container) could PutLogEvents into any user's streams. It now has no log
rights: awslogs writes with the execution role
(ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE=true). The task and execution
roles create streams in the environment's group but write only into
log-stream:<owner_key>/* (every awslogs stream's prefix); the Fargate
fingerprint moves deliberately. The live test asserts task logs are
written. README: per-user logs, orphan clock skew, verdict wording;
boundary version comments no longer mention Session Manager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:33:57 -08:00
shadowdaoandClaude Opus 5.5 8fe0810901 fix(aws): never let the user record vouch for EC2 names tagged as another owner's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:30:41 -08:00
shadowdaoandClaude Opus 5.5 8c9ffd4c4c fix(aws): never attach to an exec-off EC2 task after a restart; widen the orphan margin
Reconcile stops a placed or orphaned exec-off task (REPLACED_REASON,
checked; the ARN is cleared only once the stop succeeded) and marks a
recent one still waiting Error with its ARN kept and an 'interrupted'
warning. Reattach refuses an exec-off task. ORPHAN_MARGIN is 10 minutes
(clock skew). A failed EC2 record read no longer blocks attaching to a
live task. One helper builds the task cluster list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:30:05 -08:00
shadowdaoandClaude Opus 5.5 6e24977cf0 fix(aws): replace an orphaned exec-off EC2 task instead of refusing for ever
A found task with ECS Exec off that still waits for an instance is
another start's only while one could still be waiting for it (created
within the EC2 placement wait plus 2 minutes); an older one is a crashed
start's orphan and is replaced (stopped with its own reason, checked,
waited for). INSTANCE_RACE now mentions Stop. The rerun's race records
the winner's task, as the first launch's race does; a first task another
start replaced says so. TaskInfo gains created_unix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:16:22 -08:00
shadowdaoandClaude Opus 5.5 374fb5a35d test(aws): harden the phase 7 live test; record the update probe
The guard paginates Auto Scaling groups and treats a failed read as not
yet gone; the test asserts exactly one live task after a cold start,
the sandbox off in the task's settings and bwrap failing (E8). README:
updating a group to an unsupported template version is denied by the
launch check (live probe); run 6 after the review fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:12:51 -08:00
shadowdaoandClaude Opus 5.5 10f473f3da fix(aws): show the sandbox as off wherever an AWS project can't run it
PermissionModeControl read the raw sandbox_mode_enabled, so an AWS
project showed "Sandbox ON — bubblewrap isolation" and no Bypass
caution although the host forces it off. A shared sandboxEffective()
(false for any AWS project) now feeds both it and the Runtime toggle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:59:44 -08:00
shadowdaoandClaude Opus 5.5 c25761789e fix(aws): never run a second task for a stopped or contested cold EC2 start
The cold-start rerun now runs again only once an instance has taken the
first task and it is still meant to run; a first task that stops by
itself (a user's Stop, a failed placement) ends the start with its
reason. The second launch goes through find_or_run, so a concurrent
start's task is reported as START_RACE instead of doubled. A found task
with ECS Exec off that is still waiting for an instance belongs to a
start in progress (INSTANCE_RACE); a placed one is stopped, the stop is
checked and waited for (its own 3-minute budget) before a new run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:59:09 -08:00
shadowdaoandClaude Opus 5.5 fc3456c44e test(aws): live phase 7 EC2 checks
a_phase7_ec2_workspace_round_trips: onboarding with per-user EC2
capacity through prepare_onboarding (tagged workspace role, all four
admin files), its collision check and refusal, admin-tier scaling
probes, a cold and a warm EC2 start (Docker access, VPN, ECS Exec into
the bridge task), in-container checks (docker ps, wg/tun,
src_valid_mark, bwrap, IMDS, introspection), RunTask on another user's
cluster, stop and scale-in, removal, re-apply without EC2 with an
instance up, offboard and destroy. The guard (ec2_cleanup) force-deletes
any per-user EC2 capacity. Results in aws/README.md and the spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:52:36 -08:00
shadowdaoandClaude Opus 5.5 6c7c2ea4ef fix(aws): keep Claude Code's sandbox off on EC2 too (E8)
Measured live on the ECS-optimized AL2023 AMI (kernel 6.1,
max_user_namespaces 30937): bwrap --unshare-user in the ECS task fails
with "No permissions to create new namespace", as on Fargate. Docker's
default seccomp profile refuses it without CAP_SYS_ADMIN. sandbox_allowed
is false for every AWS project, and the Runtime toggle is locked off on
EC2 as on Fargate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:35:30 -08:00
shadowdaoandClaude Opus 5.5 43fcc520ab fix(aws): run a cold EC2 task again once its instance is up
ECS turns enableExecuteCommand off on a RunTask that has to wait for an
instance (PROVISIONING behind a capacity provider), and the task keeps it
off once placed: verified live (CloudTrail shows true in the request,
false in the answer; a RunTask with an instance up keeps it). Such a
task can never be reached, so every cold EC2 start timed out.

A cold start now lets that first task bring the instance up, stops it as
soon as it is placed, waits for it to stop and runs the task again onto
the instance; a second task without ECS Exec is stopped and reported. A
live task found with ECS Exec off is stopped and replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:34:38 -08:00
shadowdaoandClaude Opus 5.5 bf5a810e0d fix(aws): allow template-only Auto Scaling group creates
A CreateAutoScalingGroup that names only a launch template sends no
autoscaling:InstanceTypes (verified live), so the scaling file's
Null:false on it denied every per-user group. Drop it; the type is held
by the caller's own ec2:RunInstances launch check on the template, which
also refuses MixedInstancesPolicy overrides of unsupported types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:24:55 -08:00
shadowdaoandClaude Opus 5.5 9e1a63cde5 feat(aws): EC2 projects in the UI, Docker access and VPN
Host settings get the launch-type control (Fargate | EC2 with the user's
instance type, disabled with the reason when their onboarding has no EC2
capacity), switching through launchTypePatch, which now also clears the
gateway sidecar and Spot for EC2 and snaps sizes per side. EC2 projects size
CPU/memory reservations checked by Rust's fit rule (ec2_fit_problem, new
command) against the user's record (aws_ec2_capacity, new command); no
ephemeral size, Spot or architecture; notes for scale-to-zero, Docker access
as root on the instance and no sidecar. The sandbox follows the project on EC2.

The cost estimate prices an EC2 project as its instance type's AmazonEC2
on-demand Linux shared-tenancy price (recorded fixture), cached per region and
type with the Fargate cache's rules. The entrypoint's Docker-socket group step
now runs in aws mode when the socket exists; the VPN skill follows
VPN_SUPPORT_ENABLED there as on Docker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:03:57 -08:00
shadowdaoandClaude Opus 5.5 d6ef6a5fd2 feat(aws): run projects on per-user EC2 capacity
EC2 projects register an EC2/bridge task definition (no runtime platform or
ephemeral storage; task-level reservations checked against the user's
instance type with a 10% memory margin), with the instance's Docker socket
and the Docker VPN pieces (NET_ADMIN, /dev/net/tun, src_valid_mark) when
enabled, and run on the user's cluster through their capacity provider.
The start reads the user record, waits up to 10 minutes with "Starting an
instance" progress, and maps RunTask access denied to the triple-c-user
mismatch. Stop, reconcile, removal and the watch follow the task's own
cluster, so a running EC2 task outlives its record. The sandbox stays on
for EC2; the gateway sidecar is refused there for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:46:06 -08:00
shadowdaoandClaude Opus 5.5 98e330060e fix(aws): EC2 name check by owner tag; keep unusable records; bundle warning
The pre-apply check now decides ownership by the resources' triple-c:owner
tag (record as fallback), so a failed apply of one's own capacity can be
re-applied; any cluster status but INACTIVE holds the name. An onboarding
seam (OnboardApi) makes the record read and the name lookups testable, and
prepare_onboarding settles everything before launch. With no choice given,
an unreadable or invalid record is refused instead of removing capacity.
Bundles warn when their cluster name looks taken; the README check prints
owner tags. The UI keeps the recorded type when the instance list fails and
says when an apply removes EC2 capacity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:31:30 -08:00
shadowdaoandClaude Opus 5.5 1a2c530be8 feat(aws): choose EC2 capacity when onboarding
Self-onboarding and the onboarding bundle take an EC2 capacity choice:
none, or an instance type from the app's table (grouped x86/ARM, default
m7i.large), 1-4 instances and the user's triple-c-user value. A re-apply
keeps the recorded capacity unless changed (the record gains
max_instances). Before any self-onboarding apply with EC2 the app refuses
per-user names (ACTIVE cluster or Auto Scaling group) that this owner's
record doesn't name (R3). OnboardingState carries the user's compute from
their record; the panel shows it. The bundle README's collision check now
comes before the apply step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:22:31 -08:00
shadowdaoandClaude Opus 5.5 e9c20287b7 fix(aws): EC2 name-collision step in onboarding bundles; bridge agent config
Task 3 fix round 1 (rulings R2, R3):
- Onboarding admin bundles' README gains an "EC2 capacity" step: before
  applying with ec2_instance_type, check with describe-clusters /
  describe-auto-scaling-groups that triple-c-<env>--u-<tag> is unused
  unless this owner's /triple-c/users/<env>/<owner key> record names it
  (exact names; <tag> when the bundle has none). Tested.
- User data for bridge tasks (R2): ECS_ENABLE_TASK_IAM_ROLE=true instead
  of ECS_AWSVPC_BLOCK_IMDS; IMDSv2 hop limit 1 kept, comment corrected;
  the test asserts no ECS_ENABLE_TASK_ENI / awsvpc settings.
- Reverted unrelated rustfmt churn in tofu_modules/tests.rs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:07:28 -08:00
shadowdaoandClaude Opus 5.5 9410c098ed feat(aws): optional per-user EC2 capacity in the onboarding module
Phase 7 Task 3 (E1-E4, E11; onboarding module version 2):
- ec2.tf: with ec2_instance_type set, the user's own cluster
  triple-c-<env>--u-<ec2_user_tag> with exactly one capacity provider
  (managed termination protection, managed scaling 100% one instance at
  a time, 60 s warm-up), an Auto Scaling group of 0..ec2_max_instances
  (desired left to ECS, protect_from_scale_in, force_delete off so the
  provider drains before deleting, fixed launch-template version, default
  tags + AmazonECSManaged), a launch template on the ECS-optimized AL2023
  AMI by architecture (IMDSv2 hop 1, 50 GiB gp3 encrypted root, the
  environment's tasks group, public IP as the environment's tasks get
  one, ECS_CLUSTER + ECS_AWSVPC_BLOCK_IMDS), the instance role
  triple-c-<env>-<owner key>-instance (bounded, tagged triple-c:cluster,
  ECS agent on its cluster only, ECR pull, logs; no SSM core) and its
  instance profile, and the user record /triple-c/users/<env>/<owner key>.
  Empty type (the default): count 0 everywhere, Fargate plan unchanged.
- Variables ec2_instance_type (the app's 30 types), ec2_max_instances
  (1-4), ec2_user_tag (as validate_ec2_user_tag, required with a type);
  onboarding_vars takes Option<&Ec2Compute> and validates the same.
- The environment record's assign_public_ip is now format-checked.
- tofu_modules.rs: ONBOARD_MODULE_VERSION 2, user_record_parameter_name,
  USER_RECORD_FIELDS, Ec2Compute, EC2_MAX_INSTANCES, ec2.tf embedded.
- Tests: EC2 calls merged into MODULE_CALLS under real types
  (all_module_calls removed); gating + version-1 resource fingerprint;
  launch template, group, capacity provider, instance role, AMI by arch,
  record fields, names, variable rules; the instance role inside the
  boundary with its cluster principal tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 14:00:23 -08:00
shadowdaoandClaude Opus 5.5 9829ff0c43 feat(aws): per-user EC2 clusters keyed by the triple-c-user principal tag
Fix round 2 for the phase 7 policies (amends plan E1):
- Per-user EC2 names: triple-c-<env>--u-<user tag> for the cluster,
  capacity provider, Auto Scaling group and launch template
  (user_ec2_stem, validate_ec2_user_tag; `--` can't occur in environment
  names or user tags, so the patterns are unambiguous); the instance
  role/profile stay owner-key named (user_instance_role_name, <= 64).
- workspace-user-tasks.json: RunTask/StartTask on a triple-c-*--u-*
  cluster is denied unless it is the caller's own
  (${aws:PrincipalTag/triple-c-user}), and denied without the tag.
- Admin: capacity providers and groups narrowed to triple-c-*--u-*; the
  boundary's agent cluster tag must match triple-c-*--u-*.
- Instance-type fail-open closed: ec2:InstanceType required (StringEquals,
  volumes in their own statement); group create requires
  autoscaling:InstanceTypes present.
- The compute file is split: environment-admin-scaling.json (groups,
  instance profiles, service-linked roles) is the admin tier's fourth file.
- Evaluator learns ArnNotLike. README: triple-c-user setup, sizes,
  still-open probes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:44:55 -08:00
shadowdaoandClaude Opus 5.5 e6fbf4e133 fix(aws): pin, type-limit and fence per-user EC2 capacity permissions
Review fix round 1 for the phase 7 admin compute file and boundary:
- Auto Scaling groups: create needs autoscaling:LaunchTemplateVersionSpecified
  (update BoolIfExists), no target groups / load balancers, supported
  instance types; CreateOrUpdateTags only on already-tagged groups.
  ModifyLaunchTemplate dropped (the default version never moves).
- RunInstances: instance and volume need the component request tag,
  the instance a supported type (the app's ec2_instance_spec table,
  pinned by a test); the security group must be the template's own and
  component-tagged, the image Amazon's and the template's.
- Boundary: the ECS agent only on the cluster its role's
  triple-c:cluster principal tag names (must be triple-c-*); Session
  Manager / ec2messages dropped (plan E4 amended).
- Evaluator learns Bool/BoolIfExists; the simulator sends the Boolean
  keys typed Boolean.
- README: instance types, pinning, -instance suffix is not an admin
  fence, RunInstances wording, still-open probes, IMDS/Docker note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:17:54 -08:00
shadowdaoandClaude Opus 5.5 7393143762 feat(aws): admin and boundary permissions for per-user EC2 capacity
Phase 7 Task 2 (E4, E5, E11):
- New third admin file environment-admin-compute.json (3,705 chars):
  capacity providers (triple-c-*), component-tagged launch templates,
  triple-c-* Auto Scaling groups (request tag to create, resource tag to
  change/protect/delete), RunInstances only from a tagged launch template
  with Amazon images, tags only at create, instance profiles (triple-c-*),
  PassRole of triple-c-*-instance roles to ec2.amazonaws.com only,
  service-linked roles for Auto Scaling and ECS only, the public
  ECS-optimized AMI parameter, autoscaling/capacity-provider reads.
- Boundary v2 (2,625 chars): the ECS agent's calls on triple-c-* clusters
  and container instances, TagResource only at RegisterContainerInstance,
  DiscoverPollEndpoint and Session Manager core. BOUNDARY_MODULE_VERSION=2
  with a template_version local and default tag, pinned by a test.
- Checks for every new action; tests for tag/name scoping, launch-only-
  through-templates, PassRole to EC2 only for instance roles, the
  workspace tier changing no compute, the boundary's agent fence.
- EC2_COMPUTE_CALLS in tofu_modules/tests.rs: the onboarding module's
  expected calls, evaluated against the admin tier and in the write drift
  test until Task 3 moves them into MODULE_CALLS.
- README: third file, sizes, boundary re-apply, resource table rows,
  scoping notes and "still open" points for the live run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:07:37 -08:00
shadowdaoandClaude Opus 5.5 c6b46a7347 fix(aws): refuse Docker/VPN on Fargate without grandfathering; launchTypePatch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:56:18 -08:00
shadowdaoandClaude Opus 5.5 86f253b7da feat(aws): EC2 launch type setting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:54:24 -08:00
shadowdaoandClaude Opus 5.5 0a325cb7f2 fix(aws): Host settings merge saves against the latest config and cache the environment's lifetime cap
Build App (Preview) / compute-version (pull_request) Successful in 38s
Secret Scan / scan (push) Successful in 17s
Secret Scan / scan (pull_request) Successful in 11s
Build App (Preview) / create-release (pull_request) Successful in 7s
Build App (Preview) / test (pull_request) Successful in 8m14s
Build App (Preview) / build-macos (pull_request) Successful in 6m4s
Build App (Preview) / build-windows (pull_request) Successful in 10m43s
Build Container / build-container (pull_request) Successful in 19m45s
Build App (Preview) / build-linux (pull_request) Successful in 16m22s
Build App (Preview) / prune-previews (pull_request) Successful in 9s
A save right after the setup script's blur (a toggle) spread the render-time
config and reverted the script; saves now start from the stored config plus
every patch saved since. aws_environment_max_hours is cached per connection,
region and environment for 10 minutes, so re-mounting the section does not
ask AWS again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:10:37 -08:00
shadowdaoandClaude Opus 5.5 ea37f8434f fix(aws): retry the copy-at-connect secret read while the secret is pending deletion
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:08:46 -08:00
shadowdaoandClaude Opus 5.5 544409c554 fix(aws): no Pricing client counts as a failed fetch, so the 5-minute back-off applies
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:08:46 -08:00
shadowdaoandClaude Opus 5.5 be96b5f68f fix(aws): the copy-at-connect warning gets its own toast topic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:08:46 -08:00
shadowdaoandClaude Opus 5.5 ff5ae9862b fix(aws): a waiting clone retry no longer holds the retry lock, so a later connect cannot strand it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 12:07:14 -08:00
shadowdaoandClaude Opus 5.5 9e1e72d2a4 feat(aws): setup script editor
Build App (Preview) / compute-version (pull_request) Successful in 6s
Secret Scan / scan (push) Successful in 7s
Secret Scan / scan (pull_request) Successful in 14s
Build App (Preview) / create-release (pull_request) Successful in 6s
Build App (Preview) / build-macos (pull_request) Successful in 6m3s
Build App (Preview) / test (pull_request) Successful in 8m39s
Build App (Preview) / build-windows (pull_request) Successful in 11m38s
Build Container / build-container (pull_request) Successful in 17m24s
Build App (Preview) / build-linux (pull_request) Failing after 21m19s
Build App (Preview) / prune-previews (pull_request) Skipped
HostSection gets a monospace "Setup script" textarea (saved on blur, blank
as none) with the 32 KiB UTF-8 limit checked using the backend's message,
and notes on when it runs (as claude, bash -e, after the clone, every start,
30 minutes, output in the Overview card) and what it gets under
copy-at-connect.

Also in Host settings: the environment's advisory lifetime cap (Q8), read
by a new aws_environment_max_hours command, and the copy-at-connect limits
(no CA before the first connect, removed credentials linger in a running
task, no setup re-run after a re-clone), documented in CLAUDE.md too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:59:37 -08:00
shadowdaoandClaude Opus 5.5 5388db487e fix(aws): never run two workspace-status polls at once
A read in flight blocks the visibilitychange restart, so hiding and showing
the window mid-read no longer starts a second poll chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:59:37 -08:00
shadowdaoandClaude Opus 5.5 3bc2b41b70 test(aws): pin the 168-hour lifetime cap across Rust, TypeScript and HCL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:56:27 -08:00
shadowdaoandClaude Opus 5.5 f3d542ba60 fix(aws): build the pricing client inside the cost estimate's 8 s bound
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:56:27 -08:00
shadowdaoandClaude Opus 5.5 66a9993e69 fix(aws): retry a secret write while its deletion finishes
After a timed-out replace (secret force-deleted, not made again) the next
start retries the create/put for up to 30 s, then says to start again in a
minute; no more advice to restore the secret in the console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:56:26 -08:00
shadowdaoandClaude Opus 5.5 56acab1bf2 fix(aws): register the workspace follower before spawning it
begin_follow runs in spawn_follow and the token is passed in, so a quick
Stop→Start can't leave the old follower registered last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:56:26 -08:00
shadowdaoandClaude Opus 5.5 f87edbc5df fix(aws): build the gateway sidecar payload only when preparing a task
Attaching to a running task no longer needs the provider key or gateway
models; the payload is built lazily on the prepare path only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:56:26 -08:00
shadowdaoandClaude Opus 5.5 34f8a4161d fix(container): copy-at-connect setup waits for the connect; distinct WIP refs; atomic CA swap
- start_clone_repos waits for the first connect when a setup script exists,
  not only when there are repositories, so the script sees the CA, SSH keys
  and Git credentials.
- wip_ref appends 8 hex of sha256(raw folder) when sanitising changed the
  name, so `a b` and `a_b` never share a WIP branch.
- triple-c-apply-connect moves new CA files to a temporary name and swaps
  them in; a failed move keeps the CA installed before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:50:55 -08:00
shadowdaoandClaude Opus 5.5 3cd8542670 test(aws): live phase 6 checks
a_phase6_workspace_round_trips: one environment (max_workspace_hours 1)
and one project with EFS storage, a setup script, copy-at-connect with a
CA file, a port mapping and the gateway sidecar, two task starts, then
removal with discard. Passed live in us-west-2 (results in aws/README.md
and the spec). The phase-5 setup moves into deploy_for_workspace_user;
aws_host::ensure_started_with takes the sidecar's provider key from the
caller (the live tests have no keychain). scripts/aws-e2e-workspace.sh
runs TRIPLEC_E2E_TEST when set. The guard's task-definition retirement
listed nothing (ECS familyPrefix is a whole family name); it now filters
the full list by prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:34:46 -08:00
shadowdaoandClaude Opus 5.5 904547b2f1 feat(aws): estimated hourly cost per workspace
Q5: aws/pricing.rs reads on-demand Fargate rates (x86 and ARM vCPU-hours,
GB-hours, ephemeral storage GB-hours) from the Price List API in us-east-1
(AmazonECS; regionCode, termType=OnDemand, usagetype CONTAINS Fargate),
caches them per region for 24 h under <data_dir>/triple-c/aws-pricing/,
and estimates a config's hourly cost (ephemeral storage billed above
20 GiB; the gateway sidecar adds nothing). aws_cost_estimate(connection_id,
region, config) never errors: denied, offline or slow (8 s) is None,
shown as "Estimate unavailable"; a failed region is not re-asked for
5 minutes and a stale cache still answers.

pricing:GetProducts on * joins workspace-user-tasks.json with its check,
a policy test, the README and a live test (passed). HostSection shows the
estimate while configuring, Overview while running, with the Spot and EFS
notes. Fixture: a recorded us-west-2 GetProducts answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:14:06 -08:00
shadowdaoandClaude Opus 5.5 2857b4ae7d feat(aws): optional LLM gateway sidecar
A non-essential 'gateway' container runs the digest-pinned LiteLLM image
next to the workspace (Q7): its secrets are exactly the three
TRIPLEC_GATEWAY_* keys, the config uses os.environ/ references (no key
in it), /bin/sh writes it to a 0600 file and execs LiteLLM on
127.0.0.1:4000. The workspace's ANTHROPIC_BASE_URL/AUTH_TOKEN point at
it with a master key minted per task start; under copy-at-connect that
token and the gateway keys stay in the secret (R1). Needs the
OpenAI-compatible backend and a gateway model (validated on save, start
and in the UI). Requests with the toggle off are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:57:07 -08:00
shadowdaoandClaude Opus 5.5 45aef8da7d fix(aws): serialise and diff port-mapping forwards; refuse the gateway sidecar's port
Opens hold a per-project lock and re-read the stored mappings, so
overlapping saves converge on the last one without false 'in use' errors.
Unchanged forwards keep their live connections. The sidecar's 4000 is
refused while it runs (mappings reach workspace loopback). Stored rows
that would be refused no longer block unrelated saves; they are skipped
with a warning at connect. Port-mapping logs get their own prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:45:37 -08:00
shadowdaoandClaude Opus 5.5 08c779ad36 feat(aws): forward port mappings to AWS workspaces
Each TCP mapping of an AWS project becomes a loopback-only listener
carried into the task over socat-over-attach (the auth bridge's
PortForward, generalised to separate host and container ports; mappings
skip the bridge's first-byte/web gate). One set per project, opened after
every connect and on a save while connected, closed with the tunnel
(stop, remove, task death, exit). A failing mapping is a workspace-warning;
UDP and reserved ports are refused on save. The Config tab offers the
editor on AWS, TCP only, "Reachable only from this machine (localhost)".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:00:56 -08:00
shadowdaoandClaude Opus 5.5 262ea041c8 fix(aws): create the secret before reading it; one staging dir per connect
- Copy-at-connect tries CreateSecret first and reads the current value only
  when the secret exists, so a first start never reads a missing secret
  (which the owner-tag condition may refuse).
- triple-c-apply-connect: --prepare makes and prints a per-connect nonce
  dir; the app uploads into it and applies exactly that dir, so concurrent
  connects never mix files. CA files move to a fixed path so an unchanged
  CA is not reinstalled.
- connect.env parsing kept a trailing '=' (base64 padding) — it was dropped.
- Pending-deletion errors from GetSecretValue are reported as such; message
  and doc-comment fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:51:14 -08:00
shadowdaoandClaude Opus 5.5 820bfab25c fix(aws): copy-at-connect review fixes — lock, ~/.ssh off EFS, secret history
- triple-c-apply-connect: the background re-clone closes the apply lock's
  fd, so a later connect never waits on it; --prepare takes the lock.
- R6: under copy-at-connect Hybrid/EFS no longer link ~/.ssh to EFS; the
  copied keys vanish with the task (UI says so, and that old keys on EFS
  stay until removed).
- R7: a copy-at-connect start that finds credentials still in the secret
  force-deletes it and creates it again (retrying ~30 s while AWS finishes),
  so no AWSPREVIOUS version keeps them.
- TRIPLE_C_CUSTOM_ENV (unsalted fingerprint) left out of the secret.
- Terminals get only the credential pairs (no file reads; keychain off the
  runtime), so a bad SSH/CA file never drops the API keys.
- ConnectBundle values are Zeroizing; UI copy updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:43:12 -08:00
shadowdaoandClaude Opus 5.5 8510797c22 feat(aws): copy credentials at connect instead of storing them
Copy-at-connect (phase 6, Q2): with secrets_delivery copy_at_connect the
project secret keeps settings, repos and the agent token but drops
TRIPLEC_FILES and every credential pair (SECRET_ENV_KEYS and all custom
variables), marking TRIPLEC_CREDENTIALS=connect. After every connect (start,
attach, background re-attach) the app uploads the SSH/CA files and a
connect.env as root into /dev/shm/triple-c and runs the new
triple-c-apply-connect: CA install as root, SSH merge and git credential
helper as claude, a `connected` marker the first clone waits for, and a
background re-clone of failed repos only. Terminals add the pairs to their
own ExecSpec env. A failed push is a workspace-warning.

The entrypoint's CA, SSH, git-credential, Hybrid-home and clone functions
move to container/entrypoint-lib.sh (sourced first; defines only), so both
scripts run the same code; Docker behaviour is unchanged. HostSection gets
the Credentials choice with its warnings (and the gateway note, R1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:32:09 -08:00
shadowdaoandClaude Opus 5.5 9c888caf13 fix(aws): follow clone and setup in the background, after the start
Ruling R5: the start ends after Connecting (Running, lock released) and a
background follower (cancelled on Stop, Remove, tunnel close, app exit)
reports only a failure it saw or one on a task this start ran. A stale
Starting/Stopping AWS project loads as Error, and reconcile also checks a
Stopped one that still has a task ARN, so a crash never hides a live task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:09:51 -08:00