Skip to content

feat(identity): subject data requests, erasure and global account closure (P03-10) - #48

Draft
cemililik wants to merge 62 commits into
mainfrom
development
Draft

cemililik wants to merge 62 commits into
mainfrom
development

Conversation

@cemililik

Copy link
Copy Markdown
Collaborator

Summary

Delivers packet P03-10 of Phase 03: subject data requests, erasure and global
account closure, on the decisions of ADR-0106, ADR-0107 and ADR-0108 (Accepted
2026-11-22). Four steps, each implemented, reviewed and fixed on development.

  • Step 1 — request core and export. Request storage (scope-group request unit,
    guards, RLS, ticket and artifact tables), the export engine, the person's own API
    (/api/v1/identity/me/data-requests) and the retained-entry API
    (/api/v1/identity/data-request-entry), encrypted chunked download under a
    short-lived ticket, and the administrator's export and erasure requests for a Revoked
    member.
  • Step 2 — tenant erasure and privileged audit redaction. Erasure after a 24-hour
    window, operator inspection and completion, the privileged audit-redaction executor
    (keyset batches, byte-bounded), the receipt that lists what is retained.
  • Step 3 — global account closure. The person files a closure; an operator Begins
    it (fences, bounds, last-administrator rule, User to Closing); a per-group fan-out
    erases each participant group; the operator Finalizes it (redacts every participant
    tenant and the platform sentinel, deletes the identity-provider account through a
    confined Keycloak adapter, User to Closed). Operator runbook:
    docs/runbooks/account-closure.md.
  • Step 4 — web surface. /account/data on the native BFF (own and retained entry,
    forms without required script, English and Turkish, relay download as one
    attachment), the administrator's surface in Studio, 24 SDK wrappers, and a copy
    catalogue with a test that fails when the API gains a refusal key the copy lacks.

Review history

  • Steps 1 and 2: two full review rounds each (fresh read-only reviewers by lens), every
    verified finding fixed.
  • Steps 3 and 4: round 1 done (14 reviewers, no Blocker; fixes merged, see the delivery
    log). Round 2 is incomplete: the agent account reached its weekly usage limit
    (resets 2026-11-26). Two of eight Step 3 slices ran (API and vocabulary; Keycloak and
    operability); the database, owner and fences, red team, audit redaction, test
    adequacy and documents slices, and all of Step 4's round 2, are owed and not
    treated as passed. The briefs are kept; the round will run after the reset and be
    recorded in the delivery log.

Verification

Per-step records are in docs/roadmap/phase-03-delivery-log.md (P03-10 entries).

Suite Result
Architecture (clean clone, Step 3-4 code head) 725 passed, 0 failed
Integration, Step 2 head (clean clone) 5,117 passed, 40 failed: 26 need frontend dependencies a clean clone lacks, 1 assertion that fails only inside the full Release run, 13 from one census pin fixed in 60eea19e
Integration, Step 3-4 code head (clean clone) first run 4,754 passed / 618 failed, all host failures (the container runtime stopped; 562 are Can't assign requested address); the 35 failed classes without frontend dependencies rerun serialized: 573 passed, 0 failed
Integration, frontend-fixture classes (working tree) 39 of 40 passed; the one failure was a defect of the packet's own BFF proof (member page now adds one MUST audit row and one visitor-budget call), fixed in a1ce6b12 and re-run green
Unit 5,083 passed
Contract 15 passed
Frontend pnpm typecheck and pnpm lint clean; pnpm test 5,222 passed, no skips
Docs make lint-docs clean

Known: AuthenticatedHttpSurfaceRuntimeTests.Production_endpoint_union_...(Development)
fails only inside the full Release run (passes alone, 7 of 7); it also failed at the
Step 2 head and the packet does not cause it. Step 1's earlier note of 24 environmental
failures was 26.

For the maintainer

  • Owed ADR amendments and decisions are collected, numbered 1 to 71, in the delivery
    log entry "P03-10 — owed ADR amendments and maintainer decisions". No Accepted ADR
    body was edited. The ones that need a ruling first: a person re-admitted during the
    erasure window (34); whether ip_address, user_agent and actor_email become NULL
    on every selected audit row or only the subject's (38); a GIN index over payload
    identifiers and the chunk-read budget against ADR-0064; the retained classes the
    receipt cannot count (31, 47, 50) and their wording; WCAG 2.2.1 for the five-minute
    retained entry; the locale/theme exception; the retained scope's organization names
    (56); the extra audit row and visitor-budget call the Studio member page now costs (71).
  • Deployment: KEYCLOAK_ACCOUNT_REMOVAL_SECRET (AccountRemoval__ClientSecret) is
    required for Finalize; without it the closure is refused before anything changes
    (fail-closed default). See docs/runbooks/account-removal-client.md.
  • Unreleased migrations: several migrations of this packet were edited in place
    before release; a development database created from an intermediate commit of this
    branch must be dropped and migrated again.
  • Not run: no Chromium proof run for the new pages; the frontend was verified by
    unit, route and rendering tests.
  • Pre-existing, not this packet: the pg_current_xact_id()::text::xid cast sites
    (owed item 12).

🤖 Generated with Claude Code

cemililik and others added 30 commits November 21, 2026 17:59
Record PR #46's merge, the final-head layout A run beside the four
hosted-only faults the pull request exposed, and the evidence that stays
open: layout-B and pair qualification (the filter ceiling is ADR-0105, PR
#47), the maintainer items and the pre-commit worktree note. Mark P03-9
complete in the phase Status block and close G13 and G14's rows, bring
the README's Identity row up to the delivered packet and point the
ADR-0099 index row at Amendments 10 to 13.

ADR: 0069
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts:
#	docs/roadmap/phase-03-delivery-log.md
PR #47 merged as 8ac1428. The record carries the hosted layout A and B
result on the reviewed source, a direct 64 KiB and 131,000-byte filter check
on the runner image, the Sourcery dispositions, the unfinished runs on the
merge commit and on main after #46, and why the P03-9 pair gap stays open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ADR-0106 to ADR-0108 close G15 and the G16 workflow after the maintainer's
questions and seven independent reviews; dated amendments in eleven ADRs, an
erratum in Standard 05 and corrections in Data Protection, Audit and the
phase text carry the changes. The step plan and the dispositions are in the
Phase 03 delivery log.

ADR: 0106, 0107, 0108
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
P03-10 Step 1, unit 1: the request, artifact, ticket and chunk tables with
the canonical row policy, the status-machine and lifecycle guards and the
exact ADR-0107 grants; the DataSubjectRequest, DataExportArtifact and
DataExportTicket aggregates; and the SharedKernel participant, eligibility,
hold-source and artifact-store ports with their closed vocabularies.

ADR: 0106, 0107
Module: Identity, SharedKernel, Application

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
P03-10 Step 1, unit 3: fn_identity_own_data_request_scopes with its two
owner arms, the HostAndOwnDataRequestScope origin and witness, the
unit-of-work setter, and the key-less OwnDataRequest and
OwnDataRequestEntry policy kinds. The native entry endpoints follow with
the request API.

ADR: 0106, 0107, 0095
Module: Identity, SharedKernel, Application, Api

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
P03-10 Step 1, unit 2: AES-256-GCM export cipher and key ring, the
Postgres artifact store, the bounded bundle builder, the Identity,
Tenancy, Customization, Education and Audit user-data participants, the
export and purge jobs, the fulfilment scheduler and the failed-request
reconciler, with the artifact truncation record.

ADR: 0106, 0107
Module: Identity, Tenancy, Customization, Education, Audit, Application

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
P03-10 Step 1, unit 4a: the live-session API for subject data exports:
self and administrator creation, receipts and pages, cancellation,
artifact revocation, the 15-minute download ticket and the chunk read,
the default eligibility and hold source, the MUST audit entries, the
write-store split that keeps each executor on one aggregate, the
additive OpenAPI and SDK contract, and the end-to-end tests. Also fixes
the stale census pins of the earlier units (hosted startup services,
job definition constructors, capture-origin sites, platform head).

ADR: 0106, 0107
Module: Identity, Api, SharedKernel

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
P03-10 Step 1, unit 4b: the six retained-entry operations for a person
without a live Membership (a Suspended or revoked one), mirroring the
consent-subject entry: the closed OwnDataRequestOperation paths, the
native credential capture, the one minting source and resolver branch,
the OwnDataRequestEntry policies and handlers over the live executors,
keyed create and cancel replays, the ticket session binding, and the
closed-set negative tests. Also pins the new controllers in the job
manifest census.

ADR: 0106, 0107, 0095
Module: Identity, Api

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review round 1 of P03-10 Step 1: the write-port census now counts the
seven retained-entry handlers beside the fourteen live ones, the
explicit read-only census names the two retained list queries, and the
database standard no longer restates census counts that the tests own.

ADR: 0106
Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review round 1 of P03-10 Step 1, area A. An artifact is inserted only
while its export is fulfilling and commits only with it completed (no
xid cast); chunk and ticket guards read the artifact FOR SHARE and a
chunk leaves only a withdrawn artifact; the job-phase and group-page
reads gain indexes and the lists project only their columns; artifact
timestamps come from the database clock; storage failures map to 503;
the cipher disposal race is gated; a missing key refuses the mint and
answers a chunk as an absence; a ticket is bounded to three open ones;
buffers are pooled and cleared; the OpenAPI text states the ticket and
paging semantics. Adds the data-export runbook and the leak, splice and
interleaving tests.

ADR: 0106, 0107
Module: Identity, Api, Infrastructure

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review round 1 of P03-10 Step 1, area B. The audit section opens with
its reach (organization, organization and tenant level, or tenant level
only) because the export job reads under the group's row policy and not
tenant-wide; the audit statements become unions of index-served branches
behind a new audit index and a bounded metadata window; the retained
attribution count reads the model instead of auditable entities; section
and collection caps clamp to half the ceiling and bound issued
invitations; colliding rewritten keys are suffixed; the unreachable
resume branches go; the export job gains metrics and ids-only logs.

ADR: 0107, 0108
Module: Identity, Audit, Tenancy, Application

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The OpenAPI descriptions of the ticket, chunk, paging and revoke
operations changed in review round 1; the generated schema follows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reflows the paragraphs P03-10 Step 1 added to the module, standards,
architecture and runbook documents to the 88-column rule of Standard 13.
The whitespace-normalised text, the list structure, the code spans and
the links are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Platform-only reversal leaves every Identity data table in place; the
four Step 1 data-request tables were missing from the surviving-table list
the full integration run checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The audit metadata scan is split into one statement per branch, each served
by its own partial index, so an organization group no longer reads tenant-wide
history. The audit section states its reach as a closed record, receipts are
counted by any user column, and the stored result columns are classified as
audit data. Describe-only participants share one guard.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The export job builds the bundle and counts references before it takes the
shared tenant fence, then re-reads the request under it. A completed export
must own an artifact, an administrator's export is refused while the person
holds a readable one, and tickets are bounded per session and per artifact
with distinct refusals. Custody refusals, purge failures and downloads are
counted, the runbook is rewritten against the code, and the OpenAPI prose is
built from the limit constants.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Moves the request rules, identifier checks and refusal spellings into one
static class, splits the export creation and chunk read at their seams, uses
the one active-status filter and one statement budget, maps the ticket
response once and consolidates the integration helpers. No behaviour,
contract or schema change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The delivery log gains the Step 1 record, the two review rounds with their
fixes and the verification closeout with the maintainer items; the Phase 03
Status row says Step 1 is delivered and twice reviewed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
P03-10 Step 2 unit 0: the two non-assignable Platform keys
(platform.data_request.read and .write), the two operator operations of
ADR-0107 section 8 (inspect and complete_erasure, audit slug
audit.redaction.apply) with their audit declarations, and the SharedKernel
IAuditRedactor port with the plan and closed report types of ADR-0108, so the
Identity, Audit and Platform units build against one stable shape.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The platform operator can list the data requests that need attention
(awaiting privileged step, overdue scheduled, stuck fulfilling, expired
artifacts: metadata only) and complete an erasure's privileged step in one
platform transaction: redact through the audit redactor, merge the audit's
retained kinds into the request result, move the row, write the result row.

The request guard gains a platform arm admitting exactly the erasure
awaiting_privileged_step -> completed arrow with system-actor stamping, and
learnstack_platform gets a closed-column read of the artifact table. The scope
handle gains RedactAuditAsync bound to the erasure-complete operation.

Module: Identity, Tenancy, Audit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AuditRedactionExecutor is the one file that updates audit_log: on the
platform scope's connection and transaction it selects a subject's rows
(whole tenant for a person's own request, the group's organization for an
administrator's), nulls ip_address, user_agent and actor_email, and replaces
the subject's identifiers at declared payload paths with the redaction
sentinel, in bounded batches. It returns a closed report of what was changed
and what survives.

Each module that audits person references registers an
IUserReferenceLocator (Identity, Tenancy, Customization, Education); a
census requires it, per-module canaries prove every declared path against a
real PostgreSQL as learnstack_platform, and the append-only sweep names the
executor as the sanctioned site.

Module: Audit, Identity, Tenancy, Customization, Education

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Every operator-completion test used a recording stand-in for the executor.
One test now builds the real AuditRedactionExecutor from the registered
locators and runs complete_erasure through the real platform scope: the
person's rows are redacted at their declared paths, another person's value
and another tenant's rows stay, the report commits with the request and its
result row, and a repeat redacts nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An erasure is filed by the person or, for a Revoked Membership, by an
administrator; it waits 24 hours and is cancellable, then a one-root job
takes the subject's User fence and the tenant key and, in one transaction,
revokes the subject's export artifacts and unstarted exports, clears and
revokes the frozen Membership snapshot and revokes the invitations the person
issued, recording each participant and the retained report before parking the
request for the operator step.

Membership and Invitation erasure operations run only under a sealed erasure
witness. A new forward migration admits one clearing UPDATE of a Revoked
Membership's profile columns while the request is fulfilling and both fences
are held. Retained-entry callers gain artifact revocation, and the receipts
show execute_at.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review round 1 of Step 2. The operator's complete-erasure act and the request
guard's platform arm refuse an erasure whose origin is closure_fanout, which
only that closure's finalization completes. The contextual guard's erasure
exception uses the repository's IS NOT TRUE idiom and its composition checks
each anchor occurs exactly once. The retained revocation's If-Match is
documented as the artifact version, the operator acts gain a per-outcome
counter, and the data-request storage tests gain the shared User fence, NULL
custom values, the blocked and scheduled arrows and the fan-out refusal.

The replay-floor proof (ADR-0107 § 9) runs a real replay of a subject-linked
delivery after a real erasure. Docs: Standards 05, 10, 11, 18 and 21, the
Identity README and audit matrix, the runbook and the glossary say what is
true at this head, including that the retained list is partial.

Module: Identity, Audit, Tenancy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cross-group isolation of artifacts, exports and invitations, resume of a
fulfilling erasure from recorded progress, the not-yet-due run, a tombstone
erased twice, more than one page of pending invitations, an organization
administrator limited to their own branch, an erased person's live and retained
routes, the hold refusal over HTTP, idempotent replay of every new keyed
operation, and the stored job's definition, scope and due time. Each new test
was shown to fail under a mutation of the behaviour it proves.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The request guard admits no request born fulfilling until a closure's fan-out
has its own witness, and the profile-clearing witness names the Membership in
the request's frozen snapshot, so the application role cannot create the
witness it needs. Cancelling an erasure after its window ends, an administrator
naming themselves and an oversized snapshot answer their own closed keys, the
contract texts spell the wire keys and describe executeAt, completedAt and the
partial retained list, and the operator acts count audit_unavailable and failed.

The runbook gains the dead-job recovery, the deploying rule, the person-asks
section and the verification recipe; Standard 05 states the guard rules as
they are.

Module: Identity, Tenancy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A selection batch is a half-open range on (timestamp, id) cut at 100 000 rows or
64 MiB of stored payload, whichever comes first, so a tenant whose rows carry
large payloads completes instead of timing out on its first batch; the update
names public.audit_log. The locator census fails an unclassified identifier,
a person key in a contained member's key and a retained key that is only part
of a composite key.

Small-batch canaries prove boundaries, ties, chunks and byte cuts equal the
one-batch result, and an end-to-end test runs a real erasure and the operator's
completion and finds no identifier of the person in any audit payload except
the retained User and Membership keys.

Module: Audit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The replay-floor test now completes the erasure through the real operator act
(audit redaction and the request's completed) before the replay, takes the
transport trail after it, and asserts the replayed observation row for the
erased person and that the completed fact's earlier observation is untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cemililik and others added 28 commits November 23, 2026 01:34
RefusingIdentityProviderAccountRemoval fails closed; KeycloakAccountRemoval
deletes one user through a confined realm client holding only manage-users,
with a per-call token narrowed to that client, a subject that must be a
canonical UUID, and outcomes for removed, absent, refused, unavailable and
uncertain answers. It is selected at the composition root only when its
secret is present, with a fixed resilience shape and no retry, because the
closure's Finalize is the repeatable retry.

The realm gains the client and its service account; the development tooling,
compose files and Keycloak tests know it; the runbook states what the client
can do, how to provision, rotate and verify it, and what an operator does for
each outcome.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The redaction plan gains two closed shapes for a global account closure: a
tenant pass (every Membership the person holds in a tenant, whole-tenant reach)
and a sentinel pass (the platform sentinel tenant, located by the person's
subject key, so a failed creation attempt is found too). The executor and the
platform scope each admit a closure pass only under the closure's Finalize
operation and an erasure plan only under the erasure completion, and a closed
aggregate report sums every pass within a bounded document.

The registry gains the closure's Begin and Finalize operations with their
audit slugs; the Finalize checkpoint slug and the matrices follow.

Module: Audit, Tenancy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A person alone files a closure for their scope group: scheduled, executeAt
24 hours later, no job, cancellable until Begin commits. The default
eligibility judges it at creation (a Membership of any status, one active
closure per group, the hold port); the last-administrator rule is Begin's.
Administrators never file, list, read or cancel one.

Two routes (live and retained entry) with protected operations 36 and 37, a
closure response type, the audit row identity.data_request.create_closure,
OpenAPI additions with truthful descriptions, and the censuses and pins the
new operations move.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One forward migration gives the platform role its closure privileges and the
database the witnesses for them: column reads of users, memberships and the
administrator Role tables; the users trigger admits only the platform's
Active to Closing and Closing to Closed while the person's fence and every
participant tenant's fence are held; the request guard's platform arm gains
Begin, the refusal record, Finalize and the fan-out completion, each checking
the person's status and the fences it needs.

The application role may now insert a request only for an Active person, and a
closure's fan-out erasure only, and born fulfilling, for a Closing one,
through a definer that confines itself to a caller holding the person's fence.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The full architecture run pinned the production controller actions: the
erasure, closure and artifact-revocation routes were not in the list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Begin takes the person's User fence and every participant tenant's fence on
the platform connection, judges the closure (the window, the hold port, the
last eligible administrator of each tenant that allows ordinary work), moves
the User to Closing and the request to fulfilling with a result row under the
sentinel, commits, and only then fans out to the served groups. A refusal is
recorded on the request, a repeat resumes, and the act is idempotent.

The fences come from one acquirer with its own census leg; the Tenancy
lifecycle reader gains a platform-scope read; the last-administrator read is
the complete-graph guard's predicate plus the person's status. The route is
POST /api/platform/v1/data-requests/{id}/begin-closure; the closure runbook
documents Begin.

Module: Identity, Tenancy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Appends the Step 2 delivery record and the records of both review rounds to
the Phase 03 delivery log. The verification and closeout record follows the
full-suite results on the Step 2 head.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
After Begin commits, one pipeline act per served group creates or adopts the
closing person's erasure under the operator act executor, which announces the
group's organization for this operation alone. A fan-out erasure is born
fulfilling and its job is queued at once; an erasure the person or an
administrator filed is adopted, cancelled inside its window or waited for.

A forward migration adds a definer that reads the affected person's User
status under the shared User fence, so a delayed provider-event delivery about
a Closing or Closed person completes as a recorded no-op. Every creation path
answers a person who is not admitted with lockey_subject_not_admitted.

Module: Identity, Audit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Records the full-suite verification of the Step 2 head, the 40 integration
failures and what each is, and the choices Step 2 leaves to the maintainer.
The Phase 03 document replaces its stale "owes a decision" paragraph on the
audit redaction with the decision ADR-0044 Amendments 17 to 19 and ADR-0108
took, adds the dated erratum on "through completion" that ADR-0107 § 7
requires, and moves the P03-10 Status row to Steps 1 and 2 delivered.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A signed-in or retained person opens /account/data to see their requests and
file an export, an erasure or an account closure, cancel one, revoke an
export and download it as one attachment relayed chunk by chunk under a
short-lived ticket. The page is server-rendered with working forms and no
required script, in English and Turkish, with one sentence for every refusal
the API emits and a test that fails when the API gains a key the copy lacks.

The SDK gains eighteen wrappers over the own and retained operations, the
native transport accepts 202, and the session store pins each response to its
owner. The generated schema is regenerated from the committed OpenAPI.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Finalize redacts the person's audit rows in every participant tenant and the
platform sentinel under the fences and writes an attempt row with the closed
counts, deletes the provider account with no transaction or lock held, then
takes the fences again, moves the User to Closed with the raw provider subject
removed, completes the participants' erasures and every open closure of the
person, and writes the result row. Every step repeats safely: a provider
refusal, an unavailable provider or a lost answer leaves the User Closing.

A forward migration lets the platform complete a closure that never began, so
a second closure inside its window cannot outlive the person. Identity's
Infrastructure reaches Tenancy's lifecycle read through an Identity-owned
port, as the module-dependency rule requires. The capstone test runs the whole
closure on the production composition with the real fan-out and jobs.

Module: Identity, Audit, Tenancy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Identity's own port over Tenancy's lifecycle read takes the entered scope's
handle as a parameter and cannot enter a scope, so it joins the files the
census allows to name the platform scope.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An administrator with the membership capability sees the data requests of
their scope, files an export for a member or an erasure for a Revoked member
with an explicit confirmation, cancels a request they filed and revokes an
available export, with one sentence for every refusal the API emits and the
member page carrying its own section. The administrator never downloads a
subject's export.

The SDK gains the six administrator wrappers over the committed OpenAPI, the
native client gains their operation kinds, and the Studio pages are protected
documents denied before any read when the caller lacks the capability. Copy
is English and Turkish and shares the person's pages' wording where it is
identical.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Phase 09 owns the first hold source for subject data requests and Phase 11
owns the unserved groups of a global closure, a person with no Membership, the
retained classes no count reaches, expired artifact purge, the backlog alert
for waiting erasures and the production account-removal client. Both phases
now list their item, as ADR-0106 and ADR-0107 say they own it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A 404 on the deletion means the account is absent only when it carries the
provider's JSON media type, so a proxy's own 404 can no longer close a person
whose account still exists. The adapter's ceiling now sits one second behind
the pipeline timeout so a hanging provider opens the breaker, a refused
connection on the deletion itself is an unknown outcome rather than "nothing
was deleted", 408 and 425 are transient, and every refusal logs one closed
reason code that carries no subject, URL or text.

An architecture rule pins the port's one call site, the runbook's secret file
and token decoding steps are corrected against the real provider, and the
wording says "no deletion was confirmed" where an outcome is unknown.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Every sentence of the page now says what the backend does today: a stopped
erasure shows its recorded reason and no promise of a new request, the
retained intro no longer assumes a suspended membership, the closure warning
names the groups that keep their data, no sentence claims a retention rule
that does not exist, and the retained pages show when the five-minute entry
ends. Headings, titles and button names tell items apart, and the Turkish copy
is revised for meaning and register.

Standard 07 records the page's locale and stylesheet decision, Standard 11 its
owner rules, and the glossary gains the retained terms.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An administrator who revokes a member is taken to a new erasure page keyed by
the Membership id, because a Revoked Membership's own page is not readable;
the dead branch and its promising copy are gone. A request whose person is
known to be Revoked is no longer read for a name, the success notice shows
only while it still matches the request, a throttled or failing optional read
degrades the section instead of the page, and the links, markers and
sentences found in review are corrected.

A successful administrator action now redirects: the BFF admission refused
every redirect that carried a query, so each export, erasure, cancel and
revoke ended in an error. It admits exactly the result targets, with tests
that go through the real middleware.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pins by value what the closure's tests only claimed by name: every
participant tenant is redacted, including one whose only group is unserved;
each erasure and closure carries its own retained counts and the total; the
judgment order, the lost-answer commit, a malformed fan-out answer, a Begin
or Finalize racing another operator, a Membership revoked after Begin and each
Finalize defect path are each reached. Three meter assertions are scoped to
their own operation, a tautological isolation helper and a vacuous idle check
are replaced, and a fence held by another backend is shown not to count.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A chunk read refused with 429, or with 503 and Retry-After, is a pause: the
relay waits within the ticket's deadline and the owner's end, then reads the
same chunk with the same ticket, so an export above about 7.5 MiB, which the
per-visitor request budget used to stop, now completes. A stalled client is
cut after a no-progress limit instead of holding a snapshot credit and a
plaintext buffer, and a failure after the headers always destroys the
connection so no short file looks complete.

Retained pages state the download and confirmation limits, error pages never
repeat a submitted group, the transport zeroes its raw reads, and Standard 07
owns the relay mechanics the runbooks now link to.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Begin judges every bound a later step enforces before the irreversible move:
a person with more than 256 participant groups, or more than 256 Memberships
in one tenant, and a person whose provider subject the removal port cannot
delete or whose deployment has no removal client, are refused with nothing
written, so no one is left Closing who can never be finalized.

Finalize's first transaction takes only the person's User fence, so the
redaction no longer stops identity writes in every participant tenant, and the
second transaction locks the awaiting erasures, accepts one the operator
already completed, keeps a now-unserved group with an open fan-out erasure
required, and answers an audit failure after the provider step as retryable.
A forward migration stops the application role writing a begun closure and
removes a status oracle; the redaction filter uses a hashed lookup past 128
spellings, and the sentinel pass sizes no payload it never reads.

The runbooks and standards say what each answer means, and the removal port
documents its pure preflight beside its one deleting call.

Module: Identity, Audit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The closure fan-out needs the operator gate and act executor, which only the
operator authority registers, so it is registered there: a host that composes
persistence without it validated its service graph and failed to start, which
broke every HTTP integration host in the full run. The setter census exempts
only the literal lock_timeout bound the fence acquirer sets, with planted
departures that still match.

The removal port's preflight now also requires a secret the client can present,
so Begin cannot admit a closure whose Finalize would stop at an unusable secret.
A Finalize that fails after the provider step is counted and logged as an audit
failure while still answering a retryable 503, the served contract and the
operator runbooks name every case where a 503 is not "nothing changed", the
console search finds a person by id, and stale statements are corrected.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Posts a valid form through the handler for every person route in both modes
and asserts the operation, the redirect and its group, drives the retained
follow-up pages and the owner-mode selection with two cookie families, and
makes the forged-cursor test deterministic. The person's routes also run
through the real native caller and SDK, the ingress and the closed server-only
module list gain the data-request modules, and a table over all 24 SDK
wrappers pins method, path, body and headers, so swapping a revoke and a
cancel path fails.

A refusal before any owner is chosen no longer touches the response lease.

Module: Identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Studio member page lists the group's data requests (Step 4), which is one
more MUST `identity.data_request.list` audit row and one more call under the
60/min visitor budget. The warm-realm BFF journey asserted seven selected-page
audits and ended its first budget window after the replacement check, so it
failed on the eighth audit row and then on a 429. It now expects eight rows
and ends the window before the replacement check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Full architecture, integration, unit, contract and frontend results on the
review-round-1 head, the host failure that hid the integration result, the
one defect the frontend-fixture classes found, and item 71 of the owed list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @cemililik, this pull request is too large to review

It changes 543 files. Sourcery can review pull requests with up to 300 changed files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant