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-173 (commit f20a0fb, tag cr-2026-173-b48-quality-gates). CC confirms exact HEAD at Step 0.
Priority. Standard.
Confidential. Internal DUNIN7.
Companion to. scoping-notes/loomworks-b48-ruff-followon-scoping-note-v0_1.md (every disposition and the execution order below are drawn from it — not repeated in full); inspection-briefs/loomworks-b48-quality-tooling-step-0-findings-v0_2.md.
Charter. standing-notes/dunin7-standing-authorization-charter-v0_1. Autonomous regime in effect.
Status. Ready for CC execution.
CR number. 174 is a best-guess next slot, one past CR-2026-173. CC confirms against the ledger before filing.
Supersedes. None.
Closes the 543 ruff findings CR-2026-173 deliberately left unfixed, then flips on the zero-tolerance gate that CR-2026-173 already built and wired but never turned on. Seven categories, each handled per the scoping note's disposition — some are a config change, some are real per-instance fixes, two need a read-only verification pass before anything is touched.
Action. Raise the configured max line length in pyproject.toml's [tool.ruff] section. CC reads the current limit and the distribution of offending line lengths at Step 0, picks a limit that clears the bulk of the 225 honestly (not just enough to silence the tool), and reports the chosen number and its rationale. Any lines still over the new limit get wrapped by hand — expected to be a small residual, not 225.
Error
Step 2a — blast-radius check (read-only, before any rename). For each of the 36 classes, grep every import and reference across all three repos (loomworks-engine, loomworks, stele) — catches by name, test assertions on exception type, anything treating the class as part of a contract. Report per-class: safe-to-rename, or needs-deprecation-alias.
Step 2b — fix. Safe-to-rename classes get renamed directly. Any class flagged needs-deprecation-alias gets the new name plus a backward-compatible alias (OldName = NewName) rather than a bare rename, and that alias gets a follow-on removal noted as a residue (not this CR's job to remove it).
Step 3a — verification pass (read-only, before any fix). For each of the 24, confirm whether it's a legitimate forward-reference pattern (per from __future__ import annotations) or a real bug. Step 0's sample suggested the former for most; this step checks all 24, not a sample.
Step 3b — fix. Confirmed-legitimate ones get a scoped # noqa: F821 with a one-line reason (not a blanket file-level suppression). Confirmed-real ones get fixed properly (missing import, typo, etc.).
raise inside except without from
Action. Per-instance fix: raise X from err where the original exception is genuinely the cause, raise X from None where it's deliberately being replaced and the original context isn't useful. CC reads each site rather than applying one pattern blindly.
Action. Per-instance fix: remove the unused variable, or rename to _/_name with a # noqa and reason if the unpacking is deliberate for readability.
Action. Per-instance judgment: legitimate deferred-import pattern (circular-import avoidance, required path setup) gets a scoped # noqa with reason; genuine disorganization gets moved to the top.
Action. CC reads the actual list at Step 7, groups by shared fix pattern where possible, fixes mechanically once grouped, and flags anything that reads as a real design question back to the Operator rather than guessing.
Once §2.1–2.7 land and the full ruff run returns 0, flip CR-2026-173's already-built zero-tolerance CI step from deferred to active (it exists in the workflow file; confirm exactly how CR-2026-173 left it — commented out, conditionally skipped, or simply never merged into the required-checks list — and activate accordingly).
| Step | What | Mode |
|---|---|---|
| 0 | Pre-flight — confirm baseline HEAD, tree clean. | Auto |
| 1 | E501 config bump + residual manual wraps (§2.1). | Auto |
| 2 | N818 blast-radius check, read-only (§2.2, Step 2a). Report per-class disposition. | Auto |
| 3 | F821 verification pass, read-only (§2.3, Step 3a). Report per-instance disposition. | Auto |
| 4 | N818 fixes per Step 2's dispositions (§2.2, Step 2b). | Auto |
| 5 | F821 fixes per Step 3's dispositions (§2.3, Step 3b). | Auto |
| 6 | B904 fixes (§2.4). | Auto |
| 7 | F841 fixes (§2.5). | Auto |
| 8 | E402 dispositions + fixes (§2.6). | Auto |
| 9 | Long-tail triage and fixes (§2.7). Any real design question found here halts and reports rather than guessing. | Auto, conditional halt |
| 10 | Full ruff run — confirm 0. Full test suite — confirm no regressions across all the above. | Auto |
| 11 | Activate the zero-tolerance CI gate (§3). Deliberate break-and-observe: introduce one throwaway violation, confirm CI red, revert, confirm green. | Auto |
| A | Checkpoint — Operator confirms before tag. | Checkpoint |
| 12 | Tag cr-2026-174-ruff-gate-closure. Push. | Auto (post-checkpoint) |
from/from None choices.Ruff backlog: genuine zero, gate active. Both quality gates from B-48 (mypy ratchet, ruff zero-tolerance) now fully live. Any deprecation aliases from N818 tracked as an open residue for later removal.
Read the Change Request at the path I supply below. This is CR-2026-174
v0.1, closing the ruff backlog CR-2026-173 deferred. You are the
executing agent. Confirm the CR number against the record's ledger
before filing.
CR path: ~/Downloads/cr-2026-174-loomworks-ruff-gate-closure-v0_1.md
Order matters: Steps 2 and 3 are read-only verification passes (N818
blast-radius, F821 legitimacy) and must complete and be reported before
Steps 4 and 5 touch anything. Do not rename an N818 class without first
confirming it's not caught-by-name elsewhere in engine, surface, or
stele. Do not suppress or "fix" an F821 without first confirming which
of the two it actually is.
Step 9 (long tail) halts and reports rather than guessing if anything
in the 22 remaining codes looks like a real design question rather
than a mechanical fix — do not force a resolution either way.
Step 11's deliberate break-and-observe is not optional — same
discipline as CR-2026-167 and CR-2026-173's mypy gate. An unproven
gate is not a trusted gate.
Baseline: post CR-2026-173, f20a0fb, tag cr-2026-173-b48-quality-gates.
Confirm exact current HEAD at Step 0.
Full suite + checkpoint before tagging.
DUNIN7 — Done In Seven LLC — Miami, Florida CR-2026-174 — Ruff gate: close the remaining 543 — v0.1 — 2026-08-06