Tutorial: documenting a release
In this tutorial you document how to cut a release of a small practice project, make a mistake in the doc, watch the real commit hook refuse the commit, fix it, watch the push hook refuse the push, then check the claim, mark it checked and push again. You type every command yourself, and every block of output on this page is what those same commands print.
Setting up
First you build the practice project, Acme, inside your clone of this
repository. You need git and uv and nothing else; the first run fetches
hatchling, which this repository builds with, so it needs a network
connection.
Run, from the root of your clone:
uv run -q scripts/tutorial.py setup
Captured from a clone of this repository:
$ uv run -q scripts/tutorial.py setup
Acme is ready: cd .tutorial/acme
Then cd .tutorial/acme. Every later command on this page runs there.
.tutorial/ is gitignored, so Acme never shows up in your clone’s own
git status, and running setup again deletes Acme and builds it afresh
from the start, which is the way back from any mistake.
Acme starts with one doc, RELEASING.md:
# Releasing Acme
Current version:
<!-- verify: cat VERSION -->
1.0.0
The <!-- verify: cat VERSION --> marker says the block beneath it is
what cat VERSION prints, and
executable-claims runs the command and
compares on every commit. VERSION holds 1.0.0, so it passes quietly.
A command runs only if this machine has granted it, in a
claims.local.toml that git does not track; setup copies one granting
cat VERSION into Acme, and Acme’s .gitignore keeps it untracked. A
fresh clone of a real project has no grants until you write your own.
claims.toml turns the commit hook on, and names the one file
claim-words reads:
[claim-words]
files = ["RELEASING.md"]
scripts/release.sh is how Acme is released:
#!/bin/sh
# Tags the current commit with the version in VERSION, then pushes the
# branch and the tag together.
set -e
version=$(cat VERSION)
git tag -a "v$version" -m "Acme $version"
git push --follow-tags
Setup installs two hooks. pre-commit runs on every git commit:
#!/bin/sh
exec uv run -q python -m claims.pre_commit
pre-push runs on every git push:
#!/bin/sh
exec uv run -q python -m claims.cli --fail-on-unmarked --diff-range origin/main...HEAD
Both run the claims in your clone, through uv, so the tutorial needs
no release installed. They are not the hook
Installation tells a real
project to install, which pins a tagged release; don’t copy them into
one.
Setup leaves your own git configuration alone. It creates Acme with
-b main, so its branch is main whatever your init.defaultBranch
says, pushes Acme’s first commit to a bare remote, origin, beside it
in .tutorial/, and sets two options of its own with git config:
core.hooksPathpoints git at the two hooks above, where they sit in your clone.commit.gpgsign=false, so that a global setting to sign every commit doesn’t stop a practice commit to ask for a key.
Committing a wrong doc
Now you add two lines to RELEASING.md and try to commit them. Make your
copy match this.
RELEASING.md now reads:
# Releasing Acme
Current version:
<!-- verify: cat VERSION -->
1.0.0
To cut a release, run `scripts/deploy.sh`.
Every release is tagged before it is pushed.
Run:
git add RELEASING.md
git diff --cached
git commit -m "Document releasing"
Captured from a fresh .tutorial/acme after the steps above:
$ git add RELEASING.md
$ git diff --cached
diff --git a/RELEASING.md b/RELEASING.md
index 6513644..8c61af9 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -6,3 +6,7 @@ Current version:
1.0.0
+
+To cut a release, run `scripts/deploy.sh`.
+
+Every release is tagged before it is pushed.
$ git commit -m "Document releasing"
[GATE] RELEASING.md:10 (check-file-refs) `scripts/deploy.sh` does not resolve to a tracked file
[advisory] RELEASING.md:12 (claim-words-totalising) Every release is tagged before it is pushed.
[exit 1]
The commit hashes and git’s own messages you see will differ from this
page, as your identity, dates and git version differ. The claims lines,
the ones starting [GATE] and [advisory], should match.
The commit is refused by the first of them, a gate finding from
check-file-refs. A gate finding is a claim
claims has proved false, and it blocks the commit until the doc is
fixed. The second line is an advisory finding from
claim-words: “Every release” is a sweeping
claim that may well be true, so it is printed for someone to check, and
it blocks nothing.
Fixing it
Now you correct the script’s name to the one Acme has, and commit again.
RELEASING.md now reads:
# Releasing Acme
Current version:
<!-- verify: cat VERSION -->
1.0.0
To cut a release, run `scripts/release.sh`.
Every release is tagged before it is pushed.
Run:
git diff
git add RELEASING.md
git commit -m "Document releasing"
Captured from a fresh .tutorial/acme after the steps above:
$ git diff
diff --git a/RELEASING.md b/RELEASING.md
index 8c61af9..1c732d0 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -7,6 +7,6 @@ Current version:
1.0.0
-To cut a release, run scripts/deploy.sh.
+To cut a release, run scripts/release.sh.
Every release is tagged before it is pushed.
$ git add RELEASING.md
$ git commit -m “Document releasing” [advisory] RELEASING.md:12 (claim-words-totalising) Every release is tagged before it is pushed. [main a5a1fdd] Document releasing 1 file changed, 4 insertions(+)
`git diff`, without `--cached`, compares your copy with what you staged
in the last step, so it shows only the correction. The `git add` before
the refused commit staged the rest, and nothing has been committed
since.
With `scripts/release.sh` <!-- example --> tracked,
[check-file-refs](checks/check-file-refs.md) has nothing to report, and
the commit lands. The [claim-words](checks/claim-words.md) advisory
finding prints again, because the sentence is unchanged, and this time
it is the only finding, so nothing stops the commit. That is the
difference between the two severities, which
[Concepts](concepts.md#gate-versus-advisory) sets out in full.
## Pushing
Now you push the commit to Acme's remote.
Run:
```sh
git push
Captured from a fresh .tutorial/acme after the steps above:
$ git push
[advisory] RELEASING.md:12 (claim-words-totalising) Every release is tagged before it is pushed.
13 checked, 1 finding(s), 0 gate failure(s), 1 unmarked
failing: 1 unmarked advisory finding(s); fix or mark each
error: failed to push some refs to '../remote.git'
[exit 1]
The push is refused. The pre-push hook runs claims with
--fail-on-unmarked, over origin/main...HEAD, the commits the push
would send, and that switch fails the run on an unmarked
finding: an
advisory finding, from a check whose findings can be marked, that no
checked mark keeps quiet. The claim-words finding the commit let
through is one.
The summary line counts, in order, the checks that ran, the findings
they reported, how many of those are gate findings, and, because of
--fail-on-unmarked, how many are unmarked. The failing: line after
it is printed only when unmarked findings fail the run.
claims itself exits 3 on a run that fails this way, as
the command line lists. git reports
any refusing pre-push hook as its own failure, so the exit code you see
from git push is 1.
Marking the claim checked
Now you read the script the sentence is about, and, finding the sentence true, record a checked mark that says so.
Run:
cat scripts/release.sh
echo 'RELEASING.md:12 claim-words-totalising scripts/release.sh runs git tag before git push' | uv run -q python -m claims.cli mark-checked --diff-range origin/main
cat claims.checked.toml
git add claims.checked.toml
git commit -m "Mark the release claim checked"
Captured from a fresh .tutorial/acme after the steps above:
$ cat scripts/release.sh
#!/bin/sh
# Tags the current commit with the version in VERSION, then pushes the
# branch and the tag together.
set -e
version=$(cat VERSION)
git tag -a "v$version" -m "Acme $version"
git push --follow-tags
$ echo 'RELEASING.md:12 claim-words-totalising scripts/release.sh runs git tag before git push' | uv run -q python -m claims.cli mark-checked --diff-range origin/main
marked 1 finding(s) in claims.checked.toml
$ cat claims.checked.toml
[[mark]]
file = "RELEASING.md"
mode = "claim-words-totalising"
unit = "b498eb80b8408ec9"
copies = 1
note = "scripts/release.sh runs git tag before git push"
subjects = {}
$ git add claims.checked.toml
$ git commit -m "Mark the release claim checked"
[main eb29022] Mark the release claim checked
1 file changed, 7 insertions(+)
create mode 100644 claims.checked.toml
scripts/release.sh runs git tag before git push --follow-tags, so a release cut with it is tagged before it is pushed,
and the note in the entry piped to mark-checked records that. An entry
is the finding’s citation and mode, as the finding line printed them,
then what you verified; mark-checked refuses an entry without a note.
mark-checked runs the checks itself and marks only a finding of that
run. By default it runs over HEAD, the changes not yet committed, and
the sentence was committed when you fixed the doc, so
claim-words, which reads only what a diff
added, would find nothing there to mark. --diff-range origin/main
compares with the remote’s tip instead, so the run covers the commits
not yet pushed, where the push found the finding.
The mark is written to claims.checked.toml, which the cat shows. Its
unit is a fingerprint of the marked sentence, not something to read or
write by hand: the mark follows the sentence rather than its line, and
stops applying once a word of it changes, as
Units sets out. subjects is empty because the
sentence names no file: a mark also stops
applying when a file its
sentence names changes, so this one does not expire if
scripts/release.sh does. The file is committed like
any other, and the commit hook has nothing to say about it.
Pushing again
Now you push again.
Run:
git push
Captured from a fresh .tutorial/acme after the steps above:
$ git push
13 checked, 0 finding(s), 0 gate failure(s), 1 quiet while checked, 0 unmarked, 1 mark(s) added in range
To ../remote.git
4946f30..eb29022 main -> main
The push lands. The claim-words finding is still there, but the mark
keeps it quiet, so the summary line counts it as 1 quiet while checked
rather than printing it, and 0 unmarked lets the push through. 1 mark(s) added in range says the push carries a new mark, which is the
thing for a reviewer to read, as What a run
shows explains.
Going further
[hook] fail_on_unmarkedhas the commit hook itself block on unmarked findings from the checks it lists.- The Claude Code plugin adds the
check-claimsskill and the judgment-agent subagent, which reads the code a claim cites.
Next
Concepts defines the vocabulary the rest of the site uses: gate versus advisory, mode, candidate versus verdict, and what makes a claim live or dated.