correction: delegate hasNodeLevelUserSupport to rawAnswerSupportsUnclassifiedMeaning

v0.15 duplicated the overlap helper logic in hasNodeLevelUserSupport with
reversed argument orientation (unknownText as source, userSupportedMeaning
as candidate) compared to rawAnswerSupportsUnclassifiedMeaning (USM as
source, unknownText as candidate). This produced different accept/reject
outcomes when the two texts have very different token counts.

The fix replaces the independent reconstruction with a single call to the
canonical helper, ensuring node-level and answer-meaning alignment use
identical semantics. Four boundary regression tests verify:

- Boundary A: overlap ratio < 0.4 but >= 3 shared tokens → accept (token rule)
- Boundary B: short candidate / long source accepted via structural linkage
- Boundary B control: unrelated unknown rejected with no structural edge
- Boundary C: ratio exactly at 0.4 threshold accepts via ratio rule
This commit is contained in:
2026-08-10 20:09:39 +01:00
parent 9e869cbcb8
commit 2e20d30890
2 changed files with 268 additions and 6 deletions
+1 -6
View File
@@ -92,12 +92,7 @@ function validateAddedUnknowns(graph, proposal, answerMeaning) {
.join(" "),
);
const overlapRatio = semanticOverlapRatio(userSupportedMeaningText, unknownText);
const overlappingTokens = semanticContentTokens(userSupportedMeaningText).filter(
(token) => semanticContentTokens(unknownText).includes(token),
).length;
return overlapRatio >= 0.4 || overlappingTokens >= 3;
return rawAnswerSupportsUnclassifiedMeaning(userSupportedMeaningText, unknownText);
}
if (addedUnknowns.length > 3) {