Rigor, Vouch, Stages Spec GitHub npm

RIGOR.md format specification — v0.3

This document specifies the RIGOR.md file: its layout, its stamp fields, the validation rules a conforming tool applies, and the prose a conforming tool generates.

A stamp declares its version with spec: "0.3". That is the only accepted value. rigor.schema.json, shipped beside this document and identified by https://rigor.diaconou.com/0.3/rigor.schema.json, is the canonical structural schema; where prose and schema disagree, the schema wins.

1. File layout

A RIGOR.md is a Markdown document. Two regions are defined:

All other content is free prose. A tool must not read it.

1.1 Locating the stamp

  1. Find every line matching ^##\s+Stamp\s*$. The last one is the stamp heading.
  2. After that line, the first line matching ^```ya?ml\s*$ opens the block.
  3. After the open, the first line matching ^```\s*$ closes it.
  4. The lines between the fences are the stamp.

Scanning is line by line, never a regular expression applied across the whole file. A missing heading, open fence, or close fence is the error No stamp found. Expected a '## Stamp' section with a fenced yaml block.

1.2 Parsing the stamp

The stamp is YAML 1.2 under the core schema. A conforming parser must reject:

Condition Error
more than 65536 bytes of UTF-8 Stamp is too large (N bytes; limit is 65536).
a YAML syntax error Stamp is not valid YAML: <detail>
a duplicate mapping key as a YAML syntax error
any anchor or alias Stamp uses YAML anchors/aliases, which are not allowed.
a document that is not a mapping Stamp parsed but is not a mapping of fields.

The anchor and alias check runs before the tree is materialized, so an expansion attack cannot detonate during validation.

Under the core schema, bare yes and no are already strings, and a bare date is a string. Three normalizations follow the parse:

2. Stamp fields

Field Required Shape
rigor yes one level name (2.1)
vouch yes one claim, or a mapping (2.2)
checks no mapping, any subset of five keys (2.3)
stages no mapping, any subset of four stages (2.4)
notes no string
spec no "0.3"
assessed no YYYY-MM or YYYY-MM-DD

Unknown keys are rejected at every level of the stamp.

2.1 rigor

Five level names, in order: unexamined, skimmed, comprehended, engineered, owned. The name is the canonical encoding; a tool must emit the name and must not emit an ordinal. comprehended and above are above the comprehension line.

2.2 vouch

Either a scalar — yes, neutral, or withheld — or a mapping with the required key claim holding one of those three, and the optional key why holding a string.

2.3 checks

Keys: comprehended, quality_reviewed, security_reviewed, tested, owned. Any subset may appear.

Each value is one of six strings, never a boolean:

Value Meaning
yes done, actor unstated
human done by a human
ai done by an AI
human-with-ai done by a human with an AI
no not done
not-applicable does not apply

The first four are the done states.

2.4 stages

Stage Keys Values
idea by, depth by: human, human-with-ai, ai; depth: one-shot, considered, deep
plan by, depth as idea
implementation by human, human-with-ai, ai
maintenance by, activity by: human, human-with-ai, ai, none; activity: active, dormant

3. Validation

Validation checks form and consistency. It does not check truth. Every value in a stamp is a self-report.

A validator reports errors, which make the stamp invalid, and warnings, which do not. Strict mode promotes one case noted in 3.2.

3.1 Structural

The stamp must satisfy rigor.schema.json: required fields present, no unknown keys, every value drawn from its vocabulary. Structural errors stop validation; semantic rules do not run against a malformed stamp.

3.2 Semantic

A headline level implies checks. The summary may not exceed the details.

rigor Required check Acceptable values
unexamined
skimmed
comprehended comprehended yes, human, human-with-ai
engineered comprehended yes, human, human-with-ai
quality_reviewed done states
security_reviewed done states
tested done states, not-applicable
owned all of engineered as above
owned done states

comprehended excludes ai: an AI that comprehends code does not put a human above the comprehension line.

Three rules apply to each required check:

  1. Present with an unacceptable value — error: rigor 'L' requires 'K' to be one of ["a", "b"], but it is 'v'. The value list is bracketed, comma and space separated, each element double quoted.
  2. Absent while rigor is engineered or ownederror: rigor 'L' claims 'K' but it is not surfaced — show your working (add 'K:' under checks:). Above the line, a claim must show its working.
  3. Absent otherwise — warning in strict mode, silent by default. At or below comprehended, a terse stamp stays legal.

