carlos / platform Public

Review brief: instance usage Task 5, the usage role

Astra per-task review brief (security gate, stopping rule 3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 3acdc080dafbe1e4724115d9f186e87151235d84 parent bf47d9c
1 file changed, +66 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-instance-usage-task5.md +66 −0

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-dYrhV8
.amadan/test-gate.sh
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading golang.org/x/net v0.62.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-instance-usage-task5.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-instance-usage-task5.md
new file mode 100644
index 000000000..0d1647524
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-instance-usage-task5.md
@@ -0,0 +1,66 @@
+# Review brief: instance usage Task 5 (the usage role and its door), round 1 of 3
+
+Repo carlos/platform, branch `instance-usage`, commit bf47d9cd5.
+Under review: the code in commit bf47d9cd5 (`git show bf47d9cd5`), Task 5
+of `docs/superpowers/plans/2026-11-29-instance-usage.md`.
+Authorities: `docs/superpowers/specs/2026-11-29-instance-usage-design.md`
+(rev 5, merged on main as 96731431a) §9 and §12; the plan's Task 5 and
+Global Constraints; AGENTS.md ("A credential never mints a credential",
+"Console security gates are ordered"). Do not review against unmerged
+branches.
+
+You are an independent reviewer. This is a per-task review because it
+changes a security gate: who may mint a credential and which doors it
+reaches (AGENTS.md stopping rule 3). Read the diff, then the code around
+it, and check every claim against that code.
+
+## Fixed: do not re-argue
+
+- The role's design (spec §9): `usage` outside Admin's union, one door
+ registered `Exactly(Usage, Instance, Operate, Admin)`, bound to one
+ app, minted by an owner through the existing services doors, refused
+ while `CONSOLE_INSTANCE_USAGE` is off. The browser form never lists it
+ (plan round 1 ruling). The route handler is a placeholder until Task 6.
+
+## What to check
+
+1. Confinement: no path gives a usage credential any door but the usage
+ route, for its own app only (another app: the byte-identical 404). No
+ `Allow` set can carry Usage; `closedDoors`/`mintDoors` refuse it; the
+ resolver fails closed on a usage row with no app, rungs or commands.
+2. Every mint path: the API services door, the browser services POST
+ (hand-made `role=usage`), the platform credential door, and any other
+ mint or rotate path you can find. Each refuses with no app, and while
+ the switch is off; none lets a credential mint a usage credential.
+3. The switch: route registered only when on (404 when off); the env
+ parsing; nothing else reads the switch wrongly.
+4. The implementer chose `linkedRefuse` for the usage door in the
+ linked-app policy (`internal/console/linkedpolicy.go`). Is that right
+ given spec §8 (the route reads only this console's root boxes' count
+ objects)? Say what it should be and why.
+5. Tests: would they fail if a second door admitted Usage, if a mint
+ path skipped a check, or if the switch were ignored?
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+ Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for
+ another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not
+raise a P2 to P1 to keep the review open. The census tests
+(`TestPlan14RootReadCensus`, `TestPlan9B8RecordWriteCensus`) fail on this
+branch until its census card is written (plan Task 9); that is known.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the problem, the evidence
+(file:line, verified), the failure scenario, a concrete fix and the
+invariant or trust boundary it breaks (its fault family). End with
+exactly one verdict: **READY**, **READY AFTER FIXES** (no P1), or
+**NOT READY** (P1s listed).
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites.