refine answerMeaning contract around user-supported meaning
This commit is contained in:
@@ -2745,14 +2745,70 @@ function proposalResolutionSummary(proposal) {
|
||||
return { resolved, proposalText };
|
||||
}
|
||||
|
||||
function deriveAnswerMeaningProfile(userSupportedMeaning) {
|
||||
const meaningText = normaliseSemanticText(userSupportedMeaning);
|
||||
|
||||
if (
|
||||
meaningText.includes("not really sure") ||
|
||||
meaningText.includes("not sure") ||
|
||||
meaningText.includes("unsure") ||
|
||||
meaningText.includes("do not know") ||
|
||||
meaningText.includes("don't know")
|
||||
) {
|
||||
return {
|
||||
category: "uncertain",
|
||||
resolutionGuidance: "must_remain_unresolved",
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
meaningText.includes("hard constraint") ||
|
||||
meaningText.includes("non-negotiable") ||
|
||||
meaningText.includes("dont want any increase in risk") ||
|
||||
meaningText.includes("do not want any increase in risk")
|
||||
) {
|
||||
return {
|
||||
category: "explicit_hard_constraint",
|
||||
resolutionGuidance: "must_resolve",
|
||||
};
|
||||
}
|
||||
|
||||
if (hasConditionalQualification(meaningText)) {
|
||||
return {
|
||||
category: "conditional_tradeoff",
|
||||
resolutionGuidance: "may_resolve",
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
meaningText.includes("matters more") ||
|
||||
meaningText.includes("more important") ||
|
||||
meaningText.includes("higher priority") ||
|
||||
meaningText.includes("greater relative importance") ||
|
||||
meaningText.includes("relative importance")
|
||||
) {
|
||||
return {
|
||||
category: "relative_priority_only",
|
||||
resolutionGuidance: "must_remain_unresolved",
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
category: "other",
|
||||
resolutionGuidance: null,
|
||||
};
|
||||
}
|
||||
|
||||
function validateAnswerMeaningAlignment(proposal) {
|
||||
if (!proposal.answerMeaning) return [];
|
||||
|
||||
const errors = [];
|
||||
const { userSupportedMeaning, supportCategory, resolutionGuidance } =
|
||||
proposal.answerMeaning;
|
||||
const { userSupportedMeaning } = proposal.answerMeaning;
|
||||
const meaningText = normaliseSemanticText(userSupportedMeaning);
|
||||
const { resolved, proposalText } = proposalResolutionSummary(proposal);
|
||||
const derivedProfile = deriveAnswerMeaningProfile(userSupportedMeaning);
|
||||
const supportCategory = derivedProfile.category;
|
||||
const resolutionGuidance = derivedProfile.resolutionGuidance;
|
||||
|
||||
if (resolutionGuidance === "must_remain_unresolved" && resolved) {
|
||||
errors.push(
|
||||
@@ -2810,6 +2866,14 @@ function validateAnswerMeaningAlignment(proposal) {
|
||||
}
|
||||
}
|
||||
|
||||
if (supportCategory === "other") {
|
||||
if (resolved || containsConstraintBoundaryLanguage(proposalText)) {
|
||||
errors.push(
|
||||
"Proposal cannot resolve or strengthen answerMeaning that does not clearly establish one of the protected reasoning categories.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user