carlos / platform Public

bootstrap-box fix round 1: repoint verify comment to release/host chain; add set -o pipefail

Review follow-up (both copies kept byte-identical):
1. Repoint the inline comment from console apisystemupdate.go bootstrapState to
   the authoritative chain the script mirrors: release.GetSystemPointer ->
   verifySystemPointer (root-key Ed25519, systempointer.go), SystemArtifactKey
   bootstrap/router/<version>/carlos-<platform> (systempointer.go:88), and the
   box self-update read of p.Current.Artifacts[platform]
   (internal/host/systemleg.go:131, installchannel.go:297).
2. Add set -o pipefail to the inner on-box script (belt-and-braces for the
   sha256sum | cut substitution; already fail-closed via the hex compare).
Verification logic unchanged; mocked-aws fail-closed transcript re-run green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude Opus (hunt fix) pushed by claude agent, operated by paul@keymail.dev 0829b17e8ee92111f7c5687cf9991b5037143438 parent 5ce7e2a
2 files changed, +18 −4
  • infra-proposed/carloku-infra/bootstrap-box.sh +9 −2
  • infra-proposed/platform-infra/bootstrap-box.sh +9 −2
diff --git a/infra-proposed/carloku-infra/bootstrap-box.sh b/infra-proposed/carloku-infra/bootstrap-box.sh
index f50b4fca1..d4c15f65f 100644
--- a/infra-proposed/carloku-infra/bootstrap-box.sh
+++ b/infra-proposed/carloku-infra/bootstrap-box.sh
@@ -43,6 +43,7 @@ d=$(mktemp -d)
cat > "$d/bootstrap.sh" <<EOF
set -e
+set -o pipefail
aws s3 cp s3://$depbucket/bootstrap/carlos /opt/carlos/carlos.new --no-progress
# --- H1-M1 / H6-M1: verify the downloaded binary against the ROOT-SIGNED
@@ -55,8 +56,14 @@ aws s3 cp s3://$depbucket/bootstrap/carlos /opt/carlos/carlos.new --no-progress
# \$pub). ANY failure here — unreachable or absent pointer, missing tool,
# bad signature, sha mismatch — exits non-zero and leaves carlos.new
# UNINSTALLED. Fail closed: a box that cannot verify never runs the binary.
-# (Mirrors console apisystemupdate.go bootstrapState: sha256(bootstrap/carlos)
-# must equal stable.Current.Artifacts["linux-arm64"].SHA256.)
+# Mirrors the platform's own verify chain: release.GetSystemPointer ->
+# verifySystemPointer/parseSystemPointer checks the Ed25519 signature under the
+# root key (internal/release/systempointer.go), the artifact key is
+# bootstrap/router/<version>/carlos-<platform> (SystemArtifactKey,
+# systempointer.go:88), and the box self-update reads the sha from
+# p.Current.Artifacts[platform] of that verified pointer
+# (internal/host/systemleg.go:131, installchannel.go:297). Here platform is
+# linux-arm64 and channel is stable (the bytes a fresh box boots).
command -v openssl >/dev/null 2>&1 || { echo "bootstrap verify: openssl not found; refusing to install unverified carlos" >&2; exit 1; }
command -v python3 >/dev/null 2>&1 || { echo "bootstrap verify: python3 not found; refusing to install unverified carlos" >&2; exit 1; }
vdir=\$(mktemp -d)
diff --git a/infra-proposed/platform-infra/bootstrap-box.sh b/infra-proposed/platform-infra/bootstrap-box.sh
index f50b4fca1..d4c15f65f 100644
--- a/infra-proposed/platform-infra/bootstrap-box.sh
+++ b/infra-proposed/platform-infra/bootstrap-box.sh
@@ -43,6 +43,7 @@ d=$(mktemp -d)
cat > "$d/bootstrap.sh" <<EOF
set -e
+set -o pipefail
aws s3 cp s3://$depbucket/bootstrap/carlos /opt/carlos/carlos.new --no-progress
# --- H1-M1 / H6-M1: verify the downloaded binary against the ROOT-SIGNED
@@ -55,8 +56,14 @@ aws s3 cp s3://$depbucket/bootstrap/carlos /opt/carlos/carlos.new --no-progress
# \$pub). ANY failure here — unreachable or absent pointer, missing tool,
# bad signature, sha mismatch — exits non-zero and leaves carlos.new
# UNINSTALLED. Fail closed: a box that cannot verify never runs the binary.
-# (Mirrors console apisystemupdate.go bootstrapState: sha256(bootstrap/carlos)
-# must equal stable.Current.Artifacts["linux-arm64"].SHA256.)
+# Mirrors the platform's own verify chain: release.GetSystemPointer ->
+# verifySystemPointer/parseSystemPointer checks the Ed25519 signature under the
+# root key (internal/release/systempointer.go), the artifact key is
+# bootstrap/router/<version>/carlos-<platform> (SystemArtifactKey,
+# systempointer.go:88), and the box self-update reads the sha from
+# p.Current.Artifacts[platform] of that verified pointer
+# (internal/host/systemleg.go:131, installchannel.go:297). Here platform is
+# linux-arm64 and channel is stable (the bytes a fresh box boots).
command -v openssl >/dev/null 2>&1 || { echo "bootstrap verify: openssl not found; refusing to install unverified carlos" >&2; exit 1; }
command -v python3 >/dev/null 2>&1 || { echo "bootstrap verify: python3 not found; refusing to install unverified carlos" >&2; exit 1; }
vdir=\$(mktemp -d)