---
id: DOM-PFM-ELG-002
title: Rule Use
realises: CON-PFM-ELG-002
product_area: platform
module: eligibility
revision: 1
status: draft
design_intent: confirmed
origin: >-
  Eligibility Engine architecture approved by Andrew 2026-10-17 (D-08 fail
  policy, D-27 private rules, D-31 plans for in-process evaluation, recorded in
  PLAT-M11 "Decisions"); PLAT-M11 plan D4 (refuse unless forced) and D6 (the
  product card), 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-003
custom_fields: none
identity: >-
  A generated use identity connects one consumer application, purpose and record
  reference to a rule. The workspace uniqueness constraint prevents duplicating
  that same connection.
attributes:
  - name: consumer
    kind: reference
    required: true
    computed: false
    notes: >-
      Names the consumer application, declared purpose and its record reference,
      with a readable usage label.
  - name: rule
    kind: reference
    required: true
    computed: false
    notes: Identifies the definition evaluated by this connection.
  - name: version choice
    kind: enum
    required: true
    computed: false
    notes: >-
      Either follows the published release effective on the evaluation day or
      pins a published or superseded release.
  - name: parameters
    kind: collection
    required: true
    computed: false
    notes: >-
      Supplies declared parameter values with type, collection, choice and bound
      validation; required values without defaults must be supplied.
  - name: uncertainty policy
    kind: enum
    required: true
    computed: false
    notes: >-
      Selects closed, open-with-review or defer behavior, using the purpose
      default unless overridden.
  - name: availability
    kind: enum
    required: true
    computed: false
    notes: Stores active or suspended availability.
  - name: evaluation plan
    kind: computed
    required: false
    computed: true
    notes: >-
      Provides a compiled plan with reporting statements, provider steps and
      SQL-only form, keyed by input fingerprint. Optional caches sit above its
      durable copy; the plan version tag supports not-modified replies.
  - name: version read
    kind: number
    required: true
    computed: false
    notes: Carries the current record version required by change requests.
relationships:
  - to: DOM-PFM-ELG-001
    cardinality: Multiple uses can select one definition.
    ownership: The use stores the definition link and active connections block archive.
    cross_service: false
  - to: DOM-PFM-ELG-003
    cardinality: One use can produce multiple recorded evaluations.
    ownership: Decision history survives deletion of its originating use.
    cross_service: false
invariants:
  - id: INV-DOM-PFM-ELG-002-01
    statement: A workspace cannot store the same consumer-to-rule connection twice.
    enforced_at:
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/db/eligibility-bindings.table.ts:eligibility_bindings_consumer_uq
  - id: INV-DOM-PFM-ELG-002-02
    statement: Pinned uses require a release number; following uses must omit it.
    enforced_at:
      - service
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/db/eligibility-bindings.table.ts:eligibility_bindings_pin_check
  - id: INV-DOM-PFM-ELG-002-03
    statement: >-
      A new or changed pin must select a published or superseded release
      belonging to this rule.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/eligibility/lifecycle.ts:bindingCompatibilityRefusal
  - id: INV-DOM-PFM-ELG-002-04
    statement: >-
      Creation and change check compatibility with the purpose and selected
      expression, then recheck publication changes while holding the rule lock.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/bindings/consumer-bindings.ts:bindDefinition
  - id: INV-DOM-PFM-ELG-002-05
    statement: Evaluation rejects suspended uses instead of reporting them ineligible.
    enforced_at:
      - service
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/evaluate/hosted-evaluate.ts:prepareEvaluations
  - id: INV-DOM-PFM-ELG-002-06
    statement: >-
      Removing a use deletes associated plans without deleting its retained
      decision history.
    enforced_at:
      - service
      - database
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/bindings/consumer-bindings.ts:unbind
  - id: INV-DOM-PFM-ELG-002-07
    statement: >-
      Console plan responses omit internal statements, providers and explanation
      templates; service consumers receive the full plan.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/compile/binding-plan.ts:redactBindingPlan
physical:
  - platform.eligibility_bindings
  - platform.eligibility_plans
evidence:
  - >-
    services-platform at ad3f6a6: db/eligibility-bindings.table.ts,
    eligibility-plans.table.ts; binding-fit.ts; lifecycle.ts;
    services/bindings/consumer-bindings.ts; services/compile/plan-cache.ts,
    binding-plan.ts; aws/api/bindings.routes.ts, eligibility-service.routes.ts;
    docs/eligibility.md §7.7, §8.3, §10.1.
  - >-
    react-console at baf6dae:
    components/eligibility/embeds/eligibility-card.tsx, use-consumer-binding.ts.
---
# Rule Use

## What It Models

A rule use applies shared qualification logic to a particular application decision.

## Identity and Attributes

It combines the consumer reference, release selection, parameters, uncertainty policy and availability.

## Relationships

Eligibility owns the connection; the consuming application retains its own business record.

## Invariants

Compatibility is a service check, while uniqueness and pin shape also have database constraints.

## How It Is Stored and Shared

Eligibility stores uses and plans. Applications call its evaluation and binding contracts; neither record declares custom fields.

## Open Design Questions

Changing products between rules is not atomic in the current browser orchestration, and ownership checks on the consumer record remain a planning disagreement.
