sisi 0.1.0: a shared rulebook and verification tool for AI coding agents
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.9) (push) Canceled after 0s
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.9) (push) Canceled after 0s
Contracts with a ladder of checks, an end-of-turn gate, retrospectives and shared lessons, time-to-delivery measurement, a library of 140 verification techniques and 20 recipes, personal data kept outside the clone, and releases with rollback. Standard library only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
commit
2fc1fe9c2d
223 files changed
+22163
No files matched your search
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: agent-tool-surface
|
||||
title: Tools, commands or an interface designed for AI agents
|
||||
applies_to: An MCP server, a CLI, or a set of functions an AI agent calls, including their names, descriptions, inputs and outputs.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Each tool has a clear name and a description that says what it does, when to use it, what it will not do, and what it returns; an agent picks the right tool from the text alone.
|
||||
- Inputs are validated with clear, fixable error messages, and unsafe or destructive actions need an explicit step.
|
||||
- Annotations (read-only, destructive, idempotent) match what the tool actually does.
|
||||
- Outputs are small, stable and structured; they do not overflow an agent's context or leak secrets.
|
||||
- Real agents, given realistic tasks, complete them through the tools with few wrong calls.
|
||||
- Dangerous sequences (call order, repeated calls) are safe.
|
||||
|
||||
## Checks
|
||||
- Task success: `agent-surface-evals` (real-world), rung 3 to 5, with tasks, a hidden answer, and a count of wrong or wasted calls.
|
||||
- Descriptions: `tool-description-lint`, `rubric-judge` (intent) by a different model family.
|
||||
- Annotations true: `annotation-behaviour-check` (real-world), rung 3; `read-only-guarantee` (regression).
|
||||
- Bad input and injection: `hostile-input-from-schema` (many-inputs); `threat-model-checklist`, `sensitive-data-leak-test` (safety).
|
||||
- Surface stability: `api-breaking-schema` (regression); `baseline-before-change`.
|
||||
- Domain results: `acceptance-examples`, `domain-evidence-report` (intent).
|
||||
|
||||
## Common false finishes
|
||||
- The tool works when called by the test that wrote it; no agent has ever tried it.
|
||||
- The description was written from the implementation, not tested for how an agent reads it; two tools sound alike and agents pick the wrong one.
|
||||
- A tool marked read-only writes (a cache, a log, a lock). Check against the file system.
|
||||
- Output is a wall of text that fills the agent's context; there is no limit or paging.
|
||||
- Error messages say "invalid input" without saying which field or what would be valid.
|
||||
- The evals use the same model that wrote the tools, or the author's wording of the tasks.
|
||||
- A secret appears in an error or log that the agent reads.
|
||||
- A destructive tool can be called with defaults and no confirmation.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: bugfix
|
||||
title: Fixing a bug
|
||||
applies_to: A reported defect in existing behaviour, where the aim is to make it right and leave everything else alone.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The bug is reproduced first by an automated test that fails on the unfixed code, for the reason in the report.
|
||||
- The same test passes after the fix, and it is kept as a permanent regression test.
|
||||
- The cause is found, not just the symptom: the fix is at the point that was wrong, and siblings of the bug (same pattern elsewhere) were looked for.
|
||||
- Nothing that worked before changed: the whole existing suite passes, and a baseline taken before the first edit matches afterwards.
|
||||
- The diff touches only what the fix needs; no drive-by refactors.
|
||||
- The report says what the bug was, why it happened, and what was not fixed.
|
||||
|
||||
## Checks
|
||||
- Fails before, passes after: `red-before-green` (test-quality), rung 3; for a bug in logic over many inputs, a property or differential check that fails on the old code (`proptest`, `hypothesis`, `differential-old-vs-new` in many-inputs), rung 2.
|
||||
- Nothing else changed: `baseline-before-change`, `characterization-tests` (regression), rung 3; `feedback-as-amendment` (intent) for the scope check on the diff.
|
||||
- The test can fail: `vacuity-check`, `mutation-on-diff` (test-quality), rung 2.
|
||||
- Same mistake elsewhere: `static-analysis-semgrep` (safety) with a rule for the pattern; log it in `findings-log` (completeness).
|
||||
- Finished cleanly: `no-stubs-scan`, `single-gate-command` (completeness), rung 3.
|
||||
- If the bug was a crash or hostile input: the input is added as a seed (`regression-seed-hygiene`, many-inputs).
|
||||
|
||||
## Common false finishes
|
||||
- The new test passes but was never run against the unfixed code. It may never have failed; run it with the fix reverted.
|
||||
- The test asserts the new behaviour on the exact reported input only. A different input with the same cause still fails; vary it.
|
||||
- The symptom is hidden: an error is caught and ignored, a value is clamped, the failing case is special-cased. The cause remains.
|
||||
- An old test was changed or deleted to make the suite green. Read the test diff first.
|
||||
- A flaky failure "went away" after the change. A bug seen once is not fixed by one clean run; see `stress-repeat` (concurrency).
|
||||
- The fix is in the wrong layer (UI hides what the engine gets wrong).
|
||||
- The reproduction used test fixtures that cannot occur in real data, so the real case is untested.
|
||||
- The change reaches further than the bug and nobody ran the invariants.
|
||||
- "Cannot reproduce" is reported as fixed. Say it is unreproduced and not fixed.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: cli-tool
|
||||
title: Building or changing a command-line tool
|
||||
applies_to: A program run from a shell, with arguments, standard input and output, and exit codes.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Every command and flag in the help text works as described, and the help matches what the code does.
|
||||
- The exit code is 0 only on success and a stable non-zero on each kind of failure; errors go to standard error, results to standard output.
|
||||
- Bad input (missing file, bad flag, empty input, huge input, a broken pipe) gives a clear message and no stack trace or partial output file.
|
||||
- Output is stable and machine-readable where scripts depend on it, and pinned by tests.
|
||||
- It installs and runs from a clean checkout or the built package on a machine that is not the author's.
|
||||
- It does not print or store secrets, and does not touch files it was not asked to.
|
||||
|
||||
## Checks
|
||||
- Behaviour by transcript: `cli-transcript-tests` (real-world), rung 3 to 4, including exit codes and standard error.
|
||||
- Output format: `golden-files-hand-verified`, `snapshot-insta` (regression), rung 4.
|
||||
- Bad input: `hostile-input-from-schema`, `cargo-fuzz` or `atheris` (many-inputs), rung 2.
|
||||
- Public contract: `api-breaking-schema` (regression) for flags and output fields.
|
||||
- Install: `clean-clone-build`, `packaging-install-upgrade`, `cross-platform-matrix` (real-world).
|
||||
- Scripts: `shellcheck` (safety). Secrets: `sensitive-data-leak-test`.
|
||||
- Done: `single-gate-command`, `no-stubs-scan` (completeness).
|
||||
|
||||
## Common false finishes
|
||||
- Tested by calling the internal function, not the binary. Flag parsing, defaults and exit codes are untested.
|
||||
- Exit code is 0 after an error was printed.
|
||||
- Errors and results both go to standard output, which corrupts pipelines.
|
||||
- The tool works in a terminal and breaks when output is piped (colour codes, prompts, width detection).
|
||||
- Paths with spaces, relative paths, and a non-existent directory were never tried.
|
||||
- The help text was not updated after a flag changed.
|
||||
- A file is half-written when the program fails; no atomic write.
|
||||
- Passing on Linux only when the user is on another system.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: concurrent-code
|
||||
title: Concurrent, parallel or async code
|
||||
applies_to: Code with threads, tasks, locks, channels, async runtimes, or shared state between processes.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The design's key properties (no lost update, no deadlock, ordering where promised, each message handled once) are stated and checked, not assumed.
|
||||
- Interleavings were explored systematically, not by hoping a test hits the bad one.
|
||||
- Memory safety and data races are checked by a tool on the real code paths.
|
||||
- Cancellation, timeout, shutdown and panic in one task leave the rest consistent and release locks and resources.
|
||||
- Results do not depend on timing: repeated runs under load give the same outcome.
|
||||
- Throughput claims, if any, are measured.
|
||||
|
||||
## Checks
|
||||
- The design: `tlaplus`, `pluscal`, `quint` or `p-lang` (design), rung 1, for protocols and state machines.
|
||||
- The code's interleavings: `loom` or `shuttle`, `deterministic-simulation` (concurrency), rung 1 to 2.
|
||||
- Races and memory: `thread-sanitizer`, `go-race-detector`, `miri`, `address-and-ub-sanitizers`; `unsafe-audit` (safety).
|
||||
- Correctness of results: `linearizability-checking`, `stateful-model-test` (many-inputs), rung 2.
|
||||
- Lifecycle: `async-cancellation-safety`, `lock-order-and-deadlock`.
|
||||
- Flakiness: `stress-repeat`, `flaky-test-detection`, `test-determinism` (test-quality).
|
||||
- Tests can fail: `mutation-on-diff`, `check-the-checker`.
|
||||
|
||||
## Common false finishes
|
||||
- The tests pass on a fast machine with two threads. Bugs need contention; use a model checker and a stress run with more tasks than cores.
|
||||
- The sanitiser ran on the tests but the tests do not run the concurrent paths together.
|
||||
- A `sleep` was added to make a test pass. That is a timing hack, not a fix.
|
||||
- The model checker explored a model, not the code; the model and the code diverged.
|
||||
- Loom or Shuttle bounds were set so small that the bad schedule was never reached; a pass with a tiny bound is partial.
|
||||
- A lock was added and now there is a deadlock under a different order. Check lock order.
|
||||
- Cancellation was tested at no point other than the start; a drop halfway through leaves state broken.
|
||||
- "Flaky, re-run" was accepted as a pass.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
id: config-or-infra-change
|
||||
title: Configuration, build, CI or infrastructure change
|
||||
applies_to: Changes to build files, CI workflows, deployment, container images, infrastructure code and runtime configuration.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The change was run in the real system (a CI run, a build, a deploy to a staging copy), not only parsed.
|
||||
- The failure path was exercised: the new step fails when it should.
|
||||
- Secrets are not in the files or logs, and permissions are no wider than needed.
|
||||
- Build and deploy work from a clean checkout and are repeatable.
|
||||
- What the change affects is stated, and the rollback is known.
|
||||
- Nothing else in the pipeline silently stopped running.
|
||||
|
||||
## Checks
|
||||
- Runs: `clean-clone-build`, `smoke-after-deploy`, `cross-platform-matrix` (real-world), rung 3.
|
||||
- The gate still gates: `single-gate-command`, `check-tiering` (completeness).
|
||||
- Scripts: `shellcheck`; secrets: `secret-scanning`, `sensitive-data-leak-test`; `threat-model-checklist` (safety).
|
||||
- Rules in config: `static-analysis-semgrep` (safety) for workflow or manifest patterns.
|
||||
- Checker works: `check-the-checker` (test-quality) by breaking something on purpose.
|
||||
|
||||
## Common false finishes
|
||||
- The YAML parses and was never run.
|
||||
- A job was skipped by a condition, so the pipeline is green with fewer checks than before.
|
||||
- The change works on the branch and not on the default branch, where secrets and permissions differ.
|
||||
- A cache hid a missing dependency.
|
||||
- Tokens were given write access "to make it work".
|
||||
- A failing step was made non-fatal (`|| true`, `continue-on-error`).
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: data-migration
|
||||
title: Migrating data or a schema
|
||||
applies_to: Changing the shape, location or encoding of stored data, with existing data that must survive.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Every record in a realistic copy of production data migrates, and none is lost, duplicated or silently changed.
|
||||
- Counts, totals, and derived views match before and after, by a check that does not use the migration's own code.
|
||||
- Old data written by every earlier version still loads.
|
||||
- The migration is safe to interrupt and to run twice, and a rollback or restore path was tried.
|
||||
- Application code that reads the new shape works with it, and a mixed period (old and new code) is handled or ruled out.
|
||||
- It was timed on production-sized data.
|
||||
|
||||
## Checks
|
||||
- Safety and rollback: `db-migration-safety` (regression), rung 3.
|
||||
- Old data: `old-data-compatibility` (many-inputs), rung 2; `replay-equivalence`, `derived-view-agreement`.
|
||||
- Equivalence: `differential-old-vs-new` (many-inputs), rung 2, on generated and real records; `round-trip` where a reverse exists.
|
||||
- Interruption: `fault-injection-storage` (many-inputs), `stress-repeat`.
|
||||
- Totals and reports: `domain-evidence-report` (intent), `golden-files-hand-verified`.
|
||||
- Contract: `baseline-before-change`; the human for production data, `owner-acceptance-runbook`.
|
||||
|
||||
## Common false finishes
|
||||
- Tested on a small clean fixture; real data has nulls, odd encodings and duplicates.
|
||||
- Counts match but values changed (timezone, rounding, trimming); no column-level comparison was made.
|
||||
- Idempotence was never tried; a second run duplicates rows.
|
||||
- The rollback exists on paper and has never been run.
|
||||
- Old code reading new data (during a rolling deploy) fails.
|
||||
- The migration takes hours in production and locks the table; it was timed on 100 rows.
|
||||
- Foreign keys, indexes, triggers or permissions were not carried over.
|
||||
- Backups were not taken or restored before the run.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: dependency-upgrade
|
||||
title: Upgrading a dependency or toolchain
|
||||
applies_to: Raising the version of a library, framework, runtime or compiler the project depends on.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The project builds from a clean checkout with the new version pinned in the lockfile, on every supported platform.
|
||||
- The whole test suite passes without any test being weakened, skipped or edited just to pass.
|
||||
- Behaviour changes the upgrade introduced are read from its changelog, decided on, and either handled or ruled out.
|
||||
- The new version has no known vulnerability, an allowed licence and a trusted source, and the transitive changes were looked at.
|
||||
- Public output (formats, error text, API) that users rely on did not change unnoticed.
|
||||
- Notices and size are current.
|
||||
|
||||
## Checks
|
||||
- Builds and tests: `clean-clone-build`, `cross-platform-matrix` (real-world), `single-gate-command` (completeness), rung 3.
|
||||
- Behaviour is unchanged: `differential-old-vs-new` (many-inputs), rung 2; `characterization-tests`, `golden-files-hand-verified`, `baseline-before-change` (regression).
|
||||
- Public interface: `api-semver-rust`, `api-surface-typescript`, `api-breaking-schema` (regression).
|
||||
- Security and legal: `dependency-audit-rust` or `dependency-audit-general`, `licence-notices` (safety).
|
||||
- Compiler and lints: `rust-lints-strict`, `zero-warnings` (regression).
|
||||
- Speed and size: `perf-regression`, `size-budget`.
|
||||
- Tests can fail: `mutation-on-diff` for any test you changed.
|
||||
|
||||
## Common false finishes
|
||||
- The lockfile was not committed, or `cargo update` / `npm update` moved many packages, and only the target was reviewed.
|
||||
- Tests pass because deprecated-behaviour tests were skipped or snapshots were regenerated; read those diffs.
|
||||
- Compile warnings about deprecated use were left, which become errors next release.
|
||||
- It was only built on the author's platform.
|
||||
- A transitive dependency changed licence, pulled in a yanked version, or added unsafe code.
|
||||
- The changelog was not read; a changed default (timeouts, parsing strictness, rounding) does not break tests.
|
||||
- A pin was loosened to make the resolver pass.
|
||||
- Release notes were summarised from memory rather than read.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: docs-change
|
||||
title: Changing documentation
|
||||
applies_to: README files, guides, API docs, comments meant to be read, and runbooks.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Every command, snippet and path in the text runs or exists as written, on a clean machine.
|
||||
- Every link and cross-reference resolves.
|
||||
- The text matches what the code does now; claims about behaviour were checked against the code or a run.
|
||||
- It answers the question its reader brings, in the order they need, and says what it does not cover.
|
||||
- Nothing else changed: no code or contract edit rode along.
|
||||
- Examples contain no real secrets, and no private names.
|
||||
|
||||
## Checks
|
||||
- Runs and links: `doc-tests-and-links` (real-world), rung 3; `cli-transcript-tests` for shown output.
|
||||
- True to the code: `acceptance-examples` (intent) for stated behaviour; `golden-files-hand-verified` for output shown.
|
||||
- Quality: `rubric-judge` (intent), rung 5, with a different model family; `pairwise-comparison` against the old text.
|
||||
- Scope: `feedback-as-amendment` (intent) for the diff.
|
||||
- Safety: `secret-scanning`, `shellcheck` for shell snippets (safety).
|
||||
- Complete: `no-stubs-scan` for TODO and "coming soon", `requirement-to-check-map` if the doc has a spec (completeness).
|
||||
|
||||
## Common false finishes
|
||||
- Snippets were written, not run; one has a typo or a removed flag.
|
||||
- The docs describe the plan or the old behaviour, not the code.
|
||||
- Links were checked before files were renamed.
|
||||
- A new feature is documented in one place; two older pages still say the opposite.
|
||||
- Output shown was typed, not copied from a run.
|
||||
- The docs are accurate for the author's machine; a path or tool is not there elsewhere.
|
||||
- Placeholder text ("TBD", "lorem") remains.
|
||||
- The human asked for a fix to one section and the whole page was rewritten.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: native-gui-change
|
||||
title: Changing a native desktop or mobile interface
|
||||
applies_to: A window, dialog or widget in a desktop or mobile application built with a native or immediate-mode toolkit.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The app starts from the built binary, reaches the changed screen through the real controls, and the change works there.
|
||||
- The screen is captured and compared to a baseline: only the intended pixels changed.
|
||||
- The view model and the logic behind it are tested without a window, so most of the behaviour needs no display.
|
||||
- The change respects the data it shows: the UI does not write what it should only read, and every number shown is the engine's.
|
||||
- Keyboard use, window resizing, high-DPI and long text behave.
|
||||
- The human has seen the result, or accepted a recorded before-and-after.
|
||||
|
||||
## Checks
|
||||
- Pixels: `visual-regression-native-gui` (regression), rung 4; `pairwise-comparison` (intent) for whether the new one is better.
|
||||
- Logic: unit and property tests on the view model (`proptest` or `hypothesis`, many-inputs); `derived-view-agreement` (many-inputs) so shown figures match the engine's.
|
||||
- Read-only: `read-only-guarantee` (regression).
|
||||
- Structure: `ui-structure-snapshot` (regression) where the toolkit exposes an accessibility tree.
|
||||
- Install: `packaging-install-upgrade`, `cross-platform-matrix` (real-world).
|
||||
- Taste: `taste-baseline`, `owner-acceptance-runbook` (intent), rung 6.
|
||||
|
||||
## Common false finishes
|
||||
- Unit tests of the model pass; the window was never opened.
|
||||
- A screenshot from one platform, theme or scale factor stands for all.
|
||||
- The baseline image was updated to match the new rendering without a person looking at it.
|
||||
- Event handlers wired to the wrong widget when several look alike.
|
||||
- The UI shows a number computed again in the UI code instead of the engine's, and they diverge in an edge case.
|
||||
- Layout breaks with long text, empty data, or a narrow window.
|
||||
- It runs on the developer's GPU or font set and fails on a clean machine.
|
||||
- Closing or killing the app mid-action leaves bad data.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: new-library
|
||||
title: Writing a new library
|
||||
applies_to: A new package or module other code will depend on, with a public interface.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The public interface is written down, every function and type has documented behaviour, errors and limits, and nothing internal is exported by accident.
|
||||
- Each documented rule is exercised by tests, including edge cases, bad input and the empty case.
|
||||
- Properties that should hold for all inputs (round trips, ordering, no panic) are tested at rung 2 or better.
|
||||
- It builds from a clean clone with only the declared dependencies and passes on every supported platform and version.
|
||||
- Dependencies are audited and their licences allowed; there is a licence file and a README with an example that runs.
|
||||
- There is no stub, skipped test, or placeholder left.
|
||||
|
||||
## Checks
|
||||
- Behaviour: `acceptance-examples` (intent) agreed with the human; `proptest`, `hypothesis`, `fast-check` or the language's equivalent (many-inputs), rung 2; `round-trip`, `algebraic-laws`.
|
||||
- Tests are not hollow: `cargo-mutants`, `mutmut`, `stryker` or `pitest` (test-quality), `coverage-floor`.
|
||||
- Interface: `api-semver-rust` or `api-surface-typescript` (regression) baseline recorded for the first release.
|
||||
- Docs run: `doc-tests-and-links` (real-world). Clean machine: `clean-clone-build`, `cross-platform-matrix`.
|
||||
- Safety: `rust-lints-strict`, `unsafe-audit`, `dependency-audit-rust` or `dependency-audit-general`, `licence-notices`.
|
||||
- Complete: `no-stubs-scan`, `single-gate-command`, `spec-traceability` if a spec exists (completeness).
|
||||
|
||||
## Common false finishes
|
||||
- Only the happy-path examples from the README are tested.
|
||||
- The README example does not compile or run; nobody ran it.
|
||||
- Everything is public. The first release then freezes accidental surface.
|
||||
- It works with the author's dependency versions only; no lower-bound or clean-lock build was tried.
|
||||
- Panics or exceptions on empty, huge or non-UTF-8 input are untested.
|
||||
- Thread-safety or `Send`/`Sync` claims are unstated and untested.
|
||||
- Licence is missing or a dependency's licence conflicts with it.
|
||||
- Test coverage is high but assertions are weak, so mutants survive.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: new-product
|
||||
title: Building a whole new product from a short statement
|
||||
applies_to: Turning a one-line or short description (an app, a service, a tool) into working software for real users.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The statement was turned into a written contract the human confirmed once: who it is for, what it must do, what it must never do, with concrete acceptance examples.
|
||||
- Every requirement has an id, code and tests cite them, and none is left unbuilt (no stubs, skipped tests or placeholder data).
|
||||
- The core logic has strong checks: proofs or property tests for its laws, a reference to compare to, hostile input for every parser.
|
||||
- The product runs from a clean machine, installs, starts, and does the real job end to end through its public surface.
|
||||
- It is safe: dependencies audited, secrets handled, trust boundaries modelled, data stored survives crashes and upgrades.
|
||||
- One command defines done; documentation says how to run and verify it; a release path exists.
|
||||
- The owner walked it and accepted it, and what was assumed is reported.
|
||||
|
||||
## Checks
|
||||
- What to build: `acceptance-examples`, `requirement-to-check-map` (completeness), `spec-traceability`; design: `tlaplus` or `quint` for state machines (design).
|
||||
- Logic: `lean4-proofs`, `kani` or `proptest` (prove, many-inputs), rung 1 to 2; `stateful-model-test`, `differential-reference`, `round-trip`.
|
||||
- Tests are real: `cargo-mutants` or the language's mutation tool, `vacuity-check`, `assertion-strength-review` (test-quality).
|
||||
- Real world: `e2e-playwright` or `cli-transcript-tests`, `clean-clone-build`, `packaging-install-upgrade`, `cross-platform-matrix`.
|
||||
- Safety: `rust-lints-strict`, `dependency-audit-rust`, `secret-scanning`, `threat-model-checklist`, `licence-notices`.
|
||||
- Done: `single-gate-command`, `no-stubs-scan`, `check-tiering`, `release-gate`; the human: `owner-acceptance-runbook` (intent), rung 6.
|
||||
|
||||
## Common false finishes
|
||||
- The demo path works. The error, empty, large and concurrent cases were never tried.
|
||||
- Features that were in the statement are quietly dropped or stubbed, and the final report does not list them.
|
||||
- The tests are many and shallow: they pass, and mutants survive.
|
||||
- It works from the author's environment and fails on a clean machine.
|
||||
- Only what the agent chose to test was tested; no independent check, no owner walk-through.
|
||||
- There is no persistence, backup or upgrade story, so the first update loses data.
|
||||
- Decisions were made silently. Every assumption belongs in the contract and the report.
|
||||
- "Done" was declared with no single command that proves it.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: numeric-or-financial-core
|
||||
title: Numeric or financial calculation code
|
||||
applies_to: Code that computes with money, quantities, rates or any number where a wrong digit is a wrong answer, such as ledgers, tax, interest, pricing.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Numbers are exact: money is integers or decimals, never binary floating point, with rounding rules named and applied in one place.
|
||||
- Conservation laws hold for every input: debits equal credits, parts sum to the total, a reversal nets to zero, allocations lose no cent.
|
||||
- Boundaries are decided and tested: zero, negative, the largest value, overflow, many decimal places, ties in rounding, currency conversion.
|
||||
- Period, year and timezone boundaries behave; leap days and month ends are covered.
|
||||
- Results agree with an independent source: a hand calculation, a reference implementation, a published example.
|
||||
- The domain's own reports (trial balance, statements) foot and the human or an expert has read them.
|
||||
|
||||
## Checks
|
||||
- Laws for all inputs: `lean4-proofs`, `kani`, `verus`, `creusot` or `exhaustive-small-domain` (prove), rung 1, for the core invariants; else `proptest` or `hypothesis`, `algebraic-laws` (many-inputs), rung 2.
|
||||
- Overflow and panics: `kani`, `cargo-fuzz`, `illegal-states-unrepresentable`.
|
||||
- Independent answer: `differential-reference`, `differential-executable-spec`, `metamorphic`, `model-test-from-spec`.
|
||||
- Rules traced: `spec-traceability` (completeness).
|
||||
- Evidence for the human: `domain-evidence-report`, `golden-files-hand-verified`.
|
||||
- Tests are real: `cargo-mutants`, `mutation-on-diff`; `rust-lints-strict` denying lossy casts (safety).
|
||||
- Leaks: `sensitive-data-leak-test` for tax ids.
|
||||
|
||||
## Common false finishes
|
||||
- Example tests with round numbers pass; the cent that disappears on a three-way split is never tried.
|
||||
- `float` or `double` is used somewhere in the path, even once.
|
||||
- Rounding happens at each step instead of at the end, or at the end instead of each step, against the stated rule.
|
||||
- A property test generates only small positive amounts, so negatives and huge values never occur.
|
||||
- The proof covers a simplified model; the shipped code uses a different type or rounding.
|
||||
- A report foots because both sides come from the same wrong figure.
|
||||
- A reversal, a late entry, or a closed period was never tried.
|
||||
- A surviving mutant in the arithmetic was written off without a reason in the `findings-log`.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
id: parser-or-codec
|
||||
title: Parsing, formatting or encoding code
|
||||
applies_to: Code that turns bytes or text into structured data or back, including file formats, protocols and serialisers.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Valid input of every form the format allows parses to the right value, checked against an independent source (the specification's examples, a reference implementation).
|
||||
- Encoding then decoding returns the original, and decoding then encoding returns the canonical form.
|
||||
- Invalid and hostile input gives an error, never a crash, hang, huge allocation or wrong answer; there are bounds on size and nesting.
|
||||
- Behaviour on the strange cases is decided and written down: duplicates, trailing data, byte order marks, case, whitespace, overlong encodings.
|
||||
- Files written by it can be read by other tools, and the reverse.
|
||||
|
||||
## Checks
|
||||
- Round trip: `round-trip` (many-inputs), rung 2, with a generator that makes valid structures.
|
||||
- Agreement with another implementation: `differential-reference`, `differential-executable-spec` (many-inputs), rung 2.
|
||||
- Crashes and hangs: `cargo-fuzz`, `atheris`, `jazzer` or `go-fuzz`, with `structure-aware-fuzzing`, rung 2; run longer than a smoke test.
|
||||
- Schema-based attack: `hostile-input-from-schema`. Seeds kept: `regression-seed-hygiene`.
|
||||
- Known good files: `golden-files-hand-verified` (regression), `old-data-compatibility`.
|
||||
- Grammar properties: `metamorphic`, `algebraic-laws`; small domains: `exhaustive-small-domain` (prove).
|
||||
- Tests are real: `mutation-on-diff`.
|
||||
|
||||
## Common false finishes
|
||||
- Round trip passes only because the generator makes values the parser already handles; the strange values are never made.
|
||||
- Fuzzing ran for a minute from an empty corpus, found nothing, and was called clean.
|
||||
- Both directions share a bug (the same wrong table) so the round trip is symmetric and wrong. Compare to an independent oracle.
|
||||
- Errors are tested by "it returns an error", not that the position and message are right.
|
||||
- The decoder accepts input the specification forbids ("be liberal"), and other tools then disagree.
|
||||
- Recursion depth, length prefixes, and decompression ratios are unbounded.
|
||||
- Locale, endianness or Unicode normalisation differs on another machine.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
id: performance-work
|
||||
title: Performance or resource-use work
|
||||
applies_to: A change whose goal is to make something faster, smaller or lighter.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- A measured baseline was taken before the change, on stated hardware, with stated inputs, and the after-numbers are on the same setup.
|
||||
- The improvement is larger than the noise, shown by repeated runs and a spread, and is the figure the request named (latency, throughput, memory, size).
|
||||
- Results are identical: the same outputs for every input, including edge cases.
|
||||
- It holds across the realistic range of inputs (small, large, adversarial), not only the one benchmarked.
|
||||
- Other costs did not rise unseen (memory, start-up, binary size, tail latency).
|
||||
- A guard now stops it getting worse again.
|
||||
|
||||
## Checks
|
||||
- Same results: `differential-old-vs-new` (many-inputs), rung 2; `characterization-tests`, `baseline-before-change` (regression).
|
||||
- Measurement and guard: `perf-regression`, `size-budget`, `ratchet-floor` (regression), rung 3.
|
||||
- Concurrency effects: `thread-sanitizer`, `stress-repeat` if threads were added.
|
||||
- Under load: `load-test-k6` (real-world) for a service; `lighthouse-budget` for a web page.
|
||||
- Tests are real: `mutation-on-diff`; gate: `single-gate-command`.
|
||||
|
||||
## Common false finishes
|
||||
- One timing run, a noisy machine, a 4% change called a win.
|
||||
- Benchmarked in debug mode, or without optimisations the product ships with.
|
||||
- The benchmark input is so small that the optimised path is never taken, or the compiler removed the work.
|
||||
- A cache warmed by the benchmark loop; the cold case is slower than before.
|
||||
- Speed gained by dropping a check, a copy that was needed, or precision; outputs differ in edge cases.
|
||||
- Median improved and the 99th percentile got worse.
|
||||
- Memory use went up as time went down and only time was measured.
|
||||
- No guard was added, so the gain disappears in the next change.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: refactor
|
||||
title: Refactoring
|
||||
applies_to: Changing the structure of code without changing what it does.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Behaviour is identical for every input that mattered before: same outputs, same errors, same side effects, same public interface.
|
||||
- Evidence of that was captured before the first edit, then compared after.
|
||||
- No behaviour change is hiding in the diff (a "small fix" while there).
|
||||
- The structure really got better in the way the request named (smaller, fewer dependencies, one place for a rule), and that can be measured.
|
||||
- Performance and size did not get worse beyond what was agreed.
|
||||
|
||||
## Checks
|
||||
- Same behaviour on many inputs: `differential-old-vs-new` (many-inputs), rung 2, the strongest; run old and new on the same generated inputs.
|
||||
- Same behaviour on known cases: `baseline-before-change`, `characterization-tests`, `golden-files-hand-verified` (regression), rung 3 to 4. Characterise before you edit.
|
||||
- Interfaces: `api-semver-rust`, `api-surface-typescript` or `api-breaking-schema` (regression), rung 2.
|
||||
- The tests can notice a change: `mutation-on-diff` (test-quality), rung 2.
|
||||
- Structure goal: `architecture-lint` (regression); `ratchet-floor` for a metric that must only improve.
|
||||
- Speed: `perf-regression`, `size-budget` (regression).
|
||||
- Gate: `single-gate-command` (completeness), rung 3.
|
||||
|
||||
## Common false finishes
|
||||
- The suite passed, but the code had no tests where you changed it. A passing suite over untested code says nothing; add characterization tests first.
|
||||
- Existing tests were edited during the refactor. Any test edit is a behaviour change until shown otherwise.
|
||||
- Error messages, ordering of results, or timing changed, and a caller relied on it.
|
||||
- A public name was renamed or moved and only in-repo callers were updated.
|
||||
- Dead code was deleted that was reached by reflection, a config string, or a plugin.
|
||||
- "Same behaviour" was checked on the happy path only; the error and empty paths differ.
|
||||
- The refactor and a fix were merged into one diff, so neither can be reviewed. Separate them.
|
||||
- The new structure is only a rename or a move, with the same coupling.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: release
|
||||
title: Releasing a version
|
||||
applies_to: Tagging, packaging and publishing a version of a program or library.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The version in the manifest, the tag, the changelog and the package name agree.
|
||||
- The full test set ran on this exact commit, including the slow set, and its result is recorded with its age.
|
||||
- The package was built from a clean checkout, not a developer's working tree, and its contents were inspected: licence, notices, the binary and nothing secret.
|
||||
- Third-party notices and dependency audits are current.
|
||||
- A fresh machine can install it, run it, and upgrade from the previous version with user data intact.
|
||||
- Publishing was done from the gate, not by hand; it can be undone or was left as a draft until the owner tried it.
|
||||
|
||||
## Checks
|
||||
- One command: `release-gate`, `single-gate-command` (completeness), rung 3.
|
||||
- Depth and freshness: `check-tiering` (completeness); mutation, proofs and fuzz evidence dates recorded.
|
||||
- Package: `packaging-install-upgrade`, `clean-clone-build`, `cross-platform-matrix` (real-world), rung 3.
|
||||
- Legal and security: `licence-notices`, `dependency-audit-rust` or `dependency-audit-general`, `secret-scanning` (safety).
|
||||
- Interface: `api-semver-rust`, `api-breaking-schema` (regression) for the version bump.
|
||||
- After publishing: `smoke-after-deploy` (real-world); the human, `owner-acceptance-runbook` (intent), rung 6.
|
||||
|
||||
## Common false finishes
|
||||
- Tests ran on the branch, then more commits landed before the tag.
|
||||
- The tag and the manifest version differ, or the changelog is for the last release.
|
||||
- Built on a dirty tree; a file that is not committed is in the package.
|
||||
- The package lacks the licence or notices file, or includes a `.env` or test data.
|
||||
- Install was tested on the machine that built it, where all the dependencies already exist.
|
||||
- Upgrade from the previous version was not tried, and the data format changed.
|
||||
- Slow tests, fuzzing and proofs were last run weeks ago and the release says "all checks passed".
|
||||
- Published by hand, skipping the gate, because it was urgent.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: security-fix
|
||||
title: Fixing a security vulnerability
|
||||
applies_to: A reported or discovered weakness (injection, access control, leaked secret, unsafe deserialisation, dependency flaw).
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The vulnerability is reproduced by an exploit-shaped test that fails before the fix and passes after, using the attacker's route, not an internal call.
|
||||
- The root cause is fixed everywhere the pattern occurs, not just at the reported spot.
|
||||
- Variants of the attack (encoding, case, path forms, another endpoint) are tried and refused.
|
||||
- Legitimate behaviour is unchanged: the existing suite and the happy paths pass.
|
||||
- If a secret leaked, it was rotated and the leak path was closed; history cleanup is not a substitute for rotation.
|
||||
- The advisory or write-up says what was affected, the fixed version, and what users must do.
|
||||
|
||||
## Checks
|
||||
- Exploit test: `red-before-green` (test-quality), rung 3; `hostile-input-from-schema`, `cargo-fuzz` or `atheris` (many-inputs) for input flaws, rung 2.
|
||||
- Variants and siblings: `static-analysis-semgrep`, `codeql` (safety), rung 2; record in `findings-log` (completeness).
|
||||
- Written model: `threat-model-checklist` (safety) with a check for each way in.
|
||||
- Leaks: `secret-scanning`, `sensitive-data-leak-test`; dependency issues: `dependency-audit-rust`, `dependency-audit-general`.
|
||||
- Access: `multi-user-isolation` (real-world).
|
||||
- No regressions: `baseline-before-change`, `single-gate-command`; memory issues: `address-and-ub-sanitizers`, `unsafe-audit`.
|
||||
|
||||
## Common false finishes
|
||||
- The exploit was blocked for the example payload; one encoding variant (URL, Unicode, double encoding) still works.
|
||||
- The check is in the UI, not on the server.
|
||||
- The reported route is fixed; the same code path is reachable by another endpoint.
|
||||
- A leaked key was removed from the repository but not rotated.
|
||||
- A denylist was added instead of an allowlist or a safe API.
|
||||
- The fix breaks a legitimate use and was reverted under pressure; run the full suite.
|
||||
- The error message still reveals what was probed, or a stack trace.
|
||||
- No test; the next refactor reintroduces it.
|
||||
- Upgrading the dependency is called done without checking the advisory's affected range against the lockfile.
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
id: service-api
|
||||
title: Building or changing a service or HTTP API
|
||||
applies_to: A server whose clients call it over a network: its endpoints, messages, status codes and storage.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- Each endpoint does what its written contract says for valid, invalid, empty, large and repeated requests, and returns the documented status codes and error bodies.
|
||||
- Clients that exist still work: the change is backward compatible, or the break is deliberate, versioned and announced.
|
||||
- Authorisation is enforced on every route, and one user or tenant cannot see or change another's data.
|
||||
- Retries and concurrent requests do not corrupt state or double-apply an effect.
|
||||
- It starts from a clean environment, migrates its storage, and answers a health check; after deploy a smoke test passes.
|
||||
- It holds under expected load and handles dependency failures.
|
||||
|
||||
## Checks
|
||||
- Contract: `contract-testing-pact`, `api-breaking-schema` (regression and real-world), rung 2 to 3.
|
||||
- Hostile and random requests: `hostile-input-from-schema`, `proptest` or `hypothesis`, `stateful-model-test` (many-inputs), rung 2.
|
||||
- Isolation: `multi-user-isolation` (real-world), rung 3; concurrency: `stress-repeat`, `deterministic-simulation`, `linearizability-checking`.
|
||||
- Storage: `db-migration-safety` (regression), `fault-injection-storage`, `old-data-compatibility`.
|
||||
- Deploy: `smoke-after-deploy`, `load-test-k6`, `runtime-self-check` (real-world).
|
||||
- Safety: `threat-model-checklist`, `static-analysis-semgrep`, `dependency-audit-general`, `secret-scanning`, `sensitive-data-leak-test`.
|
||||
|
||||
## Common false finishes
|
||||
- Tests call handlers directly and skip authentication, serialisation and middleware.
|
||||
- Only a single user is tested, so tenant isolation is unknown.
|
||||
- A new required field breaks existing clients and nobody ran the old client's requests.
|
||||
- An idempotency or retry case was not tried; a client timeout leads to a double charge.
|
||||
- Error responses leak stack traces, SQL or other users' ids.
|
||||
- The migration works on an empty database and fails on real data.
|
||||
- Passes against a mock of the dependency; the real one behaves differently.
|
||||
- Load was tested with one repeated request, so caches hid real cost.
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
id: storage-engine
|
||||
title: A storage engine, database layer or persistent format
|
||||
applies_to: Code that writes data to disk or a database and must read it back correctly after crashes, upgrades and concurrency.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- What is written is what is read back, for all value shapes, including the empty, the largest and the unusual.
|
||||
- A crash or power loss at any point leaves the store either as before or as after, never in between, and recovery works.
|
||||
- Concurrent readers and writers see consistent states, with the isolation the documentation promises.
|
||||
- Files written by every earlier version still open; the new version's files are rejected or migrated safely by older ones.
|
||||
- Corruption is detected and reported, not silently returned.
|
||||
- Disk full, permission denied and a failed write are handled without damaging existing data.
|
||||
- Performance and size on realistic volume are measured.
|
||||
|
||||
## Checks
|
||||
- Round trip and model: `stateful-model-test`, `round-trip`, `model-test-from-spec` (many-inputs), rung 2.
|
||||
- Crash and failure: `fault-injection-storage`, `deterministic-simulation` (concurrency), rung 2.
|
||||
- Consistency: `linearizability-checking`, `loom` or `shuttle`, `stress-repeat`.
|
||||
- Old data: `old-data-compatibility`, `replay-equivalence`, `derived-view-agreement`; migration: `db-migration-safety`.
|
||||
- Hostile files: `cargo-fuzz`, `structure-aware-fuzzing`.
|
||||
- Design: `tlaplus` or `quint` for recovery protocols (design), rung 1.
|
||||
- Read-only paths: `read-only-guarantee`. Speed: `perf-regression`.
|
||||
|
||||
## Common false finishes
|
||||
- Tests never kill the process mid-write; the write-then-rename or log protocol was not exercised.
|
||||
- `fsync` was not called (or the directory was not synced), and the test machine's cache hid it.
|
||||
- The store was tested in memory or on tmpfs, not on a real disk.
|
||||
- One thread only; a second writer breaks it.
|
||||
- The test reopened the store in the same process, which kept caches alive. Restart a fresh process.
|
||||
- An old file from the previous release was never opened.
|
||||
- Corrupted bytes are returned as valid data because there is no checksum.
|
||||
- A lock file is left behind after a crash and blocks the next start.
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
id: web-ui-change
|
||||
title: Changing a web interface
|
||||
applies_to: A page, component or flow in a browser-based user interface.
|
||||
---
|
||||
|
||||
## Done means
|
||||
- The page works in a real browser through the real user journey, not only in a component test.
|
||||
- It looks right at the sizes users use (phone, tablet, desktop) and nothing else on the page moved unintentionally.
|
||||
- It is usable by keyboard and screen reader, with sufficient contrast.
|
||||
- Loading, empty, error and slow-network states exist and are shown correctly.
|
||||
- The change did not make the page measurably slower or heavier.
|
||||
- The human has seen it, or the person's verdict on a before-and-after is recorded.
|
||||
|
||||
## Checks
|
||||
- Journey: `e2e-playwright` (real-world), rung 3, running the actual flow with assertions on what the user sees.
|
||||
- Appearance: `visual-regression-web` (regression), rung 4; `pairwise-comparison` and `taste-baseline` (intent) for whether it is better.
|
||||
- Structure: `ui-structure-snapshot` (regression) for the accessibility tree.
|
||||
- Accessibility: `accessibility-axe` (real-world), rung 2 to 3.
|
||||
- Performance: `lighthouse-budget`, `size-budget`, `perf-regression`.
|
||||
- Contract with the backend: `contract-testing-pact`. Invariants: `baseline-before-change`.
|
||||
- Judge: `rubric-judge` (intent) for tone and clarity, rung 5; the human for taste, rung 6.
|
||||
|
||||
## Common false finishes
|
||||
- Screenshots were taken after the change but not compared with before; "looks fine" is a guess.
|
||||
- The snapshot was regenerated to match the new output, so the diff proves nothing. Look at the images.
|
||||
- Tested at one viewport and one browser.
|
||||
- Only the success path was tested; the error and empty states look broken.
|
||||
- Component tests pass while the page fails to load because of a bundle, route or auth problem.
|
||||
- Text overflows or truncates with long names, other languages or large font settings.
|
||||
- A new element is not reachable by keyboard, or steals focus.
|
||||
- Passing a11y scans taken as proof the page is accessible; they find only a fraction of problems.
|
||||
- The dev server was tested and the production build was not.
|
||||
Reference in new issue
Block a user