Skip to content

CLI reference

There is one command to learn: sr. sr <group> <cmd> is a proxy for the sr-<group> binary (sr session start runs sr-session start), passing stdio, signals and exit codes through unchanged. The plugin’s hooks call the sr-<group> binaries directly; you use sr. You rarely call any of this by hand — the hooks run it — but this is the whole surface, generated from the binaries’ own command definitions.

sr-session

Session lifecycle — the hook points a harness calls.

Enforce a project's declared guardrails at the moments a harness can pause. A project declares guardrails under .sloprail/guardrails/; the harness calls the hook points below, and the engine runs whichever guardrails bind to what is about to happen. sr-session start a session is beginning sr-session pre-tool a tool is about to run — the refusable moment sr-session post-tool a tool has run (its output is kept where the harness's record lacks it) sr-session stop a turn has ended sr-session subagent-start a subagent is starting (recorded in the sub-agent registry) sr-session subagent-stop a subagent's turn has ended sr-session worktree-remove a worktree is being removed (never blocks it) sr-session id | query | state what a hook asks about the session so far sr-session refs list|track|untrack the ranges of commits the session answers for sr-session agents list the sub-agents the session dispatched, and which still run sr-session plugins the plugins the harness resolves for this project (JSON lines) sr-session trajectory ... read a trajectory — describe it, cite into it sr-session codex-trust trust sloprail's plugin hooks in Codex (it skips untrusted ones silently) sr-session project-hooks register the hooks a plugin cannot carry in the project (Cursor: stop, sessionStart, preCompact) There is no setup command. The guardrails directory is created by whatever writes the first declaration, and a project with none is an ordinary project — the engine loads cleanly and no session sees a difference. The hook subcommands are invoked by a harness with a payload on stdin, not typed by a person. The event kinds a guardrail may bind to are per-build, and `sr-session start` reports them: a declaration binding to a kind this build does not produce is refused by name, and the refusal lists every kind it does produce. To write a guardrail, use the authoring-guardrails skill.

sr-session agents

The sub-agents this session dispatched: list.

The sub-agents this session dispatched, and whether each still runs. sr-session agents list [--json] the registry: status, times, transcript, the ranges each owns The registry is kept in the session's own store, fed by the SubagentStart / SubagentStop hooks, a sub-agent's own tool calls and the dispatching transcript's task-notifications, and it survives a compaction, /clear and resume. A background agent that is running has its ranges left for later at the root's Stop; one silent for subagent_silent_after_minutes (default 10) is named there, and after subagent_stale_after_minutes (default 60) it is stale and its ranges are judged.

  • sr-session agents list — The session's sub-agent registry

sr-session codex-trust

Trust sloprail's plugin hooks in Codex (Codex skips untrusted hooks silently).

Codex runs a plugin's hooks only after they are trusted, and skips the others without a message: an enabled sloprail plugin whose hooks are untrusted guards nothing. This asks Codex (codex app-server, the same calls its review dialog makes) which of sloprail's hooks it would skip, and records trust for them. Enabling or upgrading the plugin does not do it; changing a hook's definition in hooks.json drops its trust again, and editing the hook's script does not. sr-session codex-trust trust sloprail's untrusted or modified hooks sr-session codex-trust --check only report; exit 1 when Codex would skip any Run it where the project is (--dir) so project-layer hooks resolve the same way. With no sloprail plugin enabled in Codex it finds nothing and changes nothing.

FlagDefaultMeaning
--checkfalseonly report the hooks Codex would skip; change nothing
--codexcodexthe codex binary
--dir—the project directory (default: the current one)

sr-session emit-context

Write stdin as the running harness's SessionStart context (used by the plugin hook).

sr-session id

The identity this conversation keeps, whatever id the harness now reports.

sr-session plugins

The plugins the harness resolves for this project, as JSON lines.

The plugins the current harness resolves for this project. sr-session plugins one JSON line per plugin: {"name": ..., "version": ..., "root": ...} root is the folder holding the plugin's files; version is the one its plugin.json declares ("" when it declares none). Plugins that could not be found are reported on stderr and not listed.

sr-session post-tool

Around a tool call: keep its output (and which Read it is) where the session record lacks it.

