---
id: STATE-PFM-ELG-005
title: Responsibility holding lifecycle
object: DOM-PFM-ELG-004
product_area: platform
module: eligibility
revision: 1
status: draft
design_intent: confirmed
origin: >-
  Responsibilities and attention architecture D-01, D-02 and D-07, approved by
  Andrew 2026-10-18 (PLAT-M15 "Decisions"); record-write standard W5 (idempotent
  creates); DEF-NT-0008 repair 2026-10-22
implementation_evidence: observed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
states:
  - name: scheduled
    meaning: >-
      The row is stored active, but its start is later than the current instant
      and it contributes no effective holder.
  - name: active
    meaning: >-
      The stored-active holding is currently within its window and participates
      in holder resolution.
  - name: lapsed
    meaning: >-
      The row remains stored active after its end but no longer contributes;
      lapsed is a read-time projection.
  - name: ended
    meaning: The holding was ended and retained with ending details.
  - name: removed
    meaning: >-
      A role default was removed and remains as an exclusion against future
      recreation.
transitions:
  - from: scheduled
    to: active
    trigger: Current instant reaches validity start
    guard: The half-open window has reached its start.
    side_effects:
      - Include the holder in subsequent responsibility and attention reads
    who: Time
    provenance: observed
    source: 'services-platform:modules/responsibilities/rules.ts:windowIncludes'
  - from: active
    to: lapsed
    trigger: Current instant reaches validity end
    guard: The current instant has reached the optional end.
    side_effects:
      - Exclude the holder
      - Refresh gap reporting on a later reconcile
    who: Time
    provenance: inferred
    source: 'services-platform:modules/responsibilities/rules.ts:windowIncludes'
  - from: active
    to: ended
    trigger: endResponsibilityAssignment
    guard: >-
      Management authority, direct or template origin and matching expected
      version.
    side_effects:
      - End attached cover atomically
      - Refresh affected gaps
      - Withdraw applicable unread assignment notice and publish ending notice
      - Attempt post-commit attention refresh
      - Audit ending
    who: Responsibility administrator
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/services/persistence/assignments.ts:endAssignment
  - from: scheduled
    to: ended
    trigger: endResponsibilityAssignment
    guard: Use the same stored-active and origin checks as manual ending.
    side_effects:
      - Apply the manual ending effects
    who: Responsibility administrator
    provenance: inferred
    source: >-
      services-platform:modules/responsibilities/services/persistence/assignments.ts:endAssignment
  - from: active
    to: removed
    trigger: removeResponsibilityRoleDefault
    guard: 'Management authority, role-default origin and matching expected version.'
    side_effects:
      - Retain its removal exclusion
      - Refresh affected gaps
      - Audit removal
    who: Responsibility administrator
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/services/persistence/assignments.ts:removeRoleDefaultAssignment
  - from: active
    to: ended
    trigger: Registration or reconcile retires a default declaration
    guard: Registration no longer declares this role default.
    side_effects:
      - Retain an ended row with the retirement reason
    who: Responsibility reconcile
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/services/persistence/assignments.ts:endRetiredRoleDefaultAssignments
  - from: active
    to: ended
    trigger: sync_derived_responsibilities omits an existing holding
    guard: The complete derived holder set omits this holding.
    side_effects:
      - End the row and audit within the source transaction
    who: Owning application
    provenance: observed
    source: >-
      services-platform:db/migrations/20261019011302_responsibilities.sql:platform.sync_derived_responsibilities
invalid:
  - from: ended
    to: active
    why: Ended holdings remain history; new accountability needs a new holding.
  - from: removed
    to: active
    why: A removed default is not restored by reconciliation.
  - from: active
    to: removed
    why: >-
      Removal is reserved for role defaults rather than direct or derived
      holdings.
concurrency: >-
  Ending and removal lock the row and require its read version. The direct
  uniqueness index compares exact validity endpoints and does not prohibit all
  overlaps. Derived synchronization serializes a derivation key.
invariants:
  - INV-DOM-PFM-ELG-004-02
  - INV-DOM-PFM-ELG-004-04
  - INV-DOM-PFM-ELG-004-05
  - INV-DOM-PFM-ELG-004-06
  - INV-DOM-PFM-ELG-004-08
  - INV-DOM-PFM-ELG-004-09
evidence:
  - >-
    services-platform at ad3f6a6:
    modules/responsibilities/services/persistence/assignments.ts,
    delegations.ts; rules.ts; services/reconcile/reconcile-tenant.ts;
    db/responsibility-assignments.table.ts; docs/responsibilities.md §3, §5, §6.
---
# Responsibility holding lifecycle

## The Lifecycle

```mermaid
stateDiagram-v2
  scheduled --> active
  active --> lapsed
  active --> ended
  scheduled --> ended
  active --> removed
```

## Transitions Explained

Effective dates project scheduled and lapsed standing over stored active rows. Ordinary ending preserves history, while derived and default changes have their own writers. Workspace purge and foreign-key deletion are exceptions to retention.

## What Cannot Happen

Ended holdings remain history; new accountability needs a new holding. A removed default is not restored by reconciliation. Removal is reserved for role defaults rather than direct or derived holdings.

## Concurrency and Timing

Ending and removal lock the row and require its read version. The direct uniqueness index compares exact validity endpoints and does not prohibit all overlaps. Derived synchronization serializes a derivation key.
