feat(confidence-engine): tighten focused relationship attribution
This commit is contained in:
@@ -118,6 +118,52 @@ describe("buildFocusedDeconstructPrompt", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildFocusedDeconstructPrompt — relationship rule boundary lock", () => {
|
||||
it("relationship instruction explicitly prohibits observation restatement", () => {
|
||||
const prompt = buildFocusedDeconstructPrompt({
|
||||
targetLabel: "X",
|
||||
targetDescription: "Y",
|
||||
centralStatement: "Z",
|
||||
question: "Q?",
|
||||
answer: "A.",
|
||||
});
|
||||
expect(prompt).toContain("Do not create a relationship by merely restating");
|
||||
});
|
||||
|
||||
it("relationship instruction explicitly prohibits promotion of tentative/conditional meaning", () => {
|
||||
const prompt = buildFocusedDeconstructPrompt({
|
||||
targetLabel: "X",
|
||||
targetDescription: "Y",
|
||||
centralStatement: "Z",
|
||||
question: "Q?",
|
||||
answer: "A.",
|
||||
});
|
||||
expect(prompt).toContain("Tentative, speculative, or conditional language must not be promoted into an established relationship");
|
||||
});
|
||||
|
||||
it("relationship instruction requires direct link between two distinct propositions", () => {
|
||||
const prompt = buildFocusedDeconstructPrompt({
|
||||
targetLabel: "X",
|
||||
targetDescription: "Y",
|
||||
centralStatement: "Z",
|
||||
question: "Q?",
|
||||
answer: "A.",
|
||||
});
|
||||
expect(prompt).toContain("must connect two distinct propositions that the user's answer itself links");
|
||||
});
|
||||
|
||||
it("relationship instruction explicitly permits relationships: [] when no direct link exists", () => {
|
||||
const prompt = buildFocusedDeconstructPrompt({
|
||||
targetLabel: "X",
|
||||
targetDescription: "Y",
|
||||
centralStatement: "Z",
|
||||
question: "Q?",
|
||||
answer: "A.",
|
||||
});
|
||||
expect(prompt).toContain("relationships: []");
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateFocusedDeconstructSchema", () => {
|
||||
it("passes when all required fields are present", () => {
|
||||
const result = { targetNodeId: "a", observations: [], uncertainties: [], assumptions: [], relationships: [], possibleFollowUpQuestions: [] };
|
||||
|
||||
Reference in New Issue
Block a user