Praetor documentation gate and engine pin¶
Praetor is the standards engine that make verify-all and the required Standards job run. This page covers what a contributor needs when the gate touches documentation, and how a maintainer moves the engine pin. For the other local checks see CI overview.
Praetor documentation gate¶
make verify-all runs two targets from praetor's Documentation Governance gate, which the docs:seo-portal facet in .standards.yaml requires:
| Target | Runs | Notes |
|---|---|---|
make docs-lint | node tools/markdownlint/verify.mjs | Installs its pinned markdownlint library (0.41.1, ADR-1506) from the npm registry into a temporary directory, so it needs network access and leaves no node_modules in the tree. |
make docs-figures | node tools/figures/build.mjs check and sources | Skips, and says why, while the repository has no figure spec under docs/figures/ and no output under docs/assets/figures/. |
Both need Node.js 24. The hosted copy is praetor-docs.yml, whose check name is Documentation Governance.
Files praetor owns¶
Do not edit praetor-owned files by hand
praetorctl audit locks them byte for byte. A praetor pin move in standards-gate.yml brings their updates, and Renovate is told to leave them alone.
The locked files are:
.github/workflows/praetor-docs.yml;- everything under
tools/markdownlint/andtools/figures/; - the
# BEGIN praetor documentation gateblock in theMakefile; - the
# BEGIN praetor managed attributesblock in.gitattributes.
Three more files are praetor's text without being locked: .config/lefthook/engine.sh, .config/praetor/engine.mk and .config/agent/hooks/block_evasion.py. praetorctl adopt writes them and audit does not read them. At a pin move adopt refreshes each one only while it is still one of praetor's own texts. An edited copy is kept as the repository's file and stops following the pin. So none of them is edited, formatted or given a licence header here:
- shfmt skips the launcher through a dated exception in
.config/lint-exceptions.d/shfmt.toml(tekmora/praetor#1282); - the launcher and
block_evasion.pyhave dated exceptions in.config/lint-exceptions.d/spdx.toml, and the default annotation ofREUSE.tomllabels them (tekmora/praetor#1281).
Consequences worth knowing:
- The workflow keeps praetor's name, which is two characters over the 30-character budget in CI job display names.
- Praetor ships its figure player bundle under
tools/figures/player/, which audit hashes; the repository-widedist/ignore rule no longer covers it, so.gitignorecarries no re-include for it. - The repository's own black, ruff and markdownlint pre-commit hooks skip
tools/figures/, since a rewrite there fails the audit (tekmora/praetor#578). - Praetor requires Git to ignore the retired numbered workspace root, so the ADR-1277 contract check accepts praetor's managed rule for it and nothing else (ADR-1351).
Settings¶
The gate's settings live in the documentation block of .standards.yaml:
| Setting | Value | Reason |
|---|---|---|
max_files | 8192 | The tree holds about 4,000 Markdown files, close to the default bound of 4,096. |
max_file_bytes | 4194304 | docs/rebase-notes.md, docs/changelog-archive/1.0.0-rc.1.md and docs/state.md exceed the default 1 MiB. 4 MiB is praetor's ceiling. |
style_exclude | docs/adr/README.md, docs/adr/_index_fragments/[0-9]*.md, **/testdata/** | The generated ADR index, the per-ADR row fragments and test fixtures, which the repository's own markdownlint hook in .pre-commit-config.yaml also skips. |
docs/rebase-notes.md grows with every rebase-sensitive change. It is about 3.2 MB and must be split before it reaches the 4 MiB ceiling.
Style rules and line length¶
Excluded files still go through the gate's private-link rule. The style rules come from praetor's locked tools/markdownlint/markdownlint-cli2.yaml, not from the root .markdownlint.json, which the gate ignores.
The two disagree on MD013: praetor turns it off, the root file limits lines to 80 characters. To exempt a block from line length, wrap it:
<!-- markdownlint-capture -->
<!-- markdownlint-disable MD013 -->
long lines here
<!-- markdownlint-restore -->
A closing markdownlint-enable MD013 switches the rule on with markdownlint's defaults under praetor's configuration, tables included.
Moving the praetor pin¶
PRAETOR_REF in standards-gate.yml names the praetor commit that CI installs with go install. The hooks run the same engine. The governance jobs of lefthook.yml, scripts/git-hooks/hiss-audit.sh and scripts/githooks/state-sync.sh call praetor's launcher, sh .config/lefthook/engine.sh <arguments>. It reads the pin from the workflow and runs the engine installed for that pin under ${XDG_CACHE_HOME:-$HOME/.cache}/praetor/engine/<pin>.
The first hook after a pin move installs the engine with go install. That needs the Go toolchain and the network, and is bounded by PRAETOR_ENGINE_INSTALL_TIMEOUT seconds (default 300). An unreadable pin, two different pins or a failed install end the hook: the launcher does not fall back to an engine on PATH.
make verify-all and a praetorctl command you type still run the engine on PATH. Check that one before you rely on its result:
To move the pin, change PRAETOR_REF to a commit whose own CI is green, install that engine, and let it regenerate what it owns:
-
Install the engine and put it first on
PATH: -
Regenerate the locked and compiled files:
-
Record the baseline with the new engine, on the final tree:
-
Verify:
Run adopt --force only in a throwaway copy
praetorctl adopt --force --lock-source-root=<praetor checkout> rewrites the AGENTS.md harness with a table that marks every invariant as not enforced, adds praetorctl hook entries to the agent settings files and writes .gemini/settings.json, which the local exclude file hides. None of that is wanted here (ADR-1351). Run it in a copy of the tree, never the real one, and copy back only the files that audit reports as stale (the documentation gate assets and the .devcontainer/ bootstrap in the last move).
Rules for a move¶
Three rules hold the move together:
- Record the baseline with the new engine, on the final tree. The baseline is keyed by file and line, and the engine decides what counts. A move may raise it with
--allow-increaseonly when the old engine records no growth on the same tree and every added entry traces to an engine change, as ADR-1351 shows for the last move. Growth caused by code stays forbidden. - Update the README governance block by hand if audit says it is stale. The line
<n> recorded infractions; audit forbids growth.must equaltotal_infractionsin.standards-baseline.json. - Bring every branch to the merged pin. The two engines do not read each other's trees. The hooks follow the pin of the tree they run in through the launcher, so a branch moves by taking the merged pin from
master. An engine onPATHthat you call yourself has to move with it. Measured on the move to6c772713a133: - the new engine fails
compile-context --verify,auditandhiss coverage --verifyon a branch at the old pin (register block, 244 entries the old baseline does not record, a renamed HISS-01 catalog title); - the old engine fails the same three and
flavor auditon the new tree, because it cannot parserepository.default_branch,documentationorregister.sourcesin.standards.yaml; dedupe scan .passes in both directions.
Audit in hooks¶
scripts/git-hooks/hiss-audit.sh runs the audit in both the pre-commit and the pre-push hook. Since praetor 6c772713a133 an audit reads the live Actions permissions and the last workflow runs from GitHub, which takes about 40 seconds here against 2 seconds offline, so the hooks pass --offline when the engine has the flag. CI and make verify-all keep the forge read.
The script calls the launcher, so the audit is the pinned engine's. Without the launcher the hook ends with status 127 and no engine runs.
The current pin¶
The pin is 6622361940dc (ADR-3285), four praetor commits after 9bf502ec6ce5. Against 9bf502ec6ce5 it changes this here:
- Register skills.
adhd-format,cavemanandsocial-textunder.agents/skills/and.claude/skills/are praetor's text at the pin, wrapped so they pass markdownlint's default rules; what they say is unchanged. - Not in effect here yet. Praetor's commit-message and pull-request checks now refuse a closing keyword that would close someone else's pull request. No gate of this repository runs those checks.
- Not adopted. As at the pin before, the pre-tool hook entries
adoptwrites into the agent settings, and.config/lefthook/python.sh, which this repository'slefthook.ymldoes not call.
Audit's warnings are the same 143 with both engines.
The pin before was 9bf502ec6ce5 (ADR-3272), three praetor commits after 4ae6247c57d2. Against 4ae6247c57d2 it changed this here:
- Hook launcher.
.config/lefthook/engine.shand.config/praetor/engine.mkare new, written bypraetorctl adopt. The seven governance jobs oflefthook.yml,scripts/git-hooks/hiss-audit.shandscripts/githooks/state-sync.shcall the launcher. They no longer look for an engine onPATHor build one withgo run, so a newer workstation engine cannot refuse commits at an older pin again (T-HOOKS-ENGINE-FROM-PATH-2026-10-11in state). - Refreshed praetor files.
tools/figures/checks.mjs,tools/markdownlint/verify.mjs,tools/markdownlint/no-private-scratch-links.mjsand.config/agent/hooks/block_evasion.pyare praetor's text at the pin. - Two dated exceptions. The launcher is not as shfmt writes it, and neither it nor
block_evasion.pycarries a licence line (see Files praetor owns). Both exceptions expire on 2026-12-31.block_evasion.pypasses ruff as praetor ships it, so its ruff exception is removed. - Not adopted.
adoptalso writes pre-tool hook entries into.claude/settings.json,.codex/hooks.jsonand.gemini/settings.json. They land in a change of their own after this one. - Not wired. The root
Makefiledoes not includeengine.mk, and its governance targets callstandardsctlfromPATH(tekmora/praetor#1231).
Audit's warnings are the same 143 with both engines.
The pin before was 4ae6247c57d2 (ADR-3240), 28 praetor commits after d141862c430b. It was the engine the workstation's hooks already ran, and it refused every commit at the old pin. Against d141862c430b it changed this here:
- Read-only context.
praetorctl compile-contextwrites a seventh file fromAGENTS.md,AGENTS.readonly.md, for agents that run without write access: steps that change files, state or history are dropped, prohibitions are kept.--verifycompares it like the other compiled files, so it is LF in every checkout (.gitattributes,scripts/ci/tests/test_praetor_hashed_files_lf.py), andtools/markdownlint/verify.mjsleaves it out as it leaves out the others. - Gate assets.
tools/markdownlint/package.jsonand its lock file carry js-yaml 5.4.3,praetor-docs.ymla newer setup-node, andpraetor-api.ymlsetsGOTOOLCHAIN: auto. Both workflows also start onmerge_group; this repository has no merge queue, so that trigger does not fire. - Register skills.
adhd-format,cavemanandsocial-textunder.agents/skills/and.claude/skills/name the work they are adapted from and each carries that work'sLICENSE;social-textgains rules for line breaks and lists. - Agent hook script.
.config/agent/hooks/block_evasion.pyis praetor's text with four CodeQL findings fixed. - Not adopted.
adoptalso writes aPreToolUseentry into.claude/settings.jsonand.codex/hooks.jsonthat callspraetorctl hook <client> pre-toolbefore every tool call. Agent settings change on the operator's decision only, which was open at that pin.
Audit's warnings were the same 143 with both engines. The hooks still ran the engine on PATH at that pin: praetor's launcher was not yet written for a repository that keeps its own lefthook.yml (tekmora/praetor#1172).
The pin before that was d141862c430b (ADR-3061). Against 3a766f2d56ad it changed one file here, tools/apicompat/gate/main.go. The API gate no longer installs go-apidiff as module@version. It writes a small build module that requires go-apidiff at the same commit and golang.org/x/tools v0.51.0 exactly, and builds the checker there. Go 1.27.2 writes export data version 5. The x/tools v0.49.0 that go-apidiff requires reads up to version 4, so the checker read every package as empty, and the gate's canary failed the Go API Compatibility check on every pull request once setup-go's stable resolved to 1.27.2 (tekmora/praetor#1051). praetor-api.yml still installs Go as stable, which is praetor's template text (tekmora/praetor#1037). The engine's audit added one advisory warning, about the missing cache-band markers in AGENTS.md.
The pin before that was 3a766f2d56ad (ADR-2784). Against 7458a220e1c9 it changed four things here:
- REUSE gates. Because the root carries
REUSE.tomlandLICENSES/,adoptwrites.github/workflows/reuse.yml, and audit checks that noREUSE.tomlannotation is shadowed by a later one and thatLICENSEholds the text of the declared licence (LICENSES/EUPL-1.2.txt) with no second root file named like a licence. Both checks pass. TheREUSE lintjob ofreuse.ymlis the one CI run ofreuse lint: it is required through the aggregator (marker instandards-gate.yml), the Pre-Commit job skips itsreuse-linthook, and the commit hook andmake lintkeep it locally.reuse.ymlis not byte-locked: praetor keeps an edited copy, so its two actions are pinned to commits here where praetor writes tags (tekmora/praetor#899). A planted file naming a licence without a text inLICENSES/fails it; a file without any SPDX line is covered by theREUSE.tomldefault and failsscripts/ci/check-copyright.shinstead. - Build-warnings gate (HISS-10). Audit fails a CI lane that compiles C, C++, Rust or Go without its toolchain's warnings-as-errors form. It reads the form only as a literal on the command (
--werroror-Dwerror=trueonmeson setup,-WerrorinCGO_CFLAGS,RUSTFLAGS: -D warnings), and not what$(scripts/ci/werror-args.sh ...), a step output or a matrix value prints. Since ADR-2828 every one of the 50 lanes it reads spells its switch that way and builds warning-free (CI); the 16 workflow entries ADR-2784 declared in.config/lint-exceptions.d/HISS-10.tomlare gone. A lane that cannot be gated yet would take an entry there, whichscripts/ci/praetor_tidy_coverage.pycopies into.standards.yaml(tidy lanes). Praetor is asked to read a declared wrapper script (tekmora/praetor#924). - Workflow trigger report (HISS-18). Audit warns, without failing, about 136 jobs in 28 workflows that skip a draft at job level or wait on a job that does. It recommends a failing first step instead, while this repository's tier design skips drafts at job level and lets the aggregator fail them (ADR-2169). Three warnings name jobs that never run on a pull request (tekmora/praetor#922).
- Engine-written files. The managed workflows name
shell: bashon their draft step; the API gate program is gofumpt-formatted and gainstools/apicompat/gate/placeholder.go; the figure-engine hook and notes are reformatted. All are regenerated by the engine.
An engine at this pin also writes an optional kind on bug-ledger rows, which older engines refuse; move every engine that reads the shared ledger before using praetorctl state bug add --kind.
The pin before was 7458a220e1c9 (ADR-2440). Against afb739ed81f3 it changed three things here:
- The emitted
praetor-api.ymlandpraetor-docs.ymlpush only onmaster, listen forready_for_reviewand stop a draft pull request with a failing first step. The engine regenerates them, so audit still locks them byte for byte, andpush_branch_exceptionsin.github/ci-tier.jsonis empty (CI routing). The jobs still start on a draft, so they stay inuntiered_jobs. - Audit fails when
core.hooksPathleaves the managed hooks directory. A throwaway clone made withgit clone -c core.hooksPath=...persists the value and fails it; pass-con each command instead. - The caveman article count ignores model names such as
A380.
The pin before was afb739ed81f3 (ADR-2321). Against its predecessor it adds five checks this repository had to meet:
| Check | What it asks here | Where it is met |
|---|---|---|
Caveman lint of every tracked nested AGENTS.md | the internal register in 72 files | the converted files and AGENTS.d/ pages (text register) |
| HISS-11 SLSA level, declared against measured | Level 3 declared by the native-gpu-systems profile and the security:high facet; the workflows reach Level 2 | a declared gap for .github/workflows/docker-publish-operator-node.yml in .config/lint-exceptions.d/HISS-11.toml, rendered into .standards.yaml (tidy-lanes); expires 2027-01-04 |
Stale .paperclip/rules.md and harness rows | the harness praetor synthesises for the declared forge | .paperclip/harness.json and rules.md regenerated by praetorctl adopt in a throwaway copy (see the warning above) |
| Register skills | the register block names a skill only when .agents/skills/ carries it | compile-context re-spliced the block without skill names |
| Markdown gate lock | katex overridden to 0.19.0, Node 22.12.0 or later | tools/markdownlint/ regenerated by the engine |
The pre-commit hook must come from a known runner (lefthook here), and the Go vulnerability gate (praetorctl security govuln) passes with the existing OpenVEX document security/vex/go.openvex.json. The live branch-protection comparison does not run, because adoption.decline lists branch-ruleset.
The pin before was 04cc813ff054 (ADR-2153): the documentation gate's lint time budget (documentation.lint_timeout_seconds: 240 in .standards.yaml, measured maximum of a lint child 11.4 s on this repository), line-ending-neutral digests, and a clang-tidy translation-unit coverage gate whose inputs are rendered from the repository's own tidy lists (tidy-lanes).
The pin before that was 0af07a733e65 (ADR-1506). It dropped markdownlint-cli2 and the braces chain from the gate's lock, and added praetor's Go API Compatibility workflow (.github/workflows/praetor-api.yml, tools/apicompat/), which audit now requires.
- The Required Checks Aggregator lists it in
required(maintainer decision, 2026-10-03). - The workflow has no path filter, so a pull request without a Go change still reports and the comparison passes.
- It is in
strictMustReportsince the pin7458a220e1c9(ADR-2440). Before, praetor's locked file did not run onready_for_review, so a draft that became ready kept the result of its last push; now it is re-run.test_go_api_compat_required.pyholds the list entry. - Audit locks the workflow byte for byte, so its
# required-aggregator-job: Go API Compatibilitymarker sits instandards-gate.yml;scripts/ci/check-aggregator-names.shfails when no job reports a name marked that way, which a rename of the job would cause. - The engine also reads shell, workflow and systemd files, so the baseline went from 227 to 503 with the old engine recording no growth on the same tree.
What the text register checks¶
The register: section of .standards.yaml declares who reads which text. forge is social, docs is docs; agent, context, ledger, hooks, prompts and mcp are internal, the terse caveman form. The gate measures only what it can read as a file:
| Text | Checked by | Gate |
|---|---|---|
Root AGENTS.md, the compiled vendor files and AGENTS.readonly.md | praetorctl compile-context --verify, praetorctl audit | blocks |
Every tracked nested AGENTS.md (72 files) | the same commands | blocks |
Canonical personas under .agents/agents/ | the same commands | blocks |
.paperclip/harness.json strings (register.sources) and .paperclip/rules.md | praetorctl audit | blocks |
AGENTS.d/ topic pages (they render into the nested AGENTS.md files), .claude/ skills, agents and workflows | praetorctl caveman check --kind=context <file> | none; run it by hand |
.workingdir ledger text, briefs, PR bodies, commit bodies | nothing | none |
Since the pin afb739ed81f3 the gate lints the nested AGENTS.md files as context, with no baseline. The move to that pin converted the 19 nested files and 195 AGENTS.d/ pages that failed praetorctl caveman check --kind=context (article density, sentences over 30 prose words, hedges), so every page passes the same command as well (agents index).
The register block names no skill. Praetor names the social-text and caveman skills only in a repository that carries them under .agents/skills/, and this repository ignores that directory.