From 839166b2292bc1a80a8c0c0a9f84da16c579458c Mon Sep 17 00:00:00 2001 From: Lum1104 Date: Sat, 14 Mar 2026 18:55:57 +0800 Subject: [PATCH] fix(core): add __tests__ pattern and handle filePath-less nodes in applyLLMLayers Add __tests__ and __specs__ (plural inside underscores) to Test Layer patterns for the common convention. Also assign file nodes without filePath to "Other" layer in applyLLMLayers for consistency. Co-Authored-By: Claude Opus 4.6 --- packages/core/src/analyzer/layer-detector.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/core/src/analyzer/layer-detector.ts b/packages/core/src/analyzer/layer-detector.ts index 2cd5a02..07eb89f 100644 --- a/packages/core/src/analyzer/layer-detector.ts +++ b/packages/core/src/analyzer/layer-detector.ts @@ -45,7 +45,7 @@ const LAYER_PATTERNS: Array<{ patterns: string[]; layerName: string; description description: "Shared utilities, helpers, and common libraries", }, { - patterns: ["test", "spec", "__test__", "__spec__"], + patterns: ["test", "spec", "__test__", "__spec__", "__tests__", "__specs__"], layerName: "Test Layer", description: "Test files and test utilities", }, @@ -227,7 +227,13 @@ export function applyLLMLayers( for (const node of graph.nodes) { if (node.type !== "file") continue; - if (!node.filePath) continue; + + if (!node.filePath) { + const other = layerMap.get("Other") ?? []; + other.push(node.id); + layerMap.set("Other", other); + continue; + } const normalizedPath = node.filePath.replace(/\\/g, "/"); let assigned = false;