import type { OpenSpecScanOptions } from './openspec-scan-service.js'; import { type CapabilityCoverageMismatch, type CapabilityMappingRow } from './coverage-evidence-reader.js'; export type OpenSpecArchiveOptions = OpenSpecScanOptions & { apply?: boolean; /** * Skip the Pre-cond 2 (Coverage Evidence) gate even when the change declares * requirements. Use only when the operator has confirmed the gap is acceptable * for this archive operation. Default: false (gate enforced). */ force?: boolean; /** * Override coverage-summary.json discovery (Fix-6B AC1.1). * When omitted, discovery order is: * 1. /coverage/coverage-summary.json * 2. /openspec/coverage-summary.json */ coverageSummaryPath?: string; archiveDirName?: string; }; export type CoverageRequirementRow = { /** Spec delta name (e.g. `quality-gates`). */ capability: string; /** Requirement heading under which the row was declared. */ requirement: string; /** One of `covered`, `partial`, `uncovered`. */ status: 'covered' | 'partial' | 'uncovered'; /** Optional test anchor — file path or test name. */ testAnchor?: string; /** Source line for diagnostics. */ line: number; }; export type CoverageEvidence = { /** Rows parsed out of the `## Coverage Evidence` block in proposal.md. */ rows: ReadonlyArray; /** True when a `## Coverage Evidence` block existed in the proposal. */ present: boolean; /** Rows parsed out of the `## Capability Mapping` block in proposal.md. */ capabilityRows: ReadonlyArray; /** Resolved coverage-summary.json absolute path (Fix-6B). */ summaryPath?: string; /** Freshness status of the summary relative to change files. */ summaryStatus: 'missing' | 'stale' | 'fresh' | 'unavailable'; /** Per-capability validation outcome. */ capabilityValidation: 'ok' | 'mismatch' | 'no-mapping' | 'not-enforced'; /** Files under the change that are newer than the summary (only when stale). */ staleFiles: ReadonlyArray; /** Per-capability failing detail (only when mismatch). */ mismatches: ReadonlyArray; }; export type OpenSpecArchiveResult = { changeId: string; from: string; to: string; applied: boolean; coverage?: CoverageEvidence; /** Set when `applied === true` and the gate was bypassed via `--force`. */ coverageGateBypassed?: boolean; /** Set when `applied === true` and the Fix-6B mismatch gate was bypassed via `--force`. */ coverageMismatchBypassed?: boolean; }; export declare class OpenSpecArchiveError extends Error { readonly code: 'OPENSPEC_COVERAGE_GATE_FAILED' | 'OPENSPEC_COVERAGE_GATE_PARTIAL' | 'OPENSPEC_COVERAGE_EVIDENCE_MALFORMED' | 'OPENSPEC_COVERAGE_EVIDENCE_MISSING' | 'OPENSPEC_COVERAGE_EVIDENCE_STALE' | 'OPENSPEC_COVERAGE_EVIDENCE_MISMATCH'; readonly detail: Record; constructor(code: 'OPENSPEC_COVERAGE_GATE_FAILED' | 'OPENSPEC_COVERAGE_GATE_PARTIAL' | 'OPENSPEC_COVERAGE_EVIDENCE_MALFORMED' | 'OPENSPEC_COVERAGE_EVIDENCE_MISSING' | 'OPENSPEC_COVERAGE_EVIDENCE_STALE' | 'OPENSPEC_COVERAGE_EVIDENCE_MISMATCH', message: string, detail?: Record); } /** * Parse the `## Coverage Evidence` block out of a proposal.md. * * Accepted shape (markdown table): * * ## Coverage Evidence * * | capability | requirement | status | testAnchor | * | --- | --- | --- | --- | * | quality-gates | 100% coverage for included modules | covered | tests/unit/quality-gates.test.ts | * * Returns `{ present: false }` when the heading is missing. Throws * `OpenSpecArchiveError` with `code: 'OPENSPEC_COVERAGE_EVIDENCE_MALFORMED'` * when the heading is present but no parsable rows are extracted. */ export declare function parseCoverageEvidence(proposalPath: string): Promise; export declare function archiveOpenSpecChange(changeId: string, options?: OpenSpecArchiveOptions): Promise;