---
id: WF-PFM-ELG-007
title: Simulate a draft and publish with its result
trigger: >-
  A publisher simulates the current draft against its latest release, then cites
  that result or chooses to skip simulation.
product_area: platform
module: eligibility
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
  - CAP-PFM-ELG-011
  - CAP-PFM-ELG-004
moves:
  - STATE-PFM-ELG-004
  - STATE-PFM-ELG-002
crosses:
  - SVC-PFM-ELG-eligibility
idempotency: >-
  Every simulation request creates new work. Publication accepts evidence only
  for the same draft identity and fingerprint.
concurrency: A later draft edit invalidates the running simulation as publication evidence.
hops:
  - 'n': 1
    actor_or_service: Simulation operation
    action: >-
      Collect recent ninety-day decision subjects and derived-role holders,
      bounded at 250,000, combine any selected scope and submit a comparison
      run.
    anchor: >-
      services-platform:modules/eligibility/services/simulation/submit-simulation.ts:submitSimulation
    seam: sync
    on_failure: Invalid preparation refuses submission.
    left_inconsistent: The draft remains untouched.
    observer: The publisher receives the explanation.
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/simulation/submit-simulation.ts:submitSimulation
  - 'n': 2
    actor_or_service: Population state machine
    action: >-
      Evaluate the selected subjects under both expressions without population
      pruning.
    anchor: >-
      services-platform:modules/eligibility/services/population/population-workflow.ts:populationWorkflow
    seam: state_machine
    on_failure: Run failure also fails the simulation.
    left_inconsistent: Failed comparison evidence cannot support a publication.
    observer: Population execution alarms expose the failure.
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/population/population-failure.ts:failPopulationRunOfJob
  - 'n': 3
    actor_or_service: Population task (finish)
    action: >-
      Store state counts, gain and loss samples limited to one hundred, cost and
      partial notices, draft fingerprint and affected consumers.
    anchor: >-
      services-platform:modules/eligibility/services/simulation/simulation-summary.ts:completeSimulation
    seam: state_machine
    on_failure: A failed completion settles the simulation as failed.
    left_inconsistent: Only the unsuccessful simulation remains.
    observer: The polling dialog shows progress and outcome.
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/simulation/simulation-summary.ts:simulationSummaryOf
  - 'n': 4
    actor_or_service: Publish dialog
    action: >-
      Display the completed impact and submit publication with its evidence or
      explicit skip choice.
    anchor: 'react-console:components/eligibility/governance/simulation-summary.tsx'
    seam: sync
    on_failure: 'Unfinished, foreign or stale evidence is rejected.'
    left_inconsistent: No release is created by a refused publication.
    observer: The publisher and change trail show the chosen evidence.
    provenance: observed
    source: >-
      services-platform:modules/eligibility/services/governance/publish.ts:publishDefinition
branches:
  - >-
    Providers without batch support make the comparison partial instead of
    rejecting simulation.
  - >-
    Publication can queue role checks for up to ten thousand newly qualifying
    subjects.
waits:
  - The publish dialog polls until simulation settles.
evidence:
  - >-
    services-platform at ad3f6a6: services/simulation/; services/population/;
    services/governance/publish.ts; docs/eligibility.md §15, §16.
  - >-
    react-console at baf6dae:
    components/eligibility/governance/publish-dialog.tsx,
    simulation-summary.tsx.
controls: [TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-DAT-005, 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-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---
# Simulate a draft and publish with its result

## What It Does

A publisher simulates the current draft against its latest release, then cites that result or chooses to skip simulation.

## The Flow

```mermaid
flowchart TD
  H1["Simulation operation" ]
  H2["Population state machine" ]
  H1 --> H2
  H3["Population task (finish)" ]
  H2 --> H3
  H4["Publish dialog" ]
  H3 --> H4
```

Collect recent ninety-day decision subjects and derived-role holders, bounded at 250,000, combine any selected scope and submit a comparison run. Evaluate the selected subjects under both expressions without population pruning. Store state counts, gain and loss samples limited to one hundred, cost and partial notices, draft fingerprint and affected consumers. Display the completed impact and submit publication with its evidence or explicit skip choice.

## When Something Fails

Invalid preparation refuses submission. The draft remains untouched. Run failure also fails the simulation. Failed comparison evidence cannot support a publication. A failed completion settles the simulation as failed. Only the unsuccessful simulation remains. Unfinished, foreign or stale evidence is rejected. No release is created by a refused publication.

## Open Design Questions

Providers without batch support make the comparison partial instead of rejecting simulation. Publication can queue role checks for up to ten thousand newly qualifying subjects.
