{"version":3,"file":"test-run-validate-DwGMo8ON.mjs","names":[],"sources":["../src/test-run-validate-rules.ts","../src/test-run-validate-executions.ts","../src/test-run-validate.ts"],"sourcesContent":["import type { MarquetteDiagnostic } from \"./validate.js\";\nimport type { TestRunRetainedEvidence } from \"./test-run-model.js\";\n\n/** Largest integer every consuming language can represent exactly. */\nexport const MAX_SAFE_EVIDENCE_INTEGER = 9007199254740991;\n\nconst IDENTIFIER = /^[a-z0-9][a-z0-9._-]*$/;\nconst DIGEST = /^[a-f0-9]{64}$/;\nconst SOURCE_REVISION = /^[a-f0-9]{40,128}$/;\nconst TIMESTAMP =\n  /^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}Z$/;\n\n/** Builds the stable diagnostic path for a named collection member. */\nexport function evidencePath(collection: string, id: string): string {\n  return `${collection}.${id}`;\n}\n\n/** Creates one error diagnostic. */\nexport function error(\n  code: MarquetteDiagnostic[\"code\"],\n  path: string,\n  message: string,\n): MarquetteDiagnostic {\n  return { code, severity: \"error\", path, message };\n}\n\n/** Validates the shared identifier grammar and the schema length bound. */\nexport function checkIdentifier(\n  id: string,\n  path: string,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  if (!IDENTIFIER.test(id)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_103\",\n        path,\n        \"identifier must use lowercase ASCII letters, digits, dash, underscore, or dot\",\n      ),\n    );\n  }\n  if (id.length === 0 || id.length > 128) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_103\", path, \"identifier must be between 1 and 128 characters\"),\n    );\n  }\n}\n\n/** Validates a lowercase 64-character SHA-256 fingerprint. */\nexport function checkDigest(value: string, path: string, diagnostics: MarquetteDiagnostic[]): void {\n  if (!DIGEST.test(value)) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_104\", path, \"fingerprint must be 64 lowercase hexadecimal characters\"),\n    );\n  }\n}\n\n/** Validates an exact source revision digest. */\nexport function checkSourceRevision(\n  value: string,\n  path: string,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  if (!SOURCE_REVISION.test(value)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_105\",\n        path,\n        \"source revision must be 40 to 128 lowercase hexadecimal characters\",\n      ),\n    );\n  }\n}\n\n/** Returns whether `value` is a millisecond-precision UTC calendar instant. */\nexport function isStrictTimestamp(value: string): boolean {\n  const match = TIMESTAMP.exec(value);\n  if (match === null) {\n    return false;\n  }\n  const year = Number(match[1]);\n  const month = Number(match[2]);\n  const day = Number(match[3]);\n  const maxDay =\n    month === 2\n      ? year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0)\n        ? 29\n        : 28\n      : month === 4 || month === 6 || month === 9 || month === 11\n        ? 30\n        : 31;\n  return day <= maxDay;\n}\n\n/** Validates a millisecond-precision UTC timestamp. */\nexport function checkTimestamp(\n  value: string,\n  path: string,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  if (!isStrictTimestamp(value)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_107\",\n        path,\n        \"timestamp must be a millisecond-precision UTC instant like 2026-01-01T00:00:00.000Z\",\n      ),\n    );\n  }\n}\n\n/** Rejects integers that lose precision in a consuming language. */\nexport function checkSafeInteger(\n  value: number,\n  path: string,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  if (value > MAX_SAFE_EVIDENCE_INTEGER) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_111\",\n        path,\n        \"value must not exceed the largest exactly-representable integer\",\n      ),\n    );\n  }\n}\n\n/**\n * Validates an immutable retained-evidence binding.\n *\n * The retrieval reference must be content-addressed and name exactly the\n * fingerprinted bytes; anything else would let retained evidence mutate\n * behind a stable-looking record.\n */\nexport function checkRetainedEvidence(\n  retained: TestRunRetainedEvidence,\n  path: string,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  checkDigest(retained.fingerprint, evidencePath(path, \"fingerprint\"), diagnostics);\n  const suffix = retained.reference.startsWith(\"sha256:\")\n    ? retained.reference.slice(\"sha256:\".length)\n    : undefined;\n  if (suffix === undefined || !DIGEST.test(suffix)) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_108\",\n        evidencePath(path, \"reference\"),\n        \"evidence reference must be sha256: followed by 64 lowercase hexadecimal characters\",\n      ),\n    );\n  } else if (suffix !== retained.fingerprint) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_109\",\n        evidencePath(path, \"reference\"),\n        \"content-addressed reference must name the fingerprinted content\",\n      ),\n    );\n  }\n}\n","import type { MarquetteDiagnostic } from \"./validate.js\";\nimport type { TestRunEvidence, TestRunSuiteExecution } from \"./test-run-model.js\";\nimport {\n  checkDigest,\n  checkIdentifier,\n  checkRetainedEvidence,\n  checkSafeInteger,\n  checkTimestamp,\n  error,\n  evidencePath,\n} from \"./test-run-validate-rules.js\";\n\n/** Maximum recorded target executions and selected target identifiers. */\nexport const TEST_RUN_MAX_TARGETS = 32;\n\n/** Maximum recorded suite executions and selected suite identifiers. */\nexport const TEST_RUN_MAX_SUITES = 512;\n\n/** Maximum shard index and shard count for one suite execution. */\nexport const TEST_RUN_MAX_SHARDS = 1024;\n\n/** Validates recorded target executions against the candidate selection. */\nexport function validateTargets(\n  evidence: TestRunEvidence,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  if (evidence.targets.length === 0 || evidence.targets.length > TEST_RUN_MAX_TARGETS) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_131\",\n        \"targets\",\n        \"record must include between 1 and 32 target executions\",\n      ),\n    );\n  }\n\n  const seen = new Set<string>();\n  const selected = new Set(evidence.selection.targetIds);\n  for (const target of evidence.targets) {\n    const path = evidencePath(\"targets\", target.id);\n    checkIdentifier(target.id, path, diagnostics);\n    checkIdentifier(target.environment, evidencePath(path, \"environment\"), diagnostics);\n    if (seen.has(target.id)) {\n      diagnostics.push(\n        error(\"VIZE_MARQUETTE_117\", path, \"target execution is recorded more than once\"),\n      );\n    }\n    seen.add(target.id);\n    if (!selected.has(target.id)) {\n      diagnostics.push(\n        error(\"VIZE_MARQUETTE_118\", path, \"target execution was not selected for this candidate\"),\n      );\n    }\n  }\n  for (const id of evidence.selection.targetIds) {\n    if (!seen.has(id)) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_119\",\n          evidencePath(\"selection.targetIds\", id),\n          \"selected target has no recorded execution\",\n        ),\n      );\n    }\n  }\n}\n\ninterface ShardGroup {\n  readonly shardCount: number;\n  readonly kind: TestRunSuiteExecution[\"kind\"];\n  readonly targetId: string;\n  readonly indexes: Set<number>;\n  kindsDisagree: boolean;\n  targetsDisagree: boolean;\n  countsDisagree: boolean;\n}\n\n/** Validates recorded suite executions, shards, and their consistency. */\nexport function validateSuites(\n  evidence: TestRunEvidence,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  if (evidence.suites.length === 0 || evidence.suites.length > TEST_RUN_MAX_SUITES) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_131\",\n        \"suites\",\n        \"record must include between 1 and 512 suite executions\",\n      ),\n    );\n  }\n\n  const shards = new Map<string, ShardGroup>();\n  const selected = new Set(evidence.selection.suiteIds);\n  const recordedTargets = new Set(evidence.targets.map((target) => target.id));\n  for (const suite of evidence.suites) {\n    const path = evidencePath(\"suites\", suite.id);\n    let group = shards.get(suite.id);\n    if (group === undefined) {\n      group = {\n        shardCount: suite.shardCount,\n        kind: suite.kind,\n        targetId: suite.targetId,\n        indexes: new Set(),\n        kindsDisagree: false,\n        targetsDisagree: false,\n        countsDisagree: false,\n      };\n      shards.set(suite.id, group);\n      // Suite-id-scoped invariants are shard-independent, so evaluate them\n      // once per unique suite id. Running them per shard would emit the same\n      // code/path/message diagnostic once for every shard of the suite.\n      checkIdentifier(suite.id, path, diagnostics);\n      if (!selected.has(suite.id)) {\n        diagnostics.push(\n          error(\"VIZE_MARQUETTE_121\", path, \"suite execution was not selected for this candidate\"),\n        );\n      }\n      if (!recordedTargets.has(suite.targetId)) {\n        diagnostics.push(\n          error(\n            \"VIZE_MARQUETTE_123\",\n            evidencePath(path, \"targetId\"),\n            \"suite target has no recorded target execution\",\n          ),\n        );\n      }\n    }\n    group.kindsDisagree ||= group.kind !== suite.kind;\n    group.targetsDisagree ||= group.targetId !== suite.targetId;\n    group.countsDisagree ||= group.shardCount !== suite.shardCount;\n    if (group.indexes.has(suite.shardIndex)) {\n      diagnostics.push(error(\"VIZE_MARQUETTE_120\", path, \"suite shard is recorded more than once\"));\n    }\n    group.indexes.add(suite.shardIndex);\n    if (\n      suite.shardCount === 0 ||\n      suite.shardCount > TEST_RUN_MAX_SHARDS ||\n      suite.shardIndex === 0 ||\n      suite.shardIndex > suite.shardCount\n    ) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_124\",\n          evidencePath(path, \"shardIndex\"),\n          \"shard index must fall within a shard count between 1 and 1024\",\n        ),\n      );\n    }\n    checkSafeInteger(suite.durationMs, evidencePath(path, \"durationMs\"), diagnostics);\n    checkDigest(\n      suite.invocationFingerprint,\n      evidencePath(path, \"invocationFingerprint\"),\n      diagnostics,\n    );\n    checkRetainedEvidence(suite.report, evidencePath(path, \"report\"), diagnostics);\n    checkRetainedEvidence(suite.log, evidencePath(path, \"log\"), diagnostics);\n\n    const executed = suite.passed + suite.failed + suite.skipped;\n    const consistent =\n      suite.outcome === \"passed\"\n        ? suite.failed === 0 && executed > 0\n        : suite.outcome === \"failed\"\n          ? suite.failed > 0\n          : true;\n    if (!consistent) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_130\",\n          evidencePath(path, \"outcome\"),\n          \"suite outcome does not match its recorded counts\",\n        ),\n      );\n    }\n  }\n\n  for (const id of evidence.selection.suiteIds) {\n    if (!shards.has(id)) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_122\",\n          evidencePath(\"selection.suiteIds\", id),\n          \"selected suite has no recorded execution\",\n        ),\n      );\n    }\n  }\n\n  for (const [id, group] of shards) {\n    const path = evidencePath(\"suites\", id);\n    if (group.kindsDisagree || group.targetsDisagree || group.countsDisagree) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_126\",\n          path,\n          \"every shard of one suite must share its kind, target, and shard count\",\n        ),\n      );\n    } else if (\n      group.shardCount !== 0 &&\n      group.shardCount <= TEST_RUN_MAX_SHARDS &&\n      group.indexes.size !== group.shardCount\n    ) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_125\",\n          path,\n          `suite must record every shard from 1 to ${group.shardCount}`,\n        ),\n      );\n    }\n  }\n}\n\n/** Validates the independent verification summary. */\nexport function validateVerification(\n  evidence: TestRunEvidence,\n  diagnostics: MarquetteDiagnostic[],\n): void {\n  const verification = evidence.verification;\n  checkIdentifier(verification.verifier, \"verification.verifier\", diagnostics);\n  checkTimestamp(verification.completedAt, \"verification.completedAt\", diagnostics);\n  checkRetainedEvidence(verification.evidence, \"verification.evidence\", diagnostics);\n  if (verification.completedAt < evidence.completedAt) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_114\",\n        \"verification.completedAt\",\n        \"verification must complete after the run completes\",\n      ),\n    );\n  }\n  if (verification.targetCount !== evidence.targets.length) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_127\",\n        \"verification.targetCount\",\n        \"verified target count must equal the recorded target executions\",\n      ),\n    );\n  }\n  if (verification.suiteCount !== evidence.suites.length) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_127\",\n        \"verification.suiteCount\",\n        \"verified suite count must equal the recorded suite executions\",\n      ),\n    );\n  }\n\n  const totals = { passed: 0, failed: 0, skipped: 0, retries: 0 };\n  for (const suite of evidence.suites) {\n    totals.passed += suite.passed;\n    totals.failed += suite.failed;\n    totals.skipped += suite.skipped;\n    totals.retries += suite.retries;\n  }\n  const recorded = [\n    [totals.passed, verification.passed, \"verification.passed\", \"passed\"],\n    [totals.failed, verification.failed, \"verification.failed\", \"failed\"],\n    [totals.skipped, verification.skipped, \"verification.skipped\", \"skipped\"],\n    [totals.retries, verification.retries, \"verification.retries\", \"retried\"],\n  ] as const;\n  for (const [total, value, path, name] of recorded) {\n    if (total !== value) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_128\",\n          path,\n          `verified ${name} total must equal the sum over suite executions`,\n        ),\n      );\n    }\n  }\n\n  if (verification.outcome === \"accepted\") {\n    const clean = evidence.suites.every(\n      (suite) => suite.outcome === \"passed\" && suite.failed === 0,\n    );\n    if (!clean || verification.failed > 0) {\n      diagnostics.push(\n        error(\n          \"VIZE_MARQUETTE_129\",\n          \"verification.outcome\",\n          \"verification cannot accept a run with failed or cancelled executions\",\n        ),\n      );\n    }\n  }\n}\n","import type { MarquetteDiagnostic } from \"./validate.js\";\nimport type { TestRunEvidence } from \"./test-run-model.js\";\nimport { TEST_RUN_EVIDENCE_FORMAT, TEST_RUN_EVIDENCE_FORMAT_VERSION } from \"./test-run-model.js\";\nimport {\n  checkDigest,\n  checkIdentifier,\n  checkRetainedEvidence,\n  checkSafeInteger,\n  checkSourceRevision,\n  checkTimestamp,\n  error,\n  evidencePath,\n} from \"./test-run-validate-rules.js\";\nimport {\n  TEST_RUN_MAX_SUITES,\n  TEST_RUN_MAX_TARGETS,\n  validateSuites,\n  validateTargets,\n  validateVerification,\n} from \"./test-run-validate-executions.js\";\n\nexport {\n  TEST_RUN_MAX_SHARDS,\n  TEST_RUN_MAX_SUITES,\n  TEST_RUN_MAX_TARGETS,\n} from \"./test-run-validate-executions.js\";\nexport type { MarquetteDiagnostic, MarquetteDiagnosticSeverity } from \"./validate.js\";\n\n/**\n * Validates a complete test-run evidence record.\n *\n * Diagnostics are deterministic and sorted by path, code, and message so the\n * same record produces identical CLI, promotion, test, and CI output in\n * every consuming language. A record with any error diagnostic must never\n * satisfy a deployment check.\n */\nexport function validateTestRunEvidence(evidence: TestRunEvidence): MarquetteDiagnostic[] {\n  const diagnostics: MarquetteDiagnostic[] = [];\n\n  if (evidence.format !== TEST_RUN_EVIDENCE_FORMAT) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_101\", \"format\", \"unsupported test-run evidence format marker\"),\n    );\n  }\n  if ((evidence.formatVersion ?? 1) !== TEST_RUN_EVIDENCE_FORMAT_VERSION) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_102\", \"formatVersion\", \"unsupported test-run evidence format version\"),\n    );\n  }\n\n  checkIdentifier(evidence.id, \"id\", diagnostics);\n  checkIdentifier(evidence.application, \"application\", diagnostics);\n  checkIdentifier(evidence.environment, \"environment\", diagnostics);\n  checkDigest(evidence.contractFingerprint, \"contractFingerprint\", diagnostics);\n  checkSourceRevision(evidence.sourceRevision, \"sourceRevision\", diagnostics);\n  if (evidence.release.length === 0 || evidence.release.length > 256) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_106\", \"release\", \"release must be between 1 and 256 characters\"),\n    );\n  }\n\n  checkIdentifier(evidence.artifact.id, \"artifact.id\", diagnostics);\n  checkDigest(evidence.artifact.fingerprint, \"artifact.fingerprint\", diagnostics);\n  if (evidence.artifact.sizeBytes === 0) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_110\", \"artifact.sizeBytes\", \"artifact size must be at least one byte\"),\n    );\n  }\n  checkSafeInteger(evidence.artifact.sizeBytes, \"artifact.sizeBytes\", diagnostics);\n\n  checkTimestamp(evidence.startedAt, \"startedAt\", diagnostics);\n  checkTimestamp(evidence.completedAt, \"completedAt\", diagnostics);\n  checkTimestamp(evidence.validUntil, \"validUntil\", diagnostics);\n  if (evidence.completedAt < evidence.startedAt) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_112\", \"completedAt\", \"run completion must not precede its start\"),\n    );\n  }\n  if (evidence.validUntil <= evidence.completedAt) {\n    diagnostics.push(\n      error(\"VIZE_MARQUETTE_113\", \"validUntil\", \"record expiry must come after run completion\"),\n    );\n  }\n\n  const runner = evidence.runner;\n  checkIdentifier(runner.identity, \"runner.identity\", diagnostics);\n  checkRetainedEvidence(\n    runner.authenticationEvidence,\n    \"runner.authenticationEvidence\",\n    diagnostics,\n  );\n  checkDigest(runner.invocationFingerprint, \"runner.invocationFingerprint\", diagnostics);\n  checkRetainedEvidence(runner.environmentEvidence, \"runner.environmentEvidence\", diagnostics);\n  checkDigest(runner.environmentFingerprint, \"runner.environmentFingerprint\", diagnostics);\n\n  const selection = evidence.selection;\n  if (selection.targetIds.length === 0 || selection.targetIds.length > TEST_RUN_MAX_TARGETS) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_115\",\n        \"selection.targetIds\",\n        \"selection must include between 1 and 32 targets\",\n      ),\n    );\n  }\n  if (selection.suiteIds.length === 0 || selection.suiteIds.length > TEST_RUN_MAX_SUITES) {\n    diagnostics.push(\n      error(\n        \"VIZE_MARQUETTE_115\",\n        \"selection.suiteIds\",\n        \"selection must include between 1 and 512 suites\",\n      ),\n    );\n  }\n  for (const id of selection.targetIds) {\n    checkIdentifier(id, evidencePath(\"selection.targetIds\", id), diagnostics);\n  }\n  for (const id of selection.suiteIds) {\n    checkIdentifier(id, evidencePath(\"selection.suiteIds\", id), diagnostics);\n  }\n\n  validateTargets(evidence, diagnostics);\n  validateSuites(evidence, diagnostics);\n  validateVerification(evidence, diagnostics);\n\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  return diagnostics;\n}\n"],"mappings":";AAMA,MAAM,aAAa;AACnB,MAAM,SAAS;AACf,MAAM,kBAAkB;AACxB,MAAM,YACJ;;AAGF,SAAgB,aAAa,YAAoB,IAAoB;CACnE,OAAO,GAAG,WAAW,GAAG;AAC1B;;AAGA,SAAgB,MACd,MACA,MACA,SACqB;CACrB,OAAO;EAAE;EAAM,UAAU;EAAS;EAAM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