import type { Rules } from '../rules/index.js' /** What a worker gets with a range (the coordinator's lease). */ export interface Lease { range: { id: number; group: string; start: number; end: number; next: number } rules: Rules } /** * A group's two cursors (REBUILD.md, "Voyager 3: window indexing", 1): `history` works the ranges the lease bounds * hand out (the windows, the history), `tail` the tail planner's ranges. Each lane has its own holder, window and * snapshot; the group routes take `?lane=` (history by default). */ export type Lane = 'history' | 'tail' /** * A group lease (REBUILD.md, "Voyager 3: window indexing", 1): the group a worker thread holds, the lane, the rules, * and the snapshot of the lane's window when there is one (its next article; the body comes from GET * groups/:id/snapshot). */ export interface GroupLease { group: { id: number; name: string; priority: number } lane: Lane rules: Rules snapshot: { next: number } | null } /** The group's next range in article order, leased to the holder (POST groups/:id/next; 204 when caught up). */ export interface NextRange { range: { id: number; start: number; end: number; next: number } }