{"version":3,"file":"test-run-transition.mjs","names":[],"sources":["../src/test-run-transition-model.ts","../src/test-run-transition-rules.ts","../src/test-run-transition.ts"],"sourcesContent":["import type { MarquetteDiagnosticSeverity } from \"./validate.js\";\nimport type { TestRunCandidate, TestRunDenialCode } from \"./test-run-admission.js\";\n\n/**\n * Serialized `format` marker for release-transition records.\n *\n * Readers must reject any other value before trusting the record.\n */\nexport const TEST_RUN_TRANSITION_FORMAT = \"vize.test-run.transition\";\n\n/**\n * Current serialized release-transition format.\n *\n * Readers must reject a higher value until they explicitly support it.\n */\nexport const TEST_RUN_TRANSITION_FORMAT_VERSION = 1;\n\n/** Maximum admission ids one transition may carry as accepted state. */\nexport const TEST_RUN_TRANSITION_MAX_ACCEPTED = 4096;\n\n/**\n * One retained diagnostic inside a durable transition record.\n *\n * The shape and serialization match live diagnostics exactly; the retained\n * form is plain data so persisted records can be read back by any host.\n */\nexport interface TestRunRetainedDiagnostic {\n  /** Stable machine-readable diagnostic code. */\n  readonly code: string;\n  /** Severity recorded for the diagnostic; any diagnostic denies. */\n  readonly severity: MarquetteDiagnosticSeverity;\n  /** JSON-style path into the decided input. */\n  readonly path: string;\n  /** Human-readable explanation recorded with the decision. */\n  readonly message: string;\n}\n\n/**\n * One retained allow-or-deny decision inside a durable transition record.\n *\n * The shape and serialization match live decisions exactly. Validation\n * rejects a retained decision whose `allowed` flag, denial codes, or\n * diagnostic ordering disagree with the published mapping, so a record\n * cannot claim an outcome its own diagnostics contradict.\n */\nexport interface TestRunRetainedDecision {\n  /** Whether the release decision admitted the candidate. */\n  readonly allowed: boolean;\n  /** Deduplicated denial causes sorted lexicographically; empty if allowed. */\n  readonly denialCodes: readonly TestRunDenialCode[];\n  /** Complete diagnostics in the stable path, code, message order. */\n  readonly diagnostics: readonly TestRunRetainedDiagnostic[];\n}\n\n/**\n * One durable atomic release transition.\n *\n * The record binds the decision, the exact candidate and evidence it\n * decided, and the complete accepted anti-replay state after the decision\n * into one canonical document. `sequence` grows by exactly one per\n * transition and `previous` names the predecessor's canonical SHA-256\n * fingerprint, so a chain tip proves the entire decision history and the\n * accepted set can never drift from the decision that produced it.\n *\n * Host durability contract: write the complete canonical bytes to a\n * temporary location, flush them to durable storage, then atomically rename\n * or commit so exactly one complete chain tip exists at every instant; on\n * recovery, verify the tip against its retained predecessor with\n * {@link verifyTestRunTransition} before deciding anything new, and discard\n * — never repair — a torn or partial record.\n */\nexport interface TestRunTransition {\n  /** Serialized format marker; always {@link TEST_RUN_TRANSITION_FORMAT}. */\n  readonly format: typeof TEST_RUN_TRANSITION_FORMAT;\n  /**\n   * Serialized format version.\n   *\n   * Defaults to {@link TEST_RUN_TRANSITION_FORMAT_VERSION}.\n   */\n  readonly formatVersion?: typeof TEST_RUN_TRANSITION_FORMAT_VERSION;\n  /** One-based position of this transition in its chain. */\n  readonly sequence: number;\n  /** Canonical fingerprint of the predecessor; `null` only at genesis. */\n  readonly previous: string | null;\n  /** Millisecond-precision UTC instant the decision was made. */\n  readonly decidedAt: string;\n  /** Exact candidate the decision was made for. */\n  readonly candidate: TestRunCandidate;\n  /** Exact `test-run:<sha256>` admission id the decision evaluated. */\n  readonly evidence: string;\n  /** Retained decision exactly as it was produced. */\n  readonly decision: TestRunRetainedDecision;\n  /**\n   * Complete anti-replay state after this transition: every admission id\n   * ever accepted in this chain, sorted and unique.\n   */\n  readonly accepted: readonly string[];\n}\n\n/**\n * Serializes a release transition canonically.\n *\n * Property order matches the record schema and the accepted state sorts\n * lexicographically after deduplication, so equivalent transitions produce\n * byte-identical JSON in every language. These are the exact bytes a host\n * must write atomically and the exact bytes the chain fingerprint covers.\n * Call validation before trusting the record; canonicalization does not\n * make an invalid record valid.\n */\nexport function canonicalTestRunTransitionJson(transition: TestRunTransition): string {\n  const canonical = {\n    format: transition.format,\n    formatVersion: transition.formatVersion ?? TEST_RUN_TRANSITION_FORMAT_VERSION,\n    sequence: transition.sequence,\n    previous: transition.previous,\n    decidedAt: transition.decidedAt,\n    candidate: {\n      application: transition.candidate.application,\n      environment: transition.candidate.environment,\n      contractFingerprint: transition.candidate.contractFingerprint,\n      sourceRevision: transition.candidate.sourceRevision,\n      release: transition.candidate.release,\n      artifactFingerprint: transition.candidate.artifactFingerprint,\n    },\n    evidence: transition.evidence,\n    decision: {\n      allowed: transition.decision.allowed,\n      denialCodes: [...new Set(transition.decision.denialCodes)].sort(),\n      diagnostics: transition.decision.diagnostics.map((diagnostic) => ({\n        code: diagnostic.code,\n        severity: diagnostic.severity,\n        path: diagnostic.path,\n        message: diagnostic.message,\n      })),\n    },\n    accepted: [...new Set(transition.accepted)].sort(),\n  };\n  return JSON.stringify(canonical);\n}\n\n/**\n * Returns the lowercase SHA-256 fingerprint of the canonical transition.\n *\n * The fingerprint is the exact value the successor transition must name as\n * `previous`, forming the durable chain. Uses the Web Crypto API available\n * in every supported runtime.\n */\nexport async function testRunTransitionFingerprint(transition: TestRunTransition): Promise<string> {\n  const bytes = new TextEncoder().encode(canonicalTestRunTransitionJson(transition));\n  const digest = await globalThis.crypto.subtle.digest(\"SHA-256\", bytes);\n  let fingerprint = \"\";\n  for (const byte of new Uint8Array(digest)) {\n    fingerprint += byte.toString(16).padStart(2, \"0\");\n  }\n  return fingerprint;\n}\n","import type { MarquetteDiagnostic } from \"./validate.js\";\nimport { testRunDenialCode } from \"./test-run-admission.js\";\nimport { parseTestRunAdmissionId } from \"./test-run-canonical.js\";\nimport {\n  TEST_RUN_TRANSITION_MAX_ACCEPTED,\n  type TestRunRetainedDiagnostic,\n  type TestRunTransition,\n} from \"./test-run-transition-model.js\";\nimport { error } from \"./test-run-validate-rules.js\";\n\n/** Validates the accepted anti-replay state carried by one transition. */\nexport function validateAccepted(\n  transition: TestRunTransition,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  const accepted = transition.accepted;\n  if (accepted.length > TEST_RUN_TRANSITION_MAX_ACCEPTED) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_131\",\n        \"transition.accepted\",\n        \"transition must accept at most 4096 admission ids\",\n      ),\n    );\n  }\n  if (accepted.some((id) => parseTestRunAdmissionId(id) === undefined)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_141\",\n        \"transition.accepted\",\n        \"accepted admission ids must be test-run: followed by 64 lowercase hexadecimal characters\",\n      ),\n    );\n  }\n  if (accepted.some((id, index) => index > 0 && (accepted[index - 1] as string) >= id)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_154\",\n        \"transition.accepted\",\n        \"accepted admission ids must be sorted and unique\",\n      ),\n    );\n  }\n  if (transition.decision.allowed && !accepted.includes(transition.evidence)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_156\",\n        \"transition.accepted\",\n        \"an allowed transition must accept its own evidence\",\n      ),\n    );\n  }\n}\n\nconst DIAGNOSTIC_CODE = /^VIZE_MARQUETTE_[0-9]{3}$/;\n\n/** Validates the retained decision carried by one transition. */\nexport function validateDecision(\n  transition: TestRunTransition,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  const decision = transition.decision;\n  if (decision.allowed && (decision.denialCodes.length > 0 || decision.diagnostics.length > 0)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_155\",\n        \"transition.decision\",\n        \"an allowed decision must carry no diagnostics\",\n      ),\n    );\n  }\n  if (!decision.allowed && decision.diagnostics.length === 0) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_155\",\n        \"transition.decision\",\n        \"a denied decision must carry its diagnostics\",\n      ),\n    );\n  }\n  if (decision.diagnostics.some((diagnostic) => !DIAGNOSTIC_CODE.test(diagnostic.code))) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_155\",\n        \"transition.decision\",\n        \"diagnostic codes must be stable VIZE_MARQUETTE codes\",\n      ),\n    );\n  }\n  const sorted = decision.diagnostics.every((diagnostic, index) => {\n    if (index === 0) {\n      return true;\n    }\n    const left = decision.diagnostics[index - 1] as TestRunRetainedDiagnostic;\n    return (\n      left.path < diagnostic.path ||\n      (left.path === diagnostic.path &&\n        (left.code < diagnostic.code ||\n          (left.code === diagnostic.code && left.message <= diagnostic.message)))\n    );\n  });\n  if (!sorted) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_155\",\n        \"transition.decision\",\n        \"decision diagnostics must be sorted by path, code, and message\",\n      ),\n    );\n  }\n  const recomputed = [\n    ...new Set(\n      decision.diagnostics.map((diagnostic) =>\n        testRunDenialCode(diagnostic as MarquetteDiagnostic),\n      ),\n    ),\n  ].sort();\n  const retained = [...decision.denialCodes];\n  if (\n    recomputed.length !== retained.length ||\n    recomputed.some((code, index) => code !== retained[index])\n  ) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_155\",\n        \"transition.decision\",\n        \"denial codes must match the published diagnostic mapping\",\n      ),\n    );\n  }\n}\n","import type { MarquetteDiagnostic } from \"./validate.js\";\nimport {\n  testRunDenialCode,\n  type TestRunAdmissionDecision,\n  type TestRunDenialCode,\n} from \"./test-run-admission.js\";\nimport { parseTestRunAdmissionId } from \"./test-run-canonical.js\";\nimport {\n  TEST_RUN_TRANSITION_FORMAT,\n  TEST_RUN_TRANSITION_FORMAT_VERSION,\n  testRunTransitionFingerprint,\n  type TestRunTransition,\n} from \"./test-run-transition-model.js\";\nimport { validateAccepted, validateDecision } from \"./test-run-transition-rules.js\";\nimport {\n  checkDigest,\n  checkIdentifier,\n  checkSafeInteger,\n  checkSourceRevision,\n  checkTimestamp,\n  error,\n  isStrictTimestamp,\n} from \"./test-run-validate-rules.js\";\n\nexport {\n  TEST_RUN_TRANSITION_FORMAT,\n  TEST_RUN_TRANSITION_FORMAT_VERSION,\n  TEST_RUN_TRANSITION_MAX_ACCEPTED,\n  canonicalTestRunTransitionJson,\n  testRunTransitionFingerprint,\n  type TestRunRetainedDecision,\n  type TestRunRetainedDiagnostic,\n  type TestRunTransition,\n} from \"./test-run-transition-model.js\";\n\n/**\n * Validates one release transition structurally.\n *\n * Diagnostics use `transition.` paths and are deterministic and sorted by\n * path, code, and message. Validation confirms the record alone is\n * internally coherent — grammar, decision consistency against the published\n * diagnostic mapping, and an allowed decision accepting its own evidence —\n * but only {@link verifyTestRunTransition} can confirm the record extends\n * the durable chain. Codes, paths, messages, and ordering are identical to\n * the native implementation.\n */\nexport function validateTestRunTransition(transition: TestRunTransition): MarquetteDiagnostic[] {\n  const diagnostics: MarquetteDiagnostic[] = [];\n\n  if ((transition.format as string) !== TEST_RUN_TRANSITION_FORMAT) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_101\",\n        \"transition.format\",\n        \"unsupported release-transition format marker\",\n      ),\n    );\n  }\n  const version = transition.formatVersion ?? TEST_RUN_TRANSITION_FORMAT_VERSION;\n  if (version !== TEST_RUN_TRANSITION_FORMAT_VERSION) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_102\",\n        \"transition.formatVersion\",\n        \"unsupported release-transition format version\",\n      ),\n    );\n  }\n\n  if (!Number.isInteger(transition.sequence) || transition.sequence < 1) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_152\",\n        \"transition.sequence\",\n        \"transition sequence must be at least one\",\n      ),\n    );\n  }\n  checkSafeInteger(transition.sequence, \"transition.sequence\", diagnostics);\n  if (transition.previous !== null && transition.sequence === 1) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_153\",\n        \"transition.previous\",\n        \"genesis transition must not name a predecessor\",\n      ),\n    );\n  } else if (transition.previous !== null) {\n    checkDigest(transition.previous, \"transition.previous\", diagnostics);\n  } else if (transition.sequence > 1) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_153\", \"transition.previous\", \"transition must name its predecessor\"),\n    );\n  }\n  checkTimestamp(transition.decidedAt, \"transition.decidedAt\", diagnostics);\n\n  const candidate = transition.candidate;\n  checkIdentifier(candidate.application, \"transition.candidate.application\", diagnostics);\n  checkIdentifier(candidate.environment, \"transition.candidate.environment\", diagnostics);\n  checkDigest(\n    candidate.contractFingerprint,\n    \"transition.candidate.contractFingerprint\",\n    diagnostics,\n  );\n  checkSourceRevision(candidate.sourceRevision, \"transition.candidate.sourceRevision\", diagnostics);\n  if (candidate.release.length === 0 || candidate.release.length > 256) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_106\",\n        \"transition.candidate.release\",\n        \"release must be between 1 and 256 characters\",\n      ),\n    );\n  }\n  checkDigest(\n    candidate.artifactFingerprint,\n    \"transition.candidate.artifactFingerprint\",\n    diagnostics,\n  );\n\n  if (parseTestRunAdmissionId(transition.evidence) === undefined) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_141\",\n        \"transition.evidence\",\n        \"transition evidence must be test-run: followed by 64 lowercase hexadecimal characters\",\n      ),\n    );\n  }\n  validateAccepted(transition, diagnostics);\n  validateDecision(transition, diagnostics);\n\n  sortDiagnostics(diagnostics);\n  return diagnostics;\n}\n\n/**\n * Verifies one release transition against the durable chain tip.\n *\n * `previous` is the retained, already-verified predecessor — `null` only\n * when deciding the very first transition of a chain. The transition must\n * validate structurally, extend the predecessor's sequence, fingerprint,\n * scope, and decision time exactly, never re-accept evidence the\n * predecessor already accepted, and carry an accepted state equal to the\n * predecessor's state plus exactly the newly accepted evidence (unchanged\n * for a denial). Any diagnostic rejects the transition: a conforming host\n * must not persist it, and on recovery must discard a tip this function\n * rejects. Diagnostics, denial codes, and ordering are identical to the\n * native implementation, as pinned by the shared transition-decision\n * fixtures.\n */\nexport async function verifyTestRunTransition(\n  transition: TestRunTransition,\n  previous: TestRunTransition | null,\n): Promise<TestRunAdmissionDecision> {\n  const diagnostics = validateTestRunTransition(transition);\n\n  let priorAccepted: readonly string[] = [];\n  if (previous === null) {\n    if (transition.sequence !== 1) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_157\",\n          \"transition.sequence\",\n          \"transition requires its predecessor to verify\",\n        ),\n      );\n    }\n  } else {\n    priorAccepted = previous.accepted;\n    if (transition.sequence !== previous.sequence + 1) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_157\",\n          \"transition.sequence\",\n          \"transition must extend its predecessor's sequence\",\n        ),\n      );\n    }\n    if (transition.previous !== (await testRunTransitionFingerprint(previous))) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_157\",\n          \"transition.previous\",\n          \"transition must name its predecessor's canonical fingerprint\",\n        ),\n      );\n    }\n    for (const [recorded, expected, path] of [\n      [\n        transition.candidate.application,\n        previous.candidate.application,\n        \"transition.candidate.application\",\n      ],\n      [\n        transition.candidate.environment,\n        previous.candidate.environment,\n        \"transition.candidate.environment\",\n      ],\n    ] as const) {\n      if (recorded !== expected) {\n        diagnostics.push(\n          error(\"VIZE_MARQUETTE_157\", path, \"transition must stay within its predecessor's scope\"),\n        );\n      }\n    }\n    if (\n      isStrictTimestamp(transition.decidedAt) &&\n      isStrictTimestamp(previous.decidedAt) &&\n      transition.decidedAt < previous.decidedAt\n    ) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_157\",\n          \"transition.decidedAt\",\n          \"transition must not predate its predecessor\",\n        ),\n      );\n    }\n    if (transition.decision.allowed && previous.accepted.includes(transition.evidence)) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_158\",\n          \"transition.evidence\",\n          \"accepted evidence must not be accepted again\",\n        ),\n      );\n    }\n  }\n\n  const expected = [\n    ...new Set(\n      transition.decision.allowed ? [...priorAccepted, transition.evidence] : priorAccepted,\n    ),\n  ].sort();\n  const accepted = transition.accepted;\n  if (accepted.length !== expected.length || accepted.some((id, index) => id !== expected[index])) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_159\",\n        \"transition.accepted\",\n        \"accepted state must equal its predecessor's state plus exactly the newly accepted evidence\",\n      ),\n    );\n  }\n\n  sortDiagnostics(diagnostics);\n  const denialCodes: TestRunDenialCode[] = [...new Set(diagnostics.map(testRunDenialCode))].sort();\n  return { allowed: diagnostics.length === 0, denialCodes, diagnostics };\n}\n\nfunction sortDiagnostics(diagnostics: MarquetteDiagnostic[]): void {\n  diagnostics.sort((left, right) =>\n    left.path !== right.path\n      ? left.path < right.path\n        ? -1\n        : 1\n      : left.code !== right.code\n        ? left.code < right.code\n          ? -1\n          : 1\n        : left.message < right.message\n          ? -1\n          : left.message > right.message\n            ? 1\n            : 0,\n  );\n}\n"],"mappings":";;;;;;;;;AAQA,MAAa,6BAA6B;;;;;;AAO1C,MAAa,qCAAqC;;AAGlD,MAAa,mCAAmC;;;;;;;;;;;AA2FhD,SAAgB,+BAA+B,YAAuC;CACpF,MAAM,YAAY;EAChB,QAAQ,WAAW;EACnB,eAAe,WAAW,iBAAA;EAC1B,UAAU,WAAW;EACrB,UAAU,WAAW;EACrB,WAAW,WAAW;EACtB,WAAW;GACT,aAAa,WAAW,UAAU;GAClC,aAAa,WAAW,UAAU;GAClC,qBAAqB,WAAW,UAAU;GAC1C,gBAAgB,WAAW,UAAU;GACrC,SAAS,WAAW,UAAU;GAC9B,qBAAqB,WAAW,UAAU;EAC5C;EACA,UAAU,WAAW;EACrB,UAAU;GACR,SAAS,WAAW,SAAS;GAC7B,aAAa,CAAC,GAAG,IAAI,IAAI,WAAW,SAAS,WAAW,CAAC,EAAE,KAAK;GAChE,aAAa,WAAW,SAAS,YAAY,KAAK,gBAAgB;IAChE,MAAM,WAAW;IACjB,UAAU,WAAW;IACrB,MAAM,WAAW;IACjB,SAAS,WAAW;GACtB,EAAE;EACJ;EACA,UAAU,CAAC,GAAG,IAAI,IAAI,WAAW,QAAQ,CAAC,EAAE,KAAK;CACnD;CACA,OAAO,KAAK,UAAU,SAAS;AACjC;;;;;;;;AASA,eAAsB,6BAA6B,YAAgD;CACjG,MAAM,QAAQ,IAAI,YAAY,EAAE,OAAO,+BAA+B,UAAU,CAAC;CACjF,MAAM,SAAS,MAAM,WAAW,OAAO,OAAO,OAAO,WAAW,KAAK;CACrE,IAAI,cAAc;CAClB,KAAK,MAAM,QAAQ,IAAI,WAAW,MAAM,GACtC,eAAe,KAAK,SAAS,EAAE,EAAE,S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