import { i as TestRunEvidence } from "./test-run-model-CF2EYJOQ.mjs"; import { MarquetteDiagnostic } from "./validate.mjs"; import { r as parseTestRunAdmissionId, t as TEST_RUN_ADMISSION_PREFIX } from "./test-run-canonical-B1IuzC5s.mjs"; //#region src/test-run-admission.d.ts /** * Exact release candidate a deployment gate wants evidence for. * * Every field must match the record exactly; admission never falls back to a * newer, older, or partially matching record. */ interface TestRunCandidate { /** Application the gate is deploying. */ readonly application: string; /** Deployment environment the gate is promoting into. */ readonly environment: string; /** Lowercase SHA-256 fingerprint of the application contract. */ readonly contractFingerprint: string; /** Exact source revision of the candidate. */ readonly sourceRevision: string; /** Release the candidate belongs to. */ readonly release: string; /** Lowercase SHA-256 fingerprint of the exact artifact being promoted. */ readonly artifactFingerprint: string; } /** * Decides whether one record admits one exact candidate at one instant. * * An empty result admits the deployment. Any diagnostic rejects it: the * record must validate cleanly, its canonical fingerprint must be the one * named by `admissionId`, every candidate binding must match exactly, the * record must not be expired at `now`, the independent verification must * have accepted the run, and no skipped test may remain unaccounted for. * * Codes, paths, messages, and ordering are identical to the native * implementation, so both host families reach the same decision for the * same record. * * `now` must be a millisecond-precision UTC timestamp such as * `2026-01-01T00:00:00.000Z`; the fixed-width format keeps the expiry * comparison exact. Callers own retrieval: fetch the canonical bytes from an * immutable store within their own deadline, refuse oversized content, and * hand the parsed record here. */ declare function admitTestRun(evidence: TestRunEvidence, candidate: TestRunCandidate, admissionId: string, now: string): Promise; /** * Every denial code, in the stable lexicographic decision order. * * The vocabulary is shared by every backend family: a JavaScript, Rust, Go, * or JVM host must derive the same codes from the same diagnostics, as * pinned by the shared `tests/fixtures/test-run-evidence` decision fixtures. * Codes are append-only: they are never renamed, renumbered, reused, or * removed, and a new rejection cause always ships with a new code. */ declare const TEST_RUN_DENIAL_CODES: readonly ["admission-id-malformed", "admission-id-mismatch", "admission-time-malformed", "candidate-application-mismatch", "candidate-artifact-fingerprint-mismatch", "candidate-contract-fingerprint-mismatch", "candidate-environment-mismatch", "candidate-release-mismatch", "candidate-source-revision-mismatch", "check-candidate-mismatch", "check-invalid", "check-observer-not-independent", "record-expired", "record-invalid", "skipped-tests-recorded", "transition-chain-broken", "transition-invalid", "transition-replayed", "transition-state-mismatch", "verification-not-accepted"]; /** Stable machine-readable cause class of one admission denial. */ type TestRunDenialCode = (typeof TEST_RUN_DENIAL_CODES)[number]; /** * Structured allow-or-deny admission decision for one exact candidate. * * The decision carries the machine-readable cause classes next to the exact * diagnostics, so a deployment gate in any language can act on one bounded * vocabulary while operators keep the full explanation. Serialization * follows the shared `test-run-admission` schema; decisions are outputs, so * a gate must never trust a decision it did not compute itself. */ interface TestRunAdmissionDecision { /** Whether the record admits the candidate; true only with no diagnostics. */ readonly allowed: boolean; /** Deduplicated denial causes sorted lexicographically; empty when allowed. */ readonly denialCodes: readonly TestRunDenialCode[]; /** Complete diagnostics in the stable path, code, message order. */ readonly diagnostics: readonly MarquetteDiagnostic[]; } /** * Returns the stable denial code one admission diagnostic maps to. * * The mapping is total and identical in every host family: admission codes * `VIZE_MARQUETTE_141` through `VIZE_MARQUETTE_148` map to their exact * cause, `VIZE_MARQUETTE_144` distinguishes the mismatched candidate binding * by its diagnostic path, `VIZE_MARQUETTE_149` through `VIZE_MARQUETTE_151` * map to their tests-check cause, `VIZE_MARQUETTE_156` through * `VIZE_MARQUETTE_159` map to their transition cause, every other * diagnostic at a `check.` path is a `check-invalid` tests-check validation * failure, every other diagnostic at a `transition.` path is a * `transition-invalid` transition validation failure, and every remaining * diagnostic is a `record-invalid` record-validation failure. */ declare function testRunDenialCode(diagnostic: MarquetteDiagnostic): TestRunDenialCode; /** * Decides one candidate and returns the structured admission decision. * * The decision wraps {@link admitTestRun}: `diagnostics` is exactly its * result, `denialCodes` maps every diagnostic through * {@link testRunDenialCode} and then deduplicates and sorts the codes * lexicographically, and `allowed` is true only when both are empty. Codes, * ordering, and diagnostics are identical to the native implementation, as * pinned by the shared decision fixtures. Inputs carry the same obligations * as {@link admitTestRun}. */ declare function decideTestRunAdmission(evidence: TestRunEvidence, candidate: TestRunCandidate, admissionId: string, now: string): Promise; //#endregion export { TEST_RUN_ADMISSION_PREFIX, TEST_RUN_DENIAL_CODES, TestRunAdmissionDecision, TestRunCandidate, TestRunDenialCode, admitTestRun, decideTestRunAdmission, parseTestRunAdmissionId, testRunDenialCode }; //# sourceMappingURL=test-run-admission.d.mts.map