carlos / platform Public

review: Astra round 1 findings on the DPA acceptance branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 57605869aa23289c9ed564b554d5603f88dec385 parent 4fea586
1 file changed, +65 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-dpa-acceptance-branch.md +65 −0

Intent

Human

<task-notification> <task-id>aa309f107ae25a5c5</task-id> <tool-use-id>toolu_01NLrmh7DGojN4iE5azTiDuG</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/260ddc60-0dfc-4cf8-8857-7688d6275097/tasks/aa309f107ae25a5c5.output</output-file> <status>completed</status> <summary>Agent "Review Task 7 (docs)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>### Spec Compliance - **H1 (C95):** `docs/site/data-processing.md` line 1 reads "Data processing agreement", which matches the approved row exactly. - **Body (C94):** the single paragraph matches the approved row byte for byte. I compared it by eye against the copy deck and saw no differences. It contains no em or en dashes. - **Nav label (C96) and blurb (C97):** `docs/site/nav.json` has both, and both match the approved rows exactly. - **Placement:** the entry sits in the Guides group, between `one-instance-per-customer` and `pdfs`. The slug `data-processing` matches the page file, and the JSON parses. - **`dpaCopyBuilt`:** `internal/console/approved_dpa_copy_test.go` now lists DPA-C94 to C97. - **Scope:** the diff touches only those three files. This is the controller's ruling (a new page plus a nav entry) rather than the brief's literal "modify an existing guide page". - **Not run (read-only review, no suite runs):** `go test ./internal/docsite` and the deck test. The report says they passed. I did not check a trailing newline. ### Issues (Critical / Important / Minor, file:line) - **Critical:** none. - **Important:** none. - **Minor, `docs/site/data-processing.md:3`:** the page is one paragraph and has no "where to find it" detail. That is correct, because the copy is approved and the page may not add text. - **Minor, process only:** `docs/superpowers/reviews/dpa-acceptance-deferred.md` is untracked in the worktree. It is outside this commit. - **Minor, process only:** brief Steps 3 to 5 (push, CI, witness) were out of scope for this review. ### Assessment The page, nav entry and `dpaCopyBuilt` additions all match the approved copy and the controller's ruling. I found no defects. **Task quality:** Approved</result> <usage><subagent_tokens>41185</subagent_tokens><tool_uses>2</tool_uses><duration_ms>19164</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bsylzu1ub</task-id> <tool-use-id>toolu_0188riu34Ao8LFcNFbqquAF1</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/260ddc60-0dfc-4cf8-8857-7688d6275097/tasks/bsylzu1ub.output</output-file> <status>completed</status> <summary>Background command "Run Astra whole-branch review in background" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 24.2 g CO₂e (3,038,079 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on dpa-and-retention, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-dpa-acceptance-branch.md b/docs/superpowers/reviews/CODEX-FINDINGS-dpa-acceptance-branch.md
new file mode 100644
index 000000000..bf04c1ec4
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-dpa-acceptance-branch.md
@@ -0,0 +1,65 @@
+Reviewed `edaed836..b65435b8` with the brief’s exclusions. No files changed. Targeted Go tests could not start in the read-only sandbox; findings below distinguish source inspection from the in-memory SQL checks.
+
+1. **P1 — CI: the code-health gate rejects this diff.**
+ [legal_store.go:73](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/legal_store.go:73) introduces 12 context-free database calls without allowances. The scanner explicitly counts these interface methods. `server.go` also grows beyond its existing 4,223-line allowance. CI’s `60-code-health` therefore fails independently of the console tests.
+ **Fix:** pass contexts through the new store methods, use the context-aware SQL operations, and move a coherent concern out of `server.go`. Run `make code-health`.
+ **Fault family:** the code-health ratchet must not increase.
+
+2. **P1 — Deletion: an in-flight acceptance can become live after account deletion.**
+ The owner check happens at [dpapane.go:307](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/dpapane.go:307), but [legal_store.go:265](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/legal_store.go:265) inserts without checking whether the account still exists and is active. If `DeleteAccount` or `ReapAccount` commits between those operations, its `endDPA` update finds no acceptance; the resumed request then creates one with `ended_at = NULL`. I reproduced that result using the branch’s schema and insert in an in-memory SQLite database.
+ **Fix:** check active-account status and current ownership in the same transaction as acceptance insertion. Add an interleaving test against both deletion paths.
+ **Fault family:** deleting an account must terminate—and prevent recreation of—its live acceptance.
+
+3. **P1 — Publishing: concurrent first publications bypass notice requirements.**
+ [oplegal.go:390](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/oplegal.go:390) reads existing documents before fetching. Lines 404–410 classify the document as the first version, while insertion occurs at line 458 without rechecking. Two different versions can both observe an empty table and both become immediately effective, with `NeedsNotice = false`. An owner can accept the first completed publication while the second fetch remains pending; the second then applies automatically without notice or explicit acceptance.
+ **Fix:** fetch first, then determine baseline status and validate effective dates inside the publication transaction. Refuse a stale baseline submission. Test two overlapping first publications with an intervening acceptance.
+ **Fault family:** only the first publication receives the baseline notice exemption.
+
+4. **P2 — Version selection: “newest” uses two incompatible orders.**
+ [legal_store.go:196](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/legal_store.go:196) selects by publication timestamp, then ID; [dpainforce.go:38](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/dpainforce.go:38) compares IDs alone. Publication timestamps are assigned before the network fetch. When requests finish out of order, the form can offer one document while the in-force calculation treats another as newer. The in-memory SQL check confirmed the ordering disagreement.
+ **Fix:** define one publication order and use it consistently for offering, accepting, applicability and pending versions. Add an out-of-order completion test.
+ **Fault family:** every consumer must agree on document chronology.
+
+5. **P2 — Acceptance pane: required agreement context is missing.**
+ [account_settings.html:227](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/templates/account_settings.html:227) renders the stored fragment and customer form, but the letterhead appears only as a hidden ID. The processor’s identity is never shown. The form also omits the document URL and summary, including when accepting a version during its notice period. An owner therefore cannot review the processor details being bound to their acceptance, as §3.3 requires.
+ **Fix:** display escaped processor details from the bound letterhead, the stable document link and the version summary alongside the unchanged agreement fragment. Test these values in the rendered pane.
+ **Fault family:** the acceptance must identify the agreement and parties shown to the signer.
+
+6. **P2 — Error handling: unique violations are classified by message text.**
+ [legal_store.go:122](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/legal_store.go:122) uses `strings.Contains(err.Error(), ...)`, contrary to the repository’s explicit rule. A changed or wrapped diagnostic can turn duplicate acceptance/publication into a 500 instead of the intended response.
+ **Fix:** use `errors.As` with `*sqlite.Error` and its extended constraint code, following `pendingMintConstraint` in `platform_store.go`.
+ **Fault family:** database error classification must use typed errors.
+
+7. **P2 — Copy: the deferred rate-limit message remains outside the approved deck.**
+ [dpapane.go:312](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/dpapane.go:312) and [oplegal.go:311](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/oplegal.go:311) emit “too many requests. Wait a minute and try again”, which has no deck row. Users encounter it when throttled; the copy gate does not cover it.
+ **Fix:** use an approved shared message or add and review the missing deck entry, with a throttled-response assertion.
+ **Fault family:** shipped user-facing strings must have approved copy coverage.
+
+No new P3 findings.
+
+Deferred-list triage:
+
+| Deferred item | Status and disposition |
+|---|---|
+| String-based unique-error matching | Still open; fix before merge—finding 6. |
+| Ignored publication/letterhead errors in store tests | Fixed; the calls and shared helper check errors. |
+| Missing document/letterhead foreign-key test | Still open. `Open` does not enable foreign keys. Add coverage when tightening acceptance validation; do not assume the declarations enforce references. |
+| Blurred fetch-error categories | Still open; follow-up. |
+| Awkward nested accepted-ID check | Fixed. |
+| Unicode format characters accepted in `href` | Fixed; explicitly refused. |
+| Bidi test passing because of malformed closing tag | Fixed; the test has a complete closing tag and checks the link error. |
+| Stale `agreementHref` comment | Fixed. |
+| No way to remove a logo | Still open; follow-up. |
+| No cap inside the shared pending-action stash | Still open, but these routes cap incoming forms; follow-up. |
+| Mixed quotes accepted by `svgFuncsOK` | Still open at line 722. Follow-up: consume at most one opening quote before requiring `#`. |
+| Raw bidi rune literals | Still open at `dpapane.go:259`; recommend replacing them with escapes before merge. No review round needed. |
+| Concurrent `ErrDPAAlreadyInForce` handler path untested | Still open; include a concurrent-owner test with the acceptance transaction fix. |
+| Dead record link pending Task 6 | Fixed. |
+| Undecked rate-limit message | Still open; fix before merge—finding 7. |
+| U+2028/U+2029 in single-line fields | Still open; follow-up. |
+| Header hidden when printing other console pages | Still present; intentional broader effect, no additional fix required. |
+| Short-digest guard untested | Still open; follow-up. |
+
+The route, parity and claim-census changes inspected are additive. The record page correctly reads the acceptance’s own document and letterhead IDs. Formatting checks passed. The Go tests and CI gate were not executed successfully here.
+
+**NOT READY**
\ No newline at end of file