/** * Dream-cycle sweep throttle policy (Task 1944) — pure, so it is tested * without a Neo4j session. * * The sweep runs the seven dream-cycle phases per account at most once per * cadence window. The window is evaluated from graph state, not from a * bookkeeping file: the most-recent dream-cycle `:Report` for the account is * the only cursor, so a frequent server tick is idempotent (a tick that finds * every account fresh does no phase work). * * Four outcomes, matching the sweep's observability vocabulary: * - run stale (or never swept), graph non-empty, report parent present * - skip within-window a dream-cycle report exists inside the window * - skip no-graph the account graph holds no nodes to sweep * - skip no-report-parent the account has no :AdminUser to parent a :Report, so a * run could not persist its throttle cursor and would repeat * every tick (a provisioned-but-pre-PIN account). Skipping it * keeps the tick idempotent. */ export type SweepDecision = { action: "run"; } | { action: "skip"; reason: "within-window" | "no-graph" | "no-report-parent"; }; /** * True iff `latestReportIso` is a parseable timestamp strictly newer than * `nowMs - windowMs`. A null (never swept) or unparseable value is not within * the window. The window edge is exclusive: a report exactly `windowMs` old is * outside, so the sweep runs again at the cadence boundary rather than one tick * late. */ export declare function isWithinWindow(latestReportIso: string | null, nowMs: number, windowMs: number): boolean; /** * The whole per-account throttle policy. Window freshness wins first, so * `hasGraph` and `canPersistReport` are only consulted for a stale (or * never-swept) account — which is why the caller may skip the graph-existence * and admin-parent queries on the common in-window path and still get a correct * decision here. * * `canPersistReport` is whether the account has an `:AdminUser` for * `memory-report-write` to parent the run's `:Report` onto. Without it the run * would execute the phases but fail to write the `:Report`, so the next tick * would see no cursor and run again — the sweep would repeat every tick. A * parent-less account is therefore skipped, not run. */ export declare function decideSweepAction(input: { latestReportIso: string | null; nowMs: number; windowMs: number; hasGraph: boolean; canPersistReport: boolean; }): SweepDecision; //# sourceMappingURL=dream-cycle-sweep-decision.d.ts.map