← Back to Pack Library
Jurisdictionslibrarycertifiedv2026.12.0

us-ca

Certified California employment compliance library pack (RFC 0004): EDD Form DE 4 (PIT withholding), Labor Code 2810.5 Wage Theft Prevention Notice, and SB 1343 Sexual Harassment Prevention Training (2-year renewal cycle), citing California statutory and regulatory authorities.

Verify locally with CLI
Validate schema & rules
pnpm ir check packs/us-ca/pack.json
Run pack scenarios
pnpm ir test packs/us-ca/pack.json
3Requirements
0Concepts
5Scenarios

Requirements (3)

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

California Form DE 4 — Employee's Withholding Allowance Certificate

ca_de4
documentca_tax
Dueemployee: engagement/start_date (on day)
Citations
  • CA UIC 13040
  • 22 CCR 4340-1

California Labor Code 2810.5 Notice to Employee

ca_wage_theft_notice
documentca_notices
Dueemployer: engagement/start_date (on day) · employee: engagement/start_date (on day)
Citations
  • CA Lab. Code 2810.5

California SB 1343 Sexual Harassment Prevention Training

ca_harassment_training
documentca_training
Dueemployee: engagement/start_date (+180d)
Expires2 years
Renew within60 days
Citations
  • CA Gov. Code 12950.1
  • 2 CCR 11024

Scenarios (5)

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

ca-w2-new-hire
as of 2026-12-01

New US W-2 employee working in California requires Form DE 4, Labor Code 2810.5 notice, and SB 1343 harassment prevention training.

Given facts
work/location_country=USwork/location_state=CAengagement/classification=w2engagement/start_date=2026-12-07engagement/reviewer=usr_hr_01engagement/employer_id=emp_acme
Expected outcomes
+ ca_de4+ ca_wage_theft_notice+ ca_harassment_trainingca_de4: availableca_wage_theft_notice: availableca_harassment_training: available
non-ca-w2-exempt
as of 2026-12-01

US W-2 employee working in Nevada does not trigger California-specific requirements.

Given facts
work/location_country=USwork/location_state=NVengagement/classification=w2engagement/start_date=2026-12-07engagement/reviewer=usr_hr_01engagement/employer_id=emp_acme
Expected outcomes
− ca_de4− ca_wage_theft_notice− ca_harassment_training
ca-1099-contractor-exempt
as of 2026-12-01

1099 independent contractor working in California is exempt from W-2 California DE 4, Wage Theft Notice, and SB 1343 requirements.

Given facts
work/location_country=USwork/location_state=CAengagement/classification=1099engagement/start_date=2026-12-07engagement/reviewer=usr_hr_01engagement/employer_id=emp_acme
Expected outcomes
− ca_de4− ca_wage_theft_notice− ca_harassment_training
work-state-change-nv-to-ca
as of 2026-12-011 step

Work state changing from NV to CA partway through onboarding triggers California DE 4, Wage Theft Notice, and SB 1343 training.

Given facts
work/location_country=USwork/location_state=NVengagement/classification=w2engagement/start_date=2026-12-07engagement/reviewer=usr_hr_01engagement/employer_id=emp_acme
Expected outcomes
− ca_de4− ca_wage_theft_notice− ca_harassment_training
ca-rehire-reuses-de4-and-training
as of 2026-12-011 step

California W-2 rehire with prior DE 4 and SB 1343 training for the same employer reuses both, while Wage Theft Notice is required fresh; advancing past 2-year training expiry opens renewal then expires.

Given facts
work/location_country=USwork/location_state=CAengagement/classification=w2engagement/start_date=2026-12-07engagement/reviewer=usr_hr_01engagement/employer_id=emp_acme
Expected outcomes
+ ca_de4+ ca_wage_theft_notice+ ca_harassment_training+ ca_harassment_training:renewalca_de4: completeca_wage_theft_notice: availableca_harassment_training: completeca_harassment_training:renewal: available

Pack JSON

