Repository navigation
refactor(python): split resolve_config_extensions into one module per function - #1087
Merged
thekevinbot merged 2 commits intoSep 5, 2026
Conversation
… function The one-function-per-file gate at max_lines = 1 flags every module-scope function past the first substantial one. resolve_config_extensions.py held four: _load_toml_module, _load_extension_entries, _has_bare_name and the module's named export resolve_config_extension_specs. Keep the export in place and move the three helpers out, one module each: toml_module.py (carrying the _toml binding it produces), load_extension_entries.py and has_bare_name.py. The plural resolver now imports the two it uses from their own modules rather than through the singular one; its test pins where each is bound from. With this the whole packages/python/dirsql tree is clean at max_lines = 1. Refs #1079
thekevinbot
merged commit Sep 5, 2026
d182aed
into
claude/1066-p1-resolve-extension
16 of 17 checks passed
This was referenced Sep 5, 2026
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.
Step 2 of 2 in the
packages/python/dirsqllane of the #1020 ratchet endgame. Stacked on #1077 (claude/1066-p1-resolve-extension) — the newhas_bare_namemodule importsis_bare_name, which #1077 moves to its own file. GitHub retargets this tomainwhen #1077 merges.resolve_config_extensions.pyheld four module-scope functions and the gate flagged three atmax_lines = 1. The holder is a free choice, so the module's named exportresolve_config_extension_specskeeps the file and the helpers move out:_load_toml_moduledirsql/toml_module.py_tomlbinding it produces (its only reader is_load_extension_entries)_load_extension_entriesdirsql/load_extension_entries.py_has_bare_namedirsql/has_bare_name.py3 flagged, 3 moves plus the
_tomlbinding riding along — no extra modules needed.resolve_configs_extension_specs.pyimports_has_bare_nameand_load_extension_entries; it now takes each from its own module rather than reaching through the singular resolver, matching how it already imports_resolve_entries. Its colocated test gains three__module__assertions pinning where each helper is bound from, so the co-change is a real assertion rather than a whitespace edit.With this the whole
packages/python/dirsqltree reports zero violations atmax_lines = 1. Verified by temporarily settingpackages/python/testing-conventions.tomlto1and re-running the gate; the config change is not in this diff (per #1020, the committed ceiling stays at 12 until the final PR deletes the key).Red/green does not apply: pure moves, no behavior change.
PARITY.md needs no change. None of these functions is in
dirsql.__all__.PARITY.mdnamesresolve_config_extension_specsandresolve_configs_extension_specs; both keep their names and their modules. No parity drift — file layout inside one SDK.Gates
just preflight: 0 failing pairs, 3 skipped (the threepackagingpairs, which need a built artifact).unit mutation, diff-scoped against the stack parent (--base claude/1066-p1-resolve-extension): 20 mutants tested, 0 survivorsunit coverage: 100% line + branch acrosspackages/python/dirsql(307 stmts, 90 branches, 0 miss)unit one-function-per-fileatmax_lines = 1: the whole tree cleanunit lint,colocated-test(incl. co-change),integration lint,declared-deps: cleanTwo tests were added rather than relocated, both to keep mutation at zero on newly-moved lines: an
OSError-on-opencase for the unreadable-config arm, and a traversal-segment case pinning that the base directory is normalised.Manual run (
uv run python -c ...against the package, with a.dirsql.tomlnamingsqlite_vec):E2E Verification
packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)cargo build -p dirsql --features cli,just e2e-attest-pythonpackages/python/e2e-attestations/claude-1079-p2-resolve-config-extensions.json;git show --staton the attest commit confirms it adds one file and deletes no sibling receipts (e2e attest silently deletes other branches' attestation receipts #1041).Changelog / Migrations
<root>/<pkg>/changelog.d/for each changed package (or:skip-changelogtrailer on a commit with reason)<root>/<pkg>/migrations.d/(or: not required -- additive/bugfix only)packages/python/changelog.d/2026-09-05-config-extension-loader-split.md. No migration fragment: pure refactor, no public API or runtime behavior change.Fixes #1079