Maintain the documentation#

The book is authored in MyST Markdown under docs/ and built with Jupyter Book 1.x. Source, tests and affected explanations belong in the same change. The public contribution process remains a draft; the repository’s existing documentation requirements already apply.

Build and preview#

The replacement book is now developed separately in docs-next/. Use make docs-next to build it incrementally, or make docs-next-serve for its preview at http://localhost:8001. Its review.md and review.csv track page review and acceptance. The commands below continue to build the existing book.

Draft builds reuse Sphinx’s cache and rebuild changed pages and their dependants. Use make docs-next-full to re-read every draft page and check all warnings before accepting changes. Warnings are errors in both modes, but cached pages may hide warnings during an incremental build. The first build and configuration changes may require a full rebuild. When calling the wrapper directly, PRIMO_DOCS_DIR=docs-next bash scripts/build_docs.sh --all forces one.

make docs
make docs-serve

make docs uses scripts/build_docs.sh, installs docs/requirements.txt into .venv-docs, re-reads every page and fails on Sphinx warnings. Generated HTML is in docs/_build/html. make docs-serve builds and serves it on port 8000. Use PRIMO_DOCS_VENV to select another documentation virtual environment.

Both books enable MyST’s dollarmath extension: use $...$ for inline mathematics and $$...$$ for displayed equations. Check the rendered page when adding equations or mathematical tables.

Notebook execution is disabled. A successful book build checks references and rendering, not the behavior of solver examples. Run:

make build
python3 scripts/check_doc_examples.py --solver ./build/primo

The inputs, expected outputs and invocation manifest live in docs/examples/. Guide pages use literalinclude so displayed programs and outputs are the files being checked. The checker exercises file/stdin use, models, scopes, quantified UF, selected unsupported/error responses, the preprocessing-only unknown response, both admitted assumptions routes, and the captured CLI help. It does not fuzz the solver or independently prove model validity.

Page roles#

Apply the roles below to new draft pages as well. Do not copy the entire old tree into the draft. Keep source links tied to the explained revision and record checks and remaining review questions for each page. The draft must pass page review and the release gates before replacing this book.

Use Current implementation and qualification for the canonical capability map, guide/ for user tasks, reference/ for interface details, and implementation chapters for representations and algorithms. The new implementation/ layout is still planned; use the nearest existing component chapter until it moves. Keep detailed paper notes in papers/ and dated investigations in archive/.

Active work and Open leads register index work in different states. Update them when work starts, is accepted, is rejected, or is deferred. An accepted component can still have active extensions and open hypotheses.

Add pages to docs/_toc.yml. Preserve explicit labels and old heading targets when moving a page, and update relative links in extracted content. The page map tracks reviewed structural dispositions and completed batches; structural review is not factual sign-off. The inventory audit also links the supporting file map, captured old targets, and proposed final contents. Check its compatibility snapshot before moving or renaming a page.

For an implementation chapter, include concrete types and source files, inputs/outputs, representation, ownership/lifetime, stable IDs versus borrowed references, allocating operations, invariants, failure paths, a worked example, and test/evidence links. Its paper mapping must state the relevant section, implemented subset, deviations and limitations. Do not claim a full paper algorithm when only a baseline or scaffold is present.

Writing conventions#

Explain what an operation does before describing its interface or limitations. Use standard mathematical and solver terminology, with these conventions:

  • Define a technical term or acronym at its first use when the reader needs it to understand the next step. For example, explain a strategy leaf as one tactic application, and expand CITE before discussing its simplification.

  • Keep code identifiers exact, but describe their behavior in ordinary prose. Prefer “clauses generated before simplification” to an unexplained label such as “raw clauses.”

  • Use concrete verbs and objects. Write “the transformation must preserve satisfiability,” rather than “the transformation owes an equivalence.” Avoid strings of compressed modifiers where a sentence would be clearer.

  • Keep warnings where they prevent a specific misunderstanding. State the scope of tests and experiments once in the evidence section, rather than repeatedly interrupting the algorithm with validation disclaimers.

  • Distinguish terms with different meanings. In particular, a logical guard controls when a constraint applies; an acceptance check decides whether a proposed rewrite is worth performing. Do not use “guard” for both without explaining which is meant.

Publication references#

Both books use docs/references.bib and render a bibliography page. Add a publication there once, then cite its key in MyST:

The arithmetic procedure uses exact bounds {cite:p}`DutertreM06`.
{cite:ts}`king2014` describes the SOI algorithm in §3.3.

Use doi for the cited edition when available. Otherwise provide a stable institutional or author url, with the report number or thesis institution. Keep a conference paper, expanded report, thesis and slide deck as separate entries when their sections differ. Record the section, theorem or printed page in the surrounding explanation, including whether a page number refers to the PDF or the publication’s pagination.

Import only bibliographic metadata: authors, title, venue, date and publication identifiers. Check imported author order, names, year, entry type and identifier escaping. Keep DOI and URL values literal, without TeX escapes. Raw bibliography imports under external/bib/ and local reading PDFs are ignored. Do not add abstracts, full text, local file fields or publisher figures to the book. Write the explanation in our own words and cite the source. Link to the publication; the project’s MIT license does not license third-party papers.

Reading notes must still distinguish the sections actually read, the implemented subset, deviations and open work. A bibliography entry does not establish any of those. Source comments and JSON records cannot use MyST roles; use a DOI or stable publication link there. If normalizing an old recorded command, mark a replaced input filename as a bibliography-key placeholder without presenting it as a literal command or a new run.

make docs-check-links rebuilds both books, checks citation resolution through Sphinx, and verifies the generated local links. make docs-check-external also checks publication URLs. Keep each book’s single bibliography directive on its references.md page; its default filter lists only works cited in that book. Changes to the shared BibTeX file also invalidate the draft’s cached citation data.

Distribution status#

The proposed website uses GitHub Pages with build artifacts for private review; it has not yet been configured. See the hosting plan.

The current make archive produces a deterministic source/HTML snapshot with SOURCE-REVISION, but excludes Markdown/MyST sources and the new guide fixtures under docs/. It is not yet the public release format promised by the rewrite. Updating packaging and testing the extracted-archive workflow remain M6 work. Use a repository checkout to rebuild the book or run these guide commands.

Logo assets#

The lowercase primo wordmark uses original SVG paths, navy lettering and a teal dot. docs/_config.yml selects light and dark variants. Editable assets are docs/_static/primo-logo.svg, docs/_static/primo-logo-dark.svg, and docs/_static/primo-avatar.svg; docs/_static/primo-avatar.png is the 512-pixel profile export. They need no external font and follow the MIT license.

Both books use the white p on navy from primo-avatar.png as their favicon, selected by html.favicon in each book’s configuration. Keep the copy in docs-next/_static/ synchronized with the original until the draft replaces the existing book.