---
id: DOM-PFM-ELG-001
title: Eligibility Rule
realises: CON-PFM-ELG-001
product_area: platform
module: eligibility
revision: 1
status: draft
design_intent: confirmed
origin: >-
  Eligibility Engine architecture approved by Andrew 2026-10-17 (decision groups
  D-01/D-31/D-11/D-12 and D-13/D-10/D-14, recorded in PLAT-M11 "Decisions");
  governance and lifecycle chapter 14 of the same proposal; PLAT-M11 plan D1 to
  D8 (2026-10-21)
implementation_evidence: observed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
owned_by: SVC-PFM-ELG-eligibility
readable_by: []
lifecycle: STATE-PFM-ELG-001
custom_fields: none
identity: >-
  A rule has a workspace-scoped readable key fixed at creation. Each release
  also has a generated identity and a permanent version number.
attributes:
  - name: key
    kind: text
    required: true
    computed: false
    notes: >-
      The key uses lowercase words separated by single underscores, begins with
      a letter and fits within 63 characters. Reserved words and the system
      prefix are rejected; the legacy alias is still returned.
  - name: 'name, description and tags'
    kind: text
    required: true
    computed: false
    notes: >-
      A name is required and limited to 200 characters; description is optional
      with a 2,000-character limit, and tags can be empty with at most twenty
      entries.
  - name: owning application
    kind: reference
    required: true
    computed: false
    notes: >-
      Identifies the application responsible for the definition; staff-created
      rules can belong to the workspace.
  - name: reuse
    kind: enum
    required: true
    computed: false
    notes: >-
      Distinguishes private consumer rules from the shared workspace catalogue
      and platform rules. Broadening reuse requires publishing authority.
  - name: standing
    kind: enum
    required: true
    computed: false
    notes: >-
      Records active, deprecated or archived standing independently of
      individual release status.
  - name: replacement
    kind: reference
    required: false
    computed: false
    notes: >-
      Optionally directs staff from a deprecated rule to another active
      published rule. Restoration clears it.
  - name: portal message
    kind: text
    required: false
    computed: false
    notes: >-
      Optional member-facing wording for a closed-policy uncertain result,
      limited to 1,000 characters.
  - name: versions
    kind: collection
    required: false
    computed: false
    notes: >-
      Contains the editable draft and numbered releases, including expression,
      declarations, fingerprint, summary, effective interval, publication
      details and simulation choice. Summary and change-note limits are 4,000
      and 1,000 characters.
  - name: dependencies
    kind: collection
    required: false
    computed: false
    notes: >-
      Records the conditions, datasets, referenced releases and facts needed by
      each version. Draft changes replace the set; rollback copies it.
  - name: latest publication
    kind: reference
    required: false
    computed: true
    notes: >-
      Points to the most recent publication, which may differ from the release
      effective on a requested day.
  - name: problems
    kind: collection
    required: false
    computed: true
    notes: >-
      Save and validation return coded warnings and errors without a separate
      persisted problems record.
  - name: usage counts
    kind: computed
    required: false
    computed: true
    notes: >-
      Derives consumer-use and live-reference counts for discovery, detail,
      usage and archive checks.
  - name: vocabulary
    kind: collection
    required: true
    computed: false
    notes: >-
      Contains shared application declarations for conditions and consumer
      purposes, filtered to the workspace’s licensed applications when read.
relationships:
  - to: DOM-PFM-ELG-002
    cardinality: One definition supports multiple consumer uses.
    ownership: Each use holds its connection; active uses block definition archive.
    cross_service: false
  - to: DOM-PFM-ELG-003
    cardinality: One release can be retained by multiple decisions.
    ownership: Decision history preserves the evaluated release reference.
    cross_service: false
  - to: DOM-PFM-ELG-001
    cardinality: >-
      Definitions can reference multiple definitions, subject to
      twenty-reference and three-level validation limits.
    ownership: Each referencing version stores its own dependency rows.
    cross_service: false
invariants:
  - id: INV-DOM-PFM-ELG-001-01
    statement: >-
      The database makes keys unique within a workspace and validates their
      shape; service writes keep an existing key unchanged.
    enforced_at:
      - api
      - service
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/db/eligibility-definitions.table.ts:eligibility_definitions_id_configuration_id_check;
      services-platform:modules/eligibility/services/persistence/definitions.ts
  - id: INV-DOM-PFM-ELG-001-02
    statement: The draft uniqueness constraint permits only one draft for a rule.
    enforced_at:
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/db/eligibility-versions.table.ts:eligibility_versions_one_draft_uidx
  - id: INV-DOM-PFM-ELG-001-03
    statement: >-
      Service writes modify drafts only; released expressions cannot be edited
      or moved back to draft.
    enforced_at:
      - service
    provenance: observed
    source: 'services-platform:modules/eligibility/lifecycle.ts:VERSION_TRANSITIONS'
  - id: INV-DOM-PFM-ELG-001-04
    statement: >-
      Service publication rejects overlapping effective intervals among releases
      still marked published; superseded releases are excluded.
    enforced_at:
      - service
    provenance: observed
    source: 'services-platform:modules/eligibility/lifecycle.ts:rangesOverlap'
  - id: INV-DOM-PFM-ELG-001-05
    statement: >-
      Publication rechecks that the validated expression still matches the draft
      inside its transaction.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/governance/publish.ts:publishDefinition
  - id: INV-DOM-PFM-ELG-001-06
    statement: >-
      Archived rules reject draft editing and new uses; deprecated rules
      continue serving existing uses but reject new ones.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/eligibility/lifecycle.ts:bindingCompatibilityRefusal
  - id: INV-DOM-PFM-ELG-001-07
    statement: >-
      Archiving requires no active consumer use and no draft or published
      reference from a live rule.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/governance/lifecycle.ts:archiveDefinitionByKey
  - id: INV-DOM-PFM-ELG-001-08
    statement: A replacement reference cannot point back to its own rule.
    enforced_at:
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/db/eligibility-definitions.table.ts:eligibility_definitions_replaced_by_check
  - id: INV-DOM-PFM-ELG-001-09
    statement: >-
      Accepted rule mutations write their attributable change event atomically;
      a refused mutation writes none.
    enforced_at:
      - service
    provenance: observed
    source: 'services-platform:modules/eligibility/services/governance/change-trail.ts'
physical:
  - platform.eligibility_definitions
  - platform.eligibility_versions
  - platform.eligibility_dependencies
  - platform.eligibility_condition_types
  - platform.eligibility_consumer_kinds
  - platform.eligibility_migration_reviews
evidence:
  - >-
    services-platform at ad3f6a6: modules/eligibility/lifecycle.ts;
    db/eligibility-definitions.table.ts, eligibility-versions.table.ts,
    eligibility-dependencies.table.ts, eligibility-condition-types.table.ts,
    eligibility-consumer-kinds.table.ts, eligibility-migration-reviews.table.ts;
    services/model/authoring.ts; services/governance/publish.ts, lifecycle.ts,
    change-trail.ts; docs/eligibility.md §1, §2, §6, §7;
    docs/proposals/eligibility/17-decision-register.md;
    docs/milestones/PLAT-M11-eligibility-rules.md (Decisions).
  - >-
    react-console at baf6dae: components/eligibility/definition-editor.tsx;
    lib/eligibility/types.ts.
---
# Eligibility Rule

## What It Models

An eligibility rule expresses reusable qualification logic independently of the application decision that applies it.

## Identity and Attributes

The definition holds its identity and descriptive information; versions hold executable expressions and release periods.

## Relationships

Consumer uses select the rule and its policy. Referenced rules supply reusable expression fragments.

## Invariants

The structured invariants distinguish database uniqueness from service lifecycle enforcement.

## How It Is Stored and Shared

Eligibility owns definitions, versions, dependencies and vocabulary. Other services consume its contracts rather than own those records. The registration enables no custom fields for this object.

## Open Design Questions

Database range exclusion and consistent version preconditions remain recorded gaps. Existing product decisions remain the authority for the intended behavior.
