/** * peaks-workflow — internal support helpers for pipeline verification. * * Private helpers used by the slimmed `pipeline-verify-service.ts` * orchestrator. NOT publicly re-exported; not part of the public API * surface. Kept in a sibling file so the orchestrator can stay under * */ import { type ArtifactPrerequisite, type RequestType } from '../artifacts/artifact-prerequisites.js'; import { rdGatesForType } from './pipeline-verify-rd-phase.js'; import type { RequestArtifactRole, RequestArtifactState } from '../artifacts/request-artifact-service.js'; import type { PipelineGate } from './pipeline-verify-types.js'; export declare function extractState(markdown: string): string; /** The rid's artifact file, read from ONE session: `sessionId` is required, and * `null` — no resolvable scope — means NO CARRIER, never a scan (that branch * reads every directory under `.peaks/_runtime/` and takes the first name that * sorts). The dir the file was FOUND in comes back as `sessionId`. */ export declare function findRequestFile(projectRoot: string, role: string, rid: string, sessionId: string | null): Promise<{ path: string; content: string; sessionId: string; } | null>; /** * Where the CURRENT contract puts one gate's evidence. * * The contract is the `artifact-prerequisites.ts` table — the table * `peaks request transition` enforces and the one the peaks-qa prose * contract mirrors (`skills/bee/peaks-qa/references/qa-transition-gates.md`). * `probeName` is the location this checker probes today. The contract's * `relativePath` is returned first, then its accepted historical locations in * the table's own declared order — `legacyRelativePath`, then * `legacyRelativePaths` (the same composition `artifact-prerequisites.ts`' own * resolver performs, so a hit here and a hit there land on the same file). * * Returns `null` when the contract carries no prerequisite for that name at * all — the artifact was retired and no gate may fail on it. * * This lookup exists because hard-coding the paths here is what let * `verify-pipeline` fall a minor release behind the gate: it kept demanding * `rd/security-review.md` as mandatory after the table had demoted that file * to a `legacyRelativePath` fallback of `audit/security.md`, and it kept * demanding `qa/security-findings-.md` / `qa/performance-findings-.md` * after the v2.11.0 D1/D4 trim dropped them from `qa:verdict-issued` */ /** * The prerequisite the contract carries for `probeName`, or null when it * carries none. `contractEvidencePaths` is this object's path projection; the * BODY contract (`mustContain` / `mustContainAny` / `headingMustContain`) rides * on the same object, which is why `contractBodyViolations` below consults it * instead of probing for the file's existence alone. */ export declare function contractPrerequisite(role: RequestArtifactRole, state: RequestArtifactState, requestType: RequestType, probeName: string): ArtifactPrerequisite | null; export declare function contractEvidencePaths(role: RequestArtifactRole, state: RequestArtifactState, requestType: RequestType, probeName: string): string[] | null; /** Re-exported so existing importers keep one import path; the builder and the * table it filters live in `pipeline-verify-rd-phase.ts`. */ export { rdGatesForType }; /** * The QA phase's gate list for one type. * * Both halves are read off the type's own table. WHICH EVIDENCE the phase owes is * the type's `qa:` row, resolved through the same contract accessor * `rdGatesForType` uses — a row the contract carries builds its gate, a row it * does not carry builds none. WHETHER the phase exists at all is * `typeRequiresQaPhase`, the same call the checker makes, which is the part that * used to be a list of three request types named here. The derivation and the * arming that keeps it total are `pipeline-verify-qa-phase.ts`. * * Two of the six types are why this reads the table instead of naming its * members. The minimal table — docs and chore — carries no `qa:` row, so those * types owe no QA evidence and get an empty list; that is how both the checker * and the commit-time carrier learn there is no phase to report. Config carries * exactly one QA row instead: a test report, and no test cases. The member list * was wrong about both, in opposite directions: one type was asked for a phase it * does not owe, and the other never for the evidence its transition requires. */ export declare function qaGatesForType(requestType: RequestType): PipelineGate[]; export declare const RD_QA_HANDOFF_STATES: Set; export declare const QA_COMPLETE_STATES: Set; export interface CanonicalPathTracker { anyEvidenceResolved: boolean; allResolvedPathsCanonical: boolean; } /** Resolve RD evidence files (prd-handoff / bug-analysis / code-review / security-review / perf-baseline) * by probing canonical + legacy paths for each gate. Mutates the gate.passed / * gate.detail fields in place and pushes violations / nextActions. Returns the * updated tracker. Verbatim-move from `pipeline-verify-service.ts`. */ export declare function resolveRdEvidencePaths(gates: PipelineGate[], rdEvidenceDir: string, projectRoot: string, rid: string, requestType: RequestType, violations: string[], nextActions: string[], tracker: CanonicalPathTracker): CanonicalPathTracker; /** Resolve QA evidence files (test-cases / test-report) by probing canonical * + legacy paths for each gate. Mutates the gate.passed / gate.detail fields * in place and pushes violations / nextActions. Returns the updated tracker. * Verbatim-move from `pipeline-verify-service.ts`. * * The `security-findings` / `performance-findings` branches that used to live * here are gone: those artifacts are not in any `qa:verdict-issued` table * (v2.11.0 D1/D4), and the evidence they stood for is resolved on the RD side * at the contract's own paths (`audit/security-.md`, * `audit/perf-.md`). */ export declare function resolveQaEvidencePaths(gates: PipelineGate[], projectRoot: string, rdEvidenceDir: string, requestType: RequestType, rid: string, violations: string[], nextActions: string[], tracker: CanonicalPathTracker): CanonicalPathTracker;