Show raw packs/us-ca/pack.json
{
  "format": 1,
  "name": "us-ca",
  "version": "2026.12.0",
  "kind": "library",
  "certified": true,
  "description": "Certified California employment compliance library pack (RFC 0004): EDD Form DE 4 (PIT withholding), Labor Code 2810.5 Wage Theft Prevention Notice, and SB 1343 Sexual Harassment Prevention Training (2-year renewal cycle), citing California statutory and regulatory authorities.",
  "requires": [
    {
      "name": "staffing-core",
      "range": "^2026.12"
    }
  ],
  "templates": [
    {
      "key": "us_ca_dlse_2810_5",
      "version": "2026.1.0",
      "title": "California Notice to Employee (Labor Code Section 2810.5)",
      "roles": [
        {
          "name": "employer",
          "kind": "user",
          "label": "Employer Representative"
        },
        {
          "name": "employee",
          "kind": "person",
          "label": "Employee",
          "after": [
            "employer"
          ]
        }
      ],
      "sections": [
        {
          "id": "employment_terms",
          "role": "employer",
          "title": "Employer and Pay Rate Disclosures",
          "fields": [
            {
              "id": "legal_employer_name",
              "type": "text",
              "label": "Legal Name of Hiring Employer",
              "required": true
            },
            {
              "id": "pay_rate",
              "type": "text",
              "label": "Rate(s) of Pay and Overtime Rate",
              "required": true
            },
            {
              "id": "pay_basis",
              "type": "choice",
              "label": "Basis of Pay",
              "options": [
                "hour",
                "shift",
                "day",
                "week",
                "salary"
              ],
              "required": true
            },
            {
              "id": "regular_payday",
              "type": "text",
              "label": "Regular Payday Designated by Employer",
              "required": true
            },
            {
              "id": "workers_comp_carrier",
              "type": "text",
              "label": "Workers' Compensation Insurance Carrier",
              "required": true
            },
            {
              "id": "paid_sick_leave_method",
              "type": "choice",
              "label": "Paid Sick Leave Method (Healthy Workplaces, Healthy Families Act)",
              "options": [
                "accrual",
                "frontload",
                "existing_policy"
              ],
              "required": true
            }
          ]
        },
        {
          "id": "acknowledgment",
          "role": "employee",
          "title": "Employee Acknowledgment of Receipt",
          "readable": [
            "employment_terms"
          ],
          "fields": [
            {
              "id": "received_date",
              "type": "date",
              "label": "Date Received",
              "required": true
            }
          ],
          "signature": {
            "id": "employee_signature",
            "attestation": "I acknowledge receipt of this Notice to Employee pursuant to California Labor Code Section 2810.5.",
            "covers": [
              "employment_terms",
              "acknowledgment"
            ]
          }
        }
      ]
    },
    {
      "key": "us_ca_sb1343_training",
      "version": "2026.1.0",
      "title": "California SB 1343 Sexual Harassment Prevention Training Attestation",
      "roles": [
        {
          "name": "employee",
          "kind": "person",
          "label": "Employee"
        }
      ],
      "sections": [
        {
          "id": "training_completion",
          "role": "employee",
          "title": "Training Completion Record",
          "fields": [
            {
              "id": "track",
              "type": "choice",
              "label": "Training Track",
              "options": [
                "nonsupervisory_1hr",
                "supervisory_2hr"
              ],
              "required": true
            },
            {
              "id": "completed_date",
              "type": "date",
              "label": "Completion Date",
              "required": true
            },
            {
              "id": "provider_name",
              "type": "text",
              "label": "Training Provider (e.g. CA CRD)",
              "required": true
            }
          ],
          "signature": {
            "id": "employee_signature",
            "attestation": "I attest that I have completed the California sexual harassment prevention training required under Government Code Section 12950.1.",
            "covers": [
              "training_completion"
            ]
          }
        }
      ]
    }
  ],
  "policies": [
    {
      "key": "us-ca",
      "version": "2026.12.0",
      "certified": true,
      "facts": {
        "work/location_country": {
          "type": "choice",
          "options": [
            "US",
            "CA",
            "GB",
            "MX",
            "OTHER"
          ]
        },
        "work/location_state": {
          "type": "choice",
          "options": [
            "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"
          ]
        },
        "engagement/classification": {
          "type": "choice",
          "options": [
            "w2",
            "1099"
          ]
        },
        "engagement/start_date": {
          "type": "date"
        },
        "engagement/reviewer": {
          "type": "string"
        },
        "engagement/employer_id": {
          "type": "string"
        }
      },
      "stages": [
        {
          "id": "ca_tax",
          "title": "California Tax Withholding"
        },
        {
          "id": "ca_notices",
          "title": "California Statutory Notices"
        },
        {
          "id": "ca_training",
          "title": "California Mandatory Training"
        }
      ],
      "requirements": {
        "ca_de4": {
          "title": "California Form DE 4 — Employee's Withholding Allowance Certificate",
          "kind": "document",
          "template": "us_ca_de4",
          "stage": "ca_tax",
          "parties": {
            "employee": "subject"
          },
          "due": {
            "employee": {
              "relative_to": "engagement/start_date",
              "days": 0
            }
          },
          "reuse": {
            "same": [
              "engagement/employer_id"
            ],
            "outcome": "satisfies"
          },
          "on_unknown": "wait",
          "cites": [
            "CA UIC 13040",
            "22 CCR 4340-1"
          ]
        },
        "ca_wage_theft_notice": {
          "title": "California Labor Code 2810.5 Notice to Employee",
          "kind": "document",
          "template": "us_ca_dlse_2810_5",
          "stage": "ca_notices",
          "parties": {
            "employer": "engagement/reviewer",
            "employee": "subject"
          },
          "due": {
            "employer": {
              "relative_to": "engagement/start_date",
              "days": 0
            },
            "employee": {
              "relative_to": "engagement/start_date",
              "days": 0
            }
          },
          "on_unknown": "wait",
          "cites": [
            "CA Lab. Code 2810.5"
          ]
        },
        "ca_harassment_training": {
          "title": "California SB 1343 Sexual Harassment Prevention Training",
          "kind": "document",
          "template": "us_ca_sb1343_training",
          "stage": "ca_training",
          "parties": {
            "employee": "subject"
          },
          "due": {
            "employee": {
              "relative_to": "engagement/start_date",
              "days": 180
            }
          },
          "reuse": {
            "same": [
              "engagement/employer_id"
            ],
            "max_age_days": 730,
            "outcome": "satisfies"
          },
          "expires": {
            "years": 2
          },
          "renew_within": {
            "days": 60
          },
          "on_unknown": "wait",
          "cites": [
            "CA Gov. Code 12950.1",
            "2 CCR 11024"
          ]
        }
      },
      "policies": [
        {
          "id": "us-ca-de4-w2",
          "title": "California Form DE 4 for W-2 employees working in California",
          "when": {
            "all": [
              {
                "fact": "work/location_country",
                "operator": "equal",
                "value": "US"
              },
              {
                "fact": "work/location_state",
                "operator": "equal",
                "value": "CA"
              },
              {
                "fact": "engagement/classification",
                "operator": "equal",
                "value": "w2"
              }
            ]
          },
          "require": [
            "ca_de4"
          ],
          "optional": false,
          "cites": [
            "CA UIC 13040",
            "22 CCR 4340-1"
          ]
        },
        {
          "id": "us-ca-wage-theft-notice-w2",
          "title": "California Labor Code 2810.5 Notice to Employee for California W-2 hires",
          "when": {
            "all": [
              {
                "fact": "work/location_country",
                "operator": "equal",
                "value": "US"
              },
              {
                "fact": "work/location_state",
                "operator": "equal",
                "value": "CA"
              },
              {
                "fact": "engagement/classification",
                "operator": "equal",
                "value": "w2"
              }
            ]
          },
          "require": [
            "ca_wage_theft_notice"
          ],
          "optional": false,
          "cites": [
            "CA Lab. Code 2810.5"
          ]
        },
        {
          "id": "us-ca-harassment-training-w2",
          "title": "California SB 1343 Sexual Harassment Prevention Training for California W-2 employees",
          "when": {
            "all": [
              {
                "fact": "work/location_country",
                "operator": "equal",
                "value": "US"
              },
              {
                "fact": "work/location_state",
                "operator": "equal",
                "value": "CA"
              },
              {
                "fact": "engagement/classification",
                "operator": "equal",
                "value": "w2"
              }
            ]
          },
          "require": [
            "ca_harassment_training"
          ],
          "optional": false,
          "cites": [
            "CA Gov. Code 12950.1",
            "2 CCR 11024"
          ]
        }
      ]
    }
  ],
  "scenarios": [
    {
      "name": "ca-w2-new-hire",
      "description": "New US W-2 employee working in California requires Form DE 4, Labor Code 2810.5 notice, and SB 1343 harassment prevention training.",
      "policy_set": "us-ca",
      "as_of": "2026-12-01",
      "facts": {
        "work/location_country": "US",
        "work/location_state": "CA",
        "engagement/classification": "w2",
        "engagement/start_date": "2026-12-07",
        "engagement/reviewer": "usr_hr_01",
        "engagement/employer_id": "emp_acme"
      },
      "expect": {
        "required": [
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training"
        ],
        "not_required": [],
        "states": {
          "ca_de4": "available",
          "ca_wage_theft_notice": "available",
          "ca_harassment_training": "available"
        },
        "missing_facts": []
      }
    },
    {
      "name": "non-ca-w2-exempt",
      "description": "US W-2 employee working in Nevada does not trigger California-specific requirements.",
      "policy_set": "us-ca",
      "as_of": "2026-12-01",
      "facts": {
        "work/location_country": "US",
        "work/location_state": "NV",
        "engagement/classification": "w2",
        "engagement/start_date": "2026-12-07",
        "engagement/reviewer": "usr_hr_01",
        "engagement/employer_id": "emp_acme"
      },
      "expect": {
        "required": [],
        "not_required": [
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training"
        ],
        "missing_facts": []
      }
    },
    {
      "name": "ca-1099-contractor-exempt",
      "description": "1099 independent contractor working in California is exempt from W-2 California DE 4, Wage Theft Notice, and SB 1343 requirements.",
      "policy_set": "us-ca",
      "as_of": "2026-12-01",
      "facts": {
        "work/location_country": "US",
        "work/location_state": "CA",
        "engagement/classification": "1099",
        "engagement/start_date": "2026-12-07",
        "engagement/reviewer": "usr_hr_01",
        "engagement/employer_id": "emp_acme"
      },
      "expect": {
        "required": [],
        "not_required": [
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training"
        ],
        "missing_facts": []
      }
    },
    {
      "name": "work-state-change-nv-to-ca",
      "description": "Work state changing from NV to CA partway through onboarding triggers California DE 4, Wage Theft Notice, and SB 1343 training.",
      "policy_set": "us-ca",
      "as_of": "2026-12-01",
      "facts": {
        "work/location_country": "US",
        "work/location_state": "NV",
        "engagement/classification": "w2",
        "engagement/start_date": "2026-12-07",
        "engagement/reviewer": "usr_hr_01",
        "engagement/employer_id": "emp_acme"
      },
      "expect": {
        "required": [],
        "not_required": [
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training"
        ],
        "missing_facts": []
      },
      "steps": [
        {
          "name": "relocate-work-state-to-ca",
          "set_facts": {
            "work/location_state": "CA"
          },
          "expect": {
            "required": [
              "ca_de4",
              "ca_wage_theft_notice",
              "ca_harassment_training"
            ],
            "not_required": [],
            "states": {
              "ca_de4": "available",
              "ca_wage_theft_notice": "available",
              "ca_harassment_training": "available"
            },
            "missing_facts": []
          }
        }
      ]
    },
    {
      "name": "ca-rehire-reuses-de4-and-training",
      "description": "California W-2 rehire with prior DE 4 and SB 1343 training for the same employer reuses both, while Wage Theft Notice is required fresh; advancing past 2-year training expiry opens renewal then expires.",
      "policy_set": "us-ca",
      "as_of": "2026-12-01",
      "facts": {
        "work/location_country": "US",
        "work/location_state": "CA",
        "engagement/classification": "w2",
        "engagement/start_date": "2026-12-07",
        "engagement/reviewer": "usr_hr_01",
        "engagement/employer_id": "emp_acme"
      },
      "evidence": [
        {
          "id": "doc_prior_de4",
          "template": "us_ca_de4",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-06-15",
          "facts": {
            "engagement/employer_id": "emp_acme"
          }
        },
        {
          "id": "doc_prior_sb1343",
          "template": "us_ca_sb1343_training",
          "template_version": "2026.1.0",
          "status": "completed",
          "completed_at": "2025-01-10",
          "facts": {
            "engagement/employer_id": "emp_acme"
          }
        }
      ],
      "expect": {
        "required": [
          "ca_de4",
          "ca_wage_theft_notice",
          "ca_harassment_training",
          "ca_harassment_training:renewal"
        ],
        "not_required": [],
        "states": {
          "ca_de4": "complete",
          "ca_wage_theft_notice": "available",
          "ca_harassment_training": "complete",
          "ca_harassment_training:renewal": "available"
        },
        "missing_facts": []
      },
      "steps": [
        {
          "name": "advance-past-2-year-training-expiry",
          "as_of": "2027-01-15",
          "expect": {
            "required": [
              "ca_de4",
              "ca_wage_theft_notice",
              "ca_harassment_training"
            ],
            "not_required": [],
            "states": {
              "ca_de4": "complete",
              "ca_wage_theft_notice": "available",
              "ca_harassment_training": "available"
            },
            "missing_facts": []
          }
        }
      ]
    }
  ]
}

