Add deterministic deadline engine with derivation traces

↗ view on GitHub · Eli Ziff · 2026-07-28 · d010821f

computeDeadline encodes computation-of-time law once: Interpretation
Act s. 27(2) exclude-first-include-last, s. 27(1) clear/at-least days,
s. 28 month anniversaries with month-end clamping, s. 26 holiday
rollover (direction-aware: before-deadlines roll earlier so the clear
period never shrinks), business-day counting, and contract-designated
extra non-business days. Holiday tables are computed from statutory
formulas (Easter computus, nth-weekday, Victoria Day Monday-before-
May-25) for CA federal / ON / BC / QC / US-with-observed-shifts, never
hardcoded per year.

Every result carries a derivation trace naming the rule and any holiday
hit - the rules-as-code lesson (Blawx/s(CASP)): for lawyers the
explanation is the product. durationNormToUnit bridges the anchor
extractor's dur:N:unit norms straight into engine parameters. 14/14
tests including jurisdiction deltas (BC has no Easter Monday, QC has
Saint-Jean-Baptiste, ON-only Family Day pre-2013-BC) and leap-day
anniversary clamps.

Vetting: rules-based deadline tools (LawToolBox, CalendarRules) are
commercial, US-litigation-court-rules products; nothing open,
contract-convention-aware, or Canadian-first exists. LLM weakness on
exactly this arithmetic is documented (Test of Time arXiv:2406.09170,
PRIMETIME, Date Fragments tokenization study).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018bhP89cYSdEEjHNPnxacns
Repository eliziff/Beaver
Author Eli Ziff <eliasziff@gmail.com>
Authored
Parents 9d04ec85
Stats 2 files changed , +598
Part of Deterministic legal-text tools ("SLA audit organs")

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-d010821f.md from inside the repo you want the change in.

⬇ Download capture-commit-d010821f.md