/** * Durable investigation lifecycle. * * Investigations live in `.feltdb/investigations/.json` inside the * workspace. That location is what makes the development loop durable rather * than browser-session memory: a refresh, a process exit, or a full workspace * restart all leave the investigation, its evidence, its finding, its Git * association, and its verification result intact and queryable. * * Every state change goes through the lifecycle state machines in * `runtime-investigation.ts`, so an invalid transition throws instead of * silently producing an impossible record. */ import type { InvestigationEvidence, InvestigationFinding, RemediationContract, RepositoryIdentity, RuntimeInvestigation, RuntimeRequestObservation } from './workspace-types.js'; /** Aggregate facts about the durable investigation store. */ export interface InvestigationStoreMetrics { investigations: number; observations: number; evidenceRecords: number; verifiedInvestigations: number; serializedBytes: number; loadMilliseconds: number; } export declare class InvestigationLifecycleManager { private readonly workspaceDir; private readonly investigationsDir; constructor(workspaceDir: string); private ensureDirectories; /** Open an investigation for a runtime observation. */ createInvestigation(observation: RuntimeRequestObservation, workspaceId?: string): RuntimeInvestigation; persistInvestigation(investigation: RuntimeInvestigation): void; loadInvestigation(id: string): RuntimeInvestigation | null; listInvestigations(): RuntimeInvestigation[]; /** Find the investigation opened for a given observation, if any. */ findByObservationId(observationId: string): RuntimeInvestigation | null; /** Add an observation reference without changing the factual observation. */ linkRuntimeObservationToInvestigation(observationId: string, investigationId: string): RuntimeInvestigation; private require; /** OBSERVED -> INVESTIGATING, attaching the runtime evidence. */ transitionToInvestigating(id: string, evidence?: InvestigationEvidence[]): RuntimeInvestigation; /** * INVESTIGATING -> FINDING. * * Accepts a structured {@link InvestigationFinding}. A bare string is still * accepted so existing callers keep working; it is stored as an analysis * finding with no evidence attribution. */ transitionToFinding(id: string, finding: InvestigationFinding | string): RuntimeInvestigation; /** * FINDING -> PROPOSED and NOT_STARTED -> SENT_TO_AGENT. * * Records the repository state at handoff so a later comparison can prove * what the agent changed. */ sendToAgent(id: string, contract: Omit, gitBefore?: RepositoryIdentity): RuntimeInvestigation; /** SENT_TO_AGENT -> IMPLEMENTING. The agent has started work. */ markImplementing(id: string): RuntimeInvestigation; /** * IMPLEMENTING -> CHANGES_DETECTED, using observable repository state. * * Returns the investigation unchanged when the repository has not moved: * FeltDB will not advance the lifecycle on an agent's say-so. */ detectRepositoryChange(id: string, projectDir: string): RuntimeInvestigation; /** * CHANGES_DETECTED -> IMPLEMENTATION_COMPLETE, and the verification state * machine becomes ready to watch the runtime. * * A detected repository change means remediation happened. It does not mean * the defect is fixed, so this only opens verification — it never concludes it. */ completeImplementation(id: string): RuntimeInvestigation; /** * Evaluate the verification contract against a runtime observation. * * The outcome is decided by the observation alone. A missing or * non-matching observation yields INCONCLUSIVE; it never yields VERIFIED. */ recordVerification(id: string, contract: RemediationContract, observation?: RuntimeRequestObservation): RuntimeInvestigation; /** * Measure the durable development-plane store. * * This is an empirical baseline for durability, queryability, and restart * cost. It is not a scale claim. */ metrics(): InvestigationStoreMetrics; } //# sourceMappingURL=investigation-lifecycle-manager.d.ts.map