Skip to content

feat(vintage): seed the CFTC release calendar so derived rows get real dates - #82

Merged
mspinola merged 1 commit into
mainfrom
feat/seed-release-schedule
Jul 31, 2026
Merged

mspinola merged 1 commit into
mainfrom
feat/seed-release-schedule

Conversation

@mspinola

Copy link
Copy Markdown
Owner

cotdata-schedule sync now also parses the published CFTC release schedule, which lists one year of release dates month by month and marks holiday-delayed ones with an asterisk — "Delayed release date due to a federal holiday."

What this is actually worth

Stated precisely, because it is less than it sounds: on a normal week derived (report_date + 3, weekend-adjusted) already lands on the right Friday. Most dates will not move. Seeding buys two things:

  1. It corrects the six 2026 weeks delayed by a federal holiday, where derived is wrong by three days:
report_date derived (wrong) scheduled (real) holiday
2025-12-30 2026-01-02 2026-01-05 New Year
2026-06-16 2026-06-19 2026-06-22 Juneteenth
2026-06-30 2026-07-03 2026-07-06 Independence Day
2026-11-10 2026-11-13 2026-11-16 Veterans Day
2026-11-24 2026-11-27 2026-11-30 Thanksgiving
2026-12-22 2026-12-25 2026-12-28 Christmas
  1. It upgrades provenance on every matched row from derived (a guess) to scheduled (a published fact) — which is what lets strict PIT evaluation trust the date at all. Per the design notes, derived fails on exactly the weeks that matter, and these are those weeks.

Design

report_date is derived from each release as the latest Tuesday at least three days earlier. That single rule covers both the normal Friday release and a holiday-delayed Monday one (which reports the previous week's Tuesday), with no holiday calendar of our own to maintain.

Parsed against a trimmed copy of the live page, committed as a fixture, so the parser is pinned to real markup. It reads the year from tag-stripped text (it sits inside <h3><strong>…) and raises rather than returning an empty frame on a layout change — a silent empty parse looks identical to "CFTC published nothing" and would quietly leave every row on derived.

Cross-validation

The calendar says report 2026-07-21 → release 2026-07-24. That is the same date the published mechanism independently derives from the weekly static's Last-Modified header. Two unrelated sources agree, and a test pins it.

Sanity checks in tests: 52 releases (one per week), every report_date a Tuesday, every unflagged release a Friday, all six delays landing on Mondays.

Limits

The page only ever shows the current year; CFTC does not publish past calendars there, so earlier years cannot be seeded this way and stay on announced/derived.

Also fixes a pandas FutureWarning in the announcements merge (concatenating into an empty store is deprecated and shifts dtype inference).

208 tests pass, ruff check src tests scripts clean. Live sync verified end to end.

🤖 Generated with Claude Code

…l dates

cotdata-schedule sync now also parses the published CFTC release schedule, which lists
one year of RELEASE dates month by month and marks holiday-delayed ones with an asterisk
('*Delayed release date due to a federal holiday.').

What this is actually worth, stated precisely: on a normal week 'derived' (report_date +
3, weekend-adjusted) already lands on the right Friday, so most dates do not move. It
buys two things. It CORRECTS the six 2026 weeks delayed by a federal holiday, where
derived is wrong by three days (New Year, Juneteenth, Independence Day, Veterans Day,
Thanksgiving, Christmas). And it upgrades the PROVENANCE of every matched row from
derived (a guess) to scheduled (a published fact), which is what lets strict
point-in-time evaluation trust the date at all.

report_date is derived from each release as the latest Tuesday at least three days
earlier. That one rule covers both the normal Friday release and a holiday-delayed
Monday one, which reports the previous week's Tuesday, without needing a holiday
calendar of our own.

Parsed against a trimmed copy of the live page committed as a fixture, so the parser is
pinned to real markup rather than an idealised shape. It reads the year from tag-stripped
text because it sits inside nested markup, and it RAISES rather than returning an empty
frame on a layout change: a silent empty parse looks exactly like 'CFTC published
nothing' and would quietly leave every row on derived.

Cross-validated: the calendar says report 2026-07-21 released 2026-07-24, which is the
same date the published mechanism independently derives from the weekly static's
Last-Modified header. Two unrelated sources agree, and a test pins that.

Also fixes a pandas FutureWarning in the announcements merge, where concatenating into an
empty store is deprecated and shifts dtype inference.

Coverage limit: the page only ever shows the current year, and CFTC does not publish past
calendars there, so earlier years cannot be seeded this way.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mspinola
mspinola merged commit 5d73eb1 into main Jul 31, 2026
5 checks passed
@mspinola
mspinola deleted the feat/seed-release-schedule branch July 31, 2026 01:50
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.

1 participant