/** * The daemon's half of workflow discovery (DES-walkthrough-proof §4.13; WT-W4): the project-level * view the two discovery entries count over, built from records the daemon already keeps and handed * to the watch registry as its `discovery` source (the registry reads it on a cadence, with a * deadline; the checks in `src/watch/checks/discovery.ts` stay pure over the view). * * Per run of the project: * - `human_added` — the catalog ids a PERSON put in the plan, from the run's `wicked.team.plan.*` * bus rows ({@link humanAddedOf}): `plan.proposed{by:"human"}` steps the PA's proposal did not * carry, floor-added never, `plan.revised` (pa_added / member_request) never, less any step an * accepted override removed; * - `walkthrough` — the newest `walkthrough_review` recorder's `WALKTHROUGH-SEAL … overall`, read * from the unit's engine-captured output (what the recorder reported; discovery counts, it does * not accept evidence, so the seal is not re-verified here — acceptance does that); * - `test` — the QE verdict the acceptance gate attributes to the run (the same ledger read * `GET /runs/:id/acceptance` makes), only for a run with a `test` step and a registered repo; * - `launched_at` — the session's `created_at`, else the run's first recorded frame. * * A run whose event log cannot be read is counted `unreadable`, never treated as "no". Terminal runs * are cached for the daemon's life (their facts cannot change); live ones are re-read. */ import type { RecordedEvent, RepoEntry, SessionView } from 'wicked-crew-api-types'; import { type BusEvent } from '../core/bus.js'; import type { DiscoverySnapshot } from '../watch/types.js'; /** A `wicked.team.plan.*` bus row as discovery reads it. */ export type PlanRow = Pick; /** * §4.13 `added_by_hand`: the catalog ids a PERSON put in one run's plan. The steps of every * `plan.proposed{by:"human"}` row (an initial human plan, or a human edit at the gate) that no * non-human proposal of the run carried (the PA's base), floor-added steps never, less the catalog * of any step an accepted `override.remove` took back ("never overrode"). `plan.revised` rows * (`pa_added`, `member_request`) are the PA's and are not read. */ export declare function humanAddedOf(rows: readonly PlanRow[]): string[]; export interface DiscoverySourceDeps { /** The engine's bus (plan rows); `undefined` = no bus, nothing human-added is known. */ dbPath: string | undefined; /** The run (and chat) ids that belong to the project (the membership index). */ runsOf(projectId: string): string[]; sessions(): Promise; runEvents(runId: string): Promise; workOutput(unitId: string): Promise; repos(): Promise; /** The run's attributed QE verdict (the acceptance gate's ledger read) from the run's QE LEDGER root; injectable for tests. */ testVerdict?(ledgerRoot: string, runId: string, events: RecordedEvent[]): Promise; now?(): number; } /** The verdict `GET /runs/:id/acceptance` would attribute to the run from its QE ledger ({@link runQeLedgerRoot}). */ export declare function attributedTestVerdict(ledgerRoot: string, runId: string, events: RecordedEvent[]): Promise; export declare function makeDiscoverySource(deps: DiscoverySourceDeps): (projectId: string) => Promise; //# sourceMappingURL=discovery-source.d.ts.map