Skip to content

Use TRUNCATE_TO_YEAR in the FRBP 9037 example - #47

Merged
jzonthemtn merged 1 commit into
mainfrom
fix/frbp-9037-example
Oct 7, 2026
Merged

jzonthemtn merged 1 commit into
mainfrom
fix/frbp-9037-example

Conversation

@jzonthemtn

Copy link
Copy Markdown
Member

The FRBP 9037 example says "dates to year only" but compiled dates to TRUNCATE. TRUNCATE keeps a set number of characters at one end of the value and replaces the rest; reducing a date to its year is TRUNCATE_TO_YEAR.

  • 04-frbp-9037.phisql and 04-frbp-9037.json now use TRUNCATE_TO_YEAR.
  • The TRUNCATE description in catalog/strategies.yaml said "e.g., dates to year only", which is likely where the example's mistake came from. It now describes what TRUNCATE does and points to TRUNCATE_TO_YEAR. The description is informative only, so what a compiler accepts is unchanged.
  • The example's header comment now says the policy is broader than the rule: FRBP 9037(a) limits only birth dates to the year and only minors' names to initials, but PhiSQL cannot yet tell those apart, so the example truncates every date and abbreviates every surname.

No grammar, schema, or compile-contract change, so no RFC is needed (CONTRIBUTING: a bug fix where the implementation diverged from the spec).

Verified locally: scripts/validate_spec.py passes, pytest scripts/tests passes (7), the Python reference compiler's tests pass (326, including test_examples_complete, which compiles each example and compares it to its JSON), and the Java reference build mvn verify passes.

🤖 Generated with Claude Code

TRUNCATE keeps leading characters rather than reducing a date to its year. Also correct the TRUNCATE catalog description, which suggested otherwise, and note that the example is broader than the rule.
@jzonthemtn jzonthemtn added the bug Something isn't working label Oct 2, 2026
@jzonthemtn
jzonthemtn merged commit 35a5331 into main Oct 7, 2026
8 checks passed
@jzonthemtn
jzonthemtn deleted the fix/frbp-9037-example branch October 7, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant