| 117 | // profile variants when both exist), then by alphabetical path so the |
| 118 | // pick is deterministic across reindexes. |
| 119 | const score = (n: Node) => { |
| 120 | const base = n.filePath.split('/').pop() ?? ''; |
| 121 | const isBase = /^(application|bootstrap)\.(yml|yaml|properties)$/i.test(base); |
| 122 | return (isBase ? 0 : 1) * 1000 + base.length; |
| 123 | }; |
| 124 | const best = candidates.reduce((a, b) => (score(a) <= score(b) ? a : b)); |
| 125 | return { original: ref, targetNodeId: best.id, confidence: 0.75, resolvedBy: 'framework' }; |
| 126 | } |