Version. 0.1
Date. 2026-08-06
Author. Claude.ai (drafting) / Marvin Percival (approving).
Target. /Users/dunin7/loomworks-engine, branch main.
Baseline reference. Post CR-2026-171 (commit 8992179, tag cr-2026-171-small-work-sweep-engine). CC confirms exact HEAD at Step 0.
Priority. Standard.
Confidential. Internal DUNIN7.
Companion to. inspection-briefs/loomworks-b48-quality-tooling-step-0-findings-v0_1.md (the evidence baseline — every count and category below is drawn from it); standing-notes/dunin7-build-list-v0_29 (B-48).
Charter. standing-notes/dunin7-standing-authorization-charter-v0_1. Autonomous regime in effect.
Status. Ready for CC execution.
CR number. 173 is a best-guess next slot, one past CR-2026-172. CC confirms against the ledger before filing.
Supersedes. None.
Two checkers (ruff, mypy) are configured but have never run as a gate. The Step 0 findings show roughly a fifth of the combined backlog is misconfiguration, not defects. This CR fixes the misconfiguration, auto-cleans the mechanical remainder, and turns both checkers into real CI gates — zero-tolerance for ruff, a non-regression ratchet for mypy. Mirrors the discipline CR-2026-167 (B-49) already established: deliberately break each gate and observe it fail before trusting it green.
Add FastAPI's Depends / Path / Query idiom to extend-immutable-calls in pyproject.toml's [tool.ruff] (or wherever the project's ruff config section lives — CC verifies exact location). This alone removes the 800 B008 findings, which the Step 0 findings confirm are not real defects.
Add stele to mypy's ignore-missing-imports allowlist (or the project's existing per-module override convention if one exists — CC verifies). Removes all 70 import-untyped findings, which Step 0 confirms trace to one fact: the sibling stele package ships no type stubs.
Run uv run ruff check . --fix for the mechanically-fixable remainder (64.8% of the post-config-fix count per Step 0). One commit, reviewed as a diff before landing — mechanical, but CC scans the diff for anything that looks like a behavior change, not just a style change, before committing.
Generate a baseline capturing every remaining mypy error (file:line:code) after the config fix, e.g. mypy-baseline.txt at the repo root or wherever the project's convention for generated-artifact files sits (CC verifies). This is the ratchet's floor.
Add both checkers to the existing CI workflow (the one CR-2026-167 established):
uv run ruff check . — fails the build on any finding. No baseline; this is the zero-tolerance gate.uv run mypy src compared against the baseline file — fails the build only on errors not present in the baseline (new errors). A script or existing tool handles the diff (CC's choice; note the mechanism used in implementation notes since no prior DUNIN7 precedent exists for this per Step 0's finding).Per the CR-2026-167 precedent: after wiring, deliberately introduce one ruff violation and one new (non-baseline) mypy error on a throwaway branch/commit, confirm CI goes red for each, then confirm CI is green again once reverted. This is what earns trust in the gate — an untested gate is not a trusted gate.
| Step | What | Mode |
|---|---|---|
| 0 | Pre-flight — confirm baseline HEAD, tree clean. | Auto |
| 1 | Ruff config fix (§3.1). | Auto |
| 2 | Mypy config fix (§3.2). | Auto |
| 3 | Ruff auto-fix pass, reviewed diff, one commit (§3.3). | Auto |
| 4 | Full test suite — confirm no behavioral regressions from the auto-fix pass. | Auto |
| 5 | Generate mypy baseline file (§3.4). | Auto |
| 6 | Wire both CI gates (§3.5). | Auto |
| 7 | Deliberate break-and-observe for both gates (§3.6). Revert the deliberate breaks. | Auto |
| A | Checkpoint — Operator confirms before tag. | Checkpoint |
| 8 | Tag cr-2026-173-b48-quality-gates. Push. | Auto (post-checkpoint) |
Both checkers are real CI gates for the first time. Ruff backlog: zero, enforced. Mypy backlog: frozen at baseline, enforced as a ceiling, worked down opportunistically over time. No design debt hidden — the ratchet mechanism and its location are recorded in implementation notes since there's no prior DUNIN7 convention for it.
Read the Change Request at the path I supply below. This is CR-2026-173
v0.1, B-48's quality-gate CR. You are the executing agent. Confirm the
CR number against the record's ledger before filing.
CR path: ~/Downloads/cr-2026-173-loomworks-b48-quality-gates-v0_1.md
Two config fixes (FastAPI immutable-calls for ruff; stele import-ignore
for mypy) remove ~22% of the combined backlog for free. Ruff auto-fix
handles most of the rest. Ruff gates at zero from here on. Mypy gates
on a non-regression baseline, not zero — the remaining ~600 errors are
real, not noise, per the Step 0 findings, and are not being bulk-fixed
in this CR.
Baseline: post CR-2026-171 (8992179, tag cr-2026-171-small-work-sweep-
engine). Confirm exact current HEAD at Step 0 — CR-2026-172 (surface)
doesn't touch the engine repo, so this should still be current, but
verify rather than assume.
Step 3's auto-fix diff should be reviewed before committing — scan for
anything that looks like a behavior change riding along with a style
fix, not just accept the tool's output blind.
Step 7 is not optional: deliberately break each gate, confirm CI goes
red, revert, confirm green. This is what makes the gate trustworthy,
same discipline as CR-2026-167 (B-49).
No prior DUNIN7 convention exists for a mypy non-regression baseline
mechanism — your choice of implementation, documented in implementation
notes.
Full suite + checkpoint before tagging.
DUNIN7 — Done In Seven LLC — Miami, Florida CR-2026-173 — B48: quality tooling gates — v0.1 — 2026-08-06