# Changelog of TTB List of Permittees: New Alcohol Permit Leads (`araluma/ttb-list-of-permittees`) Actor

- **URL**: https://apify.com/araluma/ttb-list-of-permittees/changelog.md
- **Full Actor documentation**: https://apify.com/araluma/ttb-list-of-permittees.md

## Changelog

Semantic versioning.

### 2.0.0 - 2026-11-23

Fixed

- Permits with a two-letter type code (for example `AZ-WS-21008`, 16 in the current file) were silently dropped from the new-permits CSV. All permits are now kept.
- In `all` mode `isNew` was always false. It now follows TTB's `New_Permit_Flag`.
- A "Page Not Found" or other HTML page served with HTTP 200 is detected and reported instead of being parsed.
- A 403 or other client error was retried as if it were a network fault. It now fails at once; 429 and 5xx are retried with backoff.
- The Actor charged a custom `actor-start` event before validating anything. It now relies on the platform's `apify-actor-start` event and charges only for records returned.
- Charge limit: the run now stops when the maximum cost per run is reached and reports it.
- A run restarted after a migration no longer pushes the first records twice.

Changed

- Columns are read by name from the header (CSV) or the file's own definitions (JSON). A renamed required column fails the run with the header it saw.
- The CSV is no longer assumed to be one long line. TTB now publishes normal rows; the old layout is still handled.
- Source discovery: the file links are read from the TTB page; if the page or link fails, the known folder is tried; if the new-permits CSV fails, the flag in the full file is used.
- Output: records are unique by permit number and sorted. New field `dataAsOf`. Text is trimmed and inner whitespace collapsed.
- Input is validated: state codes are checked and upper-cased, permit types are matched case-insensitively, `maxRecords` must be a whole number.
- Events: `new-permit` (mode `new`) and `permit-record` (mode `all`) replace `permit-item`.
- Node 24 base image, Apify SDK 3.8.0, got-scraping 4.2.2, memory 512 MB to 1 GB.

Added

- `onlyUnseen` option and the `ttb-permittees-seen` key-value store.
- `RUN_SUMMARY` record, a second dataset view, a summary link in the output schema.
- Offline tests (`npm test`) with a local stand-in for ttb.gov.

Removed

- `PARSER_HEALTH` record (replaced by `RUN_SUMMARY` and clear failure messages).

### 1.0.0 - 2026-06-29

First version: new-permits mode, full-list mode, state and permit-type filters.
