make-diff-compliant · git:20261001.eb09810 · 2026-10-01 · sha256 a48f60b555562dbe

make-diff-compliant git:20261001.eb09810A

Immutable. This exact content never changes and is served at /api/v1/blob/a48f60b555562dbe.

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_wfpdtyrp6wkx2ccn/a48f60b555562dbed2976ce2677bcd4105589e34751b5f543e7e1dd09ada7f6c.json

Then /plugin install make-diff-compliant@markdownregistry-wfpdtyrp6wkx2ccn in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.

---
name: make-diff-compliant
description: Use to bring exactly the Python files a PR/branch touches up to the deterministic-refactor compliance conditions (typed, @override, spec-bound mocks), so a future refactor over them is verifiable. Scoped to the diff — grows compliance monotonically, no repo-wide migration.
---

**Preflight:** run `la-doctor --expect 0.2.1` once per session before using any `la-*` or `dr-*` command; if it fails, stop and show the user its output.

# Make the diff compliant

Raise compliance one PR at a time instead of a big-bang migration: every diff
leaves the files it touched fully refactor-verifiable.

## Steps

1. **Changed Python files:**
   `git diff --name-only <base>...HEAD -- '*.py'` (base = the PR's target branch).
2. **Report:** `dr-compliance <changed files>` → `untyped-def` /
   `unannotated-attr` / `mock` violations.
3. **Fix each, within the changed files:**
   - `untyped-def` → add param and return annotations.
   - `unannotated-attr` → annotate the attribute (class-body `x: T`, or
     `self.x: T = ...`).
   - `mock` → bind to a spec: `create_autospec(X, spec_set=True)`,
     `MagicMock(spec_set=X)`, `patch(..., autospec=True)`, or a `Protocol` fake.
   - Add `@typing.override` to any override among the changed methods.
4. **Re-check until clean:**
   - `dr-compliance <changed files>` exits 0;
   - the project's type checker shows no new errors on those files;
   - `dr-mock-lint <changed tests>` passes.
5. Run the non-integration test suite. Review. The user commits.

Never weaken existing annotations. Keep edits within the diff's files unless a
fix requires annotating an immediate caller.