← Back to Pack Library
Example Bindingsbindinguncertifiedv2026.12.0

acme

Acme Healthcare binding pack (RFC 0004): maps staffing-core, us-federal, and us-ca concepts onto Acme's custom nurse/assignment/site entity graph, tightens Form I-9 deadlines, and adds Acme employee handbook and clinical TB attestation requirements.

Verify locally with CLI
Validate schema & rules
pnpm ir check packs/acme/pack.json
Run pack scenarios
pnpm ir test packs/acme/pack.json
3Requirements
1Concepts
12Bindings
3Entity Types
7Scenarios

Requirements (3)

Compliance and operational rules declared in this pack's policies, with authority classification, legal citations, and due/renewal schedules.

Form I-9 — Employment Eligibility Verification (Sections 1 & 2, Acme Tightened SLA)

federal_i9
documenteligibility
Duesubject: engagement/start_date (-1d) · reviewer: engagement/start_date (+1bd)
Citations
  • 8 USC 1324a
  • 8 CFR 274a.2(b)(1)(i)(A)
  • 8 CFR 274a.2(b)(1)(ii)(B)
  • 8 CFR 274a.2(c)(1)
  • Acme Policy HR-102 (1-business-day I-9 SLA)

Acme Healthcare Employee Handbook Acknowledgment

acme_handbook
documentacme_company
Duenurse: engagement/start_date (on day)
Citations
  • Acme Policy HR-101

Acme Clinical TB Screening and Clearance Attestation

acme_tb_attestation
documentacme_clinical
Duenurse: engagement/start_date (-3d) · credentialing: engagement/start_date (-1d)
Expires1 year
Renew within30 days
Citations
  • Acme Clinical Policy CL-204
  • CDC TB Screening Guidelines

Concepts (1)

Typed domain facts introduced by this pack that policies evaluate against.

ConceptTypeChoices / Description
acme/patient_facingboolean

Whether the Acme assignment is at a patient-facing clinical site

Bindings (12)

Mappings from abstract library concepts to concrete entity graph paths.

ConceptEntity PathDefault & Notes
work/location_stateassignment.site->site.state

Work state from the assignment's linked clinical site

work/location_countryassignment.site->site.country

Work country from the assignment's linked clinical site

work/is_remoteassignment.is_remote

Whether the assignment is performed remotely

engagement/start_dateassignment.starts_on

First day of the nurse's assignment

engagement/classificationassignment.employment_type

W-2 or 1099 classification on the assignment

engagement/reviewerassignment.credentialing_owner

Acme credentialing specialist reviewing employer sections

engagement/employer_idassignment.legal_entity_id

Acme hiring legal entity identifier for document reuse scoping

engagement/everify_enrolledassignment.site->site.everify_participating

Whether the linked site participates in DHS/USCIS E-Verify

principal/is_rehireassignment.nurse->nurse.is_rehire

Whether the linked nurse was previously employed by Acme

principal/residence_stateassignment.nurse->nurse.home_state

Primary state of residence on the linked nurse entity

principal/work_authorized_usassignment.nurse->nurse.us_work_authorized

US work authorization flag on the linked nurse entity

acme/patient_facingassignment.site->site.patient_facing

Whether the linked site requires clinical patient-facing clearance

Entity Types (3)

JSON Schema object definitions and typed x-ref edges shipped in this pack.

nursev1
full_name*string
email*string
home_state*string
is_rehire*boolean
prior_assignmentsinteger
us_work_authorizedboolean
specialtystring
license_numberstring
statusstring
assignmentv1
legal_entity_id*string
employment_type*string
starts_on*string
is_remoteboolean
credentialing_ownerstring
clinical_unitstring
statusstring
sitev1
name*string
state*string
country*string
everify_participating*boolean
patient_facing*boolean

Scenarios (7)

Executable compliance test cases verified against this pack by pnpm ir test.

acme-ca-nurse-new-hire
as of 2026-12-011 step

New W-2 nurse assigned to a patient-facing E-Verify California site requires federal, California, and Acme documents with tightened I-9 due dates; completing I-9 unlocks E-Verify.

Given facts
assignment (asgn_ca_01)=legal_entity_id=emp_acme_health, employment_type=w2, starts_on=2026-12-07, is_remote=falsenurse (nurse_01)=full_name=Elena Alvarez, email=elena.alvarez@example.test, home_state=CA, is_rehire=falsesite (site_sf_01)=name=Bayview Medical Center, state=CA, country=US, everify_participating=true
Expected outcomes
+ federal_i9+ federal_w4+ federal_everify+ ca_de4+ ca_wage_theft_notice+ ca_harassment_training+ acme_handbook+ acme_tb_attestationfederal_i9: availablefederal_w4: availablefederal_everify: waitingca_de4: availableca_wage_theft_notice: availableca_harassment_training: availableacme_handbook: availableacme_tb_attestation: available
acme-work-state-change-nv-to-ca
as of 2026-12-011 step

Assignment starts at a Nevada site (no CA requirements); updating site.state from NV to CA partway through onboarding triggers DE 4, Wage Theft Notice, and SB 1343 training.

Given facts
assignment (asgn_move_01)=legal_entity_id=emp_acme_health, employment_type=w2, starts_on=2026-12-14, is_remote=falsenurse (nurse_02)=full_name=Marcus Chen, email=marcus.chen@example.test, home_state=NV, is_rehire=falsesite (site_west_01)=name=Sierra Regional Clinic, state=NV, country=US, everify_participating=false
Expected outcomes
+ federal_i9+ federal_w4+ acme_handbook+ acme_tb_attestation− federal_everify− ca_de4− ca_wage_theft_notice− ca_harassment_trainingfederal_i9: availablefederal_w4: availableacme_handbook: availableacme_tb_attestation: available
acme-rehire-i9-reuse
as of 2026-12-01

Rehired nurse at an Acme California site reuses prior Form I-9 with needs_update (Supplement B), satisfies W-4, DE 4, handbook, and TB attestation via reuse, and skips E-Verify.

Given facts
assignment (asgn_rehire_01)=legal_entity_id=emp_acme_health, employment_type=w2, starts_on=2026-12-10, is_remote=falsenurse (nurse_rehire_01)=full_name=Priya Patel, email=priya.patel@example.test, home_state=CA, is_rehire=truesite (site_la_01)=name=Pacific Coast Hospital, state=CA, country=US, everify_participating=true
Expected outcomes
+ federal_i9+ federal_w4+ ca_de4+ ca_wage_theft_notice+ ca_harassment_training+ acme_handbook+ acme_tb_attestation− federal_everifyfederal_i9: availablefederal_w4: completeca_de4: completeca_wage_theft_notice: availableca_harassment_training: availableacme_handbook: completeacme_tb_attestation: complete
acme-non-patient-facing-admin-site
as of 2026-12-01

W-2 nurse assigned to a non-patient-facing Texas admin site skips clinical TB attestation, California forms, and E-Verify.

Given facts
assignment (asgn_tx_01)=legal_entity_id=emp_acme_health, employment_type=w2, starts_on=2026-12-14, is_remote=truenurse (nurse_03)=full_name=Devon Brooks, email=devon.brooks@example.test, home_state=TX, is_rehire=falsesite (site_tx_admin)=name=Austin Operations Hub, state=TX, country=US, everify_participating=false
Expected outcomes
+ federal_i9+ federal_w4+ acme_handbook− federal_everify− ca_de4− ca_wage_theft_notice− ca_harassment_training− acme_tb_attestationfederal_i9: availablefederal_w4: availableacme_handbook: available
acme-1099-contractor-clinical
as of 2026-12-01

1099 clinician at a patient-facing California site skips W-2 federal and California tax/eligibility forms but still requires Acme handbook and TB attestation.

Given facts
assignment (asgn_1099_01)=legal_entity_id=emp_acme_health, employment_type=1099, starts_on=2026-12-14, is_remote=falsenurse (nurse_04)=full_name=Sora Takahashi, email=sora.takahashi@example.test, home_state=CA, is_rehire=falsesite (site_ca_02)=name=Golden Gate Surgical Center, state=CA, country=US, everify_participating=true
Expected outcomes
+ acme_handbook+ acme_tb_attestation− federal_i9− federal_w4− federal_everify− ca_de4− ca_wage_theft_notice− ca_harassment_trainingacme_handbook: availableacme_tb_attestation: available
acme-tb-expiry-and-renewal
as of 2026-12-011 step

