/** * The campaigns-surface delivery rollup (wicked-studio#27; api-types 0.19.0). * * `GET /campaigns` / `GET /campaigns/:id` join, per member, the SAME delivery derivation the run * DTOs already carry (`AgentSession.delivery`/`deliverUrl` — crew#393's tri-state + crew#311's * vacuity split, computed by `deliveryStateWithVacuity` from the shared `DeliveryIndex` record * and the TTL-memoized git probes). One `sessionsDetail()` engine read serves a whole request — * never a per-node fetch — and the join is DTO-assembly-only: nothing here is persisted, so the * engine's Campaign shape stays the one producer of everything else on the wire. * * Why the fields ride the campaigns wire at all (instead of leaning on the `GET /runs` join a * client could do itself): the runs list default-excludes ARCHIVED runs, and bulk write-off of * campaign backlogs is an explicit feature (crew#265) — a rollup joined against the default runs * list would silently lose archived siblings. This join reads the full session set, so an * archived node still reports its delivery honestly. */ import type { Campaign, RunGroup, SessionView } from '../core/types.js'; import { type VacuityProbes } from '../api/delivery-index.js'; import type { GroupIndex } from '../api/group-index.js'; import type { PushedOnlyDelivery } from '../core/deliver.js'; import type { TestSetIndex } from '../qe/test-sets.js'; /** The delivery machinery shared with the run DTOs — injected by `registerRoutes`. */ export interface RollupDeps { groupIndex: GroupIndex; /** The registered test sets (wave 6, F-7R2-014) served beside the campaigns as `test_sets` — * `createServer` hydrates one from the trail; a directly-driven route set may omit it. */ testSets?: TestSetIndex; /** The `DeliveryIndex` record (the durable `run.delivered` fact). */ deliveryUrlFor: (runId: string) => string | undefined; /** N1: the recorded push-only delivery (a non-GitHub origin) — absent on a route set that has none. */ deliveryPushedFor?: (runId: string) => PushedOnlyDelivery | undefined; /** The shared TTL-memoized probes behind `'stranded'`/`'vacuous'`. */ vacuity: VacuityProbes; /** ERROR-level channel — only a NON-probe derivation throw (a defect) is reported here; the * expected probe-unavailable degrade stays quiet (the probe layer already said it). */ logDefect?: (msg: string) => void; /** Def-awareness (crew#481 / D-14) — the SAME `runCanDeliver(view, runWorkflowDef(…))` the * run DTOs' delivery cache applies, so a completed `capture-learnings` node reads `'none'` here * AND on `GET /runs` (the split-brain this surface's charter forbids). Absent ⇒ every completed * repo-scoped node is a candidate — today's behaviour for a directly-driven route set. */ canDeliver?: (view: SessionView) => boolean; } /** Index a session list by run id — built once per request from ONE `sessionsDetail()` read. */ export declare function sessionsById(views: SessionView[]): Map; /** * The served Campaign: the engine's persisted shape verbatim, plus the two daemon-joined 0.19.0 * fields — `node_delivery` (keyed by node_id, entry present once the node's current-attempt run * exists on the store) and `attached_runs` (the ad-hoc runs filed onto this campaign at launch, * launch order; entries only for runs the store still holds). */ export declare function enrichCampaign(campaign: Campaign, byId: Map, deps: RollupDeps): Promise; /** Every ad-hoc label group, first-use order, members in launch order (wicked-studio#27). */ export declare function buildGroups(byId: Map, deps: RollupDeps): Promise; //# sourceMappingURL=rollup.d.ts.map