ARCH: замкнуть all-time continuity после metadata pivot
This commit is contained in:
@@ -157,7 +157,9 @@ describe("assistant MCP catalog index", () => {
|
||||
["document"],
|
||||
["counterparty"],
|
||||
["contract"],
|
||||
["period", "organization"]
|
||||
["period", "organization"],
|
||||
["all_time_scope", "counterparty"],
|
||||
["all_time_scope", "organization"]
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -180,6 +182,27 @@ describe("assistant MCP catalog index", () => {
|
||||
expect(review.missing_axes_by_primitive).toEqual({});
|
||||
});
|
||||
|
||||
it("marks an all-time organization-scoped document plan as catalog-compatible without requiring an explicit period", () => {
|
||||
const plan = buildAssistantMcpDiscoveryPlan({
|
||||
semanticDataNeed: "document evidence",
|
||||
turnMeaning: {
|
||||
asked_domain_family: "documents",
|
||||
asked_action_family: "list_documents",
|
||||
explicit_organization_scope: "ООО Альтернатива Плюс",
|
||||
metadata_scope_hint: "НДС",
|
||||
subject_resolution_optional: true
|
||||
},
|
||||
proposedPrimitives: ["query_documents", "probe_coverage"],
|
||||
requiredAxes: ["organization", "all_time_scope", "metadata_scope", "coverage_target"]
|
||||
});
|
||||
|
||||
const review = reviewAssistantMcpDiscoveryPlanAgainstCatalog(plan);
|
||||
|
||||
expect(review.review_status).toBe("catalog_compatible");
|
||||
expect(review.reason_codes).toContain("catalog_plan_compatible");
|
||||
expect(review.missing_axes_by_primitive).toEqual({});
|
||||
});
|
||||
|
||||
it("preserves source-summary evidence floors for metadata and coverage primitives", () => {
|
||||
expect(getAssistantMcpCatalogPrimitive("inspect_1c_metadata").evidence_floor).toBe("source_summary");
|
||||
expect(getAssistantMcpCatalogPrimitive("probe_coverage").evidence_floor).toBe("source_summary");
|
||||
|
||||
@@ -905,4 +905,46 @@ describe("assistant MCP discovery planner", () => {
|
||||
expect(result.catalog_review.review_status).toBe("catalog_compatible");
|
||||
expect(result.reason_codes).toContain("planner_selected_metadata_scoped_movement_from_data_need_graph");
|
||||
});
|
||||
|
||||
it("keeps metadata-scoped document evidence execution-ready with all-time scope once organization is known", () => {
|
||||
const result = planAssistantMcpDiscovery({
|
||||
dataNeedGraph: {
|
||||
schema_version: "assistant_data_need_graph_v1",
|
||||
policy_owner: "assistantMcpDiscoveryDataNeedGraph",
|
||||
subject_candidates: [],
|
||||
metadata_scope_hint: "НДС",
|
||||
subject_resolution_optional: true,
|
||||
business_fact_family: "document_evidence",
|
||||
action_family: "list_documents",
|
||||
aggregation_need: null,
|
||||
time_scope_need: "all_time_scope",
|
||||
comparison_need: null,
|
||||
ranking_need: null,
|
||||
proof_expectation: "coverage_checked_fact",
|
||||
clarification_gaps: [],
|
||||
decomposition_candidates: ["fetch_scoped_documents", "probe_coverage"],
|
||||
forbidden_overclaim_flags: ["no_raw_model_claims", "no_unchecked_fact_totals"],
|
||||
reason_codes: [
|
||||
"data_need_graph_built",
|
||||
"data_need_graph_metadata_scoped_open_lane_without_subject",
|
||||
"data_need_graph_all_time_scope_hint"
|
||||
]
|
||||
},
|
||||
turnMeaning: {
|
||||
asked_domain_family: "documents",
|
||||
asked_action_family: "list_documents",
|
||||
metadata_scope_hint: "НДС",
|
||||
subject_resolution_optional: true,
|
||||
explicit_organization_scope: "ООО Альтернатива Плюс",
|
||||
unsupported_but_understood_family: "document_evidence"
|
||||
}
|
||||
});
|
||||
|
||||
expect(result.planner_status).toBe("ready_for_execution");
|
||||
expect(result.selected_chain_id).toBe("document_evidence");
|
||||
expect(result.proposed_primitives).toEqual(["query_documents", "probe_coverage"]);
|
||||
expect(result.required_axes).toEqual(["organization", "metadata_scope", "all_time_scope", "coverage_target"]);
|
||||
expect(result.catalog_review.review_status).toBe("catalog_compatible");
|
||||
expect(result.reason_codes).toContain("planner_selected_metadata_scoped_document_from_data_need_graph");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user