Completed TB attestation within 30 days of its 1-year expiry opens a renewal item; advancing past the expiry date marks the original TB attestation expired.

Given facts
assignment (asgn_tb_01)=legal_entity_id=emp_acme_health, employment_type=1099, starts_on=2026-12-07, is_remote=falsenurse (nurse_05)=full_name=Hannah Lindqvist, email=hannah.lindqvist@example.test, home_state=OR, is_rehire=truesite (site_or_01)=name=Willamette Valley Hospital, state=OR, country=US, everify_participating=false
Expected outcomes
+ acme_handbook+ acme_tb_attestation+ acme_tb_attestation:renewalacme_handbook: completeacme_tb_attestation: completeacme_tb_attestation:renewal: available
acme-missing-site-link-tentative
as of 2026-12-01

When an assignment has no linked site yet, site-derived concepts are unresolved and dependent federal, California, and TB requirements are blocked_on_facts.

Given facts
assignment (asgn_nosite_01)=legal_entity_id=emp_acme_health, employment_type=w2, starts_on=2026-12-14, is_remote=falsenurse (nurse_06)=full_name=Noah Williams, email=noah.williams@example.test, home_state=CA, is_rehire=false
Expected outcomes
+ federal_i9+ federal_w4+ federal_everify+ ca_de4+ ca_wage_theft_notice+ ca_harassment_training+ acme_handbook+ acme_tb_attestationacme_handbook: availablefederal_i9: blocked_on_factsca_de4: blocked_on_factsacme_tb_attestation: blocked_on_facts

Pack JSON

