import type { SetupAgentsWorkspaceMode, WorkflowRunRecord } from '../types/index.js'; export type ReleaseCheckName = 'ac-evidence-mapping' | 'code-analyzer' | 'open-blockers' | 'threat-model' | 'performance-baseline' | 'docs-link-check' | 'deprecation-policy' | 'migration-path' | 'changelog' | 'risk-governance' | 'e2e-suite' | 'manual-qa-signoff' | 'npm-audit' | 'knip' | 'coverage' | 'secret-scan'; export type CheckResult = { name: string; status: 'pass' | 'warn' | 'fail'; blocking: boolean; detail: string; evidenceId?: string; reasonCode?: ReleaseReasonCode; }; export type ReleaseReasonCode = 'ADVISORY_NOT_RELEASE_READY' | 'UNRESOLVED_BLOCKED_PHASE' | 'PENDING_OR_REJECTED_REVIEW' | 'MISSING_ACCEPTANCE_CRITERIA' | 'MISSING_AC_EVIDENCE_MAPPING' | 'MISSING_CURRENT_EVIDENCE' | 'STALE_OR_GENERIC_EVIDENCE' | 'FAILED_REQUIRED_CHECK' | 'STALE_SETUP_HEALTH' | 'STALE_KNOWLEDGE' | 'RELEASE_READY'; export type ReleaseCheckReport = { taskId: string; checks: CheckResult[]; overallPass: boolean; runAt: string; }; export type CriterionClassification = 'blocking' | 'advisory'; export type ReleaseGateConfig = { criteria: Record; timeoutMs: number; totalTimeoutMs: number; }; export type CriterionResult = { id: ReleaseCheckName; name: string; number: number; status: 'pass' | 'warn' | 'fail'; classification: CriterionClassification; blocking: boolean; detail: string; evidenceId?: string; executionTimeMs: number; }; export type ReleaseGateReport = { taskId: string; criteria: CriterionResult[]; overallPass: boolean; advisoryWarnings: string[]; executionTimeMs: number; runAt: string; configSource: string; }; export type NpmAuditOutput = { metadata?: { vulnerabilities?: { [key: string]: number | undefined; high?: number; critical?: number; }; }; vulnerabilities?: Record; }; export declare function parseNpmAudit(stdout: string): { blocking: boolean; detail: string; }; export type KnipOutput = { files?: string[]; issues?: Array<{ [key: string]: unknown; file?: string; owners?: string[]; }>; }; export declare function parseKnip(stdout: string): { hasIssues: boolean; detail: string; }; export type SecretScanOutput = { hits: Array<{ file: string; line: number; match: string; pattern: string; }>; }; export declare function parseSecretScan(stdout: string): { blocking: boolean; detail: string; }; export declare function parseCoverageOutput(stdout: string): { detail: string; }; export declare function withTimeout(fn: () => Promise, ms: number): Promise; export declare function loadGateConfig(cwd: string): { config: ReleaseGateConfig; source: string; }; export declare function runReleaseChecks(cwd: string, taskId: string, checks?: ReleaseCheckName[]): Promise; /** * Mutable indirection over {@link runReleaseChecks} so callers route through a * single seam that tests can replace. A named ESM export binding is immutable * under the ts-node/esm loader, but the *property* of an exported object is * writable — so tests stub `releaseCheckProvider.runReleaseChecks` (mirrors the * docFetchProvider pattern) to exercise the CI-green loop without real checks. */ export declare const releaseCheckProvider: { runReleaseChecks: typeof runReleaseChecks; }; export type ProjectReleaseOptions = { mode: SetupAgentsWorkspaceMode; requiredChecks?: ReleaseCheckName[]; }; /** * Production release predicate. Unlike the historical criterion catalogue below, * every check is derived from the active workflow run or a current workspace * health projection. Legacy tool checks remain supported as explicitly configured * required checks, but cannot replace the mandatory project evidence checks. */ export declare function runProjectReleaseGate(cwd: string, run: WorkflowRunRecord, options: ProjectReleaseOptions): Promise; export declare const projectReleaseGateProvider: { run: typeof runProjectReleaseGate; }; export declare function runReleaseGate(cwd: string, taskId: string, config?: ReleaseGateConfig): Promise;