Forma Lisp

Show Forma Lisp source us-ca.forma
(pack us-ca
  :format 1
  :version "2026.12.0"
  :kind "library"
  :certified true
  :description "Certified California employment compliance library pack (RFC 0004): EDD Form DE 4 (PIT withholding), Labor Code 2810.5 Wage Theft Prevention Notice, and SB 1343 Sexual Harassment Prevention Training (2-year renewal cycle), citing California statutory and regulatory authorities.")

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

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

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

(template us_ca_dlse_2810_5
  :version "2026.1.0"
  :title "California Notice to Employee (Labor Code Section 2810.5)"
  :roles
    [{:name "employer" :kind "user" :label "Employer Representative"}
     {:name "employee" :kind "person" :label "Employee" :after ["employer"]}]
  :sections
    [{:id "employment_terms"
       :role "employer"
       :title "Employer and Pay Rate Disclosures"
       :fields
        [{:id "legal_employer_name"
           :type "text"
           :label "Legal Name of Hiring Employer"
           :required true}
         {:id "pay_rate"
           :type "text"
           :label "Rate(s) of Pay and Overtime Rate"
           :required true}
         {:id "pay_basis"
           :type "choice"
           :label "Basis of Pay"
           :options ["hour" "shift" "day" "week" "salary"]
           :required true}
         {:id "regular_payday"
           :type "text"
           :label "Regular Payday Designated by Employer"
           :required true}
         {:id "workers_comp_carrier"
           :type "text"
           :label "Workers' Compensation Insurance Carrier"
           :required true}
         {:id "paid_sick_leave_method"
           :type "choice"
           :label "Paid Sick Leave Method (Healthy Workplaces, Healthy Families Act)"
           :options ["accrual" "frontload" "existing_policy"]
           :required true}]}
     {:id "acknowledgment"
       :role "employee"
       :title "Employee Acknowledgment of Receipt"
       :readable ["employment_terms"]
       :fields [{:id "received_date" :type "date" :label "Date Received" :required true}]
       :signature
        {:id "employee_signature"
         :attestation "I acknowledge receipt of this Notice to Employee pursuant to California Labor Code Section 2810.5."
         :covers ["employment_terms" "acknowledgment"]}}])