Show raw packs/acme/pack.json
{
  "format": 1,
  "name": "acme",
  "version": "2026.12.0",
  "kind": "binding",
  "description": "Acme Healthcare binding pack (RFC 0004): maps staffing-core, us-federal, and us-ca concepts onto Acme's custom nurse/assignment/site entity graph, tightens Form I-9 deadlines, and adds Acme employee handbook and clinical TB attestation requirements.",
  "requires": [
    {
      "name": "staffing-core",
      "range": "^2026.12"
    },
    {
      "name": "us-federal",
      "range": "^2026.12"
    },
    {
      "name": "us-ca",
      "range": "^2026.12"
    }
  ],
  "concepts": [
    {
      "key": "acme/patient_facing",
      "type": "boolean",
      "description": "Whether the Acme assignment is at a patient-facing clinical site"
    }
  ],
  "bindings": [
    {
      "concept": "work/location_state",
      "path": "assignment.site->site.state",
      "description": "Work state from the assignment's linked clinical site"
    },
    {
      "concept": "work/location_country",
      "path": "assignment.site->site.country",
      "description": "Work country from the assignment's linked clinical site"
    },
    {
      "concept": "work/is_remote",
      "path": "assignment.is_remote",
      "description": "Whether the assignment is performed remotely"
    },
    {
      "concept": "engagement/start_date",
      "path": "assignment.starts_on",
      "description": "First day of the nurse's assignment"
    },
    {
      "concept": "engagement/classification",
      "path": "assignment.employment_type",
      "description": "W-2 or 1099 classification on the assignment"
    },
    {
      "concept": "engagement/reviewer",
      "path": "assignment.credentialing_owner",
      "description": "Acme credentialing specialist reviewing employer sections"
    },
    {
      "concept": "engagement/employer_id",
      "path": "assignment.legal_entity_id",
      "description": "Acme hiring legal entity identifier for document reuse scoping"
    },
    {
      "concept": "engagement/everify_enrolled",
      "path": "assignment.site->site.everify_participating",
      "description": "Whether the linked site participates in DHS/USCIS E-Verify"
    },
    {
      "concept": "principal/is_rehire",
      "path": "assignment.nurse->nurse.is_rehire",
      "description": "Whether the linked nurse was previously employed by Acme"
    },
    {
      "concept": "principal/residence_state",
      "path": "assignment.nurse->nurse.home_state",
      "description": "Primary state of residence on the linked nurse entity"
    },
    {
      "concept": "principal/work_authorized_us",
      "path": "assignment.nurse->nurse.us_work_authorized",
      "description": "US work authorization flag on the linked nurse entity"
    },
    {
      "concept": "acme/patient_facing",
      "path": "assignment.site->site.patient_facing",
      "description": "Whether the linked site requires clinical patient-facing clearance"
    }
  ],
  "entity_types": [
    {
      "kind": "nurse",
      "version": "1",
      "schema": {
        "type": "object",
        "properties": {
          "full_name": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "home_state": {
            "type": "string",
            "enum": [
              "AL",
              "AK",
              "AZ",
              "AR",
              "CA",
              "CO",
              "CT",
              "DE",
              "DC",
              "FL",
              "GA",
              "HI",
              "ID",
              "IL",
              "IN",
              "IA",
              "KS",
              "KY",
              "LA",
              "ME",
              "MD",
              "MA",
              "MI",
              "MN",
              "MS",
              "MO",
              "MT",
              "NE",
              "NV",
              "NH",
              "NJ",
              "NM",
              "NY",
              "NC",
              "ND",
              "OH",
              "OK",
              "OR",
              "PA",
              "PR",
              "RI",
              "SC",
              "SD",
              "TN",
              "TX",
              "UT",
              "VT",
              "VA",
              "WA",
              "WV",
              "WI",
              "WY"
            ]
          },
          "is_rehire": {
            "type": "boolean"
          },
          "prior_assignments": {
            "type": "integer",
            "minimum": 0
          },
          "us_work_authorized": {
            "type": "boolean"
          },
          "specialty": {
            "type": "string",
            "enum": [
              "ICU",
              "ER",
              "OR",
              "MedSurg",
              "NICU"
            ]
          },
          "license_number": {
            "type": "string",
            "x-sensitivity": "pii"
          },
          "status": {
            "type": "string",
            "enum": [
              "onboarding",
              "active",
              "inactive"
            ]
          }
        },
        "required": [
          "full_name",
          "email",
          "home_state",
          "is_rehire"
        ],
        "additionalProperties": false
      }
    },
    {
      "kind": "assignment",
      "version": "1",
      "schema": {
        "type": "object",
        "properties": {
          "legal_entity_id": {
            "type": "string",
            "minLength": 1
          },
          "employment_type": {
            "type": "string",
            "enum": [
              "w2",
              "1099"
            ]
          },
          "starts_on": {
            "type": "string",
            "format": "date"
          },
          "is_remote": {
            "type": "boolean"
          },
          "credentialing_owner": {
            "type": "string"
          },
          "clinical_unit": {
            "type": "string",
            "enum": [
              "icu",
              "er",
              "medsurg",
              "admin"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "completed",
              "cancelled"
            ]
          }
        },
        "required": [
          "legal_entity_id",
          "employment_type",
          "starts_on"
        ],
        "additionalProperties": false
      }
    },
    {
      "kind": "site",
      "version": "1",
      "schema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "AL",
              "AK",
              "AZ",
              "AR",
              "CA",
              "CO",
              "CT",
              "DE",
              "DC",
              "FL",
              "GA",
              "HI",
              "ID",
              "IL",
              "IN",
              "IA",
              "KS",
              "KY",
              "LA",
              "ME",
              "MD",
              "MA",
              "MI",
              "MN",
              "MS",
              "MO",
              "MT",
              "NE",
              "NV",
              "NH",
              "NJ",
              "NM",
              "NY",
              "NC",
              "ND",
              "OH",
              "OK",
              "OR",
              "PA",
              "PR",
              "RI",
              "SC",
              "SD",
              "TN",
              "TX",
              "UT",
              "VT",
              "VA",
              "WA",
              "WV",
              "WI",
              "WY"
            ]
          },
          "country": {
            "type": "string",
            "enum": [
              "US",
              "CA",
              "GB",
              "MX",
              "OTHER"
            ]
          },
          "everify_participating": {
            "type": "boolean"
          },
          "patient_facing": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "state",
          "country",
          "everify_participating",
          "patient_facing"
        ],
        "additionalProperties": false
      }
    }
  ],
  "templates": [
    {
      "key": "acme_handbook_ack",
      "version": "2026.1.0",
      "title": "Acme Healthcare Employee Handbook Acknowledgment",
      "roles": [
        {
          "name": "nurse",
          "kind": "person",
          "label": "Clinician"
        }
      ],
      "sections": [
        {
          "id": "handbook",
          "role": "nurse",
          "title": "Handbook Receipt and Acknowledgment",
          "fields": [
            {
              "id": "handbook_edition",
              "type": "choice",
              "label": "Handbook Edition Reviewed",
              "options": [
                "2026_national",
                "2026_california_addendum"
              ],
              "required": true
            },
            {
              "id": "acknowledged",
              "type": "boolean",
              "label": "I have received, read, and agree to follow the Acme Healthcare Employee Handbook.",
              "required": true
            }
          ],
          "signature": {
            "id": "nurse_handbook_signature",
            "attestation": "I acknowledge receipt of the Acme Healthcare Employee Handbook.",
            "covers": [
              "handbook"
            ]
          }
        }
      ]
    },
    {
      "key": "acme_tb_attestation",
      "version": "2026.1.0",
      "title": "Acme Clinical TB Screening and Clearance Attestation",
      "roles": [
        {
          "name": "nurse",
          "kind": "person",
          "label": "Clinician"
        },
        {
          "name": "credentialing",
          "kind": "user",
          "label": "Credentialing Specialist",
          "after": [
            "nurse"
          ]
        }
      ],
      "sections": [
        {
          "id": "screening",
          "role": "nurse",
          "title": "Tuberculosis Screening Record",
          "fields": [
            {
              "id": "screening_date",
              "type": "date",
              "label": "Screening Date",
              "required": true
            },
            {
              "id": "screening_method",
              "type": "choice",
              "label": "Screening Method",
              "options": [
                "quantiferon_gold",
                "t_spot",
                "two_step_ppd",
                "chest_xray"
              ],
              "required": true
            },
            {
              "id": "symptom_free",
              "type": "boolean",
              "label": "I attest that I am free of active tuberculosis symptoms.",
              "required": true
            }
          ],
          "signature": {
            "id": "nurse_tb_signature",
            "attestation": "I certify that the TB screening information provided is true and accurate.",
            "covers": [
              "screening"
            ]
          }
        },
        {
          "id": "clearance",
          "role": "credentialing",
          "title": "Acme Credentialing Clearance",
          "readable": [
            "screening"
          ],
          "fields": [
            {
              "id": "clearance_result",
              "type": "choice",
              "label": "Clearance Determination",
              "options": [
                "cleared",
                "follow_up_required"
              ],
              "required": true
            }
          ]
        }
      ]
    }
  ],
  "policies": [
    {
      "key": "acme-onboarding",
      "version": "2026.12.0",
      "extends": [
        {
          "key": "us-federal",
          "version": "2026.12.0"
        },
        {
          "key": "us-ca",
          "version": "2026.12.0"
        }
      ],
      "facts": {
        "work/location_country": {
          "type": "choice",
          "options": [
            "US",
            "CA",
            "GB",
            "MX",
            "OTHER"
          ]
        },
        "engagement/classification": {
          "type": "choice",
          "options": [
            "w2",
            "1099"
          ]
        },
        "engagement/start_date": {
          "type": "date"
        },
        "engagement/reviewer": {
          "type": "string"
        },
        "engagement/employer_id": {
          "type": "string"
        },
        "acme/patient_facing": {
          "type": "boolean"
        }
      },
      "stages": [
        {
          "id": "eligibility",
          "title": "Employment Eligibility"
        },
        {
          "id": "acme_company",
          "title": "Acme Company Policies"
        },
        {
          "id": "acme_clinical",
          "title": "Acme Clinical Clearance"
        }
      ],
      "requirements": {
        "federal_i9": {
          "title": "Form I-9 — Employment Eligibility Verification (Sections 1 & 2, Acme Tightened SLA)",
          "kind": "document",
          "template": "us_uscis_i9",
          "stage": "eligibility",
          "parties": {
            "subject": "subject",
            "reviewer": "engagement/reviewer"
          },
          "due": {
            "subject": {
              "relative_to": "engagement/start_date",
              "days": -1
            },
            "reviewer": {
              "relative_to": "engagement/start_date",
              "business_days": 1
            }
          },
          "reuse": {
            "same": [
              "engagement/employer_id"
            ],
            "max_age_days": 1095,
            "outcome": "needs_update"
          },
          "on_unknown": "wait",
          "cites": [
            "8 USC 1324a",
            "8 CFR 274a.2(b)(1)(i)(A)",
            "8 CFR 274a.2(b)(1)(ii)(B)",
            "8 CFR 274a.2(c)(1)",
            "Acme Policy HR-102 (1-business-day I-9 SLA)"
          ]
        },
        "acme_handbook": {
          "title": "Acme Healthcare Employee Handbook Acknowledgment",
          "kind": "document",
          "template": "acme_handbook_ack",
          "stage": "acme_company",
          "parties": {
            "nurse": "subject"
          },
          "due": {
            "nurse": {
              "relative_to": "engagement/start_date",
              "days": 0
            }
          },
          "reuse": {
            "same": [
              "engagement/employer_id"
            ],
            "outcome": "satisfies"
          },
          "on_unknown": "wait",
          "cites": [
            "Acme Policy HR-101"
          ]
        },
        "acme_tb_attestation": {
          "title": "Acme Clinical TB Screening and Clearance Attestation",
          "kind": "document",
          "template": "acme_tb_attestation",
          "stage": "acme_clinical",
          "parties": {
            "nurse": "subject",
            "credentialing": "engagement/reviewer"
          },
          "due": {
            "nurse": {
              "relative_to": "engagement/start_date",
              "days": -3
            },
            "credentialing": {
              "relative_to": "engagement/start_date",
              "days": -1
            }
          },
          "reuse": {
            "same": [
              "engagement/employer_id"
            ],
            "max_age_days": 365,
            "outcome": "satisfies"
          },
          "expires": {
            "years": 1
          },
          "renew_within": {
            "days": 30
          },
          "on_unknown": "wait",
          "cites": [
            "Acme Clinical Policy CL-204",
            "CDC TB Screening Guidelines"
          ]
        }
      },
      "policies": [
        {
          "id": "us-federal-i9-w2",
          "title": "Federal Form I-9 for U.S. W-2 employees (Acme tightened due SLA)",
          "when": {
            "all": [
              {
                "fact": "engagement/classification",
                "operator": "equal",
                "value": "w2"
              },
              {
                "fact": "work/location_country",
                "operator": "equal",
                "value": "US"
              }
            ]
          },
          "require": [
            "federal_i9"
          ],
          "optional": false,
          "cites": [
            "8 USC 1324a",
            "8 CFR 274a.2",
            "Acme Policy HR-102"
          ]
        },
        {
          "id": "acme-handbook-all",
          "title": "Acme employee handbook required for all W-2 and 1099 clinicians",
          "when": {
            "fact": "engagement/classification",
            "operator": "in",
            "value": [
              "w2",
              "1099"
            ]
          },
          "require": [
            "acme_handbook"
          ],
          "cites": [
            "Acme Policy HR-101"
          ]
        },
        {
          "id": "acme-tb-patient-facing",
          "title": "Clinical TB screening attestation required for patient-facing sites",
          "when": {
            "fact": "acme/patient_facing",
            "operator": "equal",
            "value": true
          },
          "require": [
            "acme_tb_attestation"
          ],
          "cites": [
            "Acme Clinical Policy CL-204"
          ]
        }
      ]
    }
  ],
  "views": [
    {
      "key": "acme-nurses",
      "title": "Acme Nurses",
      "description": "Roster of Acme clinicians with home state, specialty, and rehire flag.",
      "source": "entity",
      "entity_kind": "nurse",
      "layout": "table",
      "columns": [
        {
          "key": "full_name",
          "label": "Nurse"
        },
        {
          "key": "specialty",
          "label": "Specialty"
        },
        {
          "key": "home_state",
          "label": "Home State"
        },
        {
          "key": "is_rehire",
          "label": "Rehire"
        },
        {
          "key": "status",
          "label": "Status"
        }
      ],
      "actions": [
        {
          "id": "start_case",
          "label": "Start Onboarding Case",
          "kind": "case.create"
        }
      ]
    },
    {
      "key": "acme-assignments",
      "title": "Acme Assignments",
      "description": "Board of Acme nurse assignments grouped by status.",
      "source": "entity",
      "entity_kind": "assignment",
      "layout": "board",
      "group_by": "status",
      "columns": [
        {
          "key": "legal_entity_id",
          "label": "Legal Entity"
        },
        {
          "key": "employment_type",
          "label": "Type"
        },
        {
          "key": "starts_on",
          "label": "Start Date"
        },
        {
          "key": "credentialing_owner",
          "label": "Credentialing"
        }
      ]
    },
    {
      "key": "acme-sites",
      "title": "Acme Clinical Sites",
      "description": "Directory of Acme sites with state, E-Verify, and patient-facing flags.",
      "source": "entity",
      "entity_kind": "site",
      "layout": "table",
      "columns": [
        {
          "key": "name",
          "label": "Site"
        },
        {
          "key": "state",
          "label": "State"
        },
        {
          "key": "everify_participating",
          "label": "E-Verify"
        },
        {
          "key": "patient_facing",
          "label": "Patient Facing"
        }
      ]
    }
  ],
  "scenarios": [
    {
      "name": "acme-ca-nurse-new-hire",
      "description": "New W-2 nurse assigned to a patient-facing E-Verify California site requires federal, California, and Acme documents with tightened I-9 due dates; completing I-9 unlocks E-Verify.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_ca_01",
        "entities": [
          {
            "id": "asgn_ca_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "w2",
              "starts_on": "2026-12-07",
              "is_remote": false,
              "credentialing_owner": "usr_cred_01",
              "clinical_unit": "icu",
              "status": "pending"
            }
          },
          {
            "id": "nurse_01",
            "kind": "nurse",
            "attributes": {
              "full_name": "Elena Alvarez",
              "email": "elena.alvarez@example.test",
              "home_state": "CA",
              "is_rehire": false,
              "prior_assignments": 0,
              "us_work_authorized": true,
              "specialty": "ICU",
              "status": "onboarding"
            }
          },
          {
            "id": "site_sf_01",
            "kind": "site",
            "attributes": {
              "name": "Bayview Medical Center",
              "state": "CA",
              "country": "US",
              "everify_participating": true,
              "patient_facing": true
            }
          }
        ],
        "links": [
          {
            "from": "asgn_ca_01",
            "to": "nurse_01",
            "relation": "nurse"
          },
          {
            "from": "asgn_ca_01",
            "to": "site_sf_01",
            "relation": "site"
          }
        ]
      },
      "expect": {
        "required": [
          "federal_i9",
          "federal_w4",
          "federal_everify",
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training",
          "acme_handbook",
          "acme_tb_attestation"
        ],
        "not_required": [],
        "states": {
          "federal_i9": "available",
          "federal_w4": "available",
          "federal_everify": "waiting",
          "ca_de4": "available",
          "ca_wage_theft_notice": "available",
          "ca_harassment_training": "available",
          "acme_handbook": "available",
          "acme_tb_attestation": "available"
        },
        "missing_facts": []
      },
      "steps": [
        {
          "name": "complete-i9-unlocks-everify",
          "progress": {
            "federal_i9": {
              "status": "completed",
              "document": "doc_acme_i9_01",
              "roles": {
                "subject": "completed",
                "reviewer": "completed"
              }
            }
          },
          "expect": {
            "required": [
              "federal_i9",
              "federal_w4",
              "federal_everify",
              "ca_de4",
              "ca_wage_theft_notice",
              "ca_harassment_training",
              "acme_handbook",
              "acme_tb_attestation"
            ],
            "states": {
              "federal_i9": "complete",
              "federal_everify": "available"
            },
            "missing_facts": []
          }
        }
      ]
    },
    {
      "name": "acme-work-state-change-nv-to-ca",
      "description": "Assignment starts at a Nevada site (no CA requirements); updating site.state from NV to CA partway through onboarding triggers DE 4, Wage Theft Notice, and SB 1343 training.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_move_01",
        "entities": [
          {
            "id": "asgn_move_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "w2",
              "starts_on": "2026-12-14",
              "is_remote": false,
              "credentialing_owner": "usr_cred_01",
              "clinical_unit": "er",
              "status": "pending"
            }
          },
          {
            "id": "nurse_02",
            "kind": "nurse",
            "attributes": {
              "full_name": "Marcus Chen",
              "email": "marcus.chen@example.test",
              "home_state": "NV",
              "is_rehire": false,
              "prior_assignments": 0,
              "us_work_authorized": true,
              "specialty": "ER",
              "status": "onboarding"
            }
          },
          {
            "id": "site_west_01",
            "kind": "site",
            "attributes": {
              "name": "Sierra Regional Clinic",
              "state": "NV",
              "country": "US",
              "everify_participating": false,
              "patient_facing": true
            }
          }
        ],
        "links": [
          {
            "from": "asgn_move_01",
            "to": "nurse_02",
            "relation": "nurse"
          },
          {
            "from": "asgn_move_01",
            "to": "site_west_01",
            "relation": "site"
          }
        ]
      },
      "expect": {
        "required": [
          "federal_i9",
          "federal_w4",
          "acme_handbook",
          "acme_tb_attestation"
        ],
        "not_required": [
          "federal_everify",
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training"
        ],
        "states": {
          "federal_i9": "available",
          "federal_w4": "available",
          "acme_handbook": "available",
          "acme_tb_attestation": "available"
        },
        "missing_facts": []
      },
      "steps": [
        {
          "name": "update-site-state-to-ca",
          "update_entity": {
            "id": "site_west_01",
            "attributes": {
              "state": "CA"
            }
          },
          "expect": {
            "required": [
              "federal_i9",
              "federal_w4",
              "ca_de4",
              "ca_wage_theft_notice",
              "ca_harassment_training",
              "acme_handbook",
              "acme_tb_attestation"
            ],
            "not_required": [
              "federal_everify"
            ],
            "states": {
              "ca_de4": "available",
              "ca_wage_theft_notice": "available",
              "ca_harassment_training": "available"
            },
            "missing_facts": []
          }
        }
      ]
    },
    {
      "name": "acme-rehire-i9-reuse",
      "description": "Rehired nurse at an Acme California site reuses prior Form I-9 with needs_update (Supplement B), satisfies W-4, DE 4, handbook, and TB attestation via reuse, and skips E-Verify.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_rehire_01",
        "entities": [
          {
            "id": "asgn_rehire_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "w2",
              "starts_on": "2026-12-10",
              "is_remote": false,
              "credentialing_owner": "usr_cred_02",
              "clinical_unit": "medsurg",
              "status": "pending"
            }
          },
          {
            "id": "nurse_rehire_01",
            "kind": "nurse",
            "attributes": {
              "full_name": "Priya Patel",
              "email": "priya.patel@example.test",
              "home_state": "CA",
              "is_rehire": true,
              "prior_assignments": 2,
              "us_work_authorized": true,
              "specialty": "MedSurg",
              "status": "onboarding"
            }
          },
          {
            "id": "site_la_01",
            "kind": "site",
            "attributes": {
              "name": "Pacific Coast Hospital",
              "state": "CA",
              "country": "US",
              "everify_participating": true,
              "patient_facing": true
            }
          }
        ],
        "links": [
          {
            "from": "asgn_rehire_01",
            "to": "nurse_rehire_01",
            "relation": "nurse"
          },
          {
            "from": "asgn_rehire_01",
            "to": "site_la_01",
            "relation": "site"
          }
        ]
      },
      "evidence": [
        {
          "id": "doc_prior_i9_acme",
          "template": "us_uscis_i9",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-11-15",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        },
        {
          "id": "doc_prior_w4_acme",
          "template": "us_irs_w4",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-11-15",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        },
        {
          "id": "doc_prior_de4_acme",
          "template": "us_ca_de4",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-11-15",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        },
        {
          "id": "doc_prior_hb_acme",
          "template": "acme_handbook_ack",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-11-15",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        },
        {
          "id": "doc_prior_tb_acme",
          "template": "acme_tb_attestation",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2026-06-01",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        }
      ],
      "expect": {
        "required": [
          "federal_i9",
          "federal_w4",
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training",
          "acme_handbook",
          "acme_tb_attestation"
        ],
        "not_required": [
          "federal_everify"
        ],
        "states": {
          "federal_i9": "available",
          "federal_w4": "complete",
          "ca_de4": "complete",
          "ca_wage_theft_notice": "available",
          "ca_harassment_training": "available",
          "acme_handbook": "complete",
          "acme_tb_attestation": "complete"
        },
        "missing_facts": []
      }
    },
    {
      "name": "acme-non-patient-facing-admin-site",
      "description": "W-2 nurse assigned to a non-patient-facing Texas admin site skips clinical TB attestation, California forms, and E-Verify.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_tx_01",
        "entities": [
          {
            "id": "asgn_tx_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "w2",
              "starts_on": "2026-12-14",
              "is_remote": true,
              "credentialing_owner": "usr_cred_01",
              "clinical_unit": "admin",
              "status": "pending"
            }
          },
          {
            "id": "nurse_03",
            "kind": "nurse",
            "attributes": {
              "full_name": "Devon Brooks",
              "email": "devon.brooks@example.test",
              "home_state": "TX",
              "is_rehire": false,
              "prior_assignments": 0,
              "us_work_authorized": true,
              "specialty": "MedSurg",
              "status": "onboarding"
            }
          },
          {
            "id": "site_tx_admin",
            "kind": "site",
            "attributes": {
              "name": "Austin Operations Hub",
              "state": "TX",
              "country": "US",
              "everify_participating": false,
              "patient_facing": false
            }
          }
        ],
        "links": [
          {
            "from": "asgn_tx_01",
            "to": "nurse_03",
            "relation": "nurse"
          },
          {
            "from": "asgn_tx_01",
            "to": "site_tx_admin",
            "relation": "site"
          }
        ]
      },
      "expect": {
        "required": [
          "federal_i9",
          "federal_w4",
          "acme_handbook"
        ],
        "not_required": [
          "federal_everify",
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training",
          "acme_tb_attestation"
        ],
        "states": {
          "federal_i9": "available",
          "federal_w4": "available",
          "acme_handbook": "available"
        },
        "missing_facts": []
      }
    },
    {
      "name": "acme-1099-contractor-clinical",
      "description": "1099 clinician at a patient-facing California site skips W-2 federal and California tax/eligibility forms but still requires Acme handbook and TB attestation.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_1099_01",
        "entities": [
          {
            "id": "asgn_1099_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "1099",
              "starts_on": "2026-12-14",
              "is_remote": false,
              "credentialing_owner": "usr_cred_01",
              "clinical_unit": "icu",
              "status": "pending"
            }
          },
          {
            "id": "nurse_04",
            "kind": "nurse",
            "attributes": {
              "full_name": "Sora Takahashi",
              "email": "sora.takahashi@example.test",
              "home_state": "CA",
              "is_rehire": false,
              "prior_assignments": 0,
              "us_work_authorized": true,
              "specialty": "ICU",
              "status": "onboarding"
            }
          },
          {
            "id": "site_ca_02",
            "kind": "site",
            "attributes": {
              "name": "Golden Gate Surgical Center",
              "state": "CA",
              "country": "US",
              "everify_participating": true,
              "patient_facing": true
            }
          }
        ],
        "links": [
          {
            "from": "asgn_1099_01",
            "to": "nurse_04",
            "relation": "nurse"
          },
          {
            "from": "asgn_1099_01",
            "to": "site_ca_02",
            "relation": "site"
          }
        ]
      },
      "expect": {
        "required": [
          "acme_handbook",
          "acme_tb_attestation"
        ],
        "not_required": [
          "federal_i9",
          "federal_w4",
          "federal_everify",
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training"
        ],
        "states": {
          "acme_handbook": "available",
          "acme_tb_attestation": "available"
        },
        "missing_facts": []
      }
    },
    {
      "name": "acme-tb-expiry-and-renewal",
      "description": "Completed TB attestation within 30 days of its 1-year expiry opens a renewal item; advancing past the expiry date marks the original TB attestation expired.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_tb_01",
        "entities": [
          {
            "id": "asgn_tb_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "1099",
              "starts_on": "2026-12-07",
              "is_remote": false,
              "credentialing_owner": "usr_cred_01",
              "clinical_unit": "icu",
              "status": "active"
            }
          },
          {
            "id": "nurse_05",
            "kind": "nurse",
            "attributes": {
              "full_name": "Hannah Lindqvist",
              "email": "hannah.lindqvist@example.test",
              "home_state": "OR",
              "is_rehire": true,
              "prior_assignments": 1,
              "us_work_authorized": true,
              "specialty": "ICU",
              "status": "active"
            }
          },
          {
            "id": "site_or_01",
            "kind": "site",
            "attributes": {
              "name": "Willamette Valley Hospital",
              "state": "OR",
              "country": "US",
              "everify_participating": false,
              "patient_facing": true
            }
          }
        ],
        "links": [
          {
            "from": "asgn_tb_01",
            "to": "nurse_05",
            "relation": "nurse"
          },
          {
            "from": "asgn_tb_01",
            "to": "site_or_01",
            "relation": "site"
          }
        ]
      },
      "evidence": [
        {
          "id": "doc_tb_expiring",
          "template": "acme_tb_attestation",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-12-15",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        },
        {
          "id": "doc_hb_done",
          "template": "acme_handbook_ack",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-12-15",
          "facts": {
            "engagement/employer_id": "emp_acme_health"
          }
        }
      ],
      "progress": {
        "acme_tb_attestation": {
          "status": "completed",
          "document": "doc_tb_expiring",
          "roles": {
            "nurse": "completed",
            "credentialing": "completed"
          }
        }
      },
      "expect": {
        "required": [
          "acme_handbook",
          "acme_tb_attestation",
          "acme_tb_attestation:renewal"
        ],
        "states": {
          "acme_handbook": "complete",
          "acme_tb_attestation": "complete",
          "acme_tb_attestation:renewal": "available"
        },
        "missing_facts": []
      },
      "steps": [
        {
          "name": "advance-past-tb-expiry-date",
          "as_of": "2026-12-16",
          "expect": {
            "required": [
              "acme_handbook",
              "acme_tb_attestation"
            ],
            "states": {
              "acme_handbook": "complete",
              "acme_tb_attestation": "available"
            },
            "missing_facts": []
          }
        }
      ]
    },
    {
      "name": "acme-missing-site-link-tentative",
      "description": "When an assignment has no linked site yet, site-derived concepts are unresolved and dependent federal, California, and TB requirements are blocked_on_facts.",
      "policy_set": "acme-onboarding",
      "as_of": "2026-12-01",
      "snapshot": {
        "subject": "asgn_nosite_01",
        "entities": [
          {
            "id": "asgn_nosite_01",
            "kind": "assignment",
            "attributes": {
              "legal_entity_id": "emp_acme_health",
              "employment_type": "w2",
              "starts_on": "2026-12-14",
              "is_remote": false,
              "credentialing_owner": "usr_cred_01",
              "clinical_unit": "icu",
              "status": "pending"
            }
          },
          {
            "id": "nurse_06",
            "kind": "nurse",
            "attributes": {
              "full_name": "Noah Williams",
              "email": "noah.williams@example.test",
              "home_state": "CA",
              "is_rehire": false,
              "prior_assignments": 0,
              "us_work_authorized": true,
              "specialty": "ICU",
              "status": "onboarding"
            }
          }
        ],
        "links": [
          {
            "from": "asgn_nosite_01",
            "to": "nurse_06",
            "relation": "nurse"
          }
        ]
      },
      "expect": {
        "required": [
          "federal_i9",
          "federal_w4",
          "federal_everify",
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training",
          "acme_handbook",
          "acme_tb_attestation"
        ],
        "states": {
          "acme_handbook": "available",
          "federal_i9": "blocked_on_facts",
          "ca_de4": "blocked_on_facts",
          "acme_tb_attestation": "blocked_on_facts"
        },
        "missing_facts": [
          "acme/patient_facing",
          "engagement/everify_enrolled",
          "work/location_country",
          "work/location_state"
        ]
      }
    }
  ]
}

