Planner Autonomy: закрепить boundary inventory templates
This commit is contained in:
@@ -293,6 +293,74 @@ describe("assistant MCP discovery runtime bridge", () => {
|
||||
expect(result.reason_codes).toContain("runtime_bridge_status_checked_sources_only");
|
||||
});
|
||||
|
||||
it("keeps inventory catalog templates unsupported until exact runtime evidence is bridged", async () => {
|
||||
const result = await runAssistantMcpDiscoveryRuntimeBridge({
|
||||
dataNeedGraph: {
|
||||
schema_version: "assistant_data_need_graph_v1",
|
||||
policy_owner: "assistantMcpDiscoveryDataNeedGraph",
|
||||
subject_candidates: [],
|
||||
business_fact_family: "inventory_stock_snapshot",
|
||||
action_family: "stock_snapshot",
|
||||
aggregation_need: null,
|
||||
time_scope_need: "explicit_period",
|
||||
comparison_need: null,
|
||||
ranking_need: null,
|
||||
proof_expectation: "coverage_checked_fact",
|
||||
clarification_gaps: [],
|
||||
decomposition_candidates: [
|
||||
"fetch_scoped_movements",
|
||||
"aggregate_checked_amounts",
|
||||
"probe_coverage",
|
||||
"explain_evidence_basis"
|
||||
],
|
||||
forbidden_overclaim_flags: ["no_raw_model_claims", "no_unchecked_stock_snapshot"],
|
||||
reason_codes: ["data_need_graph_built", "data_need_graph_family_inventory_stock_snapshot"]
|
||||
},
|
||||
turnMeaning: {
|
||||
asked_domain_family: "inventory_stock",
|
||||
asked_action_family: "stock_snapshot",
|
||||
explicit_organization_scope: "OOO Alternative Plus",
|
||||
explicit_date_scope: "2021-09-30"
|
||||
},
|
||||
deps: buildDeps([])
|
||||
});
|
||||
const userFacing = [
|
||||
result.answer_draft.headline,
|
||||
...result.answer_draft.confirmed_lines,
|
||||
...result.answer_draft.inference_lines,
|
||||
...result.answer_draft.unknown_lines,
|
||||
...result.answer_draft.limitation_lines,
|
||||
result.answer_draft.next_step_line ?? ""
|
||||
].join("\n");
|
||||
|
||||
expect(result.bridge_status).toBe("unsupported");
|
||||
expect(result.answer_draft.answer_mode).toBe("checked_sources_only");
|
||||
expect(result.pilot.pilot_scope).toBe("inventory_route_template_v1");
|
||||
expect(result.pilot.mcp_execution_performed).toBe(false);
|
||||
expect(result.loop_state).toMatchObject({
|
||||
loop_status: "blocked",
|
||||
selected_chain_id: "inventory_stock_snapshot",
|
||||
pilot_scope: "inventory_route_template_v1",
|
||||
asked_domain_family: "inventory_stock",
|
||||
asked_action_family: "stock_snapshot",
|
||||
explicit_organization_scope: "OOO Alternative Plus",
|
||||
explicit_date_scope: "2021-09-30"
|
||||
});
|
||||
expect(result.business_fact_answer_allowed).toBe(false);
|
||||
expect(result.reason_codes).toContain("pilot_scope_unsupported_for_live_execution");
|
||||
expect(result.answer_draft.must_not_claim).toEqual(
|
||||
expect.arrayContaining([
|
||||
"Do not present inventory route-template planning as executed stock, supplier, purchase, or sale evidence.",
|
||||
"Do not expose inventory_route_template_v1 or MCP primitive names in the user answer."
|
||||
])
|
||||
);
|
||||
expect(userFacing).toContain("Инвентарный route-template");
|
||||
expect(userFacing).not.toContain("inventory_route_template_v1");
|
||||
expect(userFacing).not.toContain("query_movements");
|
||||
expect(userFacing).not.toContain("primitive");
|
||||
expect(userFacing).not.toContain("MCP discovery pilot");
|
||||
});
|
||||
|
||||
it("keeps document evidence executable when the planner expands primitives from fact-axis search", async () => {
|
||||
const result = await runAssistantMcpDiscoveryRuntimeBridge({
|
||||
dataNeedGraph: {
|
||||
|
||||
Reference in New Issue
Block a user