carlos / platform Public

C2 Astra findings round 1: NOT READY (5 P1, one cause: scope under-approximates), unedited

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 72cf5945587d94def304f8ca86ecf826cd13e183 parent 2dce1a0
1 file changed, +25 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-census-rebase-c2.md +25 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-census-rebase-c2.md b/docs/superpowers/reviews/CODEX-FINDINGS-census-rebase-c2.md
new file mode 100644
index 000000000..abf1f94eb
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-census-rebase-c2.md
@@ -0,0 +1,25 @@
+Reviewed `ed03ca7…1a2e87a`, round 1. Five P1 findings:
+
+1. **P1 — §§1–2: references outside dispatcher switches are discarded.**
+ [census_scope_test.go:295](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/provision/census_scope_test.go:295) records these references under `""`, but `refAdd` rejects an empty source at line 155. Consequently, calls such as `rootaws.ScrubEnvironment()` in [main.go:26](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/main.go:26) and `systemVerb(args)` are excluded. Changing the environment scrubber can weaken root’s protection without changing any scoped declaration or envelope.
+ **Fix:** allow the empty case bucket, or use a distinct nonempty sentinel. Add fixture assertions and mutations for calls before and after dispatch. **Invariant:** unconditional code executed by root must remain covered.
+
+2. **P1 — §2: package initializers themselves are not seeded.**
+ [census_scope_test.go:369](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/provision/census_scope_test.go:369) seeds only directly identified, repository-defined functions called by initializers. It excludes the initializer declaration, external calls and calls through function variables. Adding `var startupBytes, startupErr = os.ReadFile("/data/input")` to an already imported package executes a read in every root process, but adds nothing to scope when those variables are otherwise unused. The declaration and its read are filtered out.
+ **Fix:** seed package initialization expressions and their dependencies, including the declaration’s fingerprint. Test direct library calls, function-value calls and initializer-argument changes. **Invariant:** code executed during root’s package initialization requires the same review as dispatched code.
+
+3. **P1 — §§1–2: the graph excludes the production ARM64 build.**
+ [census_scope_test.go:166](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/provision/census_scope_test.go:166) hardcodes `GOARCH=amd64`; the fleet module selects ARM64 in [main.tf:23](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/infra/modules/region-host/main.tf:23). A new `internal/host/*_arm64.go` containing an `init` that reads root state is parsed by the raw scanner but absent from this graph, so the scoped scan discards it. The previous whole-file envelopes would catch the addition.
+ **Fix:** build and union scope for supported root deployment architectures, including ARM64. Add an ARM64-only initializer proof. **Invariant:** census coverage must include code compiled into production root binaries.
+
+4. **P1 — §3(a): import-only changes can bypass root-read review.**
+ [plan14_root_reads_test.go:390](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/provision/plan14_root_reads_test.go:390) hashes declarations, while imports are excluded at line 449. For example, replacing the import in [programhistory.go:13](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/release/programhistory.go:13) with `safefile "os"` preserves every declaration’s bytes and read-kind names while replacing guarded filesystem operations with ordinary ones. Other reached callers retain the safefile declarations, so their removal from this caller need not change the reached set either. Root’s history read would lose safefile’s symlink and regular-file checks without a census discrepancy.
+ **Fix:** fingerprint the import bindings used by reached declarations, alongside their source. Add this import-substitution regression case. **Invariant:** changing the implementation of a root read must change its census fingerprint.
+
+5. **P1 — §2: dependency-invoked callbacks escape the method allowlist.**
+ [census_scope_test.go:51](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/provision/census_scope_test.go:51) omits callbacks used by dependencies, including `Uid`, `Gid` and `Rdev`. Root’s [BuildProbeImage](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/instancectl/probeimage.go:69) invokes the squashfs writer, whose [AddFS implementation](/home/paulca/go/pkg/mod/github.com/!karpeles!lab/squashfs@v1.2.0/writer.go:204) calls those methods on [rootfsimage.owner](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/census-rebase-c2/internal/rootfsimage/squashfs.go:306). No repository call references those methods, and they are absent from the allowlist. Adding a file read inside `owner.Uid` therefore leaves it outside scope despite execution as root.
+ **Fix:** cover interface callbacks invoked by dependencies, including these methods, and add a fixture where a dependency invokes a local implementation. **Invariant:** crossing into dependency code must not hide callbacks that execute with root authority.
+
+The migration check found all 2,269 carried rows and 749 freezes unchanged against the archived effective inventory; the schema and base seal also match. No files were edited. Targeted tests were attempted under `nice -n 19`, but Go could not create its work directory in the read-only sandbox; these findings are from code inspection.
+
+NOT READY
\ No newline at end of file