---
id: DOM-PFM-ELG-004
title: Responsibility
realises: CON-PFM-ELG-004
product_area: platform
module: eligibility
revision: 1
status: draft
design_intent: confirmed
origin: >-
  Responsibilities and attention architecture D-01 to D-13 approved by Andrew
  2026-10-18 as recommended (recorded in PLAT-M15 "Decisions"), in particular
  D-01 (own module, never read by the authorizer), D-02 (role defaults as rows)
  and D-07 (delegation in phase 1); PLAT-M23 D3 for the notices; record-write
  standard rule W5 for the idempotent create (DEF-NT-0008, 2026-10-22)
implementation_evidence: observed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
owned_by: SVC-PFM-ELG-responsibilities
readable_by:
  - SVC-PFM-ELG-attention
lifecycle: STATE-PFM-ELG-005
custom_fields: none
identity: >-
  Application declarations name responsibility areas. Generated holding and
  cover identities track who looks after them; direct-holding uniqueness
  compares the exact scope and validity endpoints.
attributes:
  - name: area
    kind: reference
    required: true
    computed: false
    notes: >-
      An application declaration supplies the label, category, allowed scopes,
      expected-holder policy, fallback, wider coverage, backup visibility,
      derivable fields and registry standing.
  - name: role defaults
    kind: collection
    required: false
    computed: false
    notes: >-
      Declares role-to-area defaults and their scope kinds as a complete
      registration set.
  - name: holder
    kind: reference
    required: true
    computed: false
    notes: >-
      Exactly one user, role or team reference is stored. User holders must
      belong to the customer; current service writes refuse teams.
  - name: scope
    kind: reference
    required: true
    computed: false
    notes: >-
      Identifies the workspace or a resource of a scope kind permitted by the
      area.
  - name: kind
    kind: enum
    required: true
    computed: false
    notes: Distinguishes primary from backup accountability.
  - name: origin
    kind: enum
    required: true
    computed: false
    notes: >-
      Identifies direct, role-default, derived or template origin; template
      creation is not implemented.
  - name: validity
    kind: date
    required: true
    computed: false
    notes: >-
      Holds a start and optional later end; effective reads use a half-open
      interval.
  - name: standing
    kind: enum
    required: true
    computed: false
    notes: >-
      Tracks active, ended or removed status, with removal reserved for role
      defaults.
  - name: cover arrangement
    kind: collection
    required: false
    computed: false
    notes: >-
      Connects a stored-active personal holding to another active colleague for
      a one-hour to ninety-day cover window. It cannot pass the holding’s end,
      but creation does not check its start.
  - name: uncovered area
    kind: collection
    required: false
    computed: true
    notes: >-
      Tracks always-held areas without an effective workspace primary and when
      each gap opens or clears.
  - name: effective holders
    kind: computed
    required: false
    computed: true
    notes: >-
      Computes effective primary and backup holders, broader coverage, cover
      arrangements and fallback holders for a scope chain.
  - name: idempotency key
    kind: text
    required: false
    computed: false
    notes: >-
      Stores an optional create key and request fingerprint internally for
      replay detection.
relationships:
  - to: DOM-PFM-ELG-005
    cardinality: Each responsibility area can be named by multiple attention occurrences.
    ownership: >-
      Attention owns the audience reference; responsibility storage does not
      hold item references.
    cross_service: false
invariants:
  - id: INV-DOM-PFM-ELG-004-01
    statement: >-
      Responsibility holdings grant no permission; tests guard their exclusion
      from authorization imports.
    enforced_at:
      - service
    provenance: test
    source: 'services-platform:tests/unit/responsibilities-not-in-authorization.spec.ts'
  - id: INV-DOM-PFM-ELG-004-02
    statement: >-
      The database rejects active direct duplicates with identical holder, area,
      scope and both endpoints; unequal overlapping windows are permitted.
    enforced_at:
      - database
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/db/responsibility-assignments.table.ts:responsibility_assignments_live_holder_uidx
  - id: INV-DOM-PFM-ELG-004-03
    statement: >-
      Each holding has one holder; database validation checks the user’s
      customer and whether the area permits its resource scope.
    enforced_at:
      - database
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/db/responsibility-assignments.table.ts:responsibility_assignments_subject_check
  - id: INV-DOM-PFM-ELG-004-04
    statement: >-
      Reusing a create key for identical input returns the existing holding;
      changed input under that key is refused.
    enforced_at:
      - service
      - database
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/db/responsibility-assignments.table.ts:responsibility_assignments_idempotency_uidx
  - id: INV-DOM-PFM-ELG-004-05
    statement: >-
      A removed role-default row prevents registration and reconciliation from
      recreating that default.
    enforced_at:
      - database
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/db/responsibility-assignments.table.ts:responsibility_assignments_role_default_uidx
  - id: INV-DOM-PFM-ELG-004-06
    statement: >-
      Manual ending permits direct and template holdings and ends their cover
      atomically; derived and role-default holdings are refused.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/services/persistence/assignments.ts:endAssignment
  - id: INV-DOM-PFM-ELG-004-07
    statement: >-
      Cover creation requires a stored-active personal holding, an active
      colleague of the same customer and a bounded window; it does not constrain
      the start to the holding’s start.
    enforced_at:
      - service
      - database
    provenance: observed
    source: 'services-platform:modules/responsibilities/rules.ts:checkDelegationWindow'
  - id: INV-DOM-PFM-ELG-004-08
    statement: >-
      Direct creation, manual ending and default removal refresh affected gap
      rows atomically; derived synchronization does not refresh them.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/responsibilities/services/persistence/assignments.ts:refreshUnassignedFor
  - id: INV-DOM-PFM-ELG-004-09
    statement: >-
      Ordinary ending retains and audits history, while workspace purge and
      foreign-key deletion can remove rows.
    enforced_at:
      - service
      - database
    provenance: observed
    source: >-
      services-platform:db/migrations/20261019011302_responsibilities.sql:platform.sync_derived_responsibilities
physical:
  - platform.responsibility_definitions
  - platform.responsibility_role_defaults
  - platform.responsibility_assignments
  - platform.responsibility_delegations
  - platform.unassigned_responsibilities
  - platform.responsibility_reconcile_jobs
  - platform.responsibility_reconcile_job_steps
  - platform.responsibility_reconcile_job_events
evidence:
  - >-
    services-platform at ad3f6a6: modules/responsibilities/db/*.table.ts;
    rules.ts; services/persistence/assignments.ts, delegations.ts;
    services/reconcile/; services/registration/; services/notices/;
    docs/responsibilities.md;
    tests/unit/responsibilities-not-in-authorization.spec.ts;
    docs/proposals/responsibilities-and-attention/16-decisions.md;
    docs/milestones/PLAT-M15-home-attention-and-responsibilities.md.
  - >-
    react-console at baf6dae: components/responsibilities/;
    lib/responsibilities/.
---
# Responsibility

## What It Models

A responsibility expresses accountability rather than access to a feature or record.

## Identity and Attributes

Declarations describe areas; holdings and cover describe the people expected to look after them over time.

## Relationships

Attention names areas as audiences and resolves their effective holders through this service.

## Invariants

Stored-active status and effective dates are distinct; the constraints do not prohibit every overlapping interval.

## How It Is Stored and Shared

Responsibilities owns declarations, defaults, holdings, cover and gap rows. Attention reads effective holders. No custom-field capability is enabled.

## Open Design Questions

Derived and template cover exceed the direct-only planning wording. Overlapping holdings, cover timing and delayed derived gap refresh need explicit treatment before preparation.
