DUNIN7 · LOOMWORKS · RECORD
record.dunin7.com
Status Current
Path change-requests/cr-2026-173-loomworks-b48-quality-gates-v0_1.md

DUNIN7-M4 — INFRASTRUCTURE CHANGE REQUEST

CR-2026-173 — B-48: quality tooling gates (v0.1)

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.


1. Executive summary

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.


2. Decision (settled, Operator deferred to Claude.ai judgment)


3. Scope

3.1 Ruff config fix

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.

3.2 Mypy config fix

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.

3.3 Ruff auto-fix pass

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.

3.4 Mypy baseline file

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.

3.5 CI wiring

Add both checkers to the existing CI workflow (the one CR-2026-167 established):

3.6 Deliberate break-and-observe

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.


4. Explicitly out of scope


5. Build steps

| 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) |


6. Acceptance gate

  1. Ruff finding count post-config-fix-and-autofix: 0 (or CC reports and halts if any non-mechanical finding remains after auto-fix, rather than hand-fixing without a scoping decision).
  2. Mypy error count post-config-fix matches the baseline file exactly at commit time.
  3. Full test suite green, no regressions from the ruff auto-fix pass.
  4. CI red-then-green demonstrated for both gates via the deliberate-break step.
  5. CI runtime increase reported in implementation notes (watch-item, not a blocker).

7. Post-CR state

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.


8. Kickoff prompt for the Claude Code session


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