(template us_ca_sb1343_training
  :version "2026.1.0"
  :title "California SB 1343 Sexual Harassment Prevention Training Attestation"
  :roles [{:name "employee" :kind "person" :label "Employee"}]
  :sections
    [{:id "training_completion"
       :role "employee"
       :title "Training Completion Record"
       :fields
        [{:id "track"
           :type "choice"
           :label "Training Track"
           :options ["nonsupervisory_1hr" "supervisory_2hr"]
           :required true}
         {:id "completed_date" :type "date" :label "Completion Date" :required true}
         {:id "provider_name"
           :type "text"
           :label "Training Provider (e.g. CA CRD)"
           :required true}]
       :signature
        {:id "employee_signature"
         :attestation "I attest that I have completed the California sexual harassment prevention training required under Government Code Section 12950.1."
         :covers ["training_completion"]}}])

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

(policy-set us-ca
  :version "2026.12.0"
  :certified true
  :facts
    {"work/location_country" {:type "choice" :options ["US" "CA" "GB" "MX" "OTHER"]}
     "work/location_state"
      {:type "choice"
       :options
        ["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"]}
     "engagement/classification" {:type "choice" :options ["w2" "1099"]}
     "engagement/start_date" {:type "date"}
     "engagement/reviewer" {:type "string"}
     "engagement/employer_id" {:type "string"}}
  :stages
    [{:id "ca_tax" :title "California Tax Withholding"}
     {:id "ca_notices" :title "California Statutory Notices"}
     {:id "ca_training" :title "California Mandatory Training"}]
  :requirements
    {:ca_de4
      {:title "California Form DE 4 — Employee's Withholding Allowance Certificate"
       :kind "document"
       :template "us_ca_de4"
       :stage "ca_tax"
       :parties {:employee "subject"}
       :due {:employee {:relative_to "engagement/start_date" :days 0}}
       :reuse {:same ["engagement/employer_id"] :outcome "satisfies"}
       :on_unknown "wait"
       :cites ["CA UIC 13040" "22 CCR 4340-1"]}
     :ca_wage_theft_notice
      {:title "California Labor Code 2810.5 Notice to Employee"
       :kind "document"
       :template "us_ca_dlse_2810_5"
       :stage "ca_notices"
       :parties {:employer "engagement/reviewer" :employee "subject"}
       :due
        {:employer {:relative_to "engagement/start_date" :days 0}
         :employee {:relative_to "engagement/start_date" :days 0}}
       :on_unknown "wait"
       :cites ["CA Lab. Code 2810.5"]}
     :ca_harassment_training
      {:title "California SB 1343 Sexual Harassment Prevention Training"
       :kind "document"
       :template "us_ca_sb1343_training"
       :stage "ca_training"
       :parties {:employee "subject"}
       :due {:employee {:relative_to "engagement/start_date" :days 180}}
       :reuse {:same ["engagement/employer_id"] :max_age_days 730 :outcome "satisfies"}
       :expires {:years 2}
       :renew_within {:days 60}
       :on_unknown "wait"
       :cites ["CA Gov. Code 12950.1" "2 CCR 11024"]}}
  :policies
    [{:id "us-ca-de4-w2"
       :title "California Form DE 4 for W-2 employees working in California"
       :when
        {:all
          [{:fact "work/location_country" :operator "equal" :value "US"}
           {:fact "work/location_state" :operator "equal" :value "CA"}
           {:fact "engagement/classification" :operator "equal" :value "w2"}]}
       :require ["ca_de4"]
       :optional false
       :cites ["CA UIC 13040" "22 CCR 4340-1"]}
     {:id "us-ca-wage-theft-notice-w2"
       :title "California Labor Code 2810.5 Notice to Employee for California W-2 hires"
       :when
        {:all
          [{:fact "work/location_country" :operator "equal" :value "US"}
           {:fact "work/location_state" :operator "equal" :value "CA"}
           {:fact "engagement/classification" :operator "equal" :value "w2"}]}
       :require ["ca_wage_theft_notice"]
       :optional false
       :cites ["CA Lab. Code 2810.5"]}
     {:id "us-ca-harassment-training-w2"
       :title "California SB 1343 Sexual Harassment Prevention Training for California W-2 employees"
       :when
        {:all
          [{:fact "work/location_country" :operator "equal" :value "US"}
           {:fact "work/location_state" :operator "equal" :value "CA"}
           {:fact "engagement/classification" :operator "equal" :value "w2"}]}
       :require ["ca_harassment_training"]
       :optional false
       :cites ["CA Gov. Code 12950.1" "2 CCR 11024"]}])

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

