feat: unify module-map paths file/folder semantics across callers#85
Merged
Conversation
- add classifyModulePath + moduleScanPatterns to lib/scanner as the single source for reading a paths entry as file / dir / glob / missing - drift importScanPattern scans a single-file entry as the file itself and treats a non-source file entry as carrying no import edges (also removes a prior ENOTDIR on file entries) - knowledge getModuleInfos + updateModuleReadme scan via moduleScanPatterns, fixing bare-directory entries that previously matched zero files - preserve existing glob forms (** and dir/**) and repo-escape clamping - tests: file/dir/glob classification, drift file-entry edges, knowledge subtree scan (all mutation-verified) - raise one git-heavy mcp contract test timeout for parallel-suite headroom - sync declared test counts (2096 -> 2112)
- graduate REQ-LIB-029 + REQ-TESTS-050 and US-361 into ai-knowledge.md; MODIFY REQ-KNOW-004 (module README scan via moduleScanPatterns) - MODIFY REQ-LIB-014 in drift-detection.md (single-file import-edge scanning) - record _archived-history summary; bump product.md last_updated - refresh raw-scan.md snapshot - harvest lessons ledger (parallel-load test-timeout flake x5; new review-fix verification lesson)
Prospec Check |
Test Coverage
|
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.
摘要
讓
module-map.yaml的paths欄位一致支援三種條目形式,跨所有 caller(drift 引擎 + knowledge 產生):src/lib/config.ts)→ 只掃描/歸屬該檔本身src/lib)→ 掃描整個子樹**/auth/**、dir/**)→ 原樣保留(既有寫法不受影響)核心為 lib 新增的單一 stat-based 路徑分類器
classifyModulePath+moduleScanPatterns,作為「一個paths條目如何被掃描」的唯一事實來源;drift 與 knowledge 掃描端共用同一語義。歸屬 matcher(makePathMatcher/fileMatchesModulePath)原本就以p === literal精確匹配檔案,維持不動。修正的既有缺陷
importScanPattern先前把每個 literal 一律展開成<prefix>/**/*.ext,使檔案條目變成<file>/**→prospec check實測 ENOTDIR crash。現在檔案條目直接掃該檔;非源碼檔條目不產生 import 邊。getModuleInfos/updateModuleReadme對裸資料夾條目(如src/lib)經 fast-glob(onlyFiles)掃到 0 檔;現在經moduleScanPatterns展開為子樹。測試
moduleScanPatterns映射、drift 檔案條目/非源碼檔/glob 回歸、knowledge 子樹掃描 wiring),全數 mutation-verifiedpnpm typecheck0 error、prospec check11/11SDD
透過 prospec 完整流程走完(story → plan → tasks → implement → review → verify grade S → archive);REQ-LIB-029 / REQ-TESTS-050 / REQ-KNOW-004 / REQ-LIB-014 已畢業進
drift-detection.md與ai-knowledge.md。