review: Astra round 3 findings on the DPA and retention spec
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+96
−0
docs/superpowers/reviews/CODEX-FINDINGS-dpa-and-retention-R3.md+96 −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-IsGa1D .amadan/test-gate.sh go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0 go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5 go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0 go: downloading github.com/aws/smithy-go v1.28.1 go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0 go: downloading github.com/benbjohnson/litestream v0.5.14 go: downloading github.com/superfly/ltx v0.5.1 go: downloading golang.org/x/net v0.62.0 go: downloading modernc.org/sqlite v1.55.0 go: downloading golang.org/x/sys v0.49.0 go: downloading golang.org/x/crypto v0.58.0 go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1 go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.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/pion/logging v0.2.4 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/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.40 go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 go: downloading github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 go: downloading github.com/klauspost/compress v1.20.2 go: downloading github.com/prometheus/client_golang v1.17.0 go: downloading github.com/lmittmann/tint v1.1.3 go: downloading golang.org/x/sync v0.24.0 go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18 go: downloading github.com/pion/dtls/v3 v3.1.4 go: downloading github.com/pion/transport/v4 v4.0.2 go: downloading github.com/pion/randutil v0.1.0 go: downloading google.golang.org/protobuf v1.36.10 go: downloading github.com/prometheus/common v0.45.0 go: downloading github.com/cespare/xxhash/v2 v2.3.0 go: downloading github.com/beorn7/perks v1.0.1 go: downloading github.com/prometheus/procfs v0.12.0 go: downloading github.com/wlynxg/anet v0.0.5 go: downloading github.com/prometheus/client_model v0.5.0 go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 go: downloading golang.org/x/text v0.43.0 go: downloading modernc.org/sqlite v1.55.0 go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0 go: downloading github.com/klauspost/compress v1.20.2 go: downloading github.com/pierrec/lz4/v4 v4.1.22 go: downloading modernc.org/libc v1.74.1 go: downloading modernc.org/libc v1.74.1 go: downloading github.com/google/uuid v1.6.0 go: downloading modernc.org/mathutil v1.7.1 go: downloading modernc.org/mathutil v1.7.1 go: downloading github.com/google/uuid v1.6.0 go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec amadan: job cancelled — a newer push superseded it
Intent
Human
I submitted the copy review
Human
<task-notification> <task-id>bwjua739j</task-id> <tool-use-id>toolu_01RvrXfzQnifE3JB3QGZLvkS</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/260ddc60-0dfc-4cf8-8857-7688d6275097/tasks/bwjua739j.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 3 review in background" completed (exit code 0)</summary> </task-notification>
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-dpa-and-retention-R3.md b/docs/superpowers/reviews/CODEX-FINDINGS-dpa-and-retention-R3.md| new file mode 100644 |
| index 000000000..035c2a0c6 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-dpa-and-retention-R3.md |
| @@ -0,0 +1,96 @@ |
| +- **R2-1 — Partly resolved:** the central gate is specified, but Keymail has no trusted attempt-start timestamp to supply to it. |
| +- **R2-2 — Partly resolved:** delivery-based dates address subsequent changes; the first-document rule bypasses notice for the existing privacy policy. |
| +- **R2-3 — Partly resolved:** reusing the manual purge covers mail and object stores, but does not delete database replicas. |
| +- **R2-4 — Partly resolved:** the retention arithmetic is corrected; expiry after replication stops remains unaddressed. |
| +- **R2-5 — Resolved:** the unconditional maximum is removed and backlog admission is increased. |
| +- **R2-6 — Resolved:** census and storage-authority review are restored. |
| +- **R2-7 — Resolved:** document ID and digest are bound through submission and replay. New PDF-related gaps are listed below. |
| +- **R2-8 — Resolved at spec level:** incident sending no longer shares the 200-per-hour limit. |
| + |
| +Reviewed commit `9c0f92fc8ea5ae4e03bf9e0632d16cd1785d90b2`. No files changed or test suites run. The live privacy page was inaccessible, so policy completeness beyond the supplied excerpts remains unverified. |
| + |
| +1. **P1 — §6.2: Keymail cannot supply the trusted attempt-start time required by `identityGate`.** |
| + |
| + **Evidence:** [§6.2](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:546) says every attempt already has a row with a creation time, including OAuth state. However, [handleSignin](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/server.go:3859) stores only state and verifier in a browser cookie. [handleCallback](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/server.go:3905) checks that cookie and exchanges the code; it reads no server-side attempt row or start timestamp. |
| + |
| + **Failure scenario:** a Keymail sign-in starts before deletion and finishes afterward. The proposed gate has no authenticated start time with which to distinguish it from a permitted fresh registration. Using callback time admits the stale attempt; trusting a newly added unsigned cookie timestamp would let the caller change the answer. |
| + |
| + **Fix:** specify a server-issued, authenticated attempt record with creation time and server-enforced expiry. Carry that proof through identity resolution and credential creation, with refusal of legacy attempts lacking it. Include the Keymail callback in the interleaving test. Also name a restart-stable marker key: the existing email-code HMAC key is explicitly [generated per process](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/store.go:87). |
| + |
| + **Fault family:** R1-2/R2-1 — deletion must revoke outstanding authority to recreate an identity or issue credentials. |
| + |
| +2. **P1 — §§3.1 and 8: the first privacy publication skips notice to existing customers.** |
| + |
| + **Evidence:** [§3.1](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:96) forces the first document of every kind to `needs_notice = 0` and immediate effectiveness because “there is nobody to notify.” Yet [§2](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:52) identifies an already-live privacy policy, and [§8](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:646) changes its retention promises and requires notice. |
| + |
| + **Failure scenario:** switch-on creates the first `privacy` row containing the changed policy. No notice is created, its date is immediately effective, and the written website rule permits publication that day. Existing owners receive no advance notice. |
| + |
| + **Fix:** distinguish the first database row from the first policy obligation. Import the existing policy as the baseline before publishing its revision, or require first-publication notices whenever an existing customer audience is affected. |
| + |
| + **Fault family:** R1-4/R2-2 — contractual changes must not precede completion of their notice obligation. |
| + |
| +3. **P1 — §6.5: the reused purge does not delete the database replica prefix.** |
| + |
| + **Evidence:** [§6.5](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:610) claims that the purge deletes the whole replica prefix, including snapshots. The manual path instead calls [release.PurgeApp with `s.cfg.Releases`](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/ownership.go:664). Its [prefix sweep](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/release/trash.go:354) deletes deployment objects. The lifetime variant [retires records and then uses that same store](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/lifetimes_purge.go:86). Database replicas remain separately under `instances/<host>` and move staging; [createleftovers.go explicitly documents their survival](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/console/createleftovers.go:4). The data-bucket lifecycle [never expires current objects](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/infra/modules/deployment-buckets/main.tf:137). |
| + |
| + **Failure scenario:** a customer deletes a hibernating database app. Automatic purge eventually removes its deployment records, mail estate and object store, but its last database replica remains current indefinitely. Increasing the promised number of days cannot fix that. |
| + |
| + **Fix:** extend the single purge workflow with explicit, retryable cleanup of the app’s database replicas and move staging in every supported location. Preserve ownership and writer-fencing evidence before removing the records needed to identify that data. Test terminal cleanup with replication stopped, including current and noncurrent objects. |
| + |
| + **Fault family:** R2-3 — every supported app-deletion path must reach terminal cleanup without an undisclosed manual step. |
| + |
| +4. **P2 — §6.4: stopped console replication has no fifteen-day expiry mechanism.** |
| + |
| + **Evidence:** [§6.4](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:580) promises fifteen days with no platform changes. Snapshot retention is configured through the [running Litestream process](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/ops/litestream.go:129); the bucket’s [seven-day rule applies only after objects become noncurrent](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/infra/modules/deployment-buckets/main.tf:137). |
| + |
| + **Failure scenario:** a console replica containing the deleted person’s data is abandoned during a move or replication stops before it prunes the snapshot. Its current objects never enter the noncurrent expiry window. |
| + |
| + **Fix:** retain Paul’s fifteen-day policy, but specify cleanup for inactive console replica prefixes and verify that case in the measurement. Correct the “hourly snapshot” assumption too: [SnapshotInterval is 24 hours](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/internal/lease/lease.go:95). |
| + |
| + **Fault family:** R1-9/R2-4 — backup erasure deadlines must cover every retention layer, including inactive replicas. |
| + |
| +5. **P2 — §§4.1–4.3: the notice schema cannot distinguish the fixed audience from later owners.** |
| + |
| + **Evidence:** [§4.3](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:339) fixes the date-setting audience at publication and excludes later owners from that calculation. But [§4.1’s schema and insertion rule](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:290) provide neither a publication-cohort marker nor a recipient creation time, and resolve owners on the hourly pass. |
| + |
| + **Failure scenario:** ownership changes between publication and the first pass. The original owner can be omitted. Once later owners are inserted, their rows are indistinguishable from the original audience, so a restart cannot reliably reconstruct which deliveries determine the date. |
| + |
| + **Fix:** snapshot the initial recipients transactionally with publication and persist their cohort membership. Add subsequent owners as a separate cohort. Define how the notice remains open while `effective_at` is unknown; currently `open_until` is mandatory while the proposed closing date is nullable. |
| + |
| + **Fault family:** notice applicability must use a durable, reproducible recipient set. |
| + |
| +6. **P2 — §4.3: the computed effective date can precede the date promised in the email.** |
| + |
| + **Evidence:** [§4.3](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:342) sets effectiveness to the last delivery plus thirty days, while the email promises “no earlier than” publication plus thirty-five days. |
| + |
| + **Failure scenario:** all deliveries succeed on publication day. The console authorizes effectiveness on day thirty, five days before the emailed lower bound. |
| + |
| + **Fix:** use `max(published_at + 35 days, last_required_delivery + 30 days)`, or change the email’s lower bound to match the scheduling rule. |
| + |
| + **Fault family:** communicated policy dates must agree with the date the console authorizes. |
| + |
| +7. **P2 — §§3.3, 3.6 and 3.8: the complete executed agreement is not bound to what the owner reviewed.** |
| + |
| + **Evidence:** [§3.3](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:148) binds only document ID and digest. [§3.6](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:221) selects the letterhead current at acceptance; that row supplies the operator party in the PDF. Separately, [§3.8](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:262) hashes raw fetched bytes but retains only the sanitized body, while the acceptance pane links to a separately published page. |
| + |
| + **Failure scenario:** the operator changes the letterhead’s legal entity while an acceptance awaits step-up. The document check still passes, but the resulting PDF names a different counterparty. A mismatch between the website page and fragment can also produce an agreement the owner never saw; the stored sanitized body cannot reproduce the raw-byte digest. |
| + |
| + **Fix:** bind the rendered letterhead ID alongside the document ID through submission and replay. Present the immutable stored agreement during acceptance. Define a canonical accepted representation and hash it; if retaining a separate source digest, archive those original bytes too. |
| + |
| + **Fault family:** recorded consent must identify the complete agreement presented to the signer. |
| + |
| +8. **P2 — §9: the UI slices omit the required UX and copy-review sequence.** |
| + |
| + **Evidence:** [§9](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/docs/superpowers/specs/2026-11-25-dpa-and-retention-design.md:662) proceeds directly to building the panes, operator forms and emails. [AGENTS.md](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/dpa-and-retention/AGENTS.md:422) requires a mockup-kit UX pass at mobile and desktop widths, in light and dark, before copy review and build. |
| + |
| + **Failure scenario:** the slices are implemented in their stated order before the required layout and copy gates. |
| + |
| + **Fix:** insert the UX pass, then copy review, before implementation in each affected slice. |
| + |
| + **Fault family:** user-facing changes must pass the repository’s required review sequence. |
| + |
| +No P3 findings. |
| + |
| +The three P1s have distinct causes: missing authentication-attempt provenance, incorrect policy bootstrap semantics, and incomplete data-deletion coverage. Refusing untracked sign-in attempts, blocking policy switch-on until the notice baseline exists, and blocking DPA activation for unsupported deletion paths would prevent those cases. Cutting the affected features would reduce the agreed scope; it would not deliver Paul’s requested outcome. This completes round three; a fourth requires Paul’s approval. |
| + |
| +**NOT READY** |
| \ No newline at end of file |