fix: exclusion matching, dep graph, module regex; add directory move#5
Closed
peteromallet wants to merge 2 commits intomainfrom
Closed
fix: exclusion matching, dep graph, module regex; add directory move#5peteromallet wants to merge 2 commits intomainfrom
peteromallet wants to merge 2 commits intomainfrom
Conversation
…support Bug fixes: - run_grep: exclusion patterns now match against relative file paths only, preventing false positives when project root contains an exclude pattern (e.g. "Wan2GP" matching "Headless-Wan2GP" in every absolute path) - finalize_graph: same relative-path fix for post-graph exclusion filtering - from_re regex: now matches absolute "from X import Y" in addition to relative "from .X import Y", fixing the dep graph missing all absolute from-imports - _has_exact_module/_replace_exact_module: replaced \b word boundary with lookaround assertions since \b treats '.' as a boundary, causing 'source.foo' to falsely match inside 'source.foo.bar' New feature: - Directory/package move support: `desloppify move source/db source/core/db` moves all files in a directory, updates external importers, and preserves intra-package relative imports that don't need changing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When moving a directory, files within the package that import siblings using absolute paths (e.g. `from source.video.ffmpeg_ops import ...` inside source/video/crossfade.py) now get those imports updated. Previously only external importers and relative self-imports were handled, leaving absolute intra-package imports stale after a directory move. Relative intra-package imports (from .foo) are correctly skipped since the files move together preserving their relative positions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
peteromallet
added a commit
that referenced
this pull request
Feb 12, 2026
…ion cleanup Scoring improvements: - Fix cycle denominator: use graph files (not edges) for realistic potential - Add small-sample dampening (MIN_SAMPLE=200) to prevent small dimensions swinging score - Fix smells unit mismatch: per-file weighted failure cap for file-based detectors - Track scan completeness (full vs fast) per language - Show dual Health/Strict scores prominently for overall + per dimension - Dimension deltas show both health and strict changes New facade detector (Issue #6): - Detect re-export facade files (pure import/re-export, no logic) - Detect facade directories (all modules are facades) - Supports both Python and TypeScript - Integrated into coupling phase, Organization scoring dimension PR #5 fixes: - Exclusion matching uses relative paths (avoids matching project root name) - Python dep graph regex matches absolute from-imports - Module word boundary uses lookaround instead of \b - Directory move support for desloppify move command Cleanup: - Remove redundant DETECTOR_NAMES lists — derive from detect_commands dict keys - Single registration point: add to get_detect_commands() and it works everywhere Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Changes incorporated into main via cacdc6a (manually applied since codebase architecture had diverged from PR base) |
peteromallet
added a commit
that referenced
this pull request
Feb 22, 2026
…st coverage Quick fixes: - Add blank line after PrimaryAction TypedDict (#3) - Fix _compute_risk_flags local type: list[dict] → list[RiskFlag] (#11) - Hoist dimension_action_type dicts to module-level constants (#17) Import path cleanup: - Remove underscore aliases in _work_queue/core.py and ranking.py (#12) Type safety: - Add WorkQueueResult TypedDict for build_work_queue return (#5) - Change build_work_queue state param to StateModel (#5) Structural refactors: - Move scorecard_dimension_rows to engine/planning/dimension_rows.py (#2) - Replace importlib.import_module with deferred imports in _state/ (#9) - Extract 13 TypedDicts from narrative/core.py to narrative/types.py (#13) - Derive _DIMENSION_SPECS from detector registry instead of manual tuple (#18) Abstraction fitness: - Remove 16 file_discovery and 3 text_utils re-exports from utils.py (#6) - Update 12 consumer files to import from source modules directly AI-generated debt: - Simplify 46 Google-style docstrings across 18 production files (#7) Test improvements: - Add 73 targeted tests for concerns.py internal generators (#15) - Split smoke test monolith into 6 per-subsystem functions (#16) Also resolved 4 findings already fixed in current code (#1, #8, #10, #14). 3636 tests passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ikx94
added a commit
to ikx94/desloppify
that referenced
this pull request
Mar 2, 2026
…fixes WIP — coded with Claude Code. New: - languages/php/test_coverage.py — full test coverage hooks (PHPUnit/Pest assertions, use-statement parsing incl group use, has_testable_logic, is_runtime_entrypoint, map_test_to_source) - languages/php/review_data/dimensions.override.json Fixes across 10 files addressing ~20 PHP gaps: - SECRET_NAME_RE: match $variable assignments (peteromallet#14) - ENV_LOOKUPS: add env(), getenv(), $_ENV[], config() (peteromallet#11) - LOG_CALLS: add Log::info/error/etc, error_log() (peteromallet#13) - RANDOM_CALLS: add rand(), mt_rand() (peteromallet#12) - Import query: group use App\Models\{User, Post} (peteromallet#5) - resolve_php_import: actually read composer.json PSR-4 (peteromallet#4) - Unused imports: handle aliased use Foo as Bar (peteromallet#6) - class_query: add enum_declaration (peteromallet#8) - _CLOSURE_NODE_TYPES: add anonymous_function_creation_expression (peteromallet#9) - _BRANCHING_NODE_TYPES: add match_conditional_expression (peteromallet#10) - Signature _ALLOWLIST: __construct, boot, register, render, etc (peteromallet#22) - _infer_lang_name: add .php -> php (peteromallet#2) - generic_lang: entry_patterns parameter (peteromallet#3) - PHP __init__: wire test_coverage, entry_patterns, zone_rules, exclude storage/bootstrap/cache/IDE helpers (peteromallet#1,peteromallet#16,peteromallet#19,peteromallet#20,peteromallet#24) - Remediation text: add random_bytes() for PHP (peteromallet#15) Deferred: peteromallet#17 (barrel_names — N/A), peteromallet#18 (dynamic_import_finder) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
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.
Summary
run_grepandfinalize_graphmatched--excludepatterns against absolute paths, so a pattern likeWan2GPwould exclude ALL files when the project root wasHeadless-Wan2GP. Now matches against relative paths only.from_reregex in Python'sbuild_dep_graphonly matched relative imports (from .foo import bar), missing all absolutefrom X import Ystatements. This meant the dep graph was incomplete anddesloppify movereported 0 replacements for projects using absolute imports._has_exact_moduleused\bwhich treats.as a word boundary, causingsource.footo falsely match insidesource.foo.bar. Replaced with lookaround assertions.desloppify move source/db source/core/dbmoves an entire package, updating external importers while preserving intra-package relative imports.Test plan
desloppify move source/constants.py source/utils/constants.py --dry-run— shows 13 correct replacements (was 0 before fix)desloppify move source/db source/core/db --dry-run— correctly moves 7 files, updates 2 external importers, preserves intra-package imports--exclude Wan2GPno longer excludes project files fromHeadless-Wan2GP/🤖 Generated with Claude Code