Brief the second team-service implementation review
1 file changed,
+99
−0
docs/superpowers/reviews/CODEX-REVIEW-BRIEF-team-service-prototype-R2.md+99 −0
CI passed — run details
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-team-service-prototype-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-team-service-prototype-R2.md| new file mode 100644 |
| index 000000000..7811f9440 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-team-service-prototype-R2.md |
| @@ -0,0 +1,99 @@ |
| +# Review brief: team-service local prototype, implementation round 2 of 3 |
| + |
| +Repo carlos/platform, branch `team-service-prototype`. |
| +Code tip: `06b09463423d0a58a38210779d826a8f41a58a44`. |
| +Base on Amadan main: `65420a4d9e0d919743ea2e95e20b1a649605db3d`. |
| +Review fixes since `d5c98b8013c41f0264d42432821ae2b6060f6eb2` and their |
| +interaction with the complete `internal/team` and `internal/teamcontract` |
| +implementation. This brief is the only subsequent source change. |
| + |
| +Authorities merged at `21738194`: the team-service design and implementation |
| +plan dated 2026-11-01 under `docs/superpowers/{specs,plans}`. The plan's local |
| +prototype section now records narrower recovery support and live-work gates. |
| +The design received two Fable rounds and was accepted; do not reopen it. |
| +Implementation R1 was Opus, NOT READY, with one P1 and seven P2 findings. |
| +Its full findings are on discussion 512 and supplied in the review prompt. |
| +This is implementation R2 of 3, regardless of filename or session changes. |
| + |
| +You are an independent Opus reviewer. Read the changed source and verify |
| +the claimed fixes. No edits, shell commands, network, credentials or subagents. |
| +Do not run the full suites. |
| + |
| +## Fixed scope |
| + |
| +This slice is an offline internal Go library and runnable test workflow for |
| +trusted control-plane callers. No live adapters, authenticated runner API, |
| +console UI, sandbox claims, deployment, automatic merge or customer messaging. |
| +The first job sets account prices, ceilings and concurrency. At most one |
| +child-job level is supported. Unsupported recovery may refuse work explicitly. |
| +Provider request ceilings and authenticated evidence remain live-adapter gates. |
| + |
| +## R1 disposition to verify |
| + |
| +First give resolved, partly resolved or unresolved for every finding below. |
| +Carry outstanding findings forward at their existing severity, then add any |
| +new findings. Do not take these claimed fixes as proof. |
| + |
| +- P1-1, account/parent policy inheritance: jobs cannot replace account Rates |
| + or PerCall; reservations use the canonical account policy. Internal and |
| + independent external tests cover later and child jobs with zero rates. |
| +- P2-1, unknown outcomes and budget: removed automatic redispatch after |
| + admission for every replay class. Absence does not prove no billable work |
| + or no late effect. No receipt means uncertain with an open reservation, |
| + including after cancellation. A receipt or audited charge closes usage. |
| +- P2-2, dispatch boundary: persist the admitting incarnation, refuse current |
| + dispatching reconciliation, serialize Resume and require paused admission. |
| + Dispatch records receipts/lost outcomes with an uncancelled context. |
| +- P2-3, recovery liveness: conservative audited settlement excludes that |
| + uncertain action from the startup blocker, without fabricating success. |
| +- P2-4, concurrency/containment: every containment-pending attempt counts, |
| + including expired and completed rows. Recovery compares parsed deadlines, |
| + since RFC3339Nano text is not chronologically sortable. |
| +- P2-5, termination/descendants: Conclude waits for nonterminal children and |
| + all uncontained attempts. Success uses termination cleanup, revoking open |
| + intents. The regression includes a contained expired optional attempt. |
| +- P2-6, capability boundary: a closed operation table limits forge/tracker |
| + publication to CapPublish; the success query also checks that capability. |
| +- P2-7, startup recovery: schema 2 records external transaction position, |
| + detecting same-incarnation rollback. Restored intents become uncertain |
| + before cancellation can release them. Missing/mismatched history stays |
| + quarantined across reopens even with no remaining action records. This |
| + prototype has no operator restore override. Schema 1 migrates conservatively. |
| + |
| +The new crash witness executes a fake publication then crashes before Record; |
| +Resume recovers the positive receipt without dispatching again. The restore |
| +witness retains the newer external marker with an older DB snapshot. |
| + |
| +R1 P3 follow-ups are retained in the implementation plan and branch discussion: |
| +authenticated provenance/check counts; failed rework consistency; resolving |
| +unsupported wait reasons; elapsed job cap beyond Claim; adapter ceilings and |
| +over-reservation reporting; numeric canonicalization; more crash/outbox and |
| +business negative cases. They do not reopen review or imply implemented scope. |
| + |
| +## What to check |
| + |
| +1. The account/parent reservation invariant, including the actual callers. |
| +2. Unknown effects and late receipts across cancel, restore and owner change. |
| +3. New schema/marker paths: fail-closed history, migration and stale owners. |
| + The marker covers local process/snapshot recovery, not host-loss durability. |
| +4. Capability, containment and success cleanup. Identify a reachable failing |
| + scenario in this offline slice, not a missing future transport. |
| +5. Regression witnesses and truthful claims about the narrowed prototype. |
| + |
| +Validation: both changed packages passed ordinary tests and `-race -count=1`. |
| +Full repository gate is rerunning on the final branch tip. No new package is |
| +in the root binary's Linux amd64/arm64 dependency set, so the census is unchanged. |
| + |
| +## Severity and output |
| + |
| +P1 means unsafe within this slice, a compile/test failure, or an implemented |
| +contract that does not work. P2 is wrong or missing but fixed without reopening |
| +review; any newly changed security/termination/storage behaviour still gets |
| +its required check inside the same round budget. P3 goes on the follow-up list. |
| +State verified file:line evidence, a failure scenario, minimal fix and fault |
| +family for each finding. Do not raise severity to prolong review. |
| + |
| +Stop at the first round with no P1. A fourth needs Paul's explicit go. Two |
| +consecutive rounds with findings in the same fault family trigger the AGENTS |
| +scope/enforcement decision, not a third patch loop. End with exactly one: |
| +READY (no P1/P2), READY AFTER FIXES (P2 only), NOT READY (P1s listed). |