Skip to content

fix(analyze): activate body and file-name detectors - #131

Merged
pablontiv merged 1 commit into
masterfrom
pablontiv/w5-issue66-dead-surface
Aug 6, 2026
Merged

fix(analyze): activate body and file-name detectors#131
pablontiv merged 1 commit into
masterfrom
pablontiv/w5-issue66-dead-surface

Conversation

@pablontiv

Copy link
Copy Markdown
Owner

Summary

  • activate AST extraction for analyze, making all three body-aware detectors live
  • detect naming inconsistency in record-file stems as well as directories, with separate populations
  • synchronize analyze documentation, architecture guidance, and the Rootline skill

Refs #66 (slice A of 3; the last slice will close the issue).

Root cause and decision

Defect Decision Root cause / rationale
1. Dead body-aware detectors Implement analyze used extract.NewRegistry(), so records had no AST and three detectors returned early. It now uses the AST-enabled registry, matching the advertised fourteen-detector contract.
2. File naming inconsistency never fires Implement The detector discarded every non-directory child even though its patterns describe record files. File stems and directory names are now scored independently to prevent mixed-population false positives.

Before / after evidence

Fixture: the reproduction script from #66, run against source builds from the same worktree.

BEFORE
threshold=default: section_patterns 0, invariants 0, formal_dependencies 0
threshold=0.1:     section_patterns 0, invariants 0, formal_dependencies 0
threshold=0.9:     section_patterns 0, invariants 0, formal_dependencies 0
file-name pattern: (none)
directory pattern: add_structural_rule, naming_inconsistency

AFTER
threshold=default: section_patterns 3, invariants 3, formal_dependencies 3
threshold=0.1:     section_patterns 6, invariants 3, formal_dependencies 3
threshold=0.9:     section_patterns 3, invariants 3, formal_dependencies 3
file-name pattern: naming_inconsistency
directory pattern: add_structural_rule, naming_inconsistency

Chain context

📍 PR A: dead detectors (this PR) → master
   PR B: repair surface              → PR A branch
   PR C: dead flags/contract         → PR B branch

Start state: master@2ccc7c0. End state: defects 1 and 2 fixed; defects 3–7 deliberately remain for later slices. Rollback: revert this one commit; no data migration is required.

Verification

  • Strict TDD focused RED captured before production edits
  • Focused GREEN: go test ./cmd/rootline ./internal/infer -run 'TestAnalyze(RunsBodyAwareDetectors|ThresholdControlsSectionPatterns)|TestDetectStructural_(NamingInconsistencyInRecordFileStems|ScoresFilesAndDirectoriesSeparately)' -count=1
  • just check
  • just test
  • just coverage-check (total 89.6%; every package above its floor)
  • Native bounded review approved (review-33a8d6b218db0d1e)

@pablontiv pablontiv added the type:bug Bug fixes label Aug 6, 2026
@pablontiv pablontiv closed this Aug 6, 2026
@pablontiv pablontiv reopened this Aug 6, 2026
@pablontiv pablontiv closed this Aug 6, 2026
@pablontiv pablontiv reopened this Aug 6, 2026
@pablontiv
pablontiv merged commit cc59a04 into master Aug 6, 2026
33 checks passed
@pablontiv
pablontiv deleted the pablontiv/w5-issue66-dead-surface branch August 6, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant