Архитектура: централизовать temporal carryover precedence в continuity policy и transition glue

This commit is contained in:
2026-04-19 10:13:24 +03:00
parent 46dfef6fb6
commit ca71335499
6 changed files with 142 additions and 93 deletions
@@ -1,5 +1,6 @@
import { describe, expect, it } from "vitest";
import {
applyTemporalCarryoverFilters,
buildRootScopedCarryoverFilters,
hydrateInventoryRootFrameState,
readAddressDebugTemporalScope,
@@ -199,4 +200,52 @@ describe("assistantContinuityPolicy organization authority", () => {
period_to: "2020-03-31"
});
});
it("applies temporal carryover from navigation scope first and falls back to continuity scope", () => {
const filters = applyTemporalCarryoverFilters(
{
organization: "Org Alt"
},
{
as_of_date: "2021-03-31",
period_from: "2021-03-01"
},
{
asOfDate: "2020-12-31",
periodFrom: "2020-12-01",
periodTo: "2020-12-31"
},
"inventory_purchase_documents_for_item"
);
expect(filters).toEqual({
organization: "Org Alt",
as_of_date: "2021-03-31",
period_from: "2021-03-01",
period_to: "2020-12-31"
});
});
it("does not inject temporal carryover for unrelated intent families", () => {
const filters = applyTemporalCarryoverFilters(
{
organization: "Org Alt"
},
{
as_of_date: "2021-03-31",
period_from: "2021-03-01",
period_to: "2021-03-31"
},
{
asOfDate: "2020-12-31",
periodFrom: "2020-12-01",
periodTo: "2020-12-31"
},
"list_documents_by_counterparty"
);
expect(filters).toEqual({
organization: "Org Alt"
});
});
});