reasoning: use structured semantic fidelity contract
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
SituationStatus,
|
||||
ConfidenceLevel,
|
||||
SituationRelationship,
|
||||
answerResolutionGuidance,
|
||||
answerSupportCategory,
|
||||
situationNodeSchema,
|
||||
situationEdgeSchema,
|
||||
situationGraphSchema,
|
||||
@@ -212,13 +214,39 @@ describe("graphUpdateSchema", () => {
|
||||
userSupportedMeaning: "Risk matters more to me.",
|
||||
possibleInference:
|
||||
"This may imply caution, but does not establish a hard constraint.",
|
||||
supportCategory: "relative priority only",
|
||||
resolutionGuidance: "leave unresolved",
|
||||
supportCategory: answerSupportCategory.relative_priority_only,
|
||||
resolutionGuidance: answerResolutionGuidance.must_remain_unresolved,
|
||||
},
|
||||
});
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects invalid supportCategory values", () => {
|
||||
const result = graphUpdateSchema.safeParse({
|
||||
answerMeaning: {
|
||||
userSupportedMeaning: "Risk matters more to me.",
|
||||
possibleInference: null,
|
||||
supportCategory: "relative priority only",
|
||||
resolutionGuidance: answerResolutionGuidance.must_remain_unresolved,
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects invalid resolutionGuidance values", () => {
|
||||
const result = graphUpdateSchema.safeParse({
|
||||
answerMeaning: {
|
||||
userSupportedMeaning: "Risk matters more to me.",
|
||||
possibleInference: null,
|
||||
supportCategory: answerSupportCategory.relative_priority_only,
|
||||
resolutionGuidance: "leave unresolved",
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects update with invalid node kind in addedNodes", () => {
|
||||
const invalid = graphUpdateSchema.safeParse({
|
||||
addedNodes: [
|
||||
|
||||
Reference in New Issue
Block a user