Skip to content
Writ

Documentation

Rules

A document's rules live in one file, .semgit/rules.yaml, on main. Writ always reads that copy — never a branch's own edited version of it — so a submission can't quietly loosen the rule that would have caught it.

A real example

This is the file from Writ's own demo document, unedited:

version: 1
instructions: |
  Be strict about claims that outrun the evidence. A reported effect size needs
  a table or citation in the same paragraph.
rules:
  - id: claims-need-evidence
    check: llm
    severity: flag
    text: "A new claim needs evidence in the same paragraph."
    scope: {headings: [4. Discussion]}
  - id: no-intensifiers
    check: regex
    severity: flag
    pattern: "\b(obviously|clearly|very|significantly)\b"
  - id: methods-frozen
    check: protected_section
    severity: block
    scope: {headings: [3. Results]}
    allow: [maintainers]

Three rules, three different check types:

The three check types

Today there are exactly three, and nothing else:

CheckHow it decidesCan it block?
llmA model judges the changed text in plain English against a rule you write in plain English.No — capped at needs attention, never blocked.
regexA plain regular expression against the new sentence text. Deterministic, no model call.Yes, if you set severity: block.
protected_sectionDeterministic: did anyone outside an allow-list change the meaning of anything under these headings?Yes, and this is the one meant to be a hard stop.

Severities

Honest limits

What a rule can't do today, by design or by what's built so far:

See What isn't built yet for the current state of the rules editor specifically.