carlos / platform Public

review: Astra brief for console-request-ctx, round 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b663ba9a646d924888b8ddd3f9e796c1fe419f46 parent febbec4
1 file changed, +55 −0
  • docs/superpowers/reviews/REVIEW-BRIEF-console-request-ctx.md +55 −0

CI failed — run details

diff --git a/docs/superpowers/reviews/REVIEW-BRIEF-console-request-ctx.md b/docs/superpowers/reviews/REVIEW-BRIEF-console-request-ctx.md
new file mode 100644
index 000000000..619961520
--- /dev/null
+++ b/docs/superpowers/reviews/REVIEW-BRIEF-console-request-ctx.md
@@ -0,0 +1,55 @@
+# Review brief: branch console-request-ctx, round 1 of 3
+
+Repo carlos/platform, branch `console-request-ctx`, commit febbec4fc05e994d82051269511e64b74d99cb88.
+Under review: the diff `origin/main...febbec4fc05e994d82051269511e64b74d99cb88` (base 7e50962).
+Authorities: `docs/superpowers/plans/2026-11-16-go-code-health.md` (batch
+3, console request cancellation in place), AGENTS.md ("Writing Go here",
+"Stopping rules"). Outside the census (internal/console).
+
+You are the independent reviewer. The console store has one SQLite
+connection; this branch threads the request context through the store
+calls on the signed-in paths (session, CLI bearer gates, account and
+membership, app gate, account chrome, app list, app page, instances list,
+/api/cli/apps), adds `...Context` forms beside old names for many-caller
+methods, and lowers the ratchet record (console db-no-context 629 to 591).
+
+## What to check
+
+1. **Security gates unchanged.** The session, bearer (cliGateRefused,
+ cliUser, CLIPrincipalContext, CLITokenAddressContext), membership,
+ role, linked-app and demo guards must refuse exactly what they refused
+ before. A cancelled or expired context must never turn a refusal into
+ an admit, or an error into an empty result read as "no rows, allowed".
+ Check every changed gate for that.
+2. **The source-scan security guards** (svcroutes_test.go bearer-resolver
+ scans, the plan-exempt guard, the placement guard) now name the new
+ `...Context` forms. Do they still catch every door that must not call a
+ resolver? Is any door now able to call a new form the scans don't see?
+3. **Context-free callers left:** five outside the slice pass
+ context.Background() with a comment; the first-sign-in account creation
+ deliberately doesn't take the request's cancellation. Correct choices?
+ Any write that should finish even if the client goes away but now gets
+ cancelled half-way (transactions, the last-seen write, the plan banner
+ notice write after render)?
+4. **Transactions:** BeginTx under the request context: a cancel mid-tx
+ rolls back cleanly? Nothing commits partially?
+5. **Tests:** TestCancelledRequestLeavesTheConnectionQueue and
+ TestSignedInPagesQueryUnderTheRequestContext: would each fail on the old
+ code; flake risk on a loaded runner?
+6. **The ratchet record change:** lowered only, no raise; server.go line
+ count handled honestly (a field, not comment deletion).
+
+## Severity
+
+- **P1**: unsafe (any gate weakened), would not compile, a test fails, or
+ it would not work.
+- **P2**: wrong or missing. Fixed without reopening this review (security
+ behaviour changes in the fix still get a scoped check).
+- **P3**: clarity or polish. Follow-up list only.
+
+## Output
+
+Findings ranked P1, P2, P3 with file:line, failure scenario and fix, and
+the invariant each breaks. End with exactly one verdict: READY, READY
+AFTER FIXES, or NOT READY. Do not edit files, spawn reviewers or run full
+suites.