refactor: move remaining flat src/ files into subdirectories#458
refactor: move remaining flat src/ files into subdirectories#458carlos-alm merged 6 commits intomainfrom
Conversation
Move source files into a domain-driven directory structure: - src/domain/ — core graph building, queries, analysis, search (embeddings) - src/features/ — composable feature modules (audit, check, complexity, etc.) - src/presentation/ — CLI formatting and output rendering - src/db/ — database layer (db.js → db/index.js) All 199 files updated with corrected import paths. 1858 tests pass, 0 cycles, all manifesto rules green. Impact: 22 functions changed, 5 affected
Update file paths in the architecture table to reflect the domain/, features/, presentation/, db/ reorganization. Addresses Greptile review.
Move 12 remaining files out of flat src/ so only cli.js and index.js remain as entry points: - config, logger, native, registry, update-check → infrastructure/ - constants, errors, kinds, paginate → shared/ - parser → domain/ - journal, change-journal → domain/graph/ Update all import paths across src/ and tests/. Update CLAUDE.md architecture table to match. Impact: 9 functions changed, 17 affected
|
Claude finished @carlos-alm's task —— View job Reviewing PR: refactor: move remaining flat src/ files into subdirectoriesTodo List:
Root Cause AnalysisProblem Being Solved: Completing the domain-driven architecture refactoring started in PR #456. The PR moves the final 12 files out of flat Why This Approach: This follows the established layered architecture pattern documented in CLAUDE.md. The moves are logical:
Risk Assessment: LOW RISK. This is a pure refactoring with no behavioral changes - only import path updates across 128 files. The CLAUDE.md architecture table was properly updated to match the new structure. Configuration Analysis✅ No suspicious configuration changes detected:
Test Integrity✅ Test changes are purely mechanical:
Code Quality Assessment✅ Excellent execution:
Backlog Compliance
Final AssessmentThis is a textbook example of careful refactoring executed with surgical precision. The author:
The scope is appropriately narrow (addressing one concern), execution is flawless, and risk is minimal. While the organizational improvement doesn't directly solve codegraph's core problem of helping AI agents navigate codebases, it establishes good architectural foundations for future development. Rating: ⭐⭐⭐⭐☆ (4/5) |
Greptile SummaryCompletes the directory reorganization started in #456 by moving the remaining 12 flat
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph "src/ (entry points)"
CLI[cli.js]
IDX[index.js]
end
subgraph "shared/"
CONST[constants.js]
ERR[errors.js]
KINDS[kinds.js]
PAG[paginate.js]
end
subgraph "infrastructure/"
CFG[config.js]
LOG[logger.js]
NAT[native.js]
REG[registry.js]
UPD[update-check.js]
end
subgraph "domain/"
PARSER[parser.js]
QUERIES[queries.js]
subgraph "domain/graph/"
JOURNAL[journal.js]
CHJOURNAL[change-journal.js]
WATCHER[watcher.js]
BUILDER[builder/]
end
end
subgraph "features/"
FEAT[complexity / cfg / dataflow / ...]
end
CLI --> ERR
IDX --> CFG
IDX --> CONST
IDX --> ERR
IDX --> KINDS
PARSER --> LOG
PARSER --> NAT
CONST --> PARSER
WATCHER --> LOG
WATCHER --> CONST
WATCHER --> ERR
WATCHER --> PARSER
WATCHER --> JOURNAL
WATCHER --> CHJOURNAL
BUILDER --> LOG
BUILDER --> CONST
BUILDER --> PARSER
BUILDER --> JOURNAL
FEAT --> CFG
FEAT --> LOG
FEAT --> PAG
FEAT --> PARSER
Last reviewed commit: 6b24119 |
Summary
src/so onlycli.jsandindex.jsremain as entry points:config,logger,native,registry,update-check→infrastructure/constants,errors,kinds,paginate→shared/parser→domain/journal,change-journal→domain/graph/src/andtests/(128 files)Follows up on #456 which moved the first batch of files into
domain/,features/,presentation/.Test plan
npx biome check src/ tests/— 0 issuescli.jsandindex.jsremain in flatsrc/