# Data library - NJDOE K-12 State Aid (GBM District Details)

Reporter's notebook for the annual per-district K-12 state school aid
allocation: where it comes from, how the file's shape drifted across the
four loaded years, and every oddity worth knowing before you trust a
category or a percent-change figure.

```toml ergo
[dataset]
ergo = "0.4"
slug = "state-aid"
title = "NJDOE K-12 State Aid (GBM District Details)"
publisher = "New Jersey Department of Education, Office of School Finance"
subject = "https://www.nj.gov/education/stateaid/"
source_url = "https://www.nj.gov/education/stateaid/"
pitfall = "FY24/FY25 carry an 'Adjustment Aid' category that FY26/FY27 drop entirely, and the state budget act's aid collar (+6.00%/-3.00%) legally binds only primary categories — so a district's total year-over-year change routinely lands close to, but not exactly on, +6.00% or -3.00%."
status = "live"
confidence = "A"
updated = "2026-08-03"
implementation = "https://github.com/lavallee/njschooldata"

[dataset.coverage]
years = "2023-24 → 2026-27 (FY24-FY27, 4 yrs)"
grain = "school year × district (excludes charters and the statewide total row)"
entities = "574-578 NJ operating school districts and county vocational districts per year"

[dataset.access]
keys = ["fiscal_year", "district_code"]
```

## Where this data now comes from

njschooldata no longer downloads or parses this source. Aquifer owns the
acquisition, the schema-era parsers, and the immutable release; the issues below
that describe parsing or source format are recorded against the producer's own
registry and are monitored here rather than handled here. The consumer adapter
installs an exact offline pin, and the issues still marked as handled are the
ones this repo genuinely handles.

Rollback is no longer "re-run the local builder" — the local builder is gone.
Roll the pin back to a retained release and re-run the adapter.

## What it is

NJDOE's "GBM District Details" workbook ("GBM" = Governor's Budget Message)
is the annual per-district breakdown of K-12 state school aid, published
each year alongside the state budget. It excludes Debt Service Aid (the
file says so on its own cover rows) and excludes charter schools entirely —
charter per-pupil funding is routed through the sending district's own aid
calculation, not published as a separate GBM line. Each row carries the
prior year's total K-12 aid, eight-or-nine category lines, the current
year's total, the dollar change, and the percent change.

