Record F4 review and extend forbidden staging path guard
Opus R1 has no P1 or P2; staging census unit and envelope approved. Preserve P3 follow-ups and the explicit incomplete live witness scope. Cover /dev and /var/lock as tmpfs defaults.
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
2 files changed,
+52
−6
docs/superpowers/notes/region-ha-p3b1-f4-followups.md+43 −0internal/host/group_boot_staging_test.go+9 −6
diff --git a/docs/superpowers/notes/region-ha-p3b1-f4-followups.md b/docs/superpowers/notes/region-ha-p3b1-f4-followups.md| new file mode 100644 |
| index 000000000..b9e86a5d4 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/region-ha-p3b1-f4-followups.md |
| @@ -0,0 +1,43 @@ |
| +# P3b-1 F4 follow-ups for the controller |
| + |
| +F4 review round 1: Opus reviewed a81a885c against amadan origin/main f6f91e2a. |
| +READY, 0 P1, 0 P2, 4 P3. Review stops here. The external census unit |
| +`infra/modules/region-host/group-init.sh.tftpl` and its module envelope were |
| +approved. Controller records that approval on #280; no amadan write was made |
| +by the implementer. The final test-only follow-up expands tmpfs-default paths |
| +in the static guard; root source and census fingerprints are unchanged. |
| + |
| +The live witness is incomplete and explicitly refused by its CLI. Review |
| +approval covers that refusal and the local dry run, not live AWS execution. |
| +The requested role lacks GetParametersByPath and the signed channel/floor/ |
| +identity/artifact reads needed to reach edge startup; a random scratch public |
| +key also cannot verify the real dev signatures. Resolve this contract before |
| +implementing or reviewing live execution. Do not remove LIVE_BLOCKERS alone. |
| + |
| +P3 follow-ups from Opus, with invariant/fault family: |
| + |
| +1. Exec-site audit: the guard skips a line containing bootstrap.sha256 without |
| + subprocess. A bootstrap exec with that string in a trailing comment can |
| + escape the execution counter. Check execution prefixes before that skip and |
| + add a mutation case. Forbidden tmpfs path scanning still runs first. |
| +2. Staging lifetime: failed boot leaves the root-only directory on disk. |
| + Rerunning user data refuses its existing helper or exclusive output files. |
| + Record this safe refusal in operational expectations; do not weaken it to |
| + reuse potentially stale bootstrap inputs. |
| +3. Witness evidence: after cleanup, the collector can inspect only the parent |
| + mount, and immediate collection may precede the edge's denied-write log. |
| + Obtain before/after mount evidence and wait for the specific journal event |
| + before enabling live assertions. |
| +4. Render hygiene: copytree(dirs_exist_ok=True) retains files removed from the |
| + source since a previous run. Build each render from a fresh source snapshot |
| + while keeping provider downloads outside it. |
| + |
| +Additional live-harness work (not claimed complete): durable two-run budget; |
| +validated live account/AMI/subnet/SG inputs; resource collision/ownership |
| +journal; response-loss recovery; retries and verified termination; complete |
| +version deletion; setup/cleanup signal coverage; post-run non-interference |
| +checks on failure; console decoding/persistence; all-failure evidence output. |
| + |
| +Review history follows the change: any later review must carry this round, |
| +its closed staging/census verdict, and the newly agreed live scope. The known |
| +incomplete harness is not a successful real-AMI witness. |
diff --git a/internal/host/group_boot_staging_test.go b/internal/host/group_boot_staging_test.go| index 8833b733f..ba5ab1154 100644 |
| --- a/internal/host/group_boot_staging_test.go |
| +++ b/internal/host/group_boot_staging_test.go |
| @@ -40,7 +40,7 @@ func between(t *testing.T, s, start, end string) string { |
| return body |
| } |
| -var groupBootTmpfs = regexp.MustCompile(`(^|[^A-Za-z0-9_./-])(/run|/tmp|/dev/shm|/var/tmp|/var/run)(/|$|[^A-Za-z0-9_.-])`) |
| +var groupBootTmpfs = regexp.MustCompile(`(^|[^A-Za-z0-9_./-])(/run|/tmp|/dev|/var/tmp|/var/run|/var/lock)(/|$|[^A-Za-z0-9_.-])`) |
| // checkGroupBootStaging inspects the paths the script stages, writes and |
| // executes. Every bootstrap execution must be the line right after the shared |
| @@ -57,6 +57,7 @@ func checkGroupBootStaging(s string) error { |
| } |
| // The one runtime directory the script names is a unit's ReadWritePaths. |
| scan := strings.ReplaceAll(s, "ReadWritePaths=-/run/carlos-hairpin", "") |
| + scan = strings.ReplaceAll(scan, ">/dev/null", "") |
| if m := groupBootTmpfs.FindString(scan); m != "" { |
| return fmt.Errorf("tmpfs path %q", strings.TrimSpace(m)) |
| } |
| @@ -108,11 +109,13 @@ func TestGroupBootStagingGuard(t *testing.T) { |
| install := groupBootStaging + "/bootstrap instance-control --group-hairpin-install" |
| hostenv := groupBootStaging + "/bootstrap system host-env" |
| mutants := map[string]func(string) string{ |
| - "run staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/run/carlos-group-boot") }, |
| - "tmp staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/tmp/carlos-group-boot") }, |
| - "dev shm staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/dev/shm/carlos-group-boot") }, |
| - "var tmp staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/var/tmp/carlos-group-boot") }, |
| - "var run staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/var/run/carlos-group-boot") }, |
| + "run staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/run/carlos-group-boot") }, |
| + "tmp staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/tmp/carlos-group-boot") }, |
| + "dev shm staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/dev/shm/carlos-group-boot") }, |
| + "var tmp staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/var/tmp/carlos-group-boot") }, |
| + "dev staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/dev/carlos-group-boot") }, |
| + "var lock staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/var/lock/carlos-group-boot") }, |
| + "var run staging": func(s string) string { return strings.ReplaceAll(s, groupBootStaging, "/var/run/carlos-group-boot") }, |
| "one run exec": func(s string) string { |
| return strings.Replace(s, install, "/run/carlos-group-boot/bootstrap instance-control --group-hairpin-install", 1) |
| }, |