plans: Task 17 live plan, revision 5 pin
PIN_SHA bdf85fb7 (livectl final). Call sites follow its exit codes: 4 and 3 hard stops; 2 retried for transients on reads and idempotent deletes, then a FINDING or the block's branch; waits get one overall bound through lv_wait. U22 settled; U23 records that livectl refuses a credential_process profile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+82
−47
docs/superpowers/plans/2026-11-23-hosted-1a-task17-live-plan.md+82 −47
diff --git a/docs/superpowers/plans/2026-11-23-hosted-1a-task17-live-plan.md b/docs/superpowers/plans/2026-11-23-hosted-1a-task17-live-plan.md| index fff3c665..02ef9a80 100644 |
| --- a/docs/superpowers/plans/2026-11-23-hosted-1a-task17-live-plan.md |
| +++ b/docs/superpowers/plans/2026-11-23-hosted-1a-task17-live-plan.md |
| @@ -39,8 +39,9 @@ Any other change to a command, or any AWS call not written here, comes back to P |
| start with the run prefix, as livectl's guard requires. A livectl guard refusal is a hard stop. |
| 0.4's account-wide MicroVM count is dropped: livectl lists by image, and R32 makes the count |
| irrelevant. |
| -4. **Code pin.** `PIN_SHA` is the livectl commit after Astra's review (P1). 0.1 checks it contains |
| - `a36861a0` (livectl) and `f95575c6` (R32), and runs livectl's offline tests. |
| +4. **Code pin.** `PIN_SHA` is `bdf85fb7`, livectl's final commit. 0.1 checks it contains |
| + `a36861a0` (livectl) and `f95575c6` (R32), and runs livectl's offline tests. Every livectl call |
| + site handles its exit codes as the usage at that commit defines them (see the livectl rule). |
| 5. **Operator role.** 2.1 creates it with `AWSLambdaNetworkConnectorOperatorPolicy` plus the inline |
| subnet-scoped delete, then waits 120 s for propagation (the wait before attempt 3's accepted |
| call). 2.2 creates the connector once. The narrow policy and its retries are gone. |
| @@ -113,8 +114,19 @@ and Elastic IP setting are checked by the controller's own code before the first |
| `$T17/bin/livectl -run <RUN>` (built in 0.2 from the pinned code). Its replies are the SDK's |
| output structs with Go field names (`State`, `VersionArn`, `MicrovmId`) and unions under |
| `.Value`; its errors are one JSON line whose `code` `lv` puts in `ECODE` and whose `aws_message` |
| - it puts in `LV_MSG`. A livectl guard refusal (exit 4) or usage error (exit 3) is a hard stop. |
| - Client tokens start with the run prefix, as livectl requires. |
| + it puts in `LV_MSG`. Client tokens start with the run prefix, as livectl requires. Exit codes, as |
| + livectl defines them at `PIN_SHA`: |
| + - **4** (guard: account, region, run prefix, missing `-run`, or credentials that are not static |
| + keys) and **3** (usage) are hard stops, inside `lv` itself. |
| + - **2** (an SDK call failed; livectl makes one attempt per call, so a throttle, a 5xx or no answer |
| + within its 60 s cutoff, `"error":"transport"`, all come back as 2). On a read, `lvr` tries a |
| + transient failure up to 3 times, 5 s apart; what is left is a FINDING, except where a hard stop |
| + depends on the read (the VM scans, `vm_end`, the collision checks, the connector's qualified |
| + ARN, the base image list). On a change it follows the block's own branches; only idempotent |
| + deletes and terminates use `lvr`. |
| + - **5** (a wait's bound passed, including an answer that came after it) and **6** (a failed |
| + state) are handled by each block against its bound. `lv_wait` gives each wait one overall bound |
| + and carries on through a transient exit 2 inside it, as a FINDING. |
| - **A hard stop means the safe stop (section S), then ask Paul.** Nothing else runs after it. |
| - **Ledger.** Before each create call the block writes an `INTENT` line (kind, run-specific name or |
| token); after the call it records the confirmed ID with `rec` (checked writes, ARN checks). Every |
| @@ -193,13 +205,14 @@ and Elastic IP setting are checked by the controller's own code before the first |
| ### 0.1 Code pin and local tools (no AWS call) |
| -`PIN_SHA` is the commit holding livectl after Astra's review (placeholder P1, relayed by the |
| -coordinator). It must contain livectl's first commit `a36861a0`, R32 (`f95575c6`) and the earlier |
| +`PIN_SHA` is `bdf85fb7` (`bdf85fb70f26094b99241de3f1285de92a76a759`), livectl's final commit (static |
| +credentials only, endpoints pinned, one attempt per call, bounded calls and waits), relayed by the |
| +coordinator. It contains livectl's first commit `a36861a0`, R32 (`f95575c6`) and the earlier |
| pre-flight work. The block also runs livectl's offline tests. |
| ```sh |
| set -euo pipefail |
| -PIN_SHA='<FROM COORDINATOR AFTER ASTRA: livectl commit SHA>' |
| +PIN_SHA='bdf85fb70f26094b99241de3f1285de92a76a759' |
| case "$PIN_SHA" in *'<'*|'') echo "ABORT: PIN_SHA is not filled in"; exit 1;; esac |
| cd /home/paulca/amadan.net/oficina/equipo-hosted-1a |
| git rev-parse --verify "$PIN_SHA^{commit}" |
| @@ -378,6 +391,23 @@ lv() { |
| [ "$RC" != 3 ] || die "livectl usage error (a plan defect): $ERR" |
| return 0 |
| } |
| +# _transient: after lv, 0 if the failure is worth trying again: livectl makes one attempt per call, |
| +# so a throttle, a server error or no answer within its 60 s cutoff comes back as exit 2. |
| +_transient() { [ "$RC" = 2 ] || return 1; [ "$LV_KIND" = transport ] && return 0 |
| + case "$ECODE" in ThrottlingException|TooManyRequestsException|InternalServerException|ServiceException|ServiceUnavailableException) return 0;; esac; return 1; } |
| +# lvr ARGS...: lv with up to 3 tries, 5 s apart, on a transient failure. For reads and idempotent |
| +# deletes and terminates only; creates and other changes use lv once. |
| +lvr() { local i; for i in 1 2 3; do lv "$@"; _transient || return 0; [ "$i" = 3 ] || { echo "transient (${ECODE:-$LV_KIND}); trying again"; sleep 5; }; done; return 0; } |
| +# lv_wait SECONDS ARGS...: a livectl wait bounded by SECONDS in all. A transient failure inside the |
| +# wait (exit 2) is a FINDING and the wait goes on with the time left. Leaves RC 0 (done), 5 (the |
| +# bound passed, also for an answer after it), 6 (a failed state) or 2 (any other error). |
| +lv_wait() { local end=$(( $(date +%s) + $1 )) left; shift |
| + while :; do |
| + left=$(( end - $(date +%s) )); if [ "$left" -le 0 ]; then RC=5; return 0; fi |
| + lv "$@" -timeout "${left}s" |
| + if _transient; then finding "transient error inside a wait (${ECODE:-$LV_KIND}); waiting on"; sleep 5; continue; fi |
| + return 0 |
| + done; } |
| # finding TEXT: a FINDING line in the journal; the run goes on (Paul's rule 1). |
| finding() { jw "FINDING $*"; echo "FINDING: $*"; } |
| # fact_eq WHAT WANT CMD...: a read of the run's own resource; a failed read or another value is a FINDING. |
| @@ -389,7 +419,7 @@ fact_json() { local w=$1 want=$2 got; shift 2; try "$@" |
| got=$(jq -c . <<<"$OUT" 2>/dev/null) || { finding "$w: reply is not JSON"; return 0; } |
| if [ "$got" = "$(jq -c . <<<"$want")" ]; then echo "ok: $w"; else finding "$w: got $got, want $want"; fi; } |
| # fact_lv WHAT WANT JQ ARGS...: a livectl read; jq -r JQ of the reply must equal WANT, else a FINDING. |
| -fact_lv() { local w=$1 want=$2 q=$3 got; shift 3; lv "$@" |
| +fact_lv() { local w=$1 want=$2 q=$3 got; shift 3; lvr "$@" |
| if [ "$RC" != 0 ]; then finding "$w: read failed (${ECODE:-rc$RC})"; return 0; fi |
| got=$(jq -r "$q" <<<"$OUT" 2>/dev/null) || { finding "$w: reply unreadable"; return 0; } |
| if [ "$got" = "$want" ]; then echo "ok: $w"; else finding "$w: got [$got], want [$want]"; fi; } |
| @@ -432,7 +462,7 @@ vm_ids() { [ -f "$VMS" ] || die "no VM ledger"; VIDS=$(cut -f1 "$VMS" | sort -u) |
| # scan: one image-scoped List, every page, every state; records every ID; writes last_scan.tsv. |
| scan() { |
| need IMAGE_ARN |
| - lv vm list -image "$IMAGE_ARN"; must |
| + lvr vm list -image "$IMAGE_ARN"; must |
| printf '%s' "$OUT" | jq -e '.Items | type == "array"' >/dev/null || die "list reply has no Items array" |
| printf '%s' "$OUT" | jq -e --arg a "$IMAGE_ARN" 'all(.Items[]; .ImageArn == $a)' >/dev/null || die "list returned a VM of another image" |
| printf '%s' "$OUT" | jq -r '.Items[] | [.MicrovmId, .State, .StartedAt] | @tsv' > "$T17/last_scan.tsv" |
| @@ -444,15 +474,15 @@ scan() { |
| # After scan, LIVE holds the IDs of this image's VMs that are not TERMINATED. |
| # vm_get ID: sets VST to the state, NOTFOUND, or ERROR:<code>. |
| vm_get() { |
| - lv vm get -id "$1" |
| - if [ "$RC" = 0 ]; then VST=$(jq -r '.State // empty' <<<"$OUT"); [ -n "$VST" ] || VST="ERROR:no-state"; elif [ "$ECODE" = ResourceNotFoundException ]; then VST=NOTFOUND; else VST="ERROR:${ECODE:-rc$RC}"; fi |
| + lvr vm get -id "$1" |
| + if [ "$RC" = 0 ]; then VST=$(jq -r '.State // empty' <<<"$OUT"); [ -n "$VST" ] || VST="ERROR:no-state"; elif [ "$ECODE" = ResourceNotFoundException ]; then VST=NOTFOUND; else VST="ERROR:${ECODE:-${LV_KIND:-rc$RC}}"; fi |
| } |
| -_vm_check() { vm_get "$1"; echo "$(date -u +%T) $1 $VST"; [ "$VST" = "$2" ] && return 0; case " $3 ThrottlingException " in *" ${VST#ERROR:} "*) return 1;; esac; return 2; } |
| +_vm_check() { vm_get "$1"; echo "$(date -u +%T) $1 $VST"; [ "$VST" = "$2" ] && return 0; case " $3 ThrottlingException transport " in *" ${VST#ERROR:} "*) return 1;; esac; return 2; } |
| # vm_wait ID TARGET SECONDS ALLOWED...: wait for TARGET; a state outside ALLOWED is fatal. |
| vm_wait() { local id=$1 t=$2 s=$3; shift 3; poll "$s" 5 "VM $id to $t" _vm_check "$id" "$t" "$*"; } |
| # vm_end ID: terminate and confirm: TERMINATED, or not found twice at least 60 s apart. |
| vm_end() { |
| - lv vm terminate -id "$1" |
| + lvr vm terminate -id "$1" |
| [ "$RC" = 0 ] || [ "$ECODE" = ResourceNotFoundException ] || die "terminate $1: ${ECODE:-rc$RC} ${LV_MSG:-$ERR}" |
| local nf=0 end=$(( $(date +%s) + 600 )) |
| while :; do |
| @@ -460,7 +490,7 @@ vm_end() { |
| case "$VST" in |
| TERMINATED) jw "VMGONE $1 TERMINATED"; return 0;; |
| NOTFOUND) [ "$nf" = 0 ] && nf=$(date +%s); [ $(( $(date +%s) - nf )) -ge 60 ] && { jw "VMGONE $1 NOTFOUND-TWICE"; return 0; };; |
| - PENDING|RUNNING|SUSPENDING|SUSPENDED|TERMINATING|ERROR:ThrottlingException) nf=0;; |
| + PENDING|RUNNING|SUSPENDING|SUSPENDED|TERMINATING|ERROR:ThrottlingException|ERROR:transport) nf=0;; |
| *) die "VM $1: $VST";; |
| esac |
| [ "$(date +%s)" -lt "$end" ] || die "VM $1 has not ended after 10 min" |
| @@ -594,7 +624,7 @@ ENVEOF |
| RUN=$(date -u +%m%d)-$(openssl rand -hex 3) |
| NAME=equipo-hosted-dev-t17-$RUN |
| cat > "$TMPDIR/equipo-t17/run.env" <<RUNEOF |
| -export PIN_SHA='<FROM COORDINATOR AFTER ASTRA: livectl commit SHA>' |
| +export PIN_SHA='bdf85fb70f26094b99241de3f1285de92a76a759' |
| export RUN=$RUN NAME=$NAME |
| export OPERATOR_ROLE=$NAME-conn-op BUILD_ROLE=$NAME-build CONN_NAME=$NAME-egress IMAGE_NAME=$NAME |
| export BUCKET=$NAME-640012953448 LOG_GROUP=/aws/lambda-microvms/$NAME TOPIC_NAME=$NAME-alerts SG_NAME=$NAME-vm |
| @@ -621,7 +651,7 @@ echo "T17=$T17 RUN=$RUN NAME=$NAME LIVECTL=$LIVECTL" |
| ```sh |
| set -euo pipefail; . "${TMPDIR:?}/equipo-t17/env.sh"; guard |
| aws sts get-caller-identity --query '[Account,Arn]' --output text |
| -lv caller; must |
| +lvr caller; must |
| [ "$(jq -r '"\(.Account) \(.Region)"' <<<"$OUT")" = "640012953448 eu-west-1" ] || die "livectl sees $(jq -c . <<<"$OUT")" |
| ``` |
| @@ -640,8 +670,8 @@ try aws resourcegroupstaggingapi get-resources --tag-filters Key=purpose,Values= |
| echo "observation: resources already tagged purpose=$TAGV (not ours, never touched): [$OUT]" |
| try aws ec2 describe-vpcs --filters Name=tag:run,Values=$RUN --query 'Vpcs[].VpcId' --output text; must; [ -z "$OUT" ] || die "a VPC already has run=$RUN" |
| for r in "$OPERATOR_ROLE" "$BUILD_ROLE"; do try aws iam get-role --role-name "$r"; expect_err NoSuchEntity; done |
| -lv connector get -id "$CONN_NAME"; { [ "$RC" != 0 ] && [ "$ECODE" = ResourceNotFoundException ]; } || die "connector name $CONN_NAME: rc $RC ${ECODE:-} (it exists, or the check could not run)" |
| -lv image list -name "$IMAGE_NAME"; must |
| +lvr connector get -id "$CONN_NAME"; { [ "$RC" != 0 ] && [ "$ECODE" = ResourceNotFoundException ]; } || die "connector name $CONN_NAME: rc $RC ${ECODE:-} (it exists, or the check could not run)" |
| +lvr image list -name "$IMAGE_NAME"; must |
| [ "$(jq --arg n "$IMAGE_NAME" '[.Items[] | select(.Name == $n)] | length' <<<"$OUT")" = 0 ] || die "image name $IMAGE_NAME exists" |
| get _v aws s3api list-buckets --prefix "$BUCKET" --query "length(Buckets[?Name=='$BUCKET'])" --output json; [ "$_v" = 0 ] || die "bucket $BUCKET exists in this account" |
| try aws logs describe-log-groups --log-group-name-prefix "$LOG_GROUP" --query 'logGroups[].logGroupName' --output text; must; [ -z "$OUT" ] || die "log group exists: $OUT" |
| @@ -814,7 +844,7 @@ lv connector create -name "$CONN_NAME" -role "$OPERATOR_ROLE_ARN" -subnet "$SUBN |
| if [ "$RC" != 0 ]; then |
| if [ "$ECODE" = InvalidParameterValueException ] && grep -qF 'invalid ConnectorOperatorRole permissions' <<<"$LV_MSG"; then |
| msg=$LV_MSG |
| - lv connector get -id "$CONN_NAME" |
| + lvr connector get -id "$CONN_NAME" |
| if [ "$RC" != 0 ] && [ "$ECODE" = ResourceNotFoundException ]; then jw "NOTCREATED connector attempt 1"; fi |
| die "the connector was refused with the managed operator policy ($msg); 2.3 onwards needs it" |
| fi |
| @@ -839,7 +869,7 @@ jq -c '{Arn,Id,State,Version,VersionArn}' "$T17/out/2.2-connector.json" |
| ```sh |
| set -euo pipefail; T17='<T17 printed by 0.2>'; . "$T17/env.sh"; guard |
| need CONN_ARN |
| -lv connector wait-active -id "$CONN_ARN" -timeout 15m -interval 15s |
| +lv_wait 900 connector wait-active -id "$CONN_ARN" -interval 15s |
| printf '%s\n' "$OUT" > "$T17/out/2.3-active.json" |
| jq -c '{State,StateReason,StateReasonCode}' "$T17/out/2.3-active.json" 2>/dev/null || true |
| [ "$RC" = 0 ] || die "connector not ACTIVE (rc $RC, ${ECODE:-no code}); 2.4 onwards needs it" |
| @@ -858,7 +888,7 @@ requirement; the rest are facts. |
| ```sh |
| set -euo pipefail; . "${TMPDIR:?}/equipo-t17/env.sh"; guard |
| need CONN_ARN CONN_ID SUBNET SG VPC |
| -lv connector get -id "$CONN_ARN:1"; must |
| +lvr connector get -id "$CONN_ARN:1"; must |
| printf '%s\n' "$OUT" > "$T17/out/2.4-qualified.json" |
| jq -e --arg q "$CONN_ARN:1" --arg s "$SUBNET" --arg g "$SG" '.Version == 1 and .VersionArn == $q and .State == "ACTIVE" |
| and .Configuration.Value.SubnetIds == [$s] and .Configuration.Value.SecurityGroupIds == [$g] |
| @@ -866,12 +896,12 @@ jq -e --arg q "$CONN_ARN:1" --arg s "$SUBNET" --arg g "$SG" '.Version == 1 and . |
| || die "the version-1 read does not show this run's ACTIVE connector: $(jq -c '{Version,VersionArn,State,Configuration}' "$T17/out/2.4-qualified.json")" |
| rec CONN_VERSION 1; rec CONN_QARN "$CONN_ARN:1" |
| fact_lv "connector Elastic IP configuration" "null" '.Configuration.Value.ElasticIpConfiguration' connector get -id "$CONN_QARN" |
| -lv connector get -id "$CONN_ARN" |
| +lvr connector get -id "$CONN_ARN" |
| if [ "$RC" = 0 ]; then |
| jw "FACT unqualified read: $(jq -c '{Version,VersionArn,LatestVersion,LatestVersionArn,ServerTime:.ResultMetadata.ServerTime}' <<<"$OUT")" |
| [ "$(jq -r .LatestVersionArn <<<"$OUT")" = "$CONN_QARN" ] || finding "unqualified read: LatestVersionArn is $(jq -r .LatestVersionArn <<<"$OUT"), not $CONN_QARN" |
| else finding "unqualified connector read failed: ${ECODE:-rc$RC}"; fi |
| -lv connector list-versions -id "$CONN_ARN" |
| +lvr connector list-versions -id "$CONN_ARN" |
| if [ "$RC" = 0 ]; then jw "FACT connector versions: $(jq -c '[.Items[] | {Version,VersionArn,State}]' <<<"$OUT")" |
| else finding "connector version list failed: ${ECODE:-rc$RC}"; fi |
| try aws ec2 describe-network-interfaces --filters Name=vpc-id,Values="$VPC" --output json |
| @@ -1030,7 +1060,7 @@ for the pre-approved step down in 3.7 and 3.8. |
| ```sh |
| set -euo pipefail; . "${TMPDIR:?}/equipo-t17/env.sh"; guard |
| -lv image base-versions; must |
| +lvr image base-versions; must |
| printf '%s\n' "$OUT" > "$T17/out/3.6-base.json" |
| jq -r '.Items[] | [.ImageVersion, .Status, ([.SupportedCpuConfigurations[]?.Architecture] | join(","))] | @tsv' "$T17/out/3.6-base.json" |
| rec BASE_ARN "$(jq -r '.BaseImage' "$T17/out/3.6-base.json")" |
| @@ -1074,7 +1104,7 @@ create_image() { |
| [ "$LV_KIND" = api ] || die "image create attempt $2: ${LV_KIND:-rc$RC} (no answer: S.2 reconciles it)" |
| IMG_CODE=$ECODE; IMG_MSG=$LV_MSG |
| jw "REFUSED image attempt $2 (base $1): ${IMG_CODE} ${IMG_MSG}" |
| - lv image list -name "$IMAGE_NAME"; must |
| + lvr image list -name "$IMAGE_NAME"; must |
| [ "$(jq --arg n "$IMAGE_NAME" '[.Items[] | select(.Name == $n)] | length' <<<"$OUT")" = 0 ] || die "a refused create left an image named $IMAGE_NAME" |
| jw "NOTCREATED image attempt $2" |
| case "$IMG_CODE" in ValidationException|AccessDeniedException|InvalidParameterValueException) role_code=yes;; *) role_code=no;; esac |
| @@ -1110,7 +1140,7 @@ If the Small build fails and 3.7 has not stepped down, the block builds a new Sm |
| ```sh |
| set -euo pipefail; T17='<T17 printed by 0.2>'; . "$T17/env.sh"; guard |
| need IMAGE_ARN IMAGE_NAME VER_SMALL ARTIFACT BASE_ARN BUILD_ROLE_ARN LOG_GROUP RUN |
| -lv image wait-version -id "$IMAGE_ARN" -version "$VER_SMALL" -timeout 20m -interval 15s |
| +lv_wait 1200 image wait-version -id "$IMAGE_ARN" -version "$VER_SMALL" -interval 15s |
| if [ "$RC" = 6 ] && [ -z "${BASE_STEPPED_DOWN:-}" ] && [ -n "${BASE_VER_DOWN:-}" ]; then |
| finding "Small version $VER_SMALL failed to build from base ${BASE_VER_USED}: $(jq -r '.StateReason // empty' <<<"$OUT"); stepping down to $BASE_VER_DOWN" |
| try aws logs filter-log-events --log-group-name "$LOG_GROUP" --limit 50 --query 'events[].message' --output text; [ "$RC" = 0 ] && printf '%s\n' "$OUT" | tail -n 20 |
| @@ -1120,13 +1150,13 @@ if [ "$RC" = 6 ] && [ -z "${BASE_STEPPED_DOWN:-}" ] && [ -n "${BASE_VER_DOWN:-}" |
| -artifact "$ARTIFACT" -base "$BASE_ARN" -base-version "$BASE_VER_DOWN" -build-role "$BUILD_ROLE_ARN" \ |
| -hooks "$T17/image/hooks.json" -log-group "$LOG_GROUP" -memory 2048 -client-token "$IMAGE_NAME-update-small-2"; must |
| rec VER_SMALL "$(jq -r .ImageVersion <<<"$OUT")"; rec BASE_VER_USED "$BASE_VER_DOWN"; rec BASE_STEPPED_DOWN yes |
| - lv image wait-version -id "$IMAGE_ARN" -version "$VER_SMALL" -timeout 20m -interval 15s |
| + lv_wait 1200 image wait-version -id "$IMAGE_ARN" -version "$VER_SMALL" -interval 15s |
| fi |
| if [ "$RC" != 0 ]; then |
| try aws logs filter-log-events --log-group-name "$LOG_GROUP" --limit 50 --query 'events[].message' --output text; [ "$RC" = 0 ] && printf '%s\n' "$OUT" | tail -n 20 |
| die "the Small version did not build; the image is needed" |
| fi |
| -lv image get-version -id "$IMAGE_ARN" -version "$VER_SMALL" |
| +lvr image get-version -id "$IMAGE_ARN" -version "$VER_SMALL" |
| if [ "$RC" = 0 ]; then |
| printf '%s\n' "$OUT" > "$T17/out/3.8-small.json" |
| jq -e --arg a "$ARTIFACT" '([.CpuConfigurations[].Architecture] == ["X86_64"]) and ([.Resources[].MinimumMemoryInMiB] == [2048]) |
| @@ -1154,16 +1184,16 @@ lv image update -id "$IMAGE_ARN" -description "Task 17 minimal hook image, large |
| printf '%s\n' "$OUT" > "$T17/out/3.9-image.json" |
| rec VER_LARGE "$(jq -r .ImageVersion "$T17/out/3.9-image.json")" |
| [ "$VER_LARGE" != "$VER_SMALL" ] || finding "the update returned the Small version $VER_SMALL" |
| -lv image wait-version -id "$IMAGE_ARN" -version "$VER_LARGE" -timeout 20m -interval 15s |
| +lv_wait 1200 image wait-version -id "$IMAGE_ARN" -version "$VER_LARGE" -interval 15s |
| if [ "$RC" = 0 ]; then |
| - lv image get-version -id "$IMAGE_ARN" -version "$VER_LARGE" |
| + lvr image get-version -id "$IMAGE_ARN" -version "$VER_LARGE" |
| if [ "$RC" = 0 ]; then |
| jq -e '([.CpuConfigurations[].Architecture] == ["X86_64"]) and ([.Resources[].MinimumMemoryInMiB] == [4096]) and (.AdditionalOsCapabilities == ["ALL"])' <<<"$OUT" >/dev/null \ |
| || finding "the Large version differs: $(jq -c '{CpuConfigurations,Resources,AdditionalOsCapabilities}' <<<"$OUT")" |
| else finding "Large version read failed: ${ECODE:-rc$RC}"; fi |
| else finding "the Large version did not build (rc $RC, ${ECODE:-}); no Large VM is ever launched, so the run goes on"; fi |
| fact_lv "Small version after the update" "SUCCESSFUL ACTIVE" '"\(.State) \(.Status)"' image get-version -id "$IMAGE_ARN" -version "$VER_SMALL" |
| -lv image get -id "$IMAGE_ARN" |
| +lvr image get -id "$IMAGE_ARN" |
| if [ "$RC" = 0 ]; then |
| case "$(jq -r .State <<<"$OUT")" in CREATED|UPDATED) ;; *) finding "image state $(jq -r .State <<<"$OUT")";; esac |
| [ "$(jq -r '.Tags.run // empty' <<<"$OUT")" = "$RUN" ] || finding "image tags: $(jq -c .Tags <<<"$OUT")" |
| @@ -1620,12 +1650,12 @@ echo "A2=$A2_RESULT A3=$A3_RESULT" |
| set -euo pipefail; . "${TMPDIR:?}/equipo-t17/env.sh"; guard |
| need VM_A A1_BEFORE A1_AFTER CONN_QARN |
| echo "run call: $A1_BEFORE to $A1_AFTER; reply: $(jq -c '{State,StartedAt}' "$T17/out/launch-A1.json")" |
| -_running() { lv vm get -id "$VM_A"; [ "$RC" = 0 ] || return 1 |
| +_running() { lvr vm get -id "$VM_A"; [ "$RC" = 0 ] || return 1 |
| echo "$(date -u +%T.%3N) $(jq -r '"\(.State) \(.StartedAt)"' <<<"$OUT")"; case "$(jq -r .State <<<"$OUT")" in RUNNING) return 0;; PENDING) return 1;; esac; return 2; } |
| if ! (poll 120 1 "VM_A to RUNNING" _running); then |
| finding "VM_A did not reach RUNNING within 120 s"; vm_end "$VM_A"; rec VM_A_ENDED "$(date -u +%FT%TZ)"; exit 0 |
| fi |
| -lv vm get -id "$VM_A" |
| +lvr vm get -id "$VM_A" |
| if [ "$RC" = 0 ]; then |
| printf '%s\n' "$OUT" > "$T17/out/9.B-get.json" |
| jw "FACT VM_A echoes: $(jq -c '{IngressNetworkConnectors,EgressNetworkConnectors,MaximumDurationInSeconds,ExecutionRoleArn,IdlePolicy,StartedAt}' "$T17/out/9.B-get.json")" |
| @@ -1702,7 +1732,7 @@ echo "4096=$PAYLOAD_4096 4097=$PAYLOAD_4097 16384=${PAYLOAD_16384:-not run} 1638 |
| set -euo pipefail; . "${TMPDIR:?}/equipo-t17/env.sh"; guard |
| need VM_A TOKEN_A |
| vm_end "$VM_A"; [ -n "${VM_A_ENDED:-}" ] || rec VM_A_ENDED "$(date -u +%FT%TZ)" |
| -lv vm terminate -id "$VM_A" |
| +lvr vm terminate -id "$VM_A" |
| if [ "$RC" = 0 ]; then rec TERMINATE_AGAIN ok; elif [ "$ECODE" = ResourceNotFoundException ]; then rec TERMINATE_AGAIN ResourceNotFoundException |
| else rec TERMINATE_AGAIN "other:${ECODE:-rc$RC}"; finding "terminate of an ended VM: ${ECODE:-rc$RC} ${LV_MSG}"; fi |
| launch E1 "$TOKEN_A" 900 "$T17/out/payload-a" |
| @@ -1768,16 +1798,16 @@ set -euo pipefail; T17='<T17 printed by 0.2>'; . "$T17/env.sh"; guard |
| stop_ctl |
| if have IMAGE_ARN; then |
| settle_all |
| -lv image delete -id "$IMAGE_ARN" |
| +lvr image delete -id "$IMAGE_ARN" |
| [ "$RC" = 0 ] || die "image delete: ${ECODE:-rc$RC} ${LV_MSG:-$ERR} (a ConflictException is a stop: U8)" |
| -_img() { lv image list -name "$IMAGE_NAME"; [ "$RC" = 0 ] || return 1 |
| +_img() { lvr image list -name "$IMAGE_NAME"; [ "$RC" = 0 ] || return 1 |
| OUT=$(jq -r --arg a "$IMAGE_ARN" '[.Items[] | select(.ImageArn == $a) | .State] | join(" ")' <<<"$OUT") || return 3 |
| echo "$(date -u +%T) listed state: [${OUT}]"; case "$OUT" in ""|DELETED) return 0;; DELETING) return 1;; esac; return 2; } |
| poll 900 15 "image deleted" _img |
| deleted microvm-image "$IMAGE_ARN" |
| for vv in VER_SMALL_FAILED VER_SMALL VER_LARGE; do |
| [ -n "${!vv:-}" ] || continue; v=${!vv} |
| - lv image get-version -id "$IMAGE_ARN" -version "$v" |
| + lvr image get-version -id "$IMAGE_ARN" -version "$v" |
| if { [ "$RC" = 0 ] && [ "$(jq -r .State <<<"$OUT")" = DELETED ]; } || { [ "$RC" != 0 ] && [ "$ECODE" = ResourceNotFoundException ]; }; then |
| deleted microvm-image-version "$IMAGE_ARN:$v" |
| else finding "version $v after the image delete: rc $RC ${ECODE:-} $(jq -r '.State // empty' <<<"$OUT" 2>/dev/null || true)"; fi |
| @@ -1791,9 +1821,9 @@ fi |
| set -euo pipefail; T17='<T17 printed by 0.2>'; . "$T17/env.sh"; guard |
| if have CONN_ARN; then |
| need VPC SUBNET OPERATOR_ROLE |
| -conn_delete() { lv connector delete -id "$CONN_ARN" |
| +conn_delete() { lvr connector delete -id "$CONN_ARN" |
| [ "$RC" = 0 ] || [ "$ECODE" = ResourceNotFoundException ] || die "connector delete: ${ECODE:-rc$RC} ${LV_MSG:-$ERR}"; } |
| -conn_gone() { lv connector wait-gone -id "$CONN_ARN" -timeout 40m -interval 15s; CG_RC=$RC; CG_CODE=$ECODE |
| +conn_gone() { lv_wait 2400 connector wait-gone -id "$CONN_ARN" -interval 15s; CG_RC=$RC; CG_CODE=$ECODE |
| echo "wait-gone: rc $CG_RC ${CG_CODE:-} $(jq -c '{State,StateReason}' <<<"$OUT" 2>/dev/null || true)"; } |
| # enis_gone SECONDS: 0 when no interface is left in the VPC within SECONDS; 1 when some are left at the bound. |
| enis_gone() { local end=$(( $(date +%s) + $1 )) |
| @@ -2057,7 +2087,7 @@ for pair in "$OPERATOR_ROLE:OPERATOR_ROLE_ARN" "$BUILD_ROLE:BUILD_ROLE_ARN"; do |
| else unresolved "iam-role $r: ${ECODE:-rc$RC}"; fi |
| done |
| if pending connector "$CONN_NAME" CONN_ARN; then |
| - lv connector get -id "$CONN_NAME" |
| + lvr connector get -id "$CONN_NAME" |
| if [ "$RC" = 0 ] && [ "$(jq -r .Name <<<"$OUT")" = "$CONN_NAME" ]; then arn=$(jq -r .Arn <<<"$OUT"); arn_ok "$arn"; rec CONN_ARN "$arn"; rec CONN_ID "$(jq -r .Id <<<"$OUT")" |
| elif code_in ResourceNotFoundException; then absent "connector $CONN_NAME" |
| else unresolved "connector $CONN_NAME: ${ECODE:-rc$RC}"; fi |
| @@ -2103,7 +2133,7 @@ if pending s3-object "s3://$BUCKET/t17/app.zip" ARTIFACT; then |
| else unresolved "s3-object: head failed: ${ECODE:-rc$RC}"; fi |
| fi |
| if pending microvm-image "$IMAGE_NAME" IMAGE_ARN; then |
| - lv image list -name "$IMAGE_NAME" |
| + lvr image list -name "$IMAGE_NAME" |
| [ "$RC" != 0 ] || OUT=$(jq -r --arg n "$IMAGE_NAME" '[.Items[] | select(.Name == $n) | .ImageArn] | join(" ")' <<<"$OUT") || RC=99 |
| if [ "$RC" != 0 ]; then unresolved "microvm-image $IMAGE_NAME: list failed: ${ECODE:-rc$RC}" |
| elif [ -z "$OUT" ]; then absent "microvm-image $IMAGE_NAME" |
| @@ -2111,7 +2141,7 @@ if pending microvm-image "$IMAGE_NAME" IMAGE_ARN; then |
| else arn=$OUT |
| [ "$arn" = "arn:aws:lambda:eu-west-1:$ACCOUNT:microvm-image:$IMAGE_NAME" ] || die "image ARN [$arn]" |
| rec IMAGE_ARN "$arn" |
| - lv image get -id "$IMAGE_ARN" |
| + lvr image get -id "$IMAGE_ARN" |
| if [ "$RC" = 0 ] && [ "$(jq -r '.Tags.run // empty' <<<"$OUT")" != "$RUN" ]; then |
| finding "microvm-image: tags missing ($(jq -c .Tags <<<"$OUT")); livectl tags only at create" |
| elif [ "$RC" != 0 ]; then finding "microvm-image: tags unreadable: ${ECODE:-rc$RC}"; fi |
| @@ -2290,6 +2320,10 @@ EOF |
| `NoSuchTagSet` is documented. Guessed S3, SNS and EC2 codes were replaced by list-and-match |
| checks. |
| - **U20, process survival:** R37 (sandbox off, PID files, identity checks). |
| +- **U22, livectl's interface:** settled at `bdf85fb7`. The plan follows `livectl-usage.md` at that |
| + commit: pinned endpoints, one attempt per call, a 60 s cutoff per call, bounded waits that never |
| + read after their deadline, and static credentials only. Every call site handles exits 2, 4 and 5 |
| + as the livectl rule above says. |
| ### Still unconfirmed, 13 |
| @@ -2319,11 +2353,12 @@ Each is now either a stop only where safety or a later step depends on it, or a |
| 12. **U21, a qualified egress ARN on RunMicrovm.** The adapter and the audit require it. A1 in 9.A |
| is the first launch; a refusal stops the run, since every VM step needs launches (Fable's |
| review). |
| -13. **U22, livectl's interface.** It is under Astra's review, and small interface changes may |
| - follow. The plan is written against `livectl-usage.md` at `a36861a0`. Any change comes back |
| - with the final `PIN_SHA`, and a livectl usage error is a hard stop, never improvised around. |
| +13. **U23, livectl and the `kass` credentials.** livectl takes only static keys (R41) and refuses |
| + a `credential_process` profile with exit 4. On 2026-11-23 the local `kass` profile in |
| + `~/.aws/config` used `credential_process`. If that is still so, 0.3's `lvr caller` refuses at |
| + once: a hard stop before anything is created ($0). The plan does not change credentials; how |
| + `kass` provides static keys to livectl needs Paul's ruling before the run. |
| ### Placeholders |
| -- **P1. `PIN_SHA`** in 0.1 and 0.2: the commit holding livectl after Astra's review, relayed by the |
| - coordinator. Both blocks refuse to run until it is filled in. |
| +None. `PIN_SHA` is `bdf85fb70f26094b99241de3f1285de92a76a759`. |