fix: reject impossible calendar dates across catalog checks - #48
Merged
TMHSDigital merged 1 commit intoSep 26, 2026
Merged
Conversation
Owner
TMHSDigital
added a commit
that referenced
this pull request
Sep 26, 2026
#48 fixed impossible dates (#10) independently. Keep its isRealDate, which also handles years 0000-0099 and non-strings, and its messages ("is not a real YYYY-MM-DD date"); drop this branch's copy. Keep this branch's evidenceDates (dates inside URLs ignored) and latestAllowedDate. Both test suites pass together: 101 check and 296 lib assertions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Wc67NX9MM964uaVGn4bpZJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
verified: 2025-13-01andverified: 2026-02-30previously passed validation. JavaScript could then normalize an impossible date into another month when calculating freshness.Add a shared
isRealDatehelper that checks strictYYYY-MM-DDsyntax and round-trips the UTC year/month/day, including years 0000–0099 without the 1900 offset. Use it for catalog verification dates, Evidence dates, stackwalkeddates, and freshness calculations. Invalid Evidence dates are reported even when the section also contains valid dates; they cannot become its newest evidence. Invalid freshness dates produce the existing unknown-date result.Regression coverage includes month/day overflow, leap years and century rules, strict input shape, valid leap-day stacks/evidence, and all affected consumers.
Closes #10
Validation
Node.js v24.20.0:
node site/checks.test.mjs: 72 assertions passed.node site/lib/lib.test.mjs: 267 assertions passed.node site/validate.mjs: 319 entries, 319 unique IDs, 5 stacks, no broken links.node site/build.mjs: passed; generated entry pages, stack pages and freshness page checks passed.git diff --check,git diff --cached --check, andgit diff --check origin/main...HEAD: passed.Before the fix, the added consumer regressions produced 6 catalog-check failures and 9 site-module failures. Separately, temporarily replacing a catalog entry's
verifiedfield with each reported impossible date madenode site/validate.mjsexit 0 before the fix and exit 1 with a real-calendar-date diagnostic afterward. The original entry was restored after the checks.Type
Checklist
node site/validate.mjspassesexpectedEntryCountare unchanged; the entry-specific checklist items do not apply.AI assistance: OpenAI Codex implemented the fix and tests, reviewed the patch, and executed the validation above.