sr-session pre-tool

Before a tool call: run the guardrails bound to what it would do.

sr-session project-hooks

Register, or remove, the hooks a harness's plugin cannot carry, in the project's hooks file.

Cursor's plugins never fire a stop hook and load too late for sessionStart, but the project's .cursor/hooks.json fires both. This merges sloprail's entries for those events into that file (keeping every other entry, idempotent) or removes only them. The harness is the running one (SLOPRAIL_HARNESS); one whose plugin carries every hook does nothing. sr-session project-hooks install --plugin-dir <installed plugin> sr-session project-hooks remove

FlagDefaultMeaning
--dir—the project directory (default: the current one)
  • sr-session project-hooks install — Merge sloprail's entries into the project's hooks file
  • sr-session project-hooks remove — Remove sloprail's entries from the project's hooks file

sr-session query

What the agent did — the part of the session not yet judged.

What the agent did — the part of the session not yet judged. Reads from where the last completed cycle stopped. A session's record only grows, so a turn already judged has not changed, and judging it again both wastes the reading and invites a judge — a model call, not a function — to reach a different verdict on a turn the agent can no longer reach to fix. The position moves only when a cycle finishes. A cycle that was interrupted may have judged nothing, so the next one reads those turns again: re-reading a turn costs a second look, skipping one loses a violation for good. The first cycle of a session, and any session whose position cannot be read, gets the whole record for the same reason. --whole-session ignores the position and reads the entire record, for a rule asking about the session as a whole rather than about this cycle's work. Entries belonging to sub-agents are left out unless asked for: a rule asking what the agent did usually means the main line of work. The answer is entries as JSON, for whatever the hook already uses to read JSON.

FlagDefaultMeaning
--include-sidechainsfalseInclude entries belonging to sub-agents
--where—Narrow which entries come back, over the same expression language a guardrail's matcher uses
--whole-sessionfalseRead the entire record, not just the part no cycle has judged yet

sr-session refs

The ranges of commits this session answers for: list, track, untrack.

The ranges of commits this session answers for, per folder. When the session discovers a folder (its own repository, a sub-agent's worktree, a repository a command ran in) it tracks the folder's current branch, from where the work started (the merge base with the default branch). At Stop each tracked range is verified: every file-guard must have a stored verdict for the content, or the Stop is refused with the `sr-checks run` command that produces it. Nothing here judges anything. sr-session refs list the tracked and untracked ranges sr-session refs track [--folder D] [--base REV] [--head REF] track a range (replaces its base) sr-session refs untrack --reason TEXT [--folder D] [--head REF] stop answering for a range Untracking is allowed freely — CI is the backstop — but the Stop lists it with your reason, and the range is tracked again by itself when the branch tip moves. A removed worktree's range moves to the root folder (pinned at its last tip if the branch is gone too). A sub-agent's ranges are verified at the root's Stop unless enable_subagent_stop_check is set.

  • sr-session refs list — The tracked and untracked ranges of this session
  • sr-session refs track — Track a range of commits in a folder (replacing its base if it is already tracked)
  • sr-session refs untrack — Stop answering for a range of commits, saying why

sr-session start

Session start: record the baseline and report the project's declarations.

sr-session state

What this guardrail remembers within this session.

What this guardrail remembers within this session. A rule spanning more than one cycle needs somewhere to keep what it knows: a refactor declared before it happens and reconciled after, a trigger seen in one cycle and answered in the next. None of that fits in an event. Neither the guardrail nor the session is an argument. Both come from the environment the engine sets when it runs a hook — SR_GUARDRAIL, SR_SESSION_ID, SR_WORKSPACE — because a hook able to name either could read a rule it was never told about, or reach into another session. Outside a hook there is no guardrail in scope, and these commands say so rather than guessing which rule is asking.

  • sr-session state get — Read back what this guardrail stored under a key
  • sr-session state list — The entries a guardrail stored under a prefix (this one, or --owner's)
  • sr-session state set — Store a value under a key, replacing what was there

sr-session stop

End of a cycle: run the guardrails bound to what it changed.

sr-session subagent-start

A SUB-AGENT is starting: record it in the session's sub-agent registry.

sr-session subagent-stop

End of a SUB-AGENT's cycle: run the guardrails bound to what it changed.

sr-session trajectory

Read a trajectory — facts about it, a citation into it, its normalized entries.

Read a trajectory: the record of one session's turns. sr-session trajectory describe facts about a trajectory — whether it is a sub-agent's, its parent, the sub-agents it spawned sr-session trajectory cite turn a substring of the user's own words into a resolvable <path>:<line> citation (--include-envelope also prints the whole question-answer envelope at that line) sr-session trajectory tool-result whether a cited --line is a tool_result, and its content — for a delivery observation that names a transcript line as proof of work describe answers "what IS this file"; cite mints a citation an agent can write, and with --include-envelope reads back the question+answers at that citation's line in the same call; tool-result confirms a line an observation names is a real tool-call result. All default to the trajectory the hook was invoked for, and all accept --path to read another — the parent or a sibling that describe named.

  • sr-session trajectory cite — Turn a substring of the user's own words into a <path>:<line> citation
  • sr-session trajectory describe — Facts about a trajectory — is it a sub-agent's, its parent, its sub-agents
  • sr-session trajectory normalize — The trajectory as normalized entries, each carrying the events re-derived from it
  • sr-session trajectory tool-result — Report whether a cited line is a tool_result, and print its content

sr-session worktree-remove

A worktree is being removed: stop tracking the ranges in it.

sr-file

Check a file's contents, or change a file grounded in citations.

Check a file's contents, or change a file grounded in citations. EXIT STATUS, for every subcommand: 0 success; 1 the input or the change was refused (each subcommand's help says what its 1 means, and `field` adds 2 and 3); 64 a usage error — an unknown command or flag, a wrong argument count, a flag with no value, --as missing, misapplied or naming no format, an unknown --cite pool.

sr-file declarations

Load and validate the .sloprail declarations under a directory.

Load and validate the new-format declarations a project keeps under its .sloprail directory — file-guards, gates, contexts, and the structure gate — reporting what loaded and, for anything that did not, the faults by name. This is an inspection surface over the declaration loader, not part of the live hook dispatch: it proves a project's declaration files parse and validate before any event is dispatched against them. THE ARGUMENT is a directory. A path ending in .sloprail is loaded as the root itself; any other path is treated as a project root whose .sloprail subdirectory is loaded — so `declarations .` and `declarations ./.sloprail` name the same tree. --plugin NAME loads the directory as the root of an installed plugin named NAME instead of a project, validating what a plugin ships by the plugin rules — a plugin's structure gate must declare a `scope`, a project's must not. STRUCTURE GATES are listed one per root: the project's (the whole tree) and each plugin's with the scope it owns. EXIT STATUS is 0 when every declaration loaded and 1 when any was invalid, so a hook or a CI step can read it. Invalid declarations are printed one fault per line. EXAMPLES: sr-file declarations . sr-file declarations examples/eval-loop-maxing sr-file declarations examples/eval-loop-maxing/.sloprail sr-file declarations --plugin mdmap path/to/plugins/mdmap

FlagDefaultMeaning
--plugin—load the directory as the root of the plugin with this name, not a project

sr-file delete

Delete a file, grounded in cited words.

Delete a file. It must exist and be a regular file. Citations: --cite:<source-types> <quote>, repeatable. <source-types> is user (the user's own words), tool_result (a tool's output), or both comma-separated. Each quote must resolve to exactly one entry of the session's trajectory, or nothing is written. The words must match exactly; whitespace need not (a line break in the message matches a space in the quote). Quote with single quotes so the shell leaves it verbatim. tool_result also resolves in the records of the sub-agents the session dispatched, so a sub-agent can cite its own tools' output. user resolves only in the user's messages in the main conversation: a sub-agent's prompt is the parent agent's, so a sub-agent quotes the user's words exactly as the user wrote them, and a parent dispatching work that must cite the user pastes the user's exact words into the prompt. Flags take their value as the next word or after '='. '--' ends the flags.

sr-file edit

Replace an exact string in a file, grounded in cited words.

Replace --old-string with --new-string — the Edit tool's semantics. --old-string must occur exactly once unless --replace-all is given, and the file must exist. Citations: --cite:<source-types> <quote>, repeatable. <source-types> is user (the user's own words), tool_result (a tool's output), or both comma-separated. Each quote must resolve to exactly one entry of the session's trajectory, or nothing is written. The words must match exactly; whitespace need not (a line break in the message matches a space in the quote). Quote with single quotes so the shell leaves it verbatim. tool_result also resolves in the records of the sub-agents the session dispatched, so a sub-agent can cite its own tools' output. user resolves only in the user's messages in the main conversation: a sub-agent's prompt is the parent agent's, so a sub-agent quotes the user's words exactly as the user wrote them, and a parent dispatching work that must cite the user pastes the user's exact words into the prompt. Flags take their value as the next word or after '='. '--' ends the flags.

sr-file field

Print one top-level field of a document, read as plain YAML.

Print one top-level field of a document, read as plain YAML — no schema. WHICH BYTES ARE THE DOCUMENT is decided as `validate` decides it: the frontmatter of a .md, the whole of a .yaml, .yml or .json; '-' reads stdin, with --as. The value is printed when it is a scalar (aliases and merge keys followed); an absent field, or one whose value is a list or a map, prints nothing. Exit status: 0 the document was read (the value, or nothing, is on stdout) 1 the document cannot be read: it does not parse as YAML, holds more than one YAML document, or defines the field (or a merge key) twice; or the input is not a regular file, or is larger than the cap 2 the file has no frontmatter: no opening --- fence 3 an opening --- fence is never closed: a forgotten close, or a rule above prose (the caller reads the text after it to tell which) 64 a usage error: an unknown command, flag or argument count EXAMPLES: sr-file field memories/topics/a/units/01/UNIT.md status jq -r .event.newContent payload.json | sr-file field - status --as .md

FlagDefaultMeaning
--as—How to read bytes on stdin: .md, .yaml or .json. Required with '-', and refused with a path

sr-file validate

Check a file against a CUE schema.

Check a file against a CUE schema. WHICH BYTES ARE THE DOCUMENT is decided by the file's extension: the frontmatter of a .md, the whole of a .yaml, .yml or .json. A markdown file is a YAML document wearing prose below it, so handing the whole file to a schema checker gets an error about the prose. An extension outside that set is an error rather than a guess. THE SCHEMA IS CUE, unmodified — the same file `cue vet` would take. Exit status is 0 when the document satisfies the schema and 1 when it does not, so a hook can read it. Failures name the file, the field, and what was expected, one line per problem, and every problem is reported rather than only the first. BYTES ON STDIN, with '-' as the path, for a hook holding content that is not on disk: at a Pre event the write has not happened, so the pending bytes are in the event and the file either does not exist or still holds the old ones. --as says how to read them, and is required, because a pipe carries no name to take the format from. --emit prints the validated document as JSON on success, so a caller can take a field out of it with jq instead of parsing the same bytes a second time. Nothing is printed for a document that failed. A path must be a regular file (a FIFO or device is refused rather than read), and input — a file or stdin — larger than 8 MiB is refused: a document this checks is frontmatter or a config file, and reading without bound would let one input stall the hook. EXAMPLES: sr-file validate memories/note.md --schema .sloprail/schemas/note.cue sr-file validate config.yaml --schema schema.cue --path '#Config' jq -r .event.fields.newContent event.json | sr-file validate - --as .md --schema s.cue sr-file validate DECISION.md --schema s.cue --emit | jq -r .transcript_path

FlagDefaultMeaning
--as—How to read bytes on stdin: .md, .yaml or .json. Required with '-', and refused with a path
--concrete, -ctrueRequire all fields to be concrete — a missing required field fails (cue vet's -c)
--emitfalseOn success, print the validated document as JSON on stdout
--path, -d—Schema definition to check against, e.g. '#Config' (cue vet's -d)
--schema, -s—The CUE schema to check against (required)

sr-file write

Write a file's whole content, grounded in cited words.

Write a file, replacing whatever it held — the Write tool's semantics. The content is --content, or stdin when --content is absent (a heredoc: sr-file write notes.md --cite:user 'keep a changelog' <<'EOF' ... EOF). Citations: --cite:<source-types> <quote>, repeatable. <source-types> is user (the user's own words), tool_result (a tool's output), or both comma-separated. Each quote must resolve to exactly one entry of the session's trajectory, or nothing is written. The words must match exactly; whitespace need not (a line break in the message matches a space in the quote). Quote with single quotes so the shell leaves it verbatim. tool_result also resolves in the records of the sub-agents the session dispatched, so a sub-agent can cite its own tools' output. user resolves only in the user's messages in the main conversation: a sub-agent's prompt is the parent agent's, so a sub-agent quotes the user's words exactly as the user wrote them, and a parent dispatching work that must cite the user pastes the user's exact words into the prompt. Flags take their value as the next word or after '='. '--' ends the flags.

sr-mark

Write // sr:<kind> <fqn> enforcement markers into impl files.

sr-mark apply

Write // sr:<kind> <fqn> markers into impl files.

Write `// sr:<kind> <fqn>` enforcement markers into impl source files. KIND is the first argument and is free-form — the marker vocabulary is the project's, not this tool's, so any kind works with no code change. It must be alphanumeric, and may use `:` to namespace itself (e.g. `blueprint:test`), `_`, `-` and `.`. Each marker pair is a flag whose NAME is the invariant fqn and whose value is <path>:<line> — i.e. `--<fqn>=<path>:<line>`. Pass many pairs in one call to write many markers. An fqn may use any character a URL admits, but must contain NO whitespace: a marker is one line of text, so a name with a space in it would write cleanly and then be unreadable — the marker reader is line-anchored and would not match it at all. Paths are resolved against --root (default $SLOPRAIL_GIT_ROOT, else cwd); line is 1-based. Writing is idempotent and uses the right comment leader for the file's language. All pairs are validated before any file is written. EXAMPLES: sr-mark apply blueprint --user.email_unique=src/auth/user.ts:42 sr-mark apply blueprint:test --user.email_unique=src/auth/user_test.ts:9 sr-mark apply docs --order.Cart.total=src/order.ts:13 --user.email_unique=src/user.ts:42

sr-mark delete

Remove // sr:<kind> <fqn> marker comments for the given fqns, wherever found.

Scan the impl tree (--root, default $SLOPRAIL_GIT_ROOT or cwd) for `// sr:<kind> <fqn>` (or `# …` / `-- …` for SQL) comments naming any of the given fqns, and remove each matching comment LINE. A marker that also carries other text on the same line is left untouched (the scanner only matches lines that ARE a marker comment, mirroring how sr-mark writes them on their own line). Silently no-ops for an fqn with no marker anywhere. KIND is the first argument and is free-form, same as for `apply`; the fqns follow. EXAMPLE: sr-mark delete blueprint order.cancel_only_pending order.cancel_only_from_early_status

sr-mark find

List the // sr:<kind> markers committed at a revision (read-only).

Scan the COMMITTED tree at --rev (default HEAD) of the repository --root (default $SLOPRAIL_GIT_ROOT, else cwd) for `sr:<kind>` markers, reading each file with the engine's own marker reader: the one a file-guard's `markers` field and `sr-mark apply` use, so what is found here is exactly what a rule would see. The working tree is never read: an uncommitted marker is not found. Prints `<path>:<line> <kind> <fqn>` per marker. With --fqn only markers naming that fqn. EXIT STATUS: 0 a marker was found; 1 none was; 2 the tree could not be read (not a git repository, unknown revision, git failed), with the reason on stderr. 2 is never "none". EXAMPLE: sr-mark find ci --fqn verify

FlagDefaultMeaning
--fqn—Only markers naming this fqn
--revHEADThe revision whose committed tree is scanned

sr-agent

Run an agent, whichever harness is running.

Run an agent without naming the harness that will run it. The prompt is positional, as every harness takes it. --prompt is accepted instead, for when the prompt comes from a file or a pipe and a positional would be awkward. sr-agent --model size-md "does this uphold the invariant?" sr-agent --model claude-opus-5,size-lg --prompt "$(cat question.txt)" MODEL SETS --model takes preferences in order, first match wins. Two kinds of entry: size-xs size-sm size-md size-lg size-xl size-xxl A size, not a model. Every harness maps every one of them, so an alias ALWAYS resolves — which means anything after an alias in a set can never be reached. Writing size-md,claude-opus-5 probably meant the other order. claude-opus-5, sonnet, ... One harness's own model. Matches only under that harness, so a set may name several harnesses' models and mean "the best available here". A set matching nothing under the running harness is REFUSED, not quietly run on a default. A verdict from a model the author did not choose is one nobody can account for. HARNESS Which harness is running is read from the environment, not asked for. An environment naming no known harness is refused rather than guessed at; pass --harness for a hook running outside any harness at all.

sr-checks

Judge the file-guards over an explicit commit range and show the results.

Judge the file-guards over an explicit range of commits. sr-checks run --base <rev> --head <rev> run what has no stored verdict (script, judge, requirement); writes the results sr-checks verify --base <rev> --head <rev> only reads stored verdicts: executes nothing, writes nothing; exit 1 when anything fails or is unjudged sr-checks show --base <rev> --head <rev> each subject's latest result, without a verdict sr-checks changeset --rule <name> --base <rev> --head <rev> what a rule would be handed, without running it sr-checks default-base --head <rev> the sha a range over head starts at: its merge base with the default branch sr-checks staged --needs citation [--amend] the staged files a commit must cite (what a file-guard's require: citation will want of it) The range is merge-base(--base, --head)..--head. --base and --head are required: the caller states the range. EVERY check is cached the same way: a guard's verdict over a subject is keyed by the rule name (not its definition: editing a rule does not void a verdict), the subject, the content of the subject's files, the citation quotes (require: citation rules) and the subject's fingerprint from the rule's subjects script, when it has one — never by a commit, session or agent — so the same content after a rebase, a squash or a revert is a cache hit, and so is the same content another clone already judged. `run` runs nothing on a hit (a stored fail is replayed); `verify` never executes a script or a judge: a key with no stored verdict is "not judged yet". Results are kept on the orphan branch sloprail/checks, pushed to origin by `run` and read from it by `verify`.

sr-checks changeset

What a file-guard would be judged on: its range and the Changeset payload, without running any check.

Show what a file-guard would be judged on, without judging it. A file-guard judges commits. Its range is merge-base(--base, --head)..--head, both revisions stated by the caller (a branch, a tag or a sha). --rule names the file-guard: its folder name (`size-limit`), or its qualified name as a refusal cites it (`file-guard/size-limit`, `plugin/file-guard/size-limit`). The output is JSON on stdout: rule the qualified name base, head the range, as SHAs: the stated one, raised to the rule's own floor (the parent of the commit that last changed the rule), as run judges it ruleHash the hash of every git-tracked file under the rule's .sloprail root (shared _lib included), as on disk, recorded on each run for the trace only: it is not part of a verdict's key, so editing a rule never voids one; untracked and ignored files do not count; a plugin rule hashes its plugin's .sloprail root unresolvedCitations Sloprail-Cites-* trailers whose quote did not resolve payload what a check receives on stdin: event, changeset (commits, files, others, citations — each with the commits that carried it and the files they changed), subject. A rule with a subjects: script prints subjects, one payload per subject, from running that script. Nothing is run and nothing is recorded. Where the session cannot be found from the environment (no harness session identity), quotes are not resolved.

FlagDefaultMeaning
--base—The base revision: a branch, tag or sha (required)
--head—The head revision: a branch, tag or sha (required)
--rule—The file-guard, by folder name or qualified name

sr-checks default-base

Print where work on head started: its merge base with the default branch.

Print the sha a range over --head starts at when nobody stated one: the merge base of --head with the REMOTE default branch (origin's HEAD, else origin/main, origin/master). Prints git's empty tree (4b825dc642cb6eb9a060e54bf8d69288fbee4904) when --head shares no history with it: everything is judged. Exits non-zero when there is no remote default branch (pass --base instead). Read-only.

FlagDefaultMeaning
--head—The head revision: a branch, tag or sha (required)

sr-checks run

Judge every file-guard over merge-base(base, head)..head and record the verdicts.

Judge every file-guard over merge-base(--base, --head)..--head. Every check (requirement, script, judge) is cached by content: one verdict per guard and subject, keyed by the rule name (never its definition), the subject, the content of its files and the citation quotes. A stored PASS is a hit and a stored FAIL with the same key is replayed (terminal until the input changes): nothing is run. A miss runs the steps in order and stores the verdict, as one segment of the sloprail/checks branch, and pushed to origin when the repository has one. Prints each refusal, and exits 1 when any rule refuses. Run it in the foreground and wait: it prints progress to stderr (a line per judge and per rule, and a heartbeat every 30s), so do not poll the process list. It is safe to run in parallel, in several worktrees at once: judges share a machine-wide limit (SLOPRAIL_JUDGE_SLOTS, default 8; a process waits for a free slot), two runs judging the same check judge it once, and a second run of the same worktree and range waits for the first and reuses its verdicts. The lock files are under the user cache dir (SLOPRAIL_LOCK_DIR overrides) and a killed run releases them.

FlagDefaultMeaning
--base—The base revision: a branch, tag or sha (required)
--head—The head revision: a branch, tag or sha (required)

sr-checks show

Each file-guard subject's latest stored result over the range, without a verdict.

Print each subject's latest result over merge-base(--base, --head)..--head, as verify reads it (nothing is asked of a model, nothing is written), over the whole range asked about (verify starts from each rule's effective base instead), and always exit 0: a reader's view, not a gate. --failing keeps only what is not passing: a fail, a result still missing, or an error. --rule limits the listing to one file-guard, by folder name or qualified name.

FlagDefaultMeaning
--base—The base revision: a branch, tag or sha (required)
--failingfalseOnly what is not passing
--head—The head revision: a branch, tag or sha (required)
--jsonfalsePrint the per-subject results as JSON
--rule—Only this file-guard (folder name or qualified name)

sr-checks staged

The staged files a commit must cite, by the file-guards' `require: citation`.

Print, one path per line, the staged files that a file-guard selects and that carry a `require: citation` the commit being made must meet. The candidate change is the index against HEAD (against git's empty tree when HEAD does not exist yet). With --amend it is the index against HEAD's parent: the amended commit replaces HEAD, so everything HEAD changed is the commit's again. File-guards are loaded, matched and their `when` evaluated exactly as `sr-checks run` does over a range, and a requirement whose `when` waives a file leaves it out. Nothing is judged, written, staged or committed. This is the prevention half of the commit-time check: `run` and `verify` refuse the commit afterwards, this says before it which files will need a citation. Exits 1 with the reason on stderr when the change could not be read: no answer is never "nothing is needed". With --trailers, read a commit message on stdin and resolve each Sloprail-Cites-User / Sloprail-Cites-Tool line in it against the session transcript, exactly as `sr-file --cite` does (the user pool for -User, tool_result for -Tool), one JSON object per line: {"trailer", "quote", "ok", "error"}. With --recorded and paths instead, print the citations this session already recorded for them (`sr-file --cite`), one JSON object per line: {"path", "trailer", "quote"}.

FlagDefaultMeaning
--amendfalseThe commit replaces HEAD: judge the index against HEAD's parent
--needs—What to list the staged files for; only 'citation' is known (required)
--recordedfalsePrint the quotes already recorded for the given paths, as JSON lines
--trailersfalseResolve the Sloprail-Cites-* lines of a commit message read from stdin, as JSON lines

sr-checks verify

Check every file-guard over merge-base(base, head)..head against the stored verdicts.

Check every file-guard over merge-base(--base, --head)..--head, deterministically. Only reads: it never executes a script, a judge or a requirement and never writes. It computes each subject's key (running the rule's subjects script, without a session) and reads the stored verdict, so the same repository state and the same stored results read the same anywhere. A key with no stored verdict is red ("not judged yet", run sr-checks run); a stored fail shows its reasons. A citation requirement counts a Sloprail-Cites-* trailer on the commit that last really changed the file, which is checkable from the repository alone. Prints each subject's latest result, then each refusal. Exits 0 when everything passes, 1 when anything fails or has no result.

FlagDefaultMeaning
--base—The base revision: a branch, tag or sha (required)
--head—The head revision: a branch, tag or sha (required)
--jsonfalsePrint the per-subject results as JSON