Releasing a sub-organization, and recovering its first-customer invitation

Who this guide is for: RESELLER PARTNERS (a designated reseller business that provisions sub-organizations) and the operators watching them. Release is an administrator action; recovery can be done by any active seat of the reseller.

Two journeys, both built on one promise: relationships change, records never lie.

  1. Release — end the reseller relationship with one provisioned sub-organization, detaching it cleanly while preserving everything the customer owns.
  2. First-customer invite recovery — when a sub-org's one-time first-customer invitation was revoked, expired, or its code lost, re-arm the same single invitation with a fresh one-time code.

Every organization, seat, invite and contact in the runs behind this guide is synthetic. No provider, payment, or production action of any kind occurred. These journeys were exercised at their database seam — the release and recovery engine functions, run over a real ordinary (NOSUPERUSER, NOBYPASSRLS) PostgreSQL 16 cluster with FORCE RLS — which is the exact engine the partner screens drive. A later supplementary browser run also drove both journeys through the real screen (see the final section); its honest standing — including the SHA-bound journey's FAILED entry expectation — is stated there and in the evidence section.


Evidence record (kept for honesty)

(The body above is customer guidance; the receipts below are the internal record.)

Two suites of the FULL3747-PG lane, each on its own fresh dedicated throwaway PostgreSQL 16 cluster, on the combined candidate:

Evidence standing: combined-candidate, local evidence; Chief acceptance and publication are OPEN. Earned shares referenced below are the frozen, immutable statement lineage keyed by provisioning provenance — no share is recomputed or rewritten by either journey.

Part 1 — Releasing a sub-organization

Who may release, and what is refused

Release is an admin-seat action of the releasing reseller, always with a reason and a caller-chosen request id. The refusal matrix the run proved — every refusal a PARTNER_RELEASE_* error with a proper status, and every refusal leaving every original relationship byte-identical:

Situation Refusal
A non-admin seat tries refused
The reseller's designation is disabled refused
The child belongs to a different reseller refused
The target was never provisioned under this reseller refused
The reason is blank/whitespace refused
The child still has its own descendants (a subtree) 409 PARTNER_RELEASE_SUBTREE_NOT_EMPTY — release inner orgs first

What a successful release changes — and what it never touches

The run released one provisioned child and verified, in storage:

Replay, races, and crashes

Receipts are immutable and isolated

Part 2 — Recovering a first-customer invitation

Each provisioned sub-org has exactly one first-customer invitation — a one-time capability with a hashed token and an expiry. Recovery re-arms that same row; it never creates a second invitation.

What is refused — and the original stays byte-identical

Situation Refusal
Inactive seat, or no seat at all refused
The child was already released/detached refused
Another reseller's invite refused
A consumed invitation refused — a claimed capability is never recoverable
An occupied child (it already has customer data) refused
The right child but a wrong invite id 404 FIRST_CUSTOMER_INVITE_NOT_FOUND — not a rotation

After every refusal, the invitation row's token hash, revoked/consumed stamps were re-read unchanged.

A successful recovery, exactly

For a revoked invitation, recovery returned:

An expired invitation re-arms the same way (state returns to unused), and so does a live-unused one — rotating a live-unused capability invalidates the never-shared old token too, so a possibly-leaked token cannot outlive its replacement.

Read states, races, crashes, boundaries

Both journeys through the real screen — supplementary proof (SUP-J3)

The browser lane's supplementary run drove both parts of this guide as a reseller lives them, in real Chromium on the same mounted candidate:

  1. Entry raises no factor prompt — the partner ledger view is a member-scope read (the honest recorded behavior, and the reason the SHA-bound journey 3 failed at its entry expectation; see the evidence section).
  2. Selecting the child raises the real prompt. The first privileged read — the invitation state behind the selected child — is factor-gated, and its refusal surfaces the product's authenticator prompt at selection time.
  3. With the factor held, both cards read back live state: the invitation state, and the release state reading linked.
  4. Release through the screen: confirm, type the reason, submit — one POST …/reseller/sub-orgs/{child}/release, answered 200, with the release receipt rendered.
  5. Recovery of the released relationship is refused on screen: after the release, asking for invitation recovery answers 404 with the error rendered — the "child already released/detached" refusal of Part 2, visible to the user — and no capability input is shown at all (there is nothing to re-arm).

After the real release: the released child's recovery refusal on screen — the 404 error rendered, no capability input, exactly as the refusal matrix promises

The screenshot is a byte-exact capture of the supplementary passing run (SHA256 and provenance in assets/ASSETS-MANIFEST.json). It is supplementary evidence — the SHA-bound journey 3 remains FAILED at its entry expectation and defect FULL3747-B-02 stays open. A small related UI fix (46fb35c8, partner cards' read-error re-read path) lives on the browser lane's branch, not on this guide branch's base. All data is synthetic.