Two of those years (FY26, FY27) fall under a legislated aid "collar": state
budget-act language caps a district's year-over-year aid change to a
maximum increase of +6.00% and a maximum decrease of -3.00%, for **primary**
aid categories. See
[Collar language applies to primary categories only](#collar-language-applies-to-primary-categories-only)
below for why that makes a district's *total* percent change land near, but
not exactly on, those two numbers.

## Access

Recent years publish a direct per-school-year workbook at a predictable
URL: `https://www.nj.gov/education/stateaid/<YY><YY+1>/FY<YY>_GBM_District_Details.xlsx`
(confirmed working for FY26 and FY27). Older years 404 at that pattern and
are only available inside a zipped bundle —
`https://www.nj.gov/education/stateaid/zippedfiles/<YEAR>.zip` — alongside
county summaries, preschool aid, and extraordinary-aid files. See
[Filename and container drift for older fiscal years](#filename-and-container-drift-for-older-fiscal-years).

Aquifer reads the workbook with `openpyxl` in read-only, calculated-value mode;
no CSV conversion is needed. njschooldata consumes the resulting exact release
and does not retain a second workbook parser.

## Structure

One row per district-year in `state_aid`:

```sql
CREATE TABLE state_aid (
  fiscal_year TEXT,               -- school year, e.g. "2026-27" (NJDOE's own label: "FY27")
  county_code TEXT, county_name TEXT, district_code TEXT, district_name TEXT,
  equalization_aid REAL, educational_adequacy_aid REAL, school_choice_aid REAL,
  transportation_aid REAL, special_education_aid REAL, security_aid REAL,
  adjustment_aid REAL,            -- NULL for 2025-26/2026-27 — the category was retired
  voc_expansion_stabilization_aid REAL, military_impact_aid REAL,
  prior_year_total REAL, total REAL, dollar_change REAL,
  pct_change REAL,                -- percentage points, e.g. 6.0 means +6.00%
  at_collar_max INTEGER, at_collar_min INTEGER,  -- 2025-26/2026-27 only; NULL otherwise
  source_url TEXT,
  PRIMARY KEY (fiscal_year, district_code)
);
```

`fiscal_year` is stored as the school year it funds (e.g. `"2026-27"`),
matching this warehouse's other `budget_year`/school-year conventions —
NJDOE's own label for that same file is `"FY27"`.

### Two column layouts across four years

FY24 and FY25 workbooks have **16** data columns (they include an
`Adjustment Aid` category between Security Aid and Vocational Expansion
Stabilization Aid); FY26 and FY27 have **15** — Adjustment Aid is gone. The
loader detects which layout it's reading by counting non-empty header
cells (`ncols == 16` vs `15`) rather than assuming a fixed shape. See
[Adjustment Aid retired after FY25](#adjustment-aid-retired-after-fy25).

`pct_change` is stored as **percentage points** (e.g. `6.0`, not `0.06`) —
the source file's own "Aid Percent Difference" column is a raw fraction;
the loader multiplies by 100 so `at_collar_max`/`at_collar_min` and any
downstream reader can compare directly against the collar's own `+6.00`
and `-3.00` language.

## Joins

Rows join to profile districts on `district_code` (zero-padded to 4
digits), the same convention `fall-enrollment` and `user-friendly-budgets`
use. `county_code` is *not* published by this source — see
[GBM publishes a county name, never a code](#gbm-publishes-a-county-name-never-a-code)
— it's derived from a static county-name lookup so this table's
`county_code` values match the unpadded numeric strings already used by
`enrollment`/`budget_summary` (e.g. Essex = `"13"`).

## Issues

### GBM publishes a county name, never a code

```toml ergo
[issue]
id = "county-code-not-in-source"
title = "The workbook's County column is a plain name; there is no county-code column at all"
effect = "breaks"
type = "linkage"
status = "monitor"
detection = "Column A of every loaded year is a plain county name ('Atlantic', 'Essex', ...); no column anywhere in the 15- or 16-column layout carries a numeric county code."

[issue.scope]
all = true
columns = ["county_code"]
```

`COUNTY_CODES` is a static 21-entry name -> code map matching the codes
already present in `enrollment.county_code` (unpadded numeric strings,
e.g. Atlantic = `"1"`, Essex = `"13"`, Warren = `"41"`). A county name that
doesn't match the map (case-insensitively) leaves `county_code` NULL and
prints a warning during the build — none did across the four loaded years.

### Adjustment Aid retired after FY25

```toml ergo
[issue]
id = "adjustment-aid-retired-fy26"
title = "FY24/FY25 files carry an 'Adjustment Aid' category that FY26/FY27 files drop entirely"
effect = "misleads"
type = "definitional"
status = "monitor"
detection = "The FY24 and FY25 workbooks have 16 data columns with an 'Adjustment Aid' header between Security Aid and Vocational Expansion Stabilization Aid; the FY26 and FY27 workbooks have 15 columns and no such header at all."
misuse = "Comparing a district's adjustment_aid across the FY25/FY26 boundary as a real-dollar trend, or summing all category columns for FY26/FY27 expecting the same category set as FY24/FY25 — the retirement is statewide and structural, not a district-level cut to zero."

[issue.scope]
years = "all"
columns = ["adjustment_aid"]
```

`adjustment_aid` is `NULL` for 2025-26 and 2026-27 rows, not `0` — the
category doesn't exist in those files, it isn't zero for every district.
Comparing a district's `adjustment_aid` across the FY25/FY26 boundary, or
summing all nine category columns for FY26/FY27 expecting the same set of
categories as FY24/FY25, misreads a statewide category retirement as a
district-level cut.

### Filename and container drift for older fiscal years

```toml ergo
[issue]
id = "filename-container-drift"
title = "FY26/FY27 publish a direct per-year xlsx; FY24/FY25 are only inside a zip, under a drifting filename"
effect = "breaks"
type = "availability"
status = "monitor"
detection = "https://www.nj.gov/education/stateaid/2324/FY24_GBM_District_Details.xlsx and the 2425 equivalent both 404. The same workbook exists only inside https://www.nj.gov/education/stateaid/zippedfiles/<YEAR>.zip, named 'FY24 GBM District Details.xlsx' (spaces, no 'Rev') in the 2324.zip bundle but 'FY25 GBM District Details Rev.xlsx' (a space-separated 'Rev' suffix) in the 2425.zip bundle."

[issue.scope]
years = "2023-24, 2024-25"
```

`fetch_workbook()` tries the direct URL first, and on a 404 downloads the
zip and matches the inner file by substring (`"district details" in
name.lower()`), preferring a `Rev` copy when both exist — so a future
year's exact filename doesn't need a code change, only the *pattern*
(direct vs zip) would.

### Collar language applies to primary categories only

```toml ergo
[issue]
id = "collar-primary-categories-only"
title = "The FY26/FY27 aid collar (+6.00%/-3.00%) legally binds only primary aid categories, not the published total"
effect = "misleads"
core = true
type = "definitional"
status = "open"
detection = "212 of 574 FY27 districts and 209 of 576 FY26 districts land within 0.005 percentage points of exactly +6.00%; 98 of 574 FY27 districts and 133 of 576 FY26 districts land within 0.005 of exactly -3.00% (state_aid.at_collar_max/at_collar_min). The rest cluster near, but not on, those two values."
misuse = "Treating every district whose total pct_change isn't exactly +6.00%/-3.00% as exempt from the collar, or treating every near-miss as a data error. Add-on categories (transportation, special education categorical, security, etc.) aren't collared the same way primary equalization/adequacy aid is, so a district can have its primary aid move by exactly the statutory amount while its published total drifts a few hundredths of a point off the collar boundary."

[issue.scope]
years = "2025-26, 2026-27"
columns = ["pct_change", "at_collar_max", "at_collar_min"]
```

Not a data defect — a fact about the FY26/FY27 budget act's own scope.
`at_collar_max`/`at_collar_min` flag districts within ±0.005 percentage
points of the collar values as a discovery aid, not as a claim that every
other district is uncollared.

### The worksheet embeds a statewide total row

```toml ergo
[issue]
id = "state-total-row-embedded"
title = "A 'State'/'Total' rollup row sits directly beneath the last real district row"
effect = "corrupts"
type = "entry"
status = "monitor"
detection = "The row immediately after the last district (Warren county's last row) reads County='State', District='Total', with every dollar column summed statewide; an 'End of worksheet.' marker row and blank rows can follow it."

[issue.scope]
all = true
```

`parse_workbook()` skips any row whose county is empty, `"State"`, or
whose county cell starts with `"end of worksheet"`/`"this worksheet"`/
`"note"`, and requires the district code to be all-digits — so neither the
total row nor the worksheet's descriptive banner rows reach `state_aid`.

## Validation

```toml ergo
[validation]
date = "2026-07-12"
method = "reconciled state_aid FY27 category columns against SOMSD's own publicly reported FY27 total"
result = "exact match: $11,595,011"
```

South Orange-Maplewood (district_code `4900`) reported **$11,595,011** in
total 2026-27 K-12 state aid. `state_aid` carries the same number as
`total`, and it's an exact sum of three category columns — the other five
(and `adjustment_aid`, retired by FY26) are all `$0` for this district:

| Category | FY27 amount |
|---|---:|
| Transportation Aid | $1,205,215 |
| Special Education Aid | $9,319,049 |
| Security Aid | $1,070,747 |
| **Sum (= published total)** | **$11,595,011** |

`prior_year_total` (FY26) is $10,938,691; `dollar_change` is $656,320;
`pct_change` is `6.0` — SOMSD sits exactly at the FY27 collar maximum
(`at_collar_max = 1`).

## Provenance

Latest loaded year: 2026-27 (FY27), downloaded directly from
`nj.gov/education/stateaid/2627/`. FY24 and FY25 came from NJDOE's zipped
archive bundles. Loaded 2026-07-12.

## Changelog

```toml ergo
[change]
date = "2026-07-12"
note = "Page created: state_aid table loaded for FY24-FY27 (2023-24 through 2026-27), 5 issues registered covering the missing county code, the FY26 Adjustment Aid retirement, FY24/FY25 filename/container drift, the primary-categories-only collar scope, and the embedded statewide total row. Validated against SOMSD's published FY27 total ($11,595,011, exact match)."
issues = ["county-code-not-in-source", "adjustment-aid-retired-fy26", "filename-container-drift", "collar-primary-categories-only", "state-total-row-embedded"]
```
