feat(enforcement): add mypy, tsconfig, and import-linter adapters#17
Merged
Conversation
The .agent/CLAUDE.md (V2) renamed "task" to "item" throughout the workflow system, but the root CLAUDE.md still referenced the old next_task.py script and used "task" terminology. This updates the Task Workflow section to match, fixing stale script references.
Three new enforcement adapters that read from the compiled constraints contract and generate native config files, following the BaseAdapter pattern established by ESLint/Ruff: - MypyAdapter: .mypy-adr.ini from config_enforcement.python.mypy - TsconfigAdapter: tsconfig.adr.json from config_enforcement.typescript.tsconfig - ImportLinterAdapter: .importlinter-adr from architecture.layer_boundaries Also extends ConflictDetector with INI conflict detection for the new ini_file fragment type, and registers all three in the EnforcementPipeline. Standalone files chosen over pyproject.toml sections to match the established pattern (.ruff-adr.toml, .eslintrc.adrs.json) and avoid modifying user config files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The enforcement pipeline had adapters for ESLint and Ruff but lacked support for mypy, TypeScript tsconfig, and Python import-linter. Users who define architectural constraints (e.g., layer boundaries, type-checking overrides) in their ADR contracts had no way to enforce them via these commonly used tools.
Approach
Three new adapters following the established
BaseAdapterpattern:.mypy-adr.inifromconfig_enforcement.python.mypycontract data. Produces per-module[mypy-<module>]sections with overrides likedisallow_untyped_defs.tsconfig.adr.jsonfromconfig_enforcement.typescript.tsconfigcontract data. Outputs a standardcompilerOptionsJSON structure..importlinter-adrfromarchitecture.layer_boundariescontract data. Produces INI-format import-linter contracts defining forbidden cross-layer imports.Key design decisions:
.ruff-adr.toml,.eslintrc.adrs.json) and avoids modifying user-owned config files.ini_filefragment type, so drift between generated and on-disk files is caught.EnforcementPipelinealongside existing ones.What Was Tested
Risks
Additive changes only — no existing adapter behavior is modified. The new adapters only activate when the corresponding contract sections exist. Existing pipelines without these contract sections are unaffected.