/** * crew#552 (F-RC1-040; user decision 2026-09-13): onboarding a repo ends with its learnings * CAPTURED. When an onboarding run THIS daemon launched completes (`sessionCompleted`), the daemon * launches the `capture-learnings` workflow for the same repo — filed in the onboarding run's * project, with the roster WITH standing (`seatsForWorkflow`) — and records `chainedFrom` on its * launch entry (`AgentSession.chained_from`, a `runChained` frame on /ws). CAPTURE is automatic; * PROMOTION stays human-gated (proposals are inert until reviewed in Steering → Memories / Policies). * * - OFF switches: the `onboardingAutoCapture` setting (`false`), or `autoCapture: false` on the * `POST /repos` / `POST /repos/:id/onboard` that launched the onboarding run (a one-off). * - Idempotent: one capture per onboarding completion — the launch entry's `chainedFrom` is read * back after a restart, so a resume's second terminal frame launches nothing; a re-index is a * new onboarding run and gets exactly one new capture. A failed onboarding launches nothing. * - Serialized: one chained capture at a time (councils are the spikiest thing the platform does); * the next waits for the running one's terminal frame. */ import type { CoreAdapter } from '../core/adapter.js'; import type { Actor, CoreEvent } from '../core/types.js'; import type { AuditLog } from './audit.js'; import { type RunTimingIndex } from './run-timing-index.js'; /** The workflow a completed onboarding chains to (the engine's built-in preset). */ export declare const CAPTURE_LEARNINGS_WORKFLOW = "capture-learnings"; /** Who launched a chained capture (the launch entry's actor). */ export declare const ONBOARDING_CHAIN_ACTOR: Actor; export interface OnboardingCaptureDeps { adapter: Pick; runTimingIndex: RunTimingIndex; audit: AuditLog; /** The project a run is filed in (the membership index), if any. */ projectOf: (runId: string) => string | undefined; /** A project's own `autoCapture` override (crew-side project settings); `undefined` = none. */ projectAutoCapture?: (projectId: string) => boolean | undefined; /** The post-commit half of a project-filed launch (index + membership event). */ fileRun: (runId: string, projectId: string) => void; /** Where the `runChained` frame goes (/ws). */ broadcast: (frame: CoreEvent) => void; log: (msg: string) => void; } export declare class OnboardingCaptureChain { private readonly deps; /** Onboarding run ids waiting for their capture launch, in completion order. */ private readonly pending; /** The chained capture run in flight (one at a time), or null. */ private active; /** The onboarding run whose capture is being launched right now (never queued twice). */ private launchingFor; /** Terminal frames seen while a launch was in flight: a capture that ended before `launchRun` * answered must not hold the slot (codex on #552). */ private readonly endedWhileLaunching; constructor(deps: OnboardingCaptureDeps); /** Fold one engine frame: an onboarding completion queues a capture; a capture's end frees the slot. */ onEvent(event: CoreEvent): void; /** Launch the next queued capture when the slot is free. Never throws. */ private next; /** The capture launch for one completed onboarding run, or `null` when it is switched off or done. */ private launchFor; } //# sourceMappingURL=onboarding-capture.d.ts.map