Skip to content

Implement Oklahoma Unemployment Insurance (ref #8264) - #8265

Open
daphnehanse11 wants to merge 8 commits into
PolicyEngine:mainfrom
daphnehanse11:ok-ui
Open

Implement Oklahoma Unemployment Insurance (ref #8264)#8265
daphnehanse11 wants to merge 8 commits into
PolicyEngine:mainfrom
daphnehanse11:ok-ui

Conversation

@daphnehanse11

@daphnehanse11 daphnehanse11 commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements Oklahoma Unemployment Insurance (administered by the Oklahoma Employment Security Commission, OESC).

Closes #8264

Regulatory authority

Monetary eligibility (§2-207)

A claimant is monetarily eligible if EITHER:

  • Test A: base-period taxable wages >= $1,500 AND base-period total wages >= 1.5 × high quarter wages
  • Test B: base-period taxable wages > 0 AND base-period total wages >= the annual taxable wage base

Annual taxable wage base

Year Amount
2025 $28,200
2026 $25,000
(Pre-2025 default: $27,000)

Weekly benefit amount (§2-104)

  • WBA = floor(high quarter taxable wages / 23)
  • Clamped to [$16, max_amount]
  • Max amount (OESC Board determination):
    Year Max WBA
    2024 $519
    2025 $541
    2026 $649

Maximum benefit amount (§2-106, HB 1933)

  • MBA = WBA × max_weeks
  • max_weeks = 26 before 2023, 16 from 2023-01-01

Partial benefits (§2-105)

  • Weekly payable = max(0, WBA - max(0, weekly_earnings - $100))

Annual benefit

  • ok_ui = min(weekly_payable × weeks_unemployed, MBA)
  • Gated by ok_ui_monetarily_eligible and Oklahoma state code

Requirements coverage

REQ Description Param Variable Test
001 Base period - ok_ui_base_period_, ok_ui_high_quarter_ -
004 Test A eligibility/min_taxable_wages, min_total_wages_multiplier ok_ui_meets_high_quarter_test ok_ui_meets_high_quarter_test.yaml
005 Test B tax/payroll/unemployment/taxable_wage_base ok_ui_meets_alternate_wages_test ok_ui_meets_alternate_wages_test.yaml
006 A OR B - ok_ui_monetarily_eligible ok_ui_monetarily_eligible.yaml
011 WBA formula wba/divisor ok_ui_weekly_benefit_rate ok_ui_weekly_benefit_rate.yaml
012 WBA clamp wba/min_amount, wba/max_amount ok_ui_weekly_benefit_rate ok_ui_weekly_benefit_rate.yaml
015 MBA - ok_ui_maximum_benefit_amount ok_ui_maximum_benefit_amount.yaml
016 max_weeks mba/max_weeks ok_ui_maximum_benefit_amount ok_ui_maximum_benefit_amount.yaml
018 Partial partial/disregard ok_ui_weekly_payable ok_ui_weekly_payable.yaml
021 Annual - ok_ui ok_ui.yaml + integration.yaml
022 Eligibility gate - ok_ui (defined_for) ok_ui.yaml + edge_cases.yaml
013 Handbook example - - ok_ui_weekly_benefit_rate.yaml Case 1 ($14,000 → $519)

Not modeled

30 NOT-MODELED items, listed in the scope decision. The most notable:

  • Able/available/seeking-work tests (§2-202, §2-205.1)
  • One-week waiting period (§2-206)
  • Disqualifications (voluntary quit, misconduct, drug/alcohol, suitable-work refusal, labor disputes, pension offset, seasonal, back-pay)
  • §1-231 16→20→26 week claim-volume escalation (treated as fixed 16 weeks per issue OK unemployment insurance #8264)
  • Alternative/extended base periods (§1-202.1, §1-202.2)
  • Alien-status rules (§2-208)
  • Extended Benefits (§§2-701 et seq.)

Historical notes

  • Maximum duration was reduced from 26 to 16 weeks by HB 1933, effective 2023-01-01.
  • $1,500 minimum taxable wage threshold has been in statute since 1980.
  • $100 partial-benefit disregard has been in statute since 1994.
  • Maximum WBA is reset annually by the OESC Board (§2-104(B)).

Files added

policyengine_us/parameters/gov/states/ok/oesc/unemployment_insurance/
├── eligibility/
│   ├── min_taxable_wages.yaml
│   └── min_total_wages_multiplier.yaml
├── wba/
│   ├── divisor.yaml
│   ├── min_amount.yaml
│   └── max_amount.yaml
├── mba/
│   └── max_weeks.yaml
├── partial/
│   └── disregard.yaml
└── index.yaml

policyengine_us/variables/gov/states/ok/oesc/unemployment_insurance/
├── ok_ui.py
├── ok_ui_base_period_taxable_wages.py
├── ok_ui_base_period_total_wages.py
├── ok_ui_gross_weekly_earnings.py
├── ok_ui_high_quarter_taxable_wages.py
├── ok_ui_maximum_benefit_amount.py
├── ok_ui_meets_alternate_wages_test.py
├── ok_ui_meets_high_quarter_test.py
├── ok_ui_monetarily_eligible.py
├── ok_ui_weekly_benefit_rate.py
└── ok_ui_weekly_payable.py

policyengine_us/tests/policy/baseline/gov/states/ok/oesc/unemployment_insurance/
├── edge_cases.yaml
├── integration.yaml
├── ok_ui.yaml
├── ok_ui_maximum_benefit_amount.yaml
├── ok_ui_meets_alternate_wages_test.yaml
├── ok_ui_meets_high_quarter_test.yaml
├── ok_ui_monetarily_eligible.yaml
├── ok_ui_weekly_benefit_rate.yaml
└── ok_ui_weekly_payable.yaml

policyengine_us/parameters/gov/states/ok/tax/payroll/unemployment/
└── taxable_wage_base.yaml (extended with 2025/2026 values)

changelog.d/
└── ok-ui.added.md

@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4c6ac7e) to head (68139b5).
⚠️ Report is 44 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8265   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3        11    +8     
  Lines           49       142   +93     
=========================================
+ Hits            49       142   +93     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

daphnehanse11 and others added 6 commits July 28, 2026 10:59
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Replace broken 2025 OESC PDF URL with working OMES PDF + OESC homepage
- Fix section citation: §1-218 → §1-201(48) + §1-223 in taxable_wage_base
- Add subsection specificity: §2-207(A) → §2-207(A)(1)/(A)(2)
- Correct PDF page anchors: divisor/min_amount/max_amount #page=49→50;
  disregard #page=50→51
- Update stale $27,400 test comments to match actual $27,000 param
- Replace 0000-01-01 sentinel with 1980-07-01 in mba/max_weeks
- Add trailing comma to make single-element reference tuples valid

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Change 0000-01-01 sentinel to 2024-01-01 in taxable_wage_base
- Replace repealed §1-202 with current §1-201(4) in base-period docstrings
- Add §2-207 reference to ok_ui_base_period_total_wages (where "total
  wages" qualifier comes from)
- Update §2-104(B) title in max_amount to clarify OESC Board determination

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@daphnehanse11
daphnehanse11 requested a review from hua7450 July 28, 2026 16:12
@daphnehanse11
daphnehanse11 marked this pull request as ready for review July 28, 2026 17:06
Remove the adds wiring into unemployment_compensation (newer core
rejects adds combined with uprating, and the integration is deferred
to PolicyEngine#8303 pending policyengine-us-data support) and the coupled
integration assertion.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@daphnehanse11

Copy link
Copy Markdown
Collaborator Author

Rebased onto current main (branch is now main + 6 commits). One substantive change during the rebase: the adds = ["ok_ui"] wiring into the federal unemployment_compensation variable was removed — newer policyengine-core rejects adds combined with uprating, and that income-flow integration is deferred to the umbrella PR #8303 pending policyengine-us-data support (per @MaxGhenis's guidance there). The PR now implements ok_ui as a standalone program. Oklahoma suite passes 56/56 locally.

@DTrim99

DTrim99 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Program Review — via /review-program (multi-agent audit)

PR: #8265 — Oklahoma Unemployment Insurance (new program, OK, 2022–2026)
Scope: 11 variables, 10 new + 1 modified parameter YAMLs, 9 test files, programs.yaml entry (verified_years: "2022-2026"), changelog fragment.
Validators: regulatory review, reference validation, code-pattern audit, test-coverage review, PDF source audit (statute + yearly numbers), 2 independent code-path verifiers.

Source Documents

# Document Link
1 Title 40 O.S. (Employment Security Act) — §§1-201, 1-217, 1-223, 1-231, 2-102, 2-104, 2-105, 2-106, 2-207 https://www.oklegislature.gov/OK_Statutes/CompleteTitles/os40.pdf
2 HB 1933 (2022), enrolled — 26→16 week duration cut, eff. 2023-01-01 https://www.oklegislature.gov/cf_pdf/2021-22%20ENR/hB/HB1933%20ENR.PDF
3 OESC Employer Important Numbers 2023 https://oklahoma.gov/content/dam/ok/en/oesc/images/misc/Employer-Important-Numbers-2023.pdf
4 OESC Employer Important Numbers 2024 https://oklahoma.gov/content/dam/ok/en/oesc/images/misc/Employer-Important-Numbers-2024.pdf
5 OESC Employer Important Numbers 2025 https://oklahoma.gov/content/dam/ok/en/oesc/images/misc/Employer-Important-Numbers-2025.pdf
6 OESC Employer Important Numbers 2026 — note the official URL carries the "Improtant" typo; it resolves to a real PDF, so the PR's hrefs are correct as-is https://oklahoma.gov/content/dam/ok/en/oesc/images/misc/Employer-Improtant-Numbers-2026.pdf
7 OESC "Oklahoma UI Tax Rates by Industry, Establishment Size and County" (Feb 2022 report; Table 1 covers 2011–2022 wage base / max WBA / MBA / conditional factors) cited in PR (oklahoma-ui-tax-rates-industry-size-county-2021.pdf)
8 OES-339 Claimant Handbook (Rev. 05-2025) cited in PR
9 USDOL Significant Measures of State UI Tax Systems, CY2024 (OK page — corroborates 2024 wage base $27,000) https://oui.doleta.gov/unemploy/pdf/sigmeasures/sigmeasuitaxsys24.pdf

All five primary PDFs were fetched and text-extracted; every 2022–2026 dollar value was checked against them (see Source Audit Summary).

Branch Status

⚠ PR branch is 41 commit(s) behind main. Consider rebasing before merge. Review scoped to merge-base diff; staleness did not affect findings.

Critical (Must Fix)

  1. 2022 base_period_wages_share = 1 (no cap) contradicts the statute — 2022 MBA overstated by up to ~88%. (CONFIRMED by code-path verification)
    File: policyengine_us/parameters/gov/states/ok/oesc/unemployment_insurance/mba/base_period_wages_share.yaml (1980-07-01: 1, first real cap at 2023-01-01: 0.4).
    Citation: 40 O.S. §2-106(3); HB 1933 enrolled text; OESC Feb-2022 tax-rates report, Table 1.
    HB 1933 rewrote only §2-106 paragraph (1) (the weeks multiple) — paragraphs (2)/(3), the conditional-factor percentage caps, are pre-existing law carried forward unchanged. There was never a year with a 100% share; the statutory range is 40–50%. Table 1 of the PR's own cited source shows the conditional factor was D in 2021–2022, so the 2022 base-period-wages cap was 40%. The PR's own mba/max_amount.yaml 2022 value ($9,900 = 20% of average annual wage) already encodes factor D for §2-106(2) in 2022 — the two parameters are internally contradictory. The wrong value is load-bearing: ok_ui_maximum_benefit_amount.py computes min(26×WBA, $9,900, 1×BPW) instead of min(26×WBA, $9,900, 0.4×BPW); the cap binds for any claimant with base-period wages < ~2.83× high-quarter wages (a broad, realistic band — Test A only requires 1.5×). Example: HQW $8,000 / BPW $12,000 → repo MBA $9,022 vs statutory $4,800. 2022 is claimed (programs.yaml verified_years: "2022-2026") and tested — the existing 2022 tests just happen to sit outside the binding band.
    Fix: 2022-01-01: 0.4 (or, if backdating is kept, use Table 1's factor history: 0.5 for no-factor years, 0.4 for 2021–2022 — never 1). Add a 2022 test in the binding band (e.g. HQW $6,900 / BPW $12,000 → MBA $4,800).

  2. taxable_wage_base.yaml history replacement silently changes/breaks pre-2022 OK payroll tax.
    File: policyengine_us/parameters/gov/states/ok/tax/payroll/unemployment/taxable_wage_base.yaml.
    This pre-existing parameter is consumed outside the new program by policyengine_us/variables/gov/states/tax/payroll/unemployment/taxable_earnings_for_state_unemployment_tax.py (generic state selector; OK registered in _jurisdictions.py). The PR deletes the old 0000-01-01: 27_000 anchor and starts the series at 2022-01-01: 24_800. The new 2022–2026 values are the correct OESC figures (the old flat $27,000 was only right for 2024), but pre-2022 is now undefined: simulations of years ≤ 2021 touching OK state unemployment payroll tax will backward-extrapolate to $24,800 (or error), instead of the previous $27,000 behavior.
    Fix: keep a pre-2022 anchor (e.g. 2021-01-01: 24_000 per the Feb-2022 report's Table 1, which lists 2011–2022 values if fuller backdating is wanted). Expect OK payroll-tax diffs for 2022/2023/2025/2026 in any regression comparison — an intended accuracy improvement, but worth stating in the PR body.

  3. os40.pdf#page=XX statute anchors are internally inconsistent — the same section is cited at different pages in different files.
    Files: wba/divisor.yaml, wba/min_amount.yaml, wba/max_amount.yaml (§2-104 at #page=50) vs ok_ui_weekly_benefit_rate.py (§2-104 at #page=49); partial/disregard.yaml (§2-105 at #page=51) vs ok_ui_weekly_payable.py (§2-105 at #page=50); ok_ui_base_period_total_wages.py (§2-207 at #page=56 mixed with #page=42).
    A section cannot be on two pages; printed-page vs file-page offsets into the 340-page consolidated Title 40 PDF are the likely cause. Render os40.pdf and confirm the file page for each of §1-201(48), §1-223, §1-231, §2-104, §2-105, §2-106, §2-207, then make every citation of a given section use the same #page. A wrong statute anchor is worse than none.

  4. taxable_wage_base.yaml re-hosted statute anchors unverified.
    File: policyengine_us/parameters/gov/states/ok/tax/payroll/unemployment/taxable_wage_base.yaml.
    The PR replaces the old oksenate.gov citation (#page=32, §1-223) with oklegislature.gov anchors: §1-201(48) at #page=23, §1-223 at #page=44. The statutory content is correct (verified against OSCN HTML), but the host/edition changed and the page numbers were not carried over reliably — confirm both file pages as part of item 3.

  5. edge_cases.yaml is a forbidden aggregate test file — merge into the per-variable test files.
    File: policyengine_us/tests/policy/baseline/gov/states/ok/oesc/unemployment_insurance/edge_cases.yaml (530 lines, Cases 1–23).
    Repo/skill convention: edge cases are appended to the existing {variable}.yaml files, never collected in a new file. Redistribute: Cases 1–6 → ok_ui_meets_high_quarter_test.yaml / ok_ui_meets_alternate_wages_test.yaml / ok_ui_monetarily_eligible.yaml; 7–12 → ok_ui_weekly_benefit_rate.yaml; 15–18 → ok_ui_weekly_payable.yaml; 19–20 → ok_ui_maximum_benefit_amount.yaml; 13–14, 21–23 → ok_ui.yaml. The cases themselves are mostly good — this is structural, not functional.

Should Address

  1. §2-207(A)(2): the 1.5× monetary-eligibility prong is applied to taxable high-quarter wages; the statute and all OESC public guidance use unqualified "wages." (CONFIRMED by code-path verification; LOW practical severity — narrow affected population)
    File: policyengine_us/variables/gov/states/ok/oesc/unemployment_insurance/ok_ui_meets_high_quarter_test.py (multiplies min_total_wages_multiplier by ok_ui_high_quarter_taxable_wages).
    Citation: 40 O.S. §2-207(A)(2) ("one and one-half (1 1/2) times the amount of wages ... in which the wages were highest" — unqualified, contrast prong (1)'s "Taxable wages"); §1-218 ("wages" = uncapped remuneration); OES-339 handbook and the OESC website both phrase the test with plain "wages," so the ambiguity defense fails. The model also has no ok_ui_high_quarter_total_wages variable, so the statutory quantity is unrepresentable and the high quarter is implicitly identified by taxable rather than total wages. Verified impact: for all inputs consistent with the PR's own variable semantics, only the intermediate boolean can flip — final ok_ui_monetarily_eligible is rescued by Test B (any claimant with a quarter above the wage base necessarily passes Test B), and no PR test changes outcome; a final-outcome divergence is constructible only under exotic annual-cap wage timing. Fix: add an ok_ui_high_quarter_total_wages input and use it in the 1.5× comparison; at minimum document the taxable-wage proxy and its no-final-effect property.

  2. Post-2025 duration escalation (§2-106(1)(c) / §1-231) held at a fixed 16 weeks; possible 2024 amendment uncited.
    File: policyengine_us/parameters/gov/states/ok/oesc/unemployment_insurance/mba/max_weeks.yaml (stops at 2023-01-01: 16).
    Citation: 40 O.S. §2-106(1)(c) ("between sixteen (16) and twenty (20) times ... dependent upon the state's average unemployment insurance claims"); §1-231(B) (16 weeks at ≤5,000 average claims, escalating to 26 above 40,000 continued claims). Holding 16 matches the low-claims branch and the Rev. 05-2025 handbook, and the limitation is disclosed in the ok_ui.py docstring — but confirm 16 was operative for 2025/2026, and note OSCN shows §1-231 was amended by HB 3596 (Laws 2024, eff. Nov 1 2024): verify the modeled values survive the amendment and add the HB3596 citation if it governs 2025+.

  3. §2-106(2) average-annual-wage cap is unmodeled and its mba/max_amount proxy is under-documented (and a no-op post-2023).
    Files: policyengine_us/parameters/gov/states/ok/oesc/unemployment_insurance/mba/max_amount.yaml; policyengine_us/variables/gov/states/ok/oesc/unemployment_insurance/ok_ui.py (docstring).
    Citation: 40 O.S. §2-106(2) (applicable % of state average annual wage, rounded to nearest $100). The 2023–2026 published values (7,888/8,304/8,656/10,384) equal exactly 16 × max WBA and are not $100 multiples, so they cannot be the §2-106(2) statutory quantity — arithmetically the parameter never binds post-2023 (min(WBA×16, maxWBA×16) = WBA×16). The omission appears benign (the §2-106(2) leg should never bind under any conditional-factor pairing), but neither ok_ui.py's "Not modeled" inventory nor max_amount.yaml's description says the parameter is an OESC-published proxy. Document both.

  4. Docstring corrections.
    Files: ok_ui_high_quarter_taxable_wages.py, ok_ui_base_period_taxable_wages.py, ok_ui.py.
    (a) The input docstrings say taxable wages are "capped at the Oklahoma taxable wage base per quarter"; §1-201(48) caps taxable wages per calendar year. (b) The ok_ui.py "Not modeled" inventory omits §2-106(2) (see item 3) and the §1-217(B)(2) 15% wage/hour-loss prong of the deemed-unemployed test — add both.

  5. Missing boundary tests for parameter year-steps and cap interactions (no formula variable is untested, but several parameter values are never exercised):
    Files: policyengine_us/tests/policy/baseline/gov/states/ok/oesc/unemployment_insurance/*.yaml.

    • 2026 Test-B wage-base boundary (the only downward step, $28,200 → $25,000): add total_wages 25_000 → true / 24_999 → false to ok_ui_meets_alternate_wages_test.yaml.
    • WBA max clamp for 2023 ($493) and 2025 ($541) in ok_ui_weekly_benefit_rate.yaml (only 2022/2024/2026 clamps are pinned there).
    • A case where the statewide mba/max_amount is the sole binding cap (e.g. 2025: HQW $20,000 → WBR 541, 541×16 = $8,656 = max_amount; total wages $100,000).
    • The 2026 base_period_wages_share step (0.4 → 0.475) binding (e.g. 2026: HQW $10,000, total $12,000 → MBA $5,700).
    • Share cap binding while weeks_unemployed < max_weeks (confirms min() ordering in ok_ui.py).
    • A 2023 case confirming the 16-week regime took effect exactly at 2023-01-01 (no 2023 test exists at all).
    • Per Critical 1's fix, a 2022 case where the 40% share cap binds.
  6. Negative-input guard: negative ok_ui_base_period_total_wages yields a negative MBA and negative ok_ui (latent bug).
    Files: ok_ui_maximum_benefit_amount.py, ok_ui.py, ok_ui_weekly_benefit_rate.py.
    min_(min_(WBR×weeks, max_amount), total_wages×share) with negative total wages returns the negative product, which then propagates through ok_ui = min(payable×weeks, MBA). Also, no test proves the $16 WBA floor holds against a negative HQW (floor(−5,000/23) = −218 → max(−218, 16) = 16). Add both cases; guard with max_(..., 0) if the negative-MBA probe confirms the bug.

  7. Zero-default wage inputs — add a microsimulation documentation note.
    Files: ok_ui_base_period_taxable_wages.py, ok_ui_base_period_total_wages.py, ok_ui_high_quarter_taxable_wages.py, ok_ui_gross_weekly_earnings.py.
    These are direct inputs (default_value = 0; quarterly wages are not derivable from annual microdata), so in microsimulation ok_ui is 0 for the entire population — a household-calculator-only estimate by design (the entry is economy: false / household: true, mirroring AL UI). No prescriptive default is warranted; document the zero-default consequence in the variable docstrings/PR body so reviewers don't expect aggregate or net-income effects.

  8. Reference formatting: page numbers embedded in title: strings.
    Files: mba/max_amount.yaml ("... 2021, page 2"), wba/max_amount.yaml (two instances, incl. "OES-339 ... page 4"), taxable_wage_base.yaml ("... 2021, page 2").
    Page numbers belong in href: (#page=XX, already present) — drop them from the titles.

  9. Description wording: value 1.5 described as a "share."
    File: policyengine_us/parameters/gov/states/ok/oesc/unemployment_insurance/eligibility/min_total_wages_multiplier.yaml ("this share of high quarter wages"). A value > 1 is a multiple, not a share — reword to "this multiple of high quarter wages" (the label already says "multiplier").

Suggestions

  1. Add OSCN per-section HTML mirrors alongside the monolithic PDF. Deep #page links into the 340-page os40.pdf break on re-pagination. Verified stable per-section URLs: §2-104 oscn.net/...CiteID=77164, §2-105 77165, §2-106 77166, §2-207 77177, §1-201 77132, §1-223 77157, §1-231 492632.
  2. Subsection precision in reference titles. mba/max_amount.yaml and mba/max_weeks.yaml cite bare "§2-106"; add the paragraph (e.g. "§2-106(1)") to match the pattern used elsewhere ("§2-207(A)(1)", "§2-104(B)").
  3. Surface the "Not modeled" inventory in app-facing metadata, not just the ok_ui.py source docstring, so users see the disqualification/waiting-week/alternative-base-period limitations.
  4. ok_ui_gross_weekly_earnings naming: label says "weekly" but definition_period = YEAR (intentional, documented); a caveat in the label/app docs would reduce confusion since the partial-benefit math treats it as one week's earnings.
  5. PR-body note that ok_ui is intentionally not wired into unemployment_compensation or household net income (standalone modeled estimate, consistent with the AL UI pattern) so reviewers don't expect a net-income effect. Minor test idiom note: several edge cases attach absolute_error_margin: 0.01 to outputs that include booleans — harmless (margin < 1 does not void a boolean) and needed for the co-checked currency outputs; no action.

Source Audit Summary

Audit Checked Matches Mismatches Notes
Statute audit (§§2-102, 2-104, 2-105, 2-106, 2-207, 1-217, 1-231; HB1933; OES-339) 18 17 1 Mismatch: §2-207(A)(2) taxable vs plain wages → verified CONFIRMED, low severity (Should Address 1)
Yearly numbers audit (wage base, max WBA, max MBA, share, $1,500 floor, effective dates; 2022–2026) 21 20 1 Mismatch: 2022 share = 1 vs statutory 0.4 → verified CONFIRMED, critical (Critical 1). All dollar values incl. 2022 corroborated from the PR's own cited sources
Total 39 37 2 Both mismatches independently CONFIRMED by dedicated code-path verifiers

The reference validator's inability to machine-read the OESC bulletins (S1 in its report) was superseded by the PDF audit, which fetched and read all of them — every 2022–2026 dollar value is now source-corroborated. Remaining open reference risks are the page anchors (Critical 3–4) and the HB3596 question (Should Address 2).

Validation Summary

Check Result
CI ✅ All 33 checks pass
Regulatory review (Validator 1) ✅ Core formulas (WBA, partial, MBA lesser-of, A/B tests) match statute; 0 critical
Reference validation (Validator 2) ⚠ 2 critical (page-anchor inconsistencies; re-hosted anchors)
Code-pattern audit (Validator 3) ⚠ 1 critical (taxable_wage_base history), 4 should-address
Test coverage (Validator 4) ⚠ 1 critical (edge_cases.yaml), 7 should-address; all 7 formula variables have dedicated tests, integration test present
PDF source audit ✅ 37/39 values match; 2 confirmed mismatches (above)
Code-path verification ✅ Both mismatches traced end-to-end; severities assigned (LOW / CRITICAL)
Changelog fragment changelog.d/ok-ui.added.md
programs.yaml entry verified_years: "2022-2026" claim is undermined by Critical 1 for 2022

Review Severity: REQUEST_CHANGES

Five critical findings — one confirmed regulatory value error active in a claimed/tested year (2022 MBA cap), one cross-program parameter-history regression, two citation-integrity blockers, and one test-structure violation — require changes before merge. The core program logic is otherwise sound and thoroughly source-verified.

Next Steps

  1. Run /fix-pr 8265 to apply the fixes above (start with Criticals 1–2, then the anchor reconciliation, then redistribute edge_cases.yaml).
  2. Rebase onto main (branch is 41 commits behind) and re-run CI.
  3. Render os40.pdf locally (poppler) to pin the true file pages for each cited section before updating anchors.
  4. After Critical 1's fix, re-confirm the programs.yaml verified_years: "2022-2026" claim (or drop 2022).

🤖 Generated by /review-program (Claude Code multi-agent review)

…tests

- Set 2022 base-period wages share to 0.4 (conditional factor D per
  40 O.S. 2-106(3) and the OESC table); pre-2023 uncapped value was
  incorrect and overstated 2022 MBAs
- Restore the pre-existing 0000-01-01: 27,000 taxable wage base anchor
  the PR had dropped, keeping pre-2022 OK payroll tax identical to main
- Reconcile every os40.pdf page anchor to verified file pages; add
  stable OSCN per-section HTML references and HB 3596 citation for the
  16-week duration; strip page numbers from reference titles
- Document the taxable-wage proxy in the 1.5x eligibility test, the
  16x-max-WBA proxy for the 2-106(2) cap, the calendar-year wage-base
  cap, the unmodeled duration escalator, and microsim-inert inputs
- Guard maximum benefit amount against negative wages with max_(.., 0)
- Dissolve the aggregate edge_cases.yaml into per-variable test files
  and add boundary tests (2026 wage-base step, WBA clamps, binding MBA
  caps by year, 16-week seam, negative wages)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DTrim99

DTrim99 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Fixes Applied (from Program Review)

Commit 68139b5 addresses all actionable findings from the review above.

Critical

  • 2022 MBA cap corrected: mba/base_period_wages_share.yaml now applies 0.4 in 2022 (conditional factor D per 40 O.S. § 2-106(3) and the OESC table) instead of an uncapped 1 — the percentage caps pre-existed HB 1933, which only rewrote the weeks multiple. A 2022 binding-band test was added (HQW $6,900 / BPW $12,000 → MBA $4,800).
  • Restored the wage-base anchor: the PR had deleted the pre-existing 0000-01-01: 27_000 value from taxable_wage_base.yaml, silently changing pre-2022 OK payroll tax. The anchor is restored ahead of the new 2022–2026 series; the payroll consumer test passes unchanged.
  • Every os40.pdf page anchor reconciled to verified file pages (§ 1-201(48) p23, § 1-223 p44, § 1-231 p48, § 2-104 p50, § 2-105 p51, § 2-106 p51, § 2-207 p56) — the previously inconsistent § 2-104/§ 2-105 cites now agree everywhere.
  • Aggregate edge_cases.yaml dissolved: its 23 cases were redistributed into the per-variable test files (eligibility, WBA, payable, MBA, ok_ui) with titles preserved, then the file was removed.

Should Address

  • § 2-207(A)(2) wage-basis deviation documented: the statute applies the 1.5× test to unqualified (total) wages; the implementation uses taxable high-quarter wages as a proxy. Documented in the docstring rather than adding a new zero-default input — the verifier confirmed the deviation affects only capped high-quarter earners and Test B rescues final eligibility in modeled cases.
  • HB 3596 (Laws 2024) verified and cited for the 16-week duration floor from 2025; the § 2-106(1)(c)/§ 1-231 16–26-week escalator documented as unmodeled.
  • Corrected docstrings: the wage-base cap is per calendar year (§ 1-201(48)), not per quarter; the 2023–26 mba/max_amount values documented as OESC-published 16×max-WBA proxies for the § 2-106(2) cap; not-modeled inventory (disqualifications, waiting week, alternative base period, 15% wage-loss prong) surfaced in the app-facing documentation string.
  • Negative-wages guard: ok_ui_maximum_benefit_amount now floors base-period wages at 0 (negative inputs previously produced a negative MBA and negative ok_ui); the $16 WBA floor already covered negative high-quarter wages. Tests added.
  • New boundary tests: 2026 Test-B wage-base step ($24,999/$25,000), WBA max clamps for 2023 ($493) and 2025 ($541), MBA max_amount sole-binding case, 2025 share-binding case, 2023 16-week seam.
  • Zero-default microsim notes on the four wage inputs; "share" → "multiple" wording; page numbers stripped from reference titles.

Suggestions

  • Stable OSCN per-section HTML references added beside the monolithic os40.pdf; subsection precision in § 2-106 titles; gross_weekly_earnings label now flags the YEAR-period/weekly-figure convention.

Skipped (deliberate)

Verification

  • All 67 OK UI YAML tests pass locally, plus the OK payroll wage-base consumer test (1/1) confirming pre-2022 behavior is identical to main.
  • ruff format + check clean.

🤖 Applied via /fix-pr (Claude Code)

@DTrim99
DTrim99 requested a review from PavelMakarchuk August 4, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OK unemployment insurance

2 participants