---
id: CAP-MBR-STR-020
title: 'Provision, migrate and remove membership setup'
feature: FEAT-MBR-STR-06
product_area: membership
module: structure
revision: 1
status: draft
product_intent: proposed
implementation_evidence: partially-observed
supersedes:
  - react-console acceptance inventory CAP-MBR-STR-013
  - react-console acceptance inventory CAP-MBR-STR-014
  - react-console acceptance inventory CAP-MBR-CFG-011
  - react-console acceptance inventory CAP-MBR-CFG-014
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources: []
purpose: 'Rhythm supplies the module’s contribution to workspace setup, migration, export and removal.'
outcomes:
  - Provisioning supplies standard relationship purposes without overwriting customer work.
  - 'Module data can participate in controlled loading, export and removal.'
concepts:
  - CON-MBR-STR-006
actors:
  - ACT-MBR-004
  - ACT-MBR-003
surfaces:
  - job
preconditions: []
postconditions: []
permissions:
  - key: membership.structure.manage
    where_checked: api
    scope: tenant
  - key: membership.programs.manage
    where_checked: api
    scope: tenant
  - key: membership.configuration.manage
    where_checked: api
    scope: tenant
rules:
  - id: BR-CAP-MBR-STR-020-01
    proved_by: [ATS-MBR-STR-007-09, ATS-MBR-STR-020-01, ATS-MBR-STR-020-09, TST-MBR-STR-004]
    statement: >-
      Provisioning applies four standard relationship kinds through the seed ledger once, leaving later
      customer changes untouched on repeat provisioning.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/lifecycle/structure-participant.integration.spec.ts#the
      structure participant in the database › seeds the four relationship types at provisioning
    origin: none
  - id: BR-CAP-MBR-STR-020-02
    proved_by: [ATS-MBR-STR-020-02, TST-MBR-STR-004]
    statement: >-
      Purge first requires Platform’s deleting state, then removes workspace structure records in batches with
      versions last and leaves other workspaces intact.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/lifecycle/structure-participant.integration.spec.ts#the
      structure participant in the database › refuses to purge a tenant Platform is not deleting, before any
      row is removed
    origin: none
  - id: BR-CAP-MBR-STR-020-03
    proved_by: [ATS-MBR-STR-020-03, TST-MBR-STR-004]
    statement: >-
      Reset requires a removable workspace state and removes unit data and versions while preserving unit and
      relationship kinds.
    kind: lifecycle
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/lifecycle/structure-participant.integration.spec.ts#the
      structure participant in the database › resets the tree of a tenant being reset and keeps its unit and
      relationship types
    origin: none
  - id: BR-CAP-MBR-STR-020-04
    proved_by: []
    statement: >-
      Development setup converges on five unit kinds, eight fixed-identity units and well-known membership
      configuration without deleting customer additions.
    kind: policy
    enforced_at:
      - service
    must_prove: false
    provenance: observed
    source: 'services-membership:modules/structure/services/well-known/well-known-structure.ts'
    origin: none
  - id: BR-CAP-MBR-STR-020-05
    proved_by: [ATS-MBR-STR-020-04, TST-MBR-STR-001]
    statement: >-
      Bulk structure loads match units by supported keys and load parents first, defer rebuilding until
      completion and reconcile history, ancestry, depths and placement kinds.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: >-
      services-membership:docs/migrations/structure/README.md#Routes, permissions, metadata, data operations,
      lifecycle, well-known objects
    origin: none
  - id: BR-CAP-MBR-STR-020-06
    proved_by: [ATS-MBR-STR-020-05, TST-MBR-STR-047]
    statement: >-
      Bulk program, type and package operations follow dependency order and reuse ordinary configuration
      validation, classifying failed items for rejection.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-membership:modules/configuration/services/data-operations/configuration-operations.ts:configurationDataOperations
    origin: none
  - id: BR-CAP-MBR-STR-020-07
    proved_by: [ATS-MBR-STR-020-06]
    statement: 'Bulk operations do not cover program unit requirements, reasons or change policy sets.'
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: >-
      services-membership:modules/configuration/services/data-operations/configuration-operations.ts:configurationDataOperations
    origin: none
  - id: BR-CAP-MBR-STR-020-08
    proved_by: []
    statement: >-
      Exports stream structure, owned information, classifications and versions while omitting derived tree
      pairs; configuration datasets describe programs, types, packages, policies and reasons.
    kind: policy
    enforced_at:
      - service
    must_prove: false
    provenance: observed
    source: 'services-membership:modules/structure/services/lifecycle/structure-participant.ts:structureParticipant'
    origin: none
  - id: BR-CAP-MBR-STR-020-09
    proved_by: [ATS-MBR-STR-020-07]
    statement: >-
      Structure purge leaves seed-ledger entries applied, so subsequent provisioning does not restore those
      relationship kinds.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: documented
    source: 'react-console:acceptance/membership/journeys/structure/MBR-ACC-0028.json'
    origin: none
  - id: BR-CAP-MBR-STR-020-10
    proved_by: [ATS-MBR-STR-020-08]
    statement: >-
      Structure loading keeps existing unit kinds, rejects unavailable kinds or parents, suppresses change
      events and rejects a completed rebuild reaching depth 32.
    kind: policy
    enforced_at:
      - service
    must_prove: true
    provenance: observed
    source: 'services-membership:modules/structure/services/tree/tree-loads.ts:loadUnit'
    origin: none
scenarios:
  - id: SC-CAP-MBR-STR-020-01
    given: Platform prepares a new customer workspace.
    when: The structure participant applies its provisioning contribution.
    then: 'The standard legal, operating, beneficiary and recipient relationship kinds are available.'
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/lifecycle/structure-participant.integration.spec.ts#the
      structure participant in the database › seeds the four relationship types at provisioning
edge_cases:
  - id: SC-CAP-MBR-STR-020-02
    given: Platform still considers the workspace active.
    when: Removal work invokes the structure purge.
    then: The state check rejects removal before any record is deleted.
    provenance: test
    source: >-
      services-membership:modules/structure/tests/integration/services/lifecycle/structure-participant.integration.spec.ts#the
      structure participant in the database › refuses to purge a tenant Platform is not deleting, before any
      row is removed
constraints: []
depends_on:
  - CAP-MBR-STR-002
  - CAP-MBR-STR-018
related:
  - CAP-MBR-STR-007
journeys: []
open_questions: []
evidence:
  - >-
    services-membership: Examination of the structure lifecycle participant, its row removal, the well-known
    structure, configuration data operations and export datasets.
  - >-
    services-membership: Examination of structure participant integration tests, acceptance journeys
    MBR-ACC-0028, 0029, 0110 and 0111.
  - 'services-membership: Examination of the structure record.'
  - 'react-console:acceptance/membership/journeys/structure/MBR-ACC-0028.json'
  - 'services-membership:docs/migrations/structure/README.md'
  - 'services-membership:modules/configuration/services/data-operations/configuration-operations.ts'
  - 'services-membership:modules/structure/services/lifecycle/structure-participant.ts'
  - 'services-membership:modules/structure/services/well-known/well-known-structure.ts'
  - >-
    services-membership:modules/structure/tests/integration/services/lifecycle/structure-participant.integration.spec.ts
controls: [TC-AVL-002, TC-AVL-003, TC-AVL-004, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-DAT-005, TC-DAT-007, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-SEC-001, TC-SEC-004, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004]
exercised_by: [FAS-MBR-STR-06-01, FAS-MBR-STR-06-02, FAS-MBR-STR-06-03, FAS-MBR-STR-06-04, FAS-MBR-STR-06-05]
suites: [TST-MBR-STR-001, TST-MBR-STR-004, TST-MBR-STR-047]
---

# Provision, migrate and remove membership setup

## Purpose

Rhythm supplies the module’s contribution to workspace setup, migration, export and removal.

## How It Works

Platform calls the module’s lifecycle contribution when a workspace is prepared or removed. Provisioning records the standard relationship purposes through the seed ledger. Repeating that call does not overwrite the customer’s later choices. Development setup supplies a recognizable association for local work. Migration definitions describe supported records and their dependency order. Configuration loading uses the ordinary record processes. Structure loading delays the complete tree rebuild until the load finishes. Reconciliation reports mismatches between stored placement information and the rebuilt structure. The service record says data-job routes and workers remain unwired, so these definitions do not establish a reachable migration submission flow. Export contributions describe owned data and omit derived tree pairs. Removal checks Platform’s workspace state before beginning batches. The product should complete migration wiring and resolve seed-ledger behavior before relying on reset and reprovisioning.

## Relationships

- Shared configuration processes validate bulk program, type and package writes.
- Structural placement and read capabilities supply the records and reconciliation checks.
- Platform orchestrates the lifecycle and data-job execution around this module.