One further semantic error: stages.maintenance.by is none while activity is present. No one responds, so activity does not apply.

3.3 Warnings

Condition Warning
quality_reviewed or security_reviewed is ai while rigor is engineered or owned an AI-only review is a different claim from a human one at this level
stages.maintenance.by is ai while rigor is engineered or owned unattended maintenance rarely sustains this level
no spec key add spec: "0.3"

The first names every affected check in one warning, not one warning per check.

3.4 Drift

The generated prose of section 4 is derived from the stamp, so the two can never be allowed to disagree.

Comparison is exact after trimming surrounding whitespace.

4. Generated prose

The sentences below are fixed. A conforming tool must reproduce them byte for byte, because section 3.4 compares generated text against stored text.

4.1 Summary block

<!-- rigor:summary -->
**<summary>**
<!-- /rigor:summary -->

<summary> is the sentences of 4.2, in this order, joined by one space. A sentence whose source field is absent is omitted:

  1. The idea was <stage phrase>.
  2. The plan was <stage phrase>.
  3. the implementation sentence
  4. the level sentence — always present
  5. the checks sentence
  6. the maintenance sentence
  7. This assessment is as of <assessed>.
  8. the vouch sentence — always present
  9. Why: <why>

4.2 Sentence tables

Level, from rigor:

Value Sentence
unexamined I have not examined this code. It ran; that is all I claim.
skimmed I have run and skimmed this code, but I have not read it properly. No human has understood it line by line.
comprehended I have read and understood this code; I can explain every line of it.
engineered I understand this code; it was deliberately reviewed for quality and for security, issues found were fixed, and it has tests I trust.
owned I stand behind this code as soundly engineered and hold architectural responsibility for it.

Vouch, from the claim:

Value Sentence
yes I recommend this for use; I put my name behind it.
neutral I make no recommendation either way about depending on it.
withheld I am specifically not recommending you depend on this.

Stage phrase, for idea and plan. With both keys it is the owner phrase followed by the depth tail; with by alone it is the owner phrase; with depth alone it is the depth-alone phrase; with neither the sentence is omitted.

by Owner phrase
human mine
human-with-ai mine, developed with an AI
ai an AI's
depth Tail (after an owner phrase) Alone
one-shot and was taken as it first came taken as it first came
considered and was thought through thought through
deep and was worked in depth, over iterations worked in depth, over iterations

Implementation, from stages.implementation.by:

Value Sentence
human The implementation was written by me.
human-with-ai The implementation was written by me with an AI.
ai The implementation was generated by an AI.

Checks. The sentence is It was <list>., built from the done checks among quality_reviewed, security_reviewed, and tested, in that order. Each contributes its phrase plus its actor parenthetical. The list joins as a, a and b, or a, b and c. No other check contributes a phrase, and the sentence is omitted when the list is empty.

Check Phrase
quality_reviewed reviewed for quality
security_reviewed reviewed for security
tested tested
Value Parenthetical
yes (none)
human (by me)
human-with-ai (by me with an AI)
ai (by an AI)

Maintenance. When activity is dormant, the sentence is:

Nothing has needed changing lately; I still use this and would respond if it broke.

Otherwise, when by is present:

by Sentence
human A human drives changes today.
human-with-ai Changes are made by an AI with a human in the loop.
ai Changes are made by an AI unattended.
none No one maintains this.

4.3 README line

The README line is the level sentence and the vouch sentence, plus Why: when the stamp carries one. It is not the full summary.

<!-- rigor:line -->
> "<level sentence> <vouch sentence>[ Why: <why>]" — [RIGOR.md](RIGOR.md)
<!-- /rigor:line -->

5. Conformance

A conforming validator must:

  1. Locate and parse the stamp by section 1, with every rejection in 1.2.
  2. Enforce rigor.schema.json (3.1) and the semantic rules (3.2).
  3. Report the warnings of 3.3 without invalidating the stamp.
  4. Compose the prose of section 4 byte for byte, and enforce the drift rules of 3.4 wherever the markers are present.

A conforming author tool must additionally regenerate the summary block in place, so a stamp and its prose stay in agreement.