Forma Lisp

Show Forma Lisp source acme.forma
(pack acme
  :format 1
  :version "2026.12.0"
  :kind "binding"
  :description "Acme Healthcare binding pack (RFC 0004): maps staffing-core, us-federal, and us-ca concepts onto Acme's custom nurse/assignment/site entity graph, tightens Form I-9 deadlines, and adds Acme employee handbook and clinical TB attestation requirements.")

;; ── Pack Dependencies ──────────────────────────────────────────────────────

(require-pack staffing-core :range "^2026.12")
(require-pack us-federal :range "^2026.12")
(require-pack us-ca :range "^2026.12")

;; ── Concepts ───────────────────────────────────────────────────────────────

(concept "acme/patient_facing"
  :type "boolean"
  :description "Whether the Acme assignment is at a patient-facing clinical site")

;; ── Bindings ───────────────────────────────────────────────────────────────

(binding "work/location_state"
  :path "assignment.site->site.state"
  :description "Work state from the assignment's linked clinical site")

(binding "work/location_country"
  :path "assignment.site->site.country"
  :description "Work country from the assignment's linked clinical site")

(binding "work/is_remote"
  :path "assignment.is_remote"
  :description "Whether the assignment is performed remotely")

(binding "engagement/start_date"
  :path "assignment.starts_on"
  :description "First day of the nurse's assignment")

