Repository navigation
Adds a guide to compiling and evaluating a rule - #209
Merged
Merged
Conversation
A how-to page under docs/guides: compile a rule's text, keep the instruction list as JSON (or the tagged encoding when it carries a date, a datetime or a float), and evaluate it for one loan, with the result each step shows. The README's Documentation map links it under Do. Refs: pts-3rn1
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.
Why
The package had no task page for the first thing a developer does with it:
compile a rule's text, keep the instruction list, and decide the rule for a
given context. The README's sections on compiling and evaluating are
reference by example; this adds the recipe.
What
docs/guides/.It states the goal and the starting point, then numbered steps in three
stages (compile, keep the list, evaluate), each step with the result it
shows. Its example is a library loan: a copy counts as lost when its loan
is more than thirty days overdue and the copy is still checked out.
its absolute GitHub URL (
docs/is not in the published package'sfiles, so a relative link would not resolve on npm).No README text is replaced: the "Compiling a rule" and "Evaluating a rule"
sections stay as the reference the page links to. No file under
src/changes, and no changelog fragment is written (
changelog.d/README.mdexcludes documentation).
Notes
is written from the package's own type declarations and the README's
"Compiling a rule", "Evaluating a rule" and "The tagged subpath" sections.
by running the page's snippets together (the instruction-list prefix, the
JSON text, both decisions, the compile refusal's reason and position, and
the unbound-variable refusal), and the snippets typecheck together under
strict settings. The page is not executed by
test/readme.test.ts, whichreads the README only.
JSON.stringify, andencodeTagged/decodeTaggedround-trip the samelist, which then evaluates; the page says so in one sentence and links the
tagged subpath.
README.md: 1168 lines, every part present.mise exec -- pnpm run gate) ran green on this head;README.mdis ingate.also_gated_paths, so the docs-only carve-out doesnot apply.
own review round checked the page against the how-to rules (goal title,
starting point, numbered steps each with a visible result, nothing taught
beyond one sentence a step) and the repository's example-world rule.
Closes pts-3rn1