import type { StatusCacheVerificationWriteResult } from "../status/types.js"; import { type InheritedValuesSnapshot } from "./output.js"; import type { WorkNode } from "../schema/workspec.js"; import { type AgentJudge } from "./agent.js"; import { type ChecklistReports } from "./checklist.js"; import { type CommandRunnerOptions } from "./command.js"; import { type CompleteChecklistResults, type NodeVerificationRecord, type PassedCriterionResult, type ObservedVerificationCacheUpdate, type ObservedVerificationResult, type VerificationCacheUpdate, type VerificationFailure, type VerificationResult } from "./results.js"; import { type TreeCheck } from "./tree.js"; import { type HostUserCapabilities, type SessionReader } from "./user.js"; export declare function digestSpecSource(source: string): string; export declare function sessionVerifications(): readonly { readonly update: ObservedVerificationCacheUpdate; readonly sourceDigest: string; }[]; /** Test-only reset; it can only remove authority, never grant it. */ export declare function forgetSessionVerifications(): void; export interface VerificationTarget { readonly worktreePath: string; readonly expectedCommit: string; } export interface VerifyNodeRequest { readonly node: WorkNode; /** Qualified address disambiguates duplicate IDs in different assemblies. */ readonly address?: readonly string[] | undefined; readonly specPath: string; /** Exact validated source supplied by work_verify; absent in observation-only calls. */ readonly source?: string | undefined; /** Additional spec-wide values captured by the tool before verification. */ readonly inherited?: InheritedValuesSnapshot | undefined; readonly target: VerificationTarget; readonly checklistReports?: ChecklistReports | undefined; readonly signal?: AbortSignal | undefined; } /** Compatibility name for the request shape; it contains no caller capabilities. */ export type VerifyNodeOptions = VerifyNodeRequest; export interface VerifierCapabilities { readonly hasUI: boolean; readonly confirm?: HostUserCapabilities["confirm"] | undefined; readonly sessionManager?: SessionReader | undefined; } export interface ObservationalVerifierAdapters { readonly command?: CommandRunnerOptions | undefined; readonly judge?: AgentJudge | undefined; readonly session?: SessionReader | undefined; readonly maxInputBytes?: number | undefined; } export type PersistVerification = (update: VerificationCacheUpdate) => Promise; export interface AuthorityVerifier { readonly inspectTarget: (target: VerificationTarget) => Promise; readonly verifyNode: (request: VerifyNodeRequest) => Promise; readonly verifyNodeAndCache: (request: VerifyNodeRequest, persist?: PersistVerification) => Promise<{ result: VerificationResult; cacheUpdate?: VerificationCacheUpdate; cacheWrite?: StatusCacheVerificationWriteResult; }>; readonly isCriterionPassed: (value: unknown) => value is PassedCriterionResult; readonly isCompleteChecklist: (value: unknown) => value is CompleteChecklistResults; readonly isNodePassed: (value: unknown) => value is NodeVerificationRecord; readonly isCacheUpdate: (value: unknown) => value is VerificationCacheUpdate; readonly verificationFailures: (result: VerificationResult) => VerificationFailure[]; } export interface ObservationalVerifier { readonly inspectTarget: (target: VerificationTarget) => Promise; readonly verifyNode: (request: VerifyNodeRequest) => Promise; readonly verifyNodeAndCache: (request: VerifyNodeRequest) => Promise<{ result: ObservedVerificationResult; cacheUpdate?: ObservedVerificationCacheUpdate; }>; readonly isCriterionPassed: (value: unknown) => value is PassedCriterionResult; readonly isCompleteChecklist: (value: unknown) => value is CompleteChecklistResults; readonly isNodePassed: (value: unknown) => value is NodeVerificationRecord; readonly isCacheUpdate: (value: unknown) => value is VerificationCacheUpdate; readonly verificationFailures: (result: ObservedVerificationResult) => VerificationFailure[]; } export declare function createVerifier(capabilities: VerifierCapabilities): AuthorityVerifier; export declare function createObservationalVerifier(adapters?: ObservationalVerifierAdapters): ObservationalVerifier; export declare function verificationFailures(result: VerificationResult | ObservedVerificationResult): VerificationFailure[];