4. Temporal versioning

Business rules change over time. A tax rate applies from a certain date. A pricing tier changes at the start of a quarter. Lemma handles this with effective dates built into the spec name itself.

When you add a date to a spec declaration, that version of the spec becomes active from that date. You can have multiple versions of the same spec, each valid for a different period. Lemma selects the right one automatically based on the date you query with.

How it works

The date in spec shipping_rates 2025-04-01 means: this version is effective from April 1st, 2025. When you query the spec, you pass an as_of date. Lemma picks the most recent version that was effective on that date.

Querying with as_of: 2025-01-01 returns results from the original version. Querying with as_of: 2025-06-01 returns results from the April version. You can time-travel to any date and get the rules that were in effect then.

Why it matters

Auditing is the obvious case: if a decision was made on a certain date, you can reproduce exactly what the rules said at that time. But it's also useful for staging future changes: write the new version now, set an effective date in the future, and it goes live automatically.

There's no migration, no feature flag, no deployment. The date in the spec name is the rollout mechanism.