(binding "engagement/classification"
  :path "assignment.employment_type"
  :description "W-2 or 1099 classification on the assignment")

(binding "engagement/reviewer"
  :path "assignment.credentialing_owner"
  :description "Acme credentialing specialist reviewing employer sections")

(binding "engagement/employer_id"
  :path "assignment.legal_entity_id"
  :description "Acme hiring legal entity identifier for document reuse scoping")

(binding "engagement/everify_enrolled"
  :path "assignment.site->site.everify_participating"
  :description "Whether the linked site participates in DHS/USCIS E-Verify")

(binding "principal/is_rehire"
  :path "assignment.nurse->nurse.is_rehire"
  :description "Whether the linked nurse was previously employed by Acme")

(binding "principal/residence_state"
  :path "assignment.nurse->nurse.home_state"
  :description "Primary state of residence on the linked nurse entity")

(binding "principal/work_authorized_us"
  :path "assignment.nurse->nurse.us_work_authorized"
  :description "US work authorization flag on the linked nurse entity")

(binding "acme/patient_facing"
  :path "assignment.site->site.patient_facing"
  :description "Whether the linked site requires clinical patient-facing clearance")

;; ── Entity Types ───────────────────────────────────────────────────────────

(entity nurse :version "1"
  {:full_name (meta String {:min-length 1})
   :email (meta String {:format "email"})
   :home_state (Union "AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DE" "DC" "FL" "GA" "HI" "ID" "IL" "IN" "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "PR" "RI" "SC" "SD" "TN" "TX" "UT" "VT" "VA" "WA" "WV" "WI" "WY")
   :is_rehire Bool
   :prior_assignments (Option (meta Int {:minimum 0}))
   :us_work_authorized (Option Bool)
   :specialty (Option (Union "ICU" "ER" "OR" "MedSurg" "NICU"))
   :license_number (Option (meta String {:sensitivity "pii"}))
   :status (Option (Union "onboarding" "active" "inactive"))})

(entity assignment :version "1"
  {:legal_entity_id (meta String {:min-length 1})
   :employment_type (Union "w2" "1099")
   :starts_on (meta String {:format "date"})
   :is_remote (Option Bool)
   :credentialing_owner (Option String)
   :clinical_unit (Option (Union "icu" "er" "medsurg" "admin"))
   :status (Option (Union "pending" "active" "completed" "cancelled"))})

(entity site :version "1"
  {:name (meta String {:min-length 1})
   :state (Union "AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DE" "DC" "FL" "GA" "HI" "ID" "IL" "IN" "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "PR" "RI" "SC" "SD" "TN" "TX" "UT" "VT" "VA" "WA" "WV" "WI" "WY")
   :country (Union "US" "CA" "GB" "MX" "OTHER")
   :everify_participating Bool
   :patient_facing Bool})

;; ── Document Templates ─────────────────────────────────────────────────────

(template acme_handbook_ack
  :version "2026.1.0"
  :title "Acme Healthcare Employee Handbook Acknowledgment"
  :roles [{:name "nurse" :kind "person" :label "Clinician"}]
  :sections
    [{:id "handbook"
       :role "nurse"
       :title "Handbook Receipt and Acknowledgment"
       :fields
        [{:id "handbook_edition"
           :type "choice"
           :label "Handbook Edition Reviewed"
           :options ["2026_national" "2026_california_addendum"]
           :required true}
         {:id "acknowledged"
           :type "boolean"
           :label "I have received, read, and agree to follow the Acme Healthcare Employee Handbook."
           :required true}]
       :signature
        {:id "nurse_handbook_signature"
         :attestation "I acknowledge receipt of the Acme Healthcare Employee Handbook."
         :covers ["handbook"]}}])

(template acme_tb_attestation
  :version "2026.1.0"
  :title "Acme Clinical TB Screening and Clearance Attestation"
  :roles
    [{:name "nurse" :kind "person" :label "Clinician"}
     {:name "credentialing"
       :kind "user"
       :label "Credentialing Specialist"
       :after ["nurse"]}]
  :sections
    [{:id "screening"
       :role "nurse"
       :title "Tuberculosis Screening Record"
       :fields
        [{:id "screening_date" :type "date" :label "Screening Date" :required true}
         {:id "screening_method"
           :type "choice"
           :label "Screening Method"
           :options ["quantiferon_gold" "t_spot" "two_step_ppd" "chest_xray"]
           :required true}
         {:id "symptom_free"
           :type "boolean"
           :label "I attest that I am free of active tuberculosis symptoms."
           :required true}]
       :signature
        {:id "nurse_tb_signature"
         :attestation "I certify that the TB screening information provided is true and accurate."
         :covers ["screening"]}}
     {:id "clearance"
       :role "credentialing"
       :title "Acme Credentialing Clearance"
       :readable ["screening"]
       :fields
        [{:id "clearance_result"
           :type "choice"
           :label "Clearance Determination"
           :options ["cleared" "follow_up_required"]
           :required true}]}])

;; ── Compliance Policy Sets ─────────────────────────────────────────────────

(policy-set acme-onboarding
  :version "2026.12.0"
  :extends [{:key "us-federal" :version "2026.12.0"} {:key "us-ca" :version "2026.12.0"}]
  :facts
    {"work/location_country" {:type "choice" :options ["US" "CA" "GB" "MX" "OTHER"]}
     "engagement/classification" {:type "choice" :options ["w2" "1099"]}
     "engagement/start_date" {:type "date"}
     "engagement/reviewer" {:type "string"}
     "engagement/employer_id" {:type "string"}
     "acme/patient_facing" {:type "boolean"}}
  :stages
    [{:id "eligibility" :title "Employment Eligibility"}
     {:id "acme_company" :title "Acme Company Policies"}
     {:id "acme_clinical" :title "Acme Clinical Clearance"}]
  :requirements
    {:federal_i9
      {:title "Form I-9 — Employment Eligibility Verification (Sections 1 & 2, Acme Tightened SLA)"
       :kind "document"
       :template "us_uscis_i9"
       :stage "eligibility"
       :parties {:subject "subject" :reviewer "engagement/reviewer"}
       :due
        {:subject {:relative_to "engagement/start_date" :days -1}
         :reviewer {:relative_to "engagement/start_date" :business_days 1}}
       :reuse {:same ["engagement/employer_id"] :max_age_days 1095 :outcome "needs_update"}
       :on_unknown "wait"
       :cites
        ["8 USC 1324a"
         "8 CFR 274a.2(b)(1)(i)(A)"
         "8 CFR 274a.2(b)(1)(ii)(B)"
         "8 CFR 274a.2(c)(1)"
         "Acme Policy HR-102 (1-business-day I-9 SLA)"]}
     :acme_handbook
      {:title "Acme Healthcare Employee Handbook Acknowledgment"
       :kind "document"
       :template "acme_handbook_ack"
       :stage "acme_company"
       :parties {:nurse "subject"}
       :due {:nurse {:relative_to "engagement/start_date" :days 0}}
       :reuse {:same ["engagement/employer_id"] :outcome "satisfies"}
       :on_unknown "wait"
       :cites ["Acme Policy HR-101"]}
     :acme_tb_attestation
      {:title "Acme Clinical TB Screening and Clearance Attestation"
       :kind "document"
       :template "acme_tb_attestation"
       :stage "acme_clinical"
       :parties {:nurse "subject" :credentialing "engagement/reviewer"}
       :due
        {:nurse {:relative_to "engagement/start_date" :days -3}
         :credentialing {:relative_to "engagement/start_date" :days -1}}
       :reuse {:same ["engagement/employer_id"] :max_age_days 365 :outcome "satisfies"}
       :expires {:years 1}
       :renew_within {:days 30}
       :on_unknown "wait"
       :cites ["Acme Clinical Policy CL-204" "CDC TB Screening Guidelines"]}}
  :policies
    [{:id "us-federal-i9-w2"
       :title "Federal Form I-9 for U.S. W-2 employees (Acme tightened due SLA)"
       :when
        {:all
          [{:fact "engagement/classification" :operator "equal" :value "w2"}
           {:fact "work/location_country" :operator "equal" :value "US"}]}
       :require ["federal_i9"]
       :optional false
       :cites ["8 USC 1324a" "8 CFR 274a.2" "Acme Policy HR-102"]}
     {:id "acme-handbook-all"
       :title "Acme employee handbook required for all W-2 and 1099 clinicians"
       :when {:fact "engagement/classification" :operator "in" :value ["w2" "1099"]}
       :require ["acme_handbook"]
       :cites ["Acme Policy HR-101"]}
     {:id "acme-tb-patient-facing"
       :title "Clinical TB screening attestation required for patient-facing sites"
       :when {:fact "acme/patient_facing" :operator "equal" :value true}
       :require ["acme_tb_attestation"]
       :cites ["Acme Clinical Policy CL-204"]}])

;; ── Saved Views ────────────────────────────────────────────────────────────

(saved-view acme-nurses
  :title "Acme Nurses"
  :description "Roster of Acme clinicians with home state, specialty, and rehire flag."
  :source "entity"
  :entity nurse
  :layout "table"
  :columns
    [{:key "full_name" :label "Nurse"}
     {:key "specialty" :label "Specialty"}
     {:key "home_state" :label "Home State"}
     {:key "is_rehire" :label "Rehire"}
     {:key "status" :label "Status"}]
  :actions [{:id "start_case" :label "Start Onboarding Case" :kind "case.create"}])

(saved-view acme-assignments
  :title "Acme Assignments"
  :description "Board of Acme nurse assignments grouped by status."
  :source "entity"
  :entity assignment
  :layout "board"
  :group-by "status"
  :columns
    [{:key "legal_entity_id" :label "Legal Entity"}
     {:key "employment_type" :label "Type"}
     {:key "starts_on" :label "Start Date"}
     {:key "credentialing_owner" :label "Credentialing"}])

(saved-view acme-sites
  :title "Acme Clinical Sites"
  :description "Directory of Acme sites with state, E-Verify, and patient-facing flags."
  :source "entity"
  :entity site
  :layout "table"
  :columns
    [{:key "name" :label "Site"}
     {:key "state" :label "State"}
     {:key "everify_participating" :label "E-Verify"}
     {:key "patient_facing" :label "Patient Facing"}])

;; ── Declarative Scenarios ──────────────────────────────────────────────────

(scenario acme-ca-nurse-new-hire
  :description "New W-2 nurse assigned to a patient-facing E-Verify California site requires federal, California, and Acme documents with tightened I-9 due dates; completing I-9 unlocks E-Verify."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_ca_01"
     :entities
      [{:id "asgn_ca_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "w2"
           :starts_on "2026-12-07"
           :is_remote false
           :credentialing_owner "usr_cred_01"
           :clinical_unit "icu"
           :status "pending"}}
       {:id "nurse_01"
         :kind "nurse"
         :attributes
          {:full_name "Elena Alvarez"
           :email "elena.alvarez@example.test"
           :home_state "CA"
           :is_rehire false
           :prior_assignments 0
           :us_work_authorized true
           :specialty "ICU"
           :status "onboarding"}}
       {:id "site_sf_01"
         :kind "site"
         :attributes
          {:name "Bayview Medical Center"
           :state "CA"
           :country "US"
           :everify_participating true
           :patient_facing true}}]
     :links
      [{:from "asgn_ca_01" :to "nurse_01" :relation "nurse"}
       {:from "asgn_ca_01" :to "site_sf_01" :relation "site"}]}
  :expect
    {:required
      ["federal_i9"
       "federal_w4"
       "federal_everify"
       "ca_de4"
       "ca_wage_theft_notice"
       "ca_harassment_training"
       "acme_handbook"
       "acme_tb_attestation"]
     :not_required []
     :states
      {:federal_i9 "available"
       :federal_w4 "available"
       :federal_everify "waiting"
       :ca_de4 "available"
       :ca_wage_theft_notice "available"
       :ca_harassment_training "available"
       :acme_handbook "available"
       :acme_tb_attestation "available"}
     :missing_facts []}
  :steps
    [{:name "complete-i9-unlocks-everify"
       :progress
        {:federal_i9
          {:status "completed"
           :document "doc_acme_i9_01"
           :roles {:subject "completed" :reviewer "completed"}}}
       :expect
        {:required
          ["federal_i9"
           "federal_w4"
           "federal_everify"
           "ca_de4"
           "ca_wage_theft_notice"
           "ca_harassment_training"
           "acme_handbook"
           "acme_tb_attestation"]
         :states {:federal_i9 "complete" :federal_everify "available"}
         :missing_facts []}}])

(scenario acme-work-state-change-nv-to-ca
  :description "Assignment starts at a Nevada site (no CA requirements); updating site.state from NV to CA partway through onboarding triggers DE 4, Wage Theft Notice, and SB 1343 training."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_move_01"
     :entities
      [{:id "asgn_move_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "w2"
           :starts_on "2026-12-14"
           :is_remote false
           :credentialing_owner "usr_cred_01"
           :clinical_unit "er"
           :status "pending"}}
       {:id "nurse_02"
         :kind "nurse"
         :attributes
          {:full_name "Marcus Chen"
           :email "marcus.chen@example.test"
           :home_state "NV"
           :is_rehire false
           :prior_assignments 0
           :us_work_authorized true
           :specialty "ER"
           :status "onboarding"}}
       {:id "site_west_01"
         :kind "site"
         :attributes
          {:name "Sierra Regional Clinic"
           :state "NV"
           :country "US"
           :everify_participating false
           :patient_facing true}}]
     :links
      [{:from "asgn_move_01" :to "nurse_02" :relation "nurse"}
       {:from "asgn_move_01" :to "site_west_01" :relation "site"}]}
  :expect
    {:required ["federal_i9" "federal_w4" "acme_handbook" "acme_tb_attestation"]
     :not_required ["federal_everify" "ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
     :states
      {:federal_i9 "available"
       :federal_w4 "available"
       :acme_handbook "available"
       :acme_tb_attestation "available"}
     :missing_facts []}
  :steps
    [{:name "update-site-state-to-ca"
       :update_entity {:id "site_west_01" :attributes {:state "CA"}}
       :expect
        {:required
          ["federal_i9"
           "federal_w4"
           "ca_de4"
           "ca_wage_theft_notice"
           "ca_harassment_training"
           "acme_handbook"
           "acme_tb_attestation"]
         :not_required ["federal_everify"]
         :states
          {:ca_de4 "available"
           :ca_wage_theft_notice "available"
           :ca_harassment_training "available"}
         :missing_facts []}}])

