Markdown for LLMs
Pin a multi-year calendar
The source Markdown for this article. Copy it into your assistant or download it as a text file.
# Pin a multi-year calendar
## Intention
I want to use one unchanging calendar set over the whole declared period.
## Incorrect form and why it stays silent
The node period and the set digest are different obligations. An old file cannot be extended under the former hash. The timezone-database pin must be a string:
```text title="Incorrect form"
timezone_db 42;
```
Omitting timezone_db is currently accepted by check; that is not proof that the set is fit for execution.
## Correct form
```law
language "law.core" version "0.2";
package recipes.e.r09 version "0.1.0";
namespace "urn:recipe:e-time:09";
source SyntheticCalendar { kind standard; jurisdiction "none"; number "E-CALENDAR"; }
calendar Calendar {
timezone "Asia/Almaty";
timezone_db "iana-tzdb@2026a";
period [@2024-01-01, @2028-01-01);
source SyntheticCalendar;
resource "resources/calendar-2024-2027.json";
format "law.calendar/0.1";
content_hash "sha256:dfd0181e1347cc2fd48b5fd81d27f3551cabae10eaefbf8b4dffb70bcbb3cd12";
}
deadline policy Days {
start_count next_day;
include_end true;
roll next_working_day;
}
relation marker();
```
## Frozen execution scene
| Facts / cut | Question | Answer |
|---|---|---|
| 2024-01-05 + 1 business day | date | 2024-01-08 |
| 2027-12-30 + 1 business day | date | 2027-12-31 |
| 2027-12-31 + 1 business day | date | RUNTIME_ERROR, CALENDAR_OUT_OF_RANGE |
```law
test "early year rolls forward" {
given {
context {
legal_time @2026-03-10;
decision_time @2027-12-31T09:00:00+05:00;
knowledge_time @2027-12-31T09:00:00+05:00;
timezone "Asia/Almaty";
deadline_policy Days;
}
}
evaluate add_business_days(@2024-01-05, 1 business_day);
expect value == @2024-01-08;
}
```
```law
test "late year rolls forward" {
given {
context {
legal_time @2026-03-10;
decision_time @2027-12-31T09:00:00+05:00;
knowledge_time @2027-12-31T09:00:00+05:00;
timezone "Asia/Almaty";
deadline_policy Days;
}
}
evaluate add_business_days(@2027-12-30, 1 business_day);
expect value == @2027-12-31;
}
```
```law
test "beyond coverage errors" {
given {
context {
legal_time @2026-03-10;
decision_time @2027-12-31T09:00:00+05:00;
knowledge_time @2027-12-31T09:00:00+05:00;
timezone "Asia/Almaty";
deadline_policy Days;
}
}
evaluate add_business_days(@2027-12-31, 1 business_day);
expect evaluation_status == RUNTIME_ERROR;
expect issue(CALENDAR_OUT_OF_RANGE);
}
```
The calendar is synthetic: Mon–Fri, 9 March 2026 is a conventional non-working day; this is not an official calendar.
## Counterfactual
teaches substitutes a number for timezone_db and requires E1305. The set bytes and the generated law.lock are verified separately, as is rejection of both resolution chains after the resource is corrupted.
## Boundary
The set covers 2024–2027 in full; the node window is the same. This is a teaching calendar without official holidays and without a historical model of timezone transitions. Extending the period needs a new resource and a conscious update of all pins; other lock files are not rewritten.
## Pitfall
Two calendars without a chosen axis are not resolved by the first node. The resource digest and the node are pinned separately.