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