The end-of-turn gate rebuilt on risk profiles; non-findings refused as retro findings

The gate enforces exactly what the profile requires, lists everything missing in
one message, closes a green unit when a finding is recorded, lets a paused unit
stop silently, never blocks a subagent, records a release as unverified, and says
at commit time when the checks have not passed on the tree. Size thresholds and
the floors file are gone. 'It went well' and similar are refused as findings.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-23 12:16:29 -07:00
commit 216f39e8f7
31 files changed
+2383 -1807

No files matched your search

+5 -3
View File
@@ -136,8 +136,10 @@ Claude Code supports a blocking stop hook. The equivalent in OpenCode, Codex and
does not exist, verification is meant to run at the next session start and failures to be reported then (that
fallback is a design intention, not built).
**Floors.** Some kinds of claim have a minimum rung. Concurrency, parsing, money, state machines and data
migration may not rest on example tests alone. The floors are in `canon/floors.json`.
**What a risk profile requires.** The strength of the evidence follows the risk of the change, not the kind a
check declares for itself: logic and above need every check to say what it covers, integration and above need
invariants, a requirement list, a risk note and an approach, and data, critical and release need independent
evidence. The table is `requirements` in `canon/risk.json`; the gate enforces it and nothing else.
**Formal tooling is provisioned.** sisi keeps a verifier library: for each language and kind of claim, the
tool, a working template and a worked example (Kani and Verus for Rust, TLA+ or Quint and Alloy for designs,
@@ -311,7 +313,7 @@ Built and covered by tests:
- The end-of-turn gate (`sisi gate`) and session-start hook (`sisi tick`), wired into Claude Code with a
blocking hook; wiring (`sisi install`, `uninstall`, `doctor`) also points Codex and OpenCode at the rulebook,
where nothing blocks.
- The rulebook (`canon/core.md`), the minimum-rung floors, the verifier library and the recipes.
- The rulebook (`canon/core.md`), the risk table, the verifier library and the recipes.
- Retrospectives and lessons (`sisi retro`, `sisi lessons`), `sisi learn` live at once, time to delivery
(`sisi time`).
- Choosing the approach as a checked step: the contract design section, `sisi design`, the gate's
+40
View File
@@ -31,6 +31,46 @@ plainly `delivered`. `sisi contract waive` records a deviation; it turns nothing
A pause records what the unit waits for. While nothing in the tree changes the gate asks
nothing; a change ends the wait. Waiting time is telemetry.
## The end-of-turn gate
At each stop the gate asks, in order: did **this session** change anything since its last settled
stop (its own edits only, read from its transcript and the before/after shell measurement, never another
session's work in the same tree)? If not, the turn ends silently, as it does for a paused unit with no
new change and for a closed unit. Otherwise it works out the profile and enforces what that profile's
row of `canon/risk.json` requires, and nothing else:
| Profile | Required |
|---|---|
| trivial | nothing (the retro is asked once only if the unit shows two send-backs or a human correction) |
| isolated | a contract with at least one check that can fail |
| logic | as isolated; every check has `covers` |
| integration | as logic; `invariants`, a `requirements` list (kind, text, decision), `risk.blast_radius` and `risk.rollback`, and an `approach` (chosen, why, an alternative) |
| data, critical | as integration, plus independent evidence |
| release | as data, plus every deep check passing on the tree |
Independent evidence is an accepted `review` delegation in the ledger for this project inside the unit's
window with a check stronger than `none`, or a passing check with `"independent": true` and a `"by"`
naming who or what produced it. Text such as `TODO`, `n/a` or `none` fills no field.
The profile is the floor (from the paths changed, see `sisi risk`) unless the contract declares a higher
one. A contract may declare a lower one only with `risk.why`; the unit then runs at the declared profile and
the record keeps floor, declared profile and reason, and `sisi status` shows it as lowered. Without a
reason the floor applies. With no unit open the floor covers the paths this session changed since its last
settled stop.
One send-back lists everything missing, each with the command or field that supplies it, within 25 lines.
When the checks pass and everything required is present, a unit with recorded retro findings is closed and
the turn ends; otherwise the gate says once, for that state of the tree, the two ways on: `sisi retro`
(which records the findings and so closes the unit) or `sisi unit pause "<what it waits for>"`. A pause
ends when the tree changes; `sisi contract init` refuses while a unit is open or paused; `sisi status`
lists open and paused units with their age. Send-backs are bounded (`gate.max_blocks`); when they run out
the gate lets the turn end, the unit's delivery status is `unverified`, the record says why, and the
agent is told to say so in its report. A subagent's stop never blocks and never asks for a retro; what it
observed (that it edited, and which files) is recorded for its parent's gate. When a logic-or-higher unit
has no check stronger than examples (rung 2 or better) the gate says so once, without blocking, and the
record stores whether the unit had one. A `git commit` or `git merge` whose unit has no passing result for the
current tree prints a one-line notice (`sisi verify`) and is never blocked.
## Verification
Five statuses: `passed`, `failed`, `skipped`, `not-applicable`, `not-run`; the last three always
+28 -28
View File
@@ -506,15 +506,15 @@
{
"id": "R-5.1-1",
"status": "partial",
"how": "The rung ladder, canon/floors.json and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/floors.json",
"how": "The rung ladder, the risk table's requirements (canon/risk.json: covers, invariants, independent evidence) and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/risk.json",
"gap": "A check still proves only that a command exited as expected; rung is agent-asserted and correctness kinds are not distinguished in any record."
},
{
"id": "R-5.1-2",
"status": "partial",
"how": "The rung ladder, canon/floors.json and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/floors.json",
"how": "The rung ladder, the risk table's requirements (canon/risk.json: covers, invariants, independent evidence) and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/risk.json",
"gap": "A check still proves only that a command exited as expected; rung is agent-asserted and correctness kinds are not distinguished in any record."
},
{
@@ -527,15 +527,15 @@
{
"id": "R-5.1-4",
"status": "partial",
"how": "The rung ladder, canon/floors.json and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/floors.json",
"how": "The rung ladder, the risk table's requirements (canon/risk.json: covers, invariants, independent evidence) and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/risk.json",
"gap": "A check still proves only that a command exited as expected; rung is agent-asserted and correctness kinds are not distinguished in any record."
},
{
"id": "R-5.1-5",
"status": "partial",
"how": "The rung ladder, canon/floors.json and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/floors.json",
"how": "The rung ladder, the risk table's requirements (canon/risk.json: covers, invariants, independent evidence) and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/risk.json",
"gap": "A check still proves only that a command exited as expected; rung is agent-asserted and correctness kinds are not distinguished in any record."
},
{
@@ -548,8 +548,8 @@
{
"id": "R-5.1-7",
"status": "partial",
"how": "The rung ladder, canon/floors.json and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/floors.json",
"how": "The rung ladder, the risk table's requirements (canon/risk.json: covers, invariants, independent evidence) and contract invariants ask for stronger evidence than a passing test",
"evidence": "canon/risk.json",
"gap": "A check still proves only that a command exited as expected; rung is agent-asserted and correctness kinds are not distinguished in any record."
},
{
@@ -597,8 +597,8 @@
{
"id": "R-5.3-1",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
@@ -611,57 +611,57 @@
{
"id": "R-5.3-3",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-4",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-5",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-6",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-7",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-8",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-9",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
"id": "R-5.3-10",
"status": "partial",
"how": "canon/floors.json sets a minimum rung by self-declared check kind and the contract splits fast and deep tiers",
"evidence": "canon/floors.json",
"how": "canon/risk.json sets what each risk profile requires of a contract (checks with covers, invariants, an approach, independent evidence) and the contract splits fast and deep tiers",
"evidence": "canon/risk.json",
"gap": "Floors compare the rung label only, so cmd true at rung 1 satisfies a floor, and no impact, likelihood, blast-radius or reversibility assessment selects the depth."
},
{
+13 -4
View File
@@ -64,13 +64,17 @@ What a profile requires. The gate enforces exactly this table and nothing else:
| trivial | no | the diff; a targeted check when one exists | no | no | no | only on an anomaly (two send-backs, or a human correction) |
| isolated | yes | at least one that is not vacuous | no | no | no | yes |
| logic | yes | as isolated, each with `covers` | no | no | no | yes |
| integration | yes | as logic, plus invariants | yes | yes | no | yes |
| integration | yes | as logic, plus invariants and an `approach` | yes | yes | no | yes |
| data, critical | yes | as integration | yes | yes | yes | yes |
| release | yes | every check (`--all`) | yes | yes | yes | yes |
"Requirement model" is the contract's `requirements` list (section 4). "Risk note" is
`risk.blast_radius` and `risk.rollback`. "Independent evidence" is a judged review delegation
in the ledger for this unit, or a passing check marked `"independent": true`.
"Requirement model" is the contract's `requirements` list (section 4); an `approach` is the
contract's `approach` object with `chosen`, `why` and at least one alternative. Text such as `TODO`,
`n/a` or `none` fills no field. The table is held as data in `canon/risk.json` (`requirements`, with
machine keys beside the prose ones) and read by the gate. "Risk note" is
`risk.blast_radius` and `risk.rollback`. "Independent evidence" is an accepted review delegation
in the ledger for this project inside the unit's window with a check stronger than `none`, or a passing check
marked `"independent": true` that names who or what produced it in `"by"`.
## 4. The work unit [10]
@@ -175,6 +179,11 @@ At the end of a turn in which the session changed something:
(`sisi retro`), which closes the unit; or `sisi unit pause "<what it waits for>"`.
5. A paused or closed unit with no new change passes silently.
In this build the retro is offered once for each state of the tree and a trivial change is asked
nothing (unless the unit shows an anomaly); a recorded retro closes the unit. A session is judged only on
its own edits, so another session's work in the same tree never sends it back. The detail is in
docs/records.md, "The end-of-turn gate".
Send-backs stay bounded; when they run out the unit is released as `unverified` and recorded
as such. Subagents are never sent back for a retro: a subagent's last message is its report to
its parent and must stay that. The question-dialog gate stays as it is.