(scenario ca-w2-new-hire
  :description "New US W-2 employee working in California requires Form DE 4, Labor Code 2810.5 notice, and SB 1343 harassment prevention training."
  :policy-set "us-ca"
  :as-of "2026-12-01"
  :facts
    {"work/location_country" "US"
     "work/location_state" "CA"
     "engagement/classification" "w2"
     "engagement/start_date" "2026-12-07"
     "engagement/reviewer" "usr_hr_01"
     "engagement/employer_id" "emp_acme"}
  :expect
    {:required ["ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
     :not_required []
     :states
      {:ca_de4 "available"
       :ca_wage_theft_notice "available"
       :ca_harassment_training "available"}
     :missing_facts []})

(scenario non-ca-w2-exempt
  :description "US W-2 employee working in Nevada does not trigger California-specific requirements."
  :policy-set "us-ca"
  :as-of "2026-12-01"
  :facts
    {"work/location_country" "US"
     "work/location_state" "NV"
     "engagement/classification" "w2"
     "engagement/start_date" "2026-12-07"
     "engagement/reviewer" "usr_hr_01"
     "engagement/employer_id" "emp_acme"}
  :expect
    {:required []
     :not_required ["ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
     :missing_facts []})

(scenario ca-1099-contractor-exempt
  :description "1099 independent contractor working in California is exempt from W-2 California DE 4, Wage Theft Notice, and SB 1343 requirements."
  :policy-set "us-ca"
  :as-of "2026-12-01"
  :facts
    {"work/location_country" "US"
     "work/location_state" "CA"
     "engagement/classification" "1099"
     "engagement/start_date" "2026-12-07"
     "engagement/reviewer" "usr_hr_01"
     "engagement/employer_id" "emp_acme"}
  :expect
    {:required []
     :not_required ["ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
     :missing_facts []})

(scenario work-state-change-nv-to-ca
  :description "Work state changing from NV to CA partway through onboarding triggers California DE 4, Wage Theft Notice, and SB 1343 training."
  :policy-set "us-ca"
  :as-of "2026-12-01"
  :facts
    {"work/location_country" "US"
     "work/location_state" "NV"
     "engagement/classification" "w2"
     "engagement/start_date" "2026-12-07"
     "engagement/reviewer" "usr_hr_01"
     "engagement/employer_id" "emp_acme"}
  :expect
    {:required []
     :not_required ["ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
     :missing_facts []}
  :steps
    [{:name "relocate-work-state-to-ca"
       :set_facts {"work/location_state" "CA"}
       :expect
        {:required ["ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
         :not_required []
         :states
          {:ca_de4 "available"
           :ca_wage_theft_notice "available"
           :ca_harassment_training "available"}
         :missing_facts []}}])

(scenario ca-rehire-reuses-de4-and-training
  :description "California W-2 rehire with prior DE 4 and SB 1343 training for the same employer reuses both, while Wage Theft Notice is required fresh; advancing past 2-year training expiry opens renewal then expires."
  :policy-set "us-ca"
  :as-of "2026-12-01"
  :facts
    {"work/location_country" "US"
     "work/location_state" "CA"
     "engagement/classification" "w2"
     "engagement/start_date" "2026-12-07"
     "engagement/reviewer" "usr_hr_01"
     "engagement/employer_id" "emp_acme"}
  :evidence
    [{:id "doc_prior_de4"
       :template "us_ca_de4"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-06-15"
       :facts {"engagement/employer_id" "emp_acme"}}
     {:id "doc_prior_sb1343"
       :template "us_ca_sb1343_training"
       :template_version "2026.1.0"
       :status "completed"
       :completed_at "2025-01-10"
       :facts {"engagement/employer_id" "emp_acme"}}]
  :expect
    {:required
      ["ca_de4"
       "ca_wage_theft_notice"
       "ca_harassment_training"
       "ca_harassment_training:renewal"]
     :not_required []
     :states
      {:ca_de4 "complete"
       :ca_wage_theft_notice "available"
       :ca_harassment_training "complete"
       "ca_harassment_training:renewal" "available"}
     :missing_facts []}
  :steps
    [{:name "advance-past-2-year-training-expiry"
       :as_of "2027-01-15"
       :expect
        {:required ["ca_de4" "ca_wage_theft_notice" "ca_harassment_training"]
         :not_required []
         :states
          {:ca_de4 "complete"
           :ca_wage_theft_notice "available"
           :ca_harassment_training "available"}
         :missing_facts []}}])