@merittdev/horus 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +15 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -65880,8 +65880,8 @@ init_cjs_shims();
|
|
|
65880
65880
|
|
|
65881
65881
|
// ../../packages/core/src/version.ts
|
|
65882
65882
|
init_cjs_shims();
|
|
65883
|
-
var HORUS_VERSION = true ? "0.12.
|
|
65884
|
-
var PINNED_SOURCE_VERSION = "2.0.
|
|
65883
|
+
var HORUS_VERSION = true ? "0.12.2" : "dev";
|
|
65884
|
+
var PINNED_SOURCE_VERSION = "2.0.1";
|
|
65885
65885
|
|
|
65886
65886
|
// ../../packages/core/src/evidence.ts
|
|
65887
65887
|
init_cjs_shims();
|
|
@@ -93865,7 +93865,7 @@ function scoreSeed(s5, index2, hintTokens, changedFiles, hintHasCode, qualifier,
|
|
|
93865
93865
|
score -= 4;
|
|
93866
93866
|
}
|
|
93867
93867
|
score += Math.max(0, 5 - index2) * (hintHasCode ? 0.8 : 0.1);
|
|
93868
|
-
if (s5.score !== void 0) score += s5.score * (hintHasCode ? 8 :
|
|
93868
|
+
if (s5.score !== void 0) score += s5.score * (hintHasCode ? 8 : 2);
|
|
93869
93869
|
if (/\.[jt]sx?$/i.test(s5.name)) score -= 5;
|
|
93870
93870
|
if (hintTokens !== void 0 && hintTokens.length > 0) {
|
|
93871
93871
|
let hintBoost = 0;
|
|
@@ -93886,17 +93886,27 @@ function isDeprioritizedSeedPath(filePath) {
|
|
|
93886
93886
|
filePath
|
|
93887
93887
|
);
|
|
93888
93888
|
}
|
|
93889
|
+
function isAnchoredExactSeed(s5, qualifier, hintHasCode, preferNamed) {
|
|
93890
|
+
if (qualifier && qualifierBoost(s5, qualifier) >= 40) return true;
|
|
93891
|
+
if (preferNamed !== void 0 && s5.name.toLowerCase() === preferNamed.toLowerCase()) return true;
|
|
93892
|
+
if (hintHasCode === true && s5.score !== void 0 && s5.score >= 0.9) return true;
|
|
93893
|
+
return false;
|
|
93894
|
+
}
|
|
93889
93895
|
function rankSeeds(seeds, hintTokens, changedFiles, hintHasCode, qualifier, preferNamed) {
|
|
93890
93896
|
const scored = seeds.map((symbol, i3) => ({
|
|
93891
93897
|
symbol,
|
|
93892
93898
|
score: scoreSeed(symbol, i3, hintTokens, changedFiles, hintHasCode, qualifier, preferNamed),
|
|
93893
93899
|
role: seedRole(symbol),
|
|
93894
93900
|
i: i3,
|
|
93895
|
-
deprio: isDeprioritizedSeedPath(symbol.filePath)
|
|
93901
|
+
deprio: isDeprioritizedSeedPath(symbol.filePath),
|
|
93902
|
+
// HOR-430: a deprioritized candidate the request anchors on exactly is exempt from the
|
|
93903
|
+
// hard demotion below — it keeps only the soft path penalty so a strong/exact match in an
|
|
93904
|
+
// example/test file can still surface.
|
|
93905
|
+
anchored: isAnchoredExactSeed(symbol, qualifier, hintHasCode, preferNamed)
|
|
93896
93906
|
}));
|
|
93897
93907
|
const hasReal = scored.some((s5) => !s5.deprio);
|
|
93898
93908
|
if (hasReal) {
|
|
93899
|
-
for (const s5 of scored) if (s5.deprio) s5.score -= 1e3;
|
|
93909
|
+
for (const s5 of scored) if (s5.deprio && !s5.anchored) s5.score -= 1e3;
|
|
93900
93910
|
}
|
|
93901
93911
|
return scored.sort((a2, b5) => b5.score === a2.score ? a2.i - b5.i : b5.score - a2.score).map(({ symbol, score, role }) => ({ symbol, score, role }));
|
|
93902
93912
|
}
|