carlos / platform Public

review: round 1 findings and scoped-check brief, aws-followups-1143

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ee93b00131bb59ca98a3ee6e58a801b7bee3ee45 parent 6ed4d20
2 files changed, +105 −0
  • docs/superpowers/reviews/CHECK-BRIEF-aws-followups-1143-R1-fix.md +32 −0
  • docs/superpowers/reviews/FINDINGS-aws-followups-1143-R1.md +73 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CHECK-BRIEF-aws-followups-1143-R1-fix.md b/docs/superpowers/reviews/CHECK-BRIEF-aws-followups-1143-R1-fix.md
new file mode 100644
index 000000000..a700aec9a
--- /dev/null
+++ b/docs/superpowers/reviews/CHECK-BRIEF-aws-followups-1143-R1-fix.md
@@ -0,0 +1,32 @@
+# Scoped check: aws-followups-1143, after round 1 (not a review round)
+
+Repo carlos/platform, branch `aws-followups-1143` (tip in the prompt).
+Round 1 (`docs/superpowers/reviews/FINDINGS-aws-followups-1143-R1.md`)
+ended READY AFTER FIXES with three P2s. The fix is commit e140ec55, census
+6ed4d208. AGENTS.md rule 1: no new round; production storage, root
+behaviour and the census are checked. Scope: `git show e140ec55` and the
+card `docs/superpowers/notes/census-proposal-aws-followups-1143.md`.
+
+Check:
+1. Each round-1 P2: resolved, partly, not.
+2. Container credentials bounded through EndpointCredentialOptions (only
+ when the client is rootaws's own; caller hooks still win). Login-session
+ credentials refused at load with errLoginSession. Does refusing
+ login-session break any real platform path (who uses it)?
+3. **Root read change:** host-env without --group now always loads through
+ rootaws.LoadDefaultConfig, so as root it gains rootaws's
+ /etc/carlos/credentials fallback (as the --group path already had).
+ As census reviewer: does root now read a file or credential it did
+ not before, and can a tenant, app or box agent write or name it? The
+ card lists internal/hostenv as envelope-only; judge whether that is
+ right or a unit claim is owed.
+4. hostfence OpenRootFenceStore: literal config carries the bounded
+ client; credential selection, mode checks, receipt check unchanged?
+5. Test isolation: loopback-only dialer, no proxy, ignore-endpoints off.
+ Any remaining route to real AWS? The test-only withoutWriterTo
+ middleware: does it hide a production problem a test should catch?
+6. Census verdicts: OpenRootFenceStore and the three envelopes.
+
+Answer each: OK, or a finding with file:line, failure scenario and fix,
+marked P1 or P2. End with exactly one line: CHECK PASSED, or CHECK FAILED
+with the P1s. Do not edit files, spawn reviewers or run full suites.
diff --git a/docs/superpowers/reviews/FINDINGS-aws-followups-1143-R1.md b/docs/superpowers/reviews/FINDINGS-aws-followups-1143-R1.md
new file mode 100644
index 000000000..4eabcea03
--- /dev/null
+++ b/docs/superpowers/reviews/FINDINGS-aws-followups-1143-R1.md
@@ -0,0 +1,73 @@
+Reviewed `78f8d936d7dc3d2f72c83d60291768ed3bbbcbf4` against merge base `a23423b7c8b5f5c4105e7a797feaf4d88061054b`, round **1 of 3**. The requested tip adds only the brief after its named implementation commit.
+
+**No P1 findings. Three P2 findings and two P3 follow-ups.** The failure scenarios below are verified from source; test execution was blocked by the sandbox.
+
+1. **P2 — Container and login-session credentials remain unbounded.**
+
+ [stall.go:170](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/stall.go:170) wraps STS, SSO and SSO OIDC providers, but leaves two credential paths outside the stated response-bound invariant.
+
+ In the pinned SDK, container credentials construct a separate HTTP client without inheriting `cfg.HTTPClient`: see [resolve_credentials.go:339](/home/paulca/go/pkg/mod/github.com/aws/aws-sdk-go-v2/config@v1.32.6/resolve_credentials.go:339) and [client.go:60](/home/paulca/go/pkg/mod/github.com/aws/aws-sdk-go-v2/credentials@v1.19.6/endpointcreds/internal/client/client.go:60). This path lacks even the injected response-header bound. Login-session credentials build a Signin client during loading, before `boundConfig`, at [resolve_credentials.go:641](/home/paulca/go/pkg/mod/github.com/aws/aws-sdk-go-v2/config@v1.32.6/resolve_credentials.go:641).
+
+ **Failure scenario:** A non-root caller uses container credentials or an expired login-session token. Its credential endpoint stalls while returning credentials. Retrieval remains blocked despite loading the application’s service config through `rootaws`.
+
+ **Fix:** Bound endpoint credentials through `EndpointCredentialOptions`, preserving caller overrides. Give login-session refresh an equivalent bound, or explicitly refuse that unsupported credential mode. Add local stalled-response tests for both.
+
+ **Invariant / fault family:** Credential-refresh liveness — every supported credential exchange must terminate when its response stops progressing. These are pre-existing gaps left unresolved by this follow-up, rather than regressions introduced by the wrappers. Root’s startup environment scrub limits their production-root reach.
+
+2. **P2 — Two allowlist entries lack the bounds their exemption needs.**
+
+ The exceptions at [guard_test.go:47](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/guard_test.go:47) and [guard_test.go:51](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/guard_test.go:51) preserve unbounded work:
+
+ - **Fence writer:** [writer.go:60](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/hostfence/writer.go:60) builds an unbounded STS client and wraps its assume-role provider in `aws.CredentialsCache`. That cache retrieves credentials using a [suppressed context](/home/paulca/go/pkg/mod/github.com/aws/aws-sdk-go-v2@v1.44.0/aws/credential_cache.go:103), which removes [deadline and cancellation](/home/paulca/go/pkg/mod/github.com/aws/aws-sdk-go-v2@v1.44.0/aws/context.go:12). The two-minute pass deadline releases the waiting caller, but cannot stop the underlying STS request. Repeated passes can leave additional stalled requests behind.
+ - **Non-group host-env:** [cli.go:49](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/hostenv/cli.go:49) supplies `context.Background()`, and [awsssm.go:55](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/hostenv/awsssm.go:55) uses the SDK loader directly. Being a one-shot command does not prevent it from hanging indefinitely on an SSM response.
+
+ **Fix:** Install `rootaws.BoundedHTTPClient()` in the fence writer’s literal config before constructing STS and S3, retaining its dedicated credential selection. Route non-group host-env through `rootaws.LoadDefaultConfig`. Update the exact allowlist entries accordingly, and test cancellation-independent credential completion.
+
+ **Invariant / fault family:** AWS-request liveness — an exception must have an effective bound on the underlying operation, including credential refresh. These existing exceptions were explicitly included in this review’s allowlist check.
+
+3. **P2 — The new credential tests do not reliably prevent real AWS traffic.**
+
+ [stall_credentials_test.go:63](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/stall_credentials_test.go:63) sets local endpoint overrides and a dead proxy, but does not neutralize `AWS_IGNORE_CONFIGURED_ENDPOINT_URLS` or `NO_PROXY`.
+
+ **Failure scenario:** With `AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true` and `NO_PROXY=*`, the SDK ignores the local fixtures and connects directly to AWS. Additionally, Go caches environment proxy configuration on first use, so changing proxy variables inside this helper is not a dependable network barrier after another test has made a request.
+
+ **Fix:** Explicitly disable “ignore configured endpoints” in these tests and enforce a local-address-only dial policy on the test loading transport. Preserve its ownership identity so the tests still exercise the production wrapping path. Do not rely on environment proxy changes as the barrier.
+
+ **Invariant / fault family:** Test isolation — credential tests must contact only their local fixtures, regardless of ambient configuration.
+
+4. **P3 — The guard has additional zero-config escape forms.**
+
+ [guard_test.go:463](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/guard_test.go:463) exempts every directly returned `aws.Config{}`, without verifying that it accompanies an error. A helper returning a zero config successfully can therefore feed an unbounded service constructor. The documented zero-valued struct-field case also escapes detection.
+
+ **Fix:** Track fixtures and enforcement for successful zero-config returns and zero-valued fields. I did not establish a current production client exploiting these forms.
+
+ **Invariant:** Guard coverage — zero configs that become service clients must not silently bypass the transport requirement. Follow-up only.
+
+5. **P3 — Direct dependencies remain marked indirect.**
+
+ [go.mod:49](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/go.mod:49) still marks SSO and SSO OIDC indirect, although `stall.go` now imports both directly.
+
+ **Fix:** Correct their dependency classification in a follow-up. This does not itself break compilation.
+
+ **Invariant:** Dependency metadata reflects direct imports.
+
+The remaining requested checks are satisfactory, with these qualifications:
+
+- **STS/SSO behavior:** The wrappers retain the SDK-created clients and replace only the per-operation HTTP client. Provider caching, refresh logic, region and endpoint resolution remain in place. CA-bundle and defaults-mode changes have already reached the client being wrapped. Caller credential hooks run afterward, and operation options run after the injected option, so their explicit replacements still win.
+- **Client ownership:** The identity check happens before SDK resolution. An explicit caller `BuildableClient`, including its later CA-bundle clone, remains caller-owned. The ordinary injected client remains owned and receives the bound.
+- **Root credential refusal:** Shared-file suppression and profile refusal remain intact. The suspected non-group host-env `credential_process` exposure is **not established**: [main.go:25](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/main.go:25) scrubs the environment before dispatch, including disabling both shared-file paths. Its timeout gap is finding 2.
+- **IMDS:** Leaving it unchanged is acceptable. The pinned SDK installs a five-second default operation timeout, in addition to its dial and header limits.
+- **Other allowlist entries:** `grouprollaws` has its own bounds, including credential-client middleware; the objstore wrapper preserves the bounded client and its non-nil production caller is console-only; `NewStagingMirrorAt` has test-only callers.
+- **Regression tests:** The credential stall cases target the old missing body bound. Explicit BuildableClient preservation cases target the old ownership mistake. The guard fixtures exercise newly detected assignments, callbacks and zero constructions. Compatibility tests, such as preservation of an ordinary caller HTTP client, need not fail on the old code. Credential-hook precedence, successful refresh/cache reuse and credential-specific CA/defaults-mode combinations are supported by source inspection, not directly demonstrated by the new tests.
+
+**Census verdict: approve the `internal/rootaws` envelope at the reviewed tip.**
+
+I reviewed the changed loader functions in [config.go:39](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/config.go:39), ownership and option handling in [stall.go:94](/home/paulca/amadan.net/carlos/platform-aws-followups-1143/internal/rootaws/stall.go:94), all credential wrappers at lines 170–265, and `boundConfig`, `BoundedHTTPClient` and `mustBoundedClient` at lines 275–329, together with their SDK construction paths and changed tests.
+
+The changes add timeout handling to existing credential exchanges. They introduce no new root-selected file, executable, endpoint or credential authority, and weaken no existing root refusal. The card contains **one envelope and no individual disposition changes**. This approves the census authority boundary, not the functional completeness described above.
+
+`git diff --check` passed. Targeted tests could not start because Go could not create its work directory in the read-only sandbox; no test or census-test pass is claimed. Network restrictions prevented reading amadan #1143. No files were edited, no reviewers spawned, and no full suites run.
+
+This is the first round without P1s. Stop the full review here; apply P2 fixes within the existing budget, with the required scoped checks for newly changed production-storage behavior and census coverage. Keep P3s on the follow-up list.
+
+READY AFTER FIXES
\ No newline at end of file