(scenario acme-rehire-i9-reuse
  :description "Rehired nurse at an Acme California site reuses prior Form I-9 with needs_update (Supplement B), satisfies W-4, DE 4, handbook, and TB attestation via reuse, and skips E-Verify."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_rehire_01"
     :entities
      [{:id "asgn_rehire_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "w2"
           :starts_on "2026-12-10"
           :is_remote false
           :credentialing_owner "usr_cred_02"
           :clinical_unit "medsurg"
           :status "pending"}}
       {:id "nurse_rehire_01"
         :kind "nurse"
         :attributes
          {:full_name "Priya Patel"
           :email "priya.patel@example.test"
           :home_state "CA"
           :is_rehire true
           :prior_assignments 2
           :us_work_authorized true
           :specialty "MedSurg"
           :status "onboarding"}}
       {:id "site_la_01"
         :kind "site"
         :attributes
          {:name "Pacific Coast Hospital"
           :state "CA"
           :country "US"
           :everify_participating true
           :patient_facing true}}]
     :links
      [{:from "asgn_rehire_01" :to "nurse_rehire_01" :relation "nurse"}
       {:from "asgn_rehire_01" :to "site_la_01" :relation "site"}]}
  :evidence
    [{:id "doc_prior_i9_acme"
       :template "us_uscis_i9"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-11-15"
       :facts {"engagement/employer_id" "emp_acme_health"}}
     {:id "doc_prior_w4_acme"
       :template "us_irs_w4"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-11-15"
       :facts {"engagement/employer_id" "emp_acme_health"}}
     {:id "doc_prior_de4_acme"
       :template "us_ca_de4"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-11-15"
       :facts {"engagement/employer_id" "emp_acme_health"}}
     {:id "doc_prior_hb_acme"
       :template "acme_handbook_ack"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-11-15"
       :facts {"engagement/employer_id" "emp_acme_health"}}
     {:id "doc_prior_tb_acme"
       :template "acme_tb_attestation"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2026-06-01"
       :facts {"engagement/employer_id" "emp_acme_health"}}]
  :expect
    {:required
      ["federal_i9"
       "federal_w4"
       "ca_de4"
       "ca_wage_theft_notice"
       "ca_harassment_training"
       "acme_handbook"
       "acme_tb_attestation"]
     :not_required ["federal_everify"]
     :states
      {:federal_i9 "available"
       :federal_w4 "complete"
       :ca_de4 "complete"
       :ca_wage_theft_notice "available"
       :ca_harassment_training "available"
       :acme_handbook "complete"
       :acme_tb_attestation "complete"}
     :missing_facts []})

(scenario acme-non-patient-facing-admin-site
  :description "W-2 nurse assigned to a non-patient-facing Texas admin site skips clinical TB attestation, California forms, and E-Verify."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_tx_01"
     :entities
      [{:id "asgn_tx_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "w2"
           :starts_on "2026-12-14"
           :is_remote true
           :credentialing_owner "usr_cred_01"
           :clinical_unit "admin"
           :status "pending"}}
       {:id "nurse_03"
         :kind "nurse"
         :attributes
          {:full_name "Devon Brooks"
           :email "devon.brooks@example.test"
           :home_state "TX"
           :is_rehire false
           :prior_assignments 0
           :us_work_authorized true
           :specialty "MedSurg"
           :status "onboarding"}}
       {:id "site_tx_admin"
         :kind "site"
         :attributes
          {:name "Austin Operations Hub"
           :state "TX"
           :country "US"
           :everify_participating false
           :patient_facing false}}]
     :links
      [{:from "asgn_tx_01" :to "nurse_03" :relation "nurse"}
       {:from "asgn_tx_01" :to "site_tx_admin" :relation "site"}]}
  :expect
    {:required ["federal_i9" "federal_w4" "acme_handbook"]
     :not_required
      ["federal_everify"
       "ca_de4"
       "ca_wage_theft_notice"
       "ca_harassment_training"
       "acme_tb_attestation"]
     :states {:federal_i9 "available" :federal_w4 "available" :acme_handbook "available"}
     :missing_facts []})

(scenario acme-1099-contractor-clinical
  :description "1099 clinician at a patient-facing California site skips W-2 federal and California tax/eligibility forms but still requires Acme handbook and TB attestation."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_1099_01"
     :entities
      [{:id "asgn_1099_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "1099"
           :starts_on "2026-12-14"
           :is_remote false
           :credentialing_owner "usr_cred_01"
           :clinical_unit "icu"
           :status "pending"}}
       {:id "nurse_04"
         :kind "nurse"
         :attributes
          {:full_name "Sora Takahashi"
           :email "sora.takahashi@example.test"
           :home_state "CA"
           :is_rehire false
           :prior_assignments 0
           :us_work_authorized true
           :specialty "ICU"
           :status "onboarding"}}
       {:id "site_ca_02"
         :kind "site"
         :attributes
          {:name "Golden Gate Surgical Center"
           :state "CA"
           :country "US"
           :everify_participating true
           :patient_facing true}}]
     :links
      [{:from "asgn_1099_01" :to "nurse_04" :relation "nurse"}
       {:from "asgn_1099_01" :to "site_ca_02" :relation "site"}]}
  :expect
    {:required ["acme_handbook" "acme_tb_attestation"]
     :not_required
      ["federal_i9"
       "federal_w4"
       "federal_everify"
       "ca_de4"
       "ca_wage_theft_notice"
       "ca_harassment_training"]
     :states {:acme_handbook "available" :acme_tb_attestation "available"}
     :missing_facts []})

(scenario acme-tb-expiry-and-renewal
  :description "Completed TB attestation within 30 days of its 1-year expiry opens a renewal item; advancing past the expiry date marks the original TB attestation expired."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_tb_01"
     :entities
      [{:id "asgn_tb_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "1099"
           :starts_on "2026-12-07"
           :is_remote false
           :credentialing_owner "usr_cred_01"
           :clinical_unit "icu"
           :status "active"}}
       {:id "nurse_05"
         :kind "nurse"
         :attributes
          {:full_name "Hannah Lindqvist"
           :email "hannah.lindqvist@example.test"
           :home_state "OR"
           :is_rehire true
           :prior_assignments 1
           :us_work_authorized true
           :specialty "ICU"
           :status "active"}}
       {:id "site_or_01"
         :kind "site"
         :attributes
          {:name "Willamette Valley Hospital"
           :state "OR"
           :country "US"
           :everify_participating false
           :patient_facing true}}]
     :links
      [{:from "asgn_tb_01" :to "nurse_05" :relation "nurse"}
       {:from "asgn_tb_01" :to "site_or_01" :relation "site"}]}
  :evidence
    [{:id "doc_tb_expiring"
       :template "acme_tb_attestation"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-12-15"
       :facts {"engagement/employer_id" "emp_acme_health"}}
     {:id "doc_hb_done"
       :template "acme_handbook_ack"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-12-15"
       :facts {"engagement/employer_id" "emp_acme_health"}}]
  :progress
    {:acme_tb_attestation
      {:status "completed"
       :document "doc_tb_expiring"
       :roles {:nurse "completed" :credentialing "completed"}}}
  :expect
    {:required ["acme_handbook" "acme_tb_attestation" "acme_tb_attestation:renewal"]
     :states
      {:acme_handbook "complete"
       :acme_tb_attestation "complete"
       "acme_tb_attestation:renewal" "available"}
     :missing_facts []}
  :steps
    [{:name "advance-past-tb-expiry-date"
       :as_of "2026-12-16"
       :expect
        {:required ["acme_handbook" "acme_tb_attestation"]
         :states {:acme_handbook "complete" :acme_tb_attestation "available"}
         :missing_facts []}}])

(scenario acme-missing-site-link-tentative
  :description "When an assignment has no linked site yet, site-derived concepts are unresolved and dependent federal, California, and TB requirements are blocked_on_facts."
  :policy-set "acme-onboarding"
  :as-of "2026-12-01"
  :snapshot
    {:subject "asgn_nosite_01"
     :entities
      [{:id "asgn_nosite_01"
         :kind "assignment"
         :attributes
          {:legal_entity_id "emp_acme_health"
           :employment_type "w2"
           :starts_on "2026-12-14"
           :is_remote false
           :credentialing_owner "usr_cred_01"
           :clinical_unit "icu"
           :status "pending"}}
       {:id "nurse_06"
         :kind "nurse"
         :attributes
          {:full_name "Noah Williams"
           :email "noah.williams@example.test"
           :home_state "CA"
           :is_rehire false
           :prior_assignments 0
           :us_work_authorized true
           :specialty "ICU"
           :status "onboarding"}}]
     :links [{:from "asgn_nosite_01" :to "nurse_06" :relation "nurse"}]}
  :expect
    {:required
      ["federal_i9"
       "federal_w4"
       "federal_everify"
       "ca_de4"
       "ca_wage_theft_notice"
       "ca_harassment_training"
       "acme_handbook"
       "acme_tb_attestation"]
     :states
      {:acme_handbook "available"
       :federal_i9 "blocked_on_facts"
       :ca_de4 "blocked_on_facts"
       :acme_tb_attestation "blocked_on_facts"}
     :missing_facts
      ["acme/patient_facing"
       "engagement/everify_enrolled"
       "work/location_country"
       "work/location_state"]})