Replay an answer from the same inputs
Intent
Section titled “Intent”I want to replay an answer from the same inputs.
Wrong form and why it stays silent
Section titled “Wrong form and why it stays silent”Current time must not be substituted for a stored legal date; a mistyped time axis is not a date.
effective [@2026-10-01, @2026-09-01);Correct form
Section titled “Correct form”language "law.core" version "0.2";package recipe.m06 version "1.0.0";namespace "urn:recipe:m-queries:06";entity Person;relation filed(p: Person);relation accepted(p: Person);rule Accept strict { for p: Person; effective [@2026-09-01, @2026-10-01); when filed(p); then accepted(p); }Frozen execution scene
Section titled “Frozen execution scene”| Input / variant | Question | Expectation |
|---|---|---|
| 1. inside the window | truth(accepted(entity_ref("urn:recipe:m-queries:p"))) | truth_status == TRUE_ONLY; evaluation_status == COMPUTED; |
| 2. different legal date | truth(accepted(entity_ref("urn:recipe:m-queries:p"))) | truth_status == NEITHER; evaluation_status == COMPUTED; |
inside window replays identically
test "inside window replays identically" { given { context { legal_time @2026-09-13; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; } assert filed(entity_ref("urn:recipe:m-queries:p")); } evaluate truth(accepted(entity_ref("urn:recipe:m-queries:p"))); expect truth_status == TRUE_ONLY; expect evaluation_status == COMPUTED;}other law date changes hashes
test "other law date changes hashes" { given { context { legal_time @2026-10-01; decision_time @2026-09-13T09:00:00Z; knowledge_time @2026-09-13T09:00:00Z; timezone "UTC"; } assert filed(entity_ref("urn:recipe:m-queries:p")); } evaluate truth(accepted(entity_ref("urn:recipe:m-queries:p"))); expect truth_status == NEITHER; expect evaluation_status == COMPUTED;}Replay feeds the same CLIR, case, query, and semantic version 0.2. All canonical answer bytes are checked, not only truthStatus. Then two runs receive different execution receipts:
[ {"engine": "one", "executedAt": "2026-09-13T10:00:00Z"}, {"engine": "two", "executedAt": "2026-09-14T10:00:00Z"}]The receipt is passed as a separate receipt.json / EvaluationRequest.receipt field. Both implementations keep the whole answer unchanged. Changing legal_time in scene 2 leaves the program’s theoryHash and artifactHash, but changes caseHash and resultHash. Thus the three hashes theory/artifact/result cannot be used interchangeably.
Check of result fields and extra inputs:
>>> import runpy>>> checks = runpy.run_path("docs/recipes/m-queries/resources/check.py")>>> checks["replay"](https://github.com/arxohq/law/blob/master/docs/recipes/m-queries/6)TrueCounterfactual
Section titled “Counterfactual”The sidecar mutation reproduces LDC-E4109. Counterfactual table variants are executed separately; input errors are not passed off as NEITHER.
Boundary
Section titled “Boundary”The execution receipt is not part of resultHash.
Pitfall
Section titled “Pitfall”The result is invariant when the receipt changes, and changes when legal_time changes.
Documentation for Arxo. Writings — blog.arxo.io.
Anonymous visit counts on stats.arxo.io, no cookies.