Adds the library world's guards as corpus rows - #228
Merged
Merged
Conversation
conformance/cases/library.json authors the renewal and standing guards of the family's library example world: the renewal guard in full and one row per conjunct that refuses it, the standing-and-fines pair, the due-soon and pickup windows, an overdue comparison, the renewal boundary, a nested read, and the holds negation. Two rows depart from their sketch because the ISA refuses the shape the sketch assumed. docs/isa.md section 5 gives subtract clauses for number-number, Date-Date, DateTime-DateTime and Date/DateTime-duration only, so 21d - 3d is a TypeMismatchError and the due-soon window is computed over a duration context value's days field instead. The same section leaves ordering between two maps unspecified for siblings, and a duration is a map at the value level, so the overdue row compares days fields rather than durations. Both carry a notes field saying so; the corpus never carries a date. The corpus diff is a regeneration: mix corpus.generate ran the twelve authored rows through the real compiler and evaluator, which is what makes their expected values true rather than asserted, and rewrote tiers 1, 3 and 4 and the manifest hash. The ratchet registry example's corpus_hash pin is refreshed to the new manifest and gains the two tier-1 evaluator entries the corpus now carries, the way a corpus regeneration has refreshed that pin before. Refs: px-5l8
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this lands
conformance/cases/library.json, the library example world's renewal andstanding guards as authored corpus rows, plus the regeneration they force.
The rows, enumerated, and what each pins:
library/renew-allowed- the renewal guard in full, satisfied.library/renew-refused-by-hold- the same guard, a hold waiting.library/renew-refused-at-max- the same guard, at the renewal limit.library/renew-refused-blocked-standing- the same guard, standing blocked.library/standing-good-no-fines- good standing and nothing owed.library/fine-owed- the same guard with one unpaid fine.library/due-soon-window- the due-soon reminder three days before theend of the loan period.
library/pickup-window- the seven-day pickup window as a duration.library/overdue-days- an overdue copy not yet at the lost-item point.library/max-renewals-boundary- the limit is exclusive at the boundary.library/nested-patron- two chained property reads over a nested context.library/holds-pending-negation- the holds flag negated.That enumeration is twelve rows, and twelve
library/*ids appear in theregenerated tier files.
Every context is drawn from the example world: the patron ids, the copy and
branch ids, the renewal limit of 2, and the loan, pickup and lost-item
durations. No case carries a date.
Corpus hash
sha256:548f54cacdcb700df0c47d67f86a944b5dbe6b0c6f96ef0c4c6fbb95b0494892sha256:bb60ec82faba2e82ef1e7abaac8d26257db2a77cd4ce0c083b683c5bc063fd43mix corpus.generateran the authored rows through the real compiler andevaluator, which is what makes their
expectedvalues true rather thanasserted, and rewrote the tier 1, tier 3 and tier 4 files and the manifest.
The asserted
tieron every row agreed with the computed one.Two rows depart from their sketch, because the ISA refuses the shape
library/due-soon-windowwas sketched as21d - 3d.docs/isa.mdsection 5's
subtractbullet gives clauses for number-number,Date-Date,DateTime-DateTimeandDate/DateTime-duration only, so aduration-duration subtraction is a
TypeMismatchError. The row computes thewindow over a duration context value's
daysfield instead, and itsnotesfield says so.
library/overdue-dayscompares thedaysfields of two duration contextvalues rather than the durations themselves. The same section leaves ordering
between two maps unspecified for siblings, and a duration is a map at the
value level. Its
notesfield says so.Both were found by reading the ISA after the generator refused the sketched
shape, not by weakening a row to pass.
Provenance
One file beyond the authored case and the regenerated corpus changed:
conformance/examples/registry.example.json. Adding two tier-1 rows moves themanifest's
corpus_hash, which that example pins, and the example claims theevaluator surface complete at tier 1, so it also gains the two new tier-1
evaluator entries.
Predicator.Conformance.RatchetRegistryTest's pin test andits R5 completeness test both name that file in their failure text; the
canonical encoding was round-tripped byte-for-byte before the edit and the
entries were re-sorted by the order rule 2 specifies. A corpus regeneration has
refreshed that same pin before, in
bdbfdab.conformance/README.mdgains one sentence under## How to add a case, without any Elixir, saying thelibrary/*rows are thefamily's shared example world and where its definition lives.
No changelog fragment
changelog.d/README.mdsays not to write a fragment for "test harness, corpustooling, or conformance fixtures". This is exactly that.
Gate
Full
mix quality, quoted whole:The branch's base is
main's tip, and the tree committed is byte-identical tothe tree that run went green on, so the commit cites this run rather than
re-running it.
Refs: px-5l8