Skip to content

Rewrites the README as an introduction - #241

Merged
johnnyt merged 1 commit into
mainfrom
px-sm34-readme-introduction
Oct 5, 2026
Merged

johnnyt merged 1 commit into
mainfrom
px-sm34-readme-introduction

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 5, 2026

Copy link
Copy Markdown
Member

Rewrites the README as an introduction to the package: what it is, why it exists, how to install it, one basic usage block, a map of the documentation grouped by the reader's question, and what it is compatible with. No file under lib/ or src/ changes.

What changed

  • What (under the H1): three sentences - a small, safe predicate language for Elixir; rules compile to instructions a stack machine runs; short programs run the same way.
  • Why a predicate language of its own: one paragraph on the problem before (every condition in code, or text evaluated as code) and the difference after (the rule is data, parsed by a closed grammar, stored as plain terms, evaluated with no eval). No history, no predecessor, no date.
  • Installation: the pin stays {:predicator, "~> 9.4"}.
  • Basic usage: one code block in the library loan - a renewal rule compiled once, evaluated against two loans, a missing value read back as an error value, and a short program recording the renewal. It is a doctest: test/docs_examples_test.exs still reads README.md.
  • Documentation: links grouped under Learn, Do, Look up and Understand, one line per link, no empty sub-list. The decision records folder is linked from Understand, beside the two records the old README cited.
  • Compatibility: Elixir 1.18 or later, no runtime dependencies, and how a stored rule's instruction-set version relates to the package version.
  • Contributing keeps the old Development section's pointer to the contributing guide.

The README goes from 337 lines to 112 (wc -l, base and head).

Unchanged except

Every H2 the old README had, by grep '^## ' base to head, and where its text now lives:

  • Installation, Documentation, License: kept (Documentation rewritten as the grouped map).
  • Quick Start: replaced by Basic usage, re-set in the library loan.
  • A worked example: an authorization rule: its compile-once, error-value and positions material is in the basic usage block and in the existing embedding guide (choose a compile function, store the instruction list, runtime errors and positions). Its short-program subsection (execute/3, execute_value/3, :protected_roots) moves to the language reference as "Running a program from Elixir", re-set in the library loan; that page is already doctested by test/docs_examples_test.exs, so the snippets stay executed.
  • Embedding Predicator in a host application: the provider, host slot, put_host/2 and serializable-context material already lives in the custom functions guide and the embedding guide, both linked under Do. Its editor-completion subsection moves to the language reference as "The vocabulary for an editor", with its snippets, under the same doctest.
  • Migrating from =: covered by the language reference's = note and the architecture page's grammar-break section; the record is linked under Understand.
  • Cross-Language Siblings: covered by the architecture page's section of the same name (linked under Understand) and the porting guide (linked under Do).
  • Development: becomes Contributing.

The AST reference is linked by absolute GitHub URL because the package tarball does not ship it (the doc links stage refuses a relative README link to an unpackaged file); every other page link is relative, as before.

ex_quality and the README stage

The acceptance turns the README stage on only where ex_quality 0.16.0 is on Hex. It is not (Hex's latest is 0.15.1), so this PR takes the acceptance's fallback: the ex_quality dev dependency and .quality.exs are untouched, and turning the stage on at severity: :error is left as follow-up work.

Checks

readme-lint.rb README.md --manifest .claude/diataxis.md:

README.md: 112 lines, every part present

readme-lint.rb README.md (no manifest):

README.md: 112 lines, every part present
  • Full mix quality green on the committed tree: Format, Compile, Doc links, Dependencies, Docs, Credo, Dialyzer and Tests (2,914 of 2,914, 95.5% coverage); Doctor, Gettext and Sobelow skipped as not installed, the repo's expected state.
  • test/docs_adr_links_test.exs green: the README keeps its absolute links to the two numbered records it cited before.
  • Sabotage of the basic usage block (one expected value changed) turned doctest README.md (1) red on the assertion; restored byte-equal and green.
  • The introduction was swept against the manifest's avoided terms and the fixture-only example domains; no hit.
  • No changelog fragment: changelog.d/README.md excludes documentation.

Direction check

This PR carries no record text: no ADR is added, edited or cited anew. The map's claims were checked against the pages they link at the head: each anchor (#running-a-program-from-elixir, #the-vocabulary-for-an-editor, #cross-language-siblings, #check-the-isa-version-before-you-run-a-stored-program) lands on the section its line names.

The README now reads as a What, a Why, the install line, one basic
usage block set in the library loan, a Documentation map grouped by
the reader's question, and a Compatibility section; it drops from 337
lines to 112.

The short-program snippets (execute/3, execute_value/3 and
:protected_roots) and the editor-vocabulary snippets move into the
language reference, which the docs examples test already doctests.
The host-embedding recipe, the = migration note and the siblings
section are covered by the custom functions guide, the language
reference and the architecture page, which the map links.

Refs: px-sm34
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@johnnyt
johnnyt merged commit c250b77 into main Oct 5, 2026
2 checks passed
@johnnyt
johnnyt deleted the px-sm34-readme-introduction branch October 5, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant