{"version":3,"file":"test-run-model-DgJ2nd5p.mjs","names":[],"sources":["../src/test-run-model.ts"],"sourcesContent":["/** Serialized `format` marker for test-run evidence records. */\nexport const TEST_RUN_EVIDENCE_FORMAT = \"vize.test-run.evidence\" as const;\n\n/** Current serialized test-run evidence format version. */\nexport const TEST_RUN_EVIDENCE_FORMAT_VERSION = 1 as const;\n\n/** Isolation level of the runner that executed the tests. */\nexport type TestRunIsolation = \"dedicated\" | \"ephemeral\";\n\n/** Kind of user-visible target a test execution ran against. */\nexport type TestRunTargetKind = \"web\" | \"native\" | \"desktop\" | \"terminal\" | \"server\";\n\n/** Semantic kind of one executed suite. */\nexport type TestRunSuiteKind =\n  | \"unit\"\n  | \"integration\"\n  | \"contract\"\n  | \"end-to-end\"\n  | \"accessibility\"\n  | \"visual\"\n  | \"performance\"\n  | \"resilience\"\n  | \"installation\"\n  | \"upgrade\"\n  | \"migration\";\n\n/** Final result of one executed suite shard. */\nexport type TestRunSuiteOutcome = \"passed\" | \"failed\" | \"cancelled\";\n\n/** Final result of the independent verification pass. */\nexport type TestRunVerificationOutcome = \"accepted\" | \"rejected\";\n\n/**\n * Immutable, content-addressed reference to retained evidence.\n *\n * The reference names the retained content by SHA-256 so a green label can\n * never drift away from the bytes that were verified.\n */\nexport interface TestRunRetainedEvidence {\n  /** Content-addressed retrieval reference in `sha256:<64 hex>` form. */\n  readonly reference: string;\n  /** Lowercase SHA-256 fingerprint of the retained content. */\n  readonly fingerprint: string;\n}\n\n/** Exact release artifact that the recorded test executions exercised. */\nexport interface TestRunArtifact {\n  /** Stable artifact identifier. */\n  readonly id: string;\n  /** Lowercase SHA-256 fingerprint of the artifact bytes. */\n  readonly fingerprint: string;\n  /** Exact artifact size in bytes; must be at least one byte. */\n  readonly sizeBytes: number;\n}\n\n/** Authenticated runner that executed the recorded test run. */\nexport interface TestRunRunner {\n  /** Stable runner identity. */\n  readonly identity: string;\n  /** Retained evidence for the runner's authentication. */\n  readonly authenticationEvidence: TestRunRetainedEvidence;\n  /** Isolation level the runner guaranteed for this invocation. */\n  readonly isolation: TestRunIsolation;\n  /** Lowercase SHA-256 fingerprint of the exact invocation. */\n  readonly invocationFingerprint: string;\n  /** Retained evidence describing the execution environment. */\n  readonly environmentEvidence: TestRunRetainedEvidence;\n  /** Lowercase SHA-256 fingerprint of the execution environment. */\n  readonly environmentFingerprint: string;\n}\n\n/**\n * Complete candidate-selected target and suite coverage for the run.\n *\n * Recorded executions must cover exactly these identifiers; anything less is\n * an undeclared omission and anything more is an undeclared execution.\n */\nexport interface TestRunSelection<\n  TargetId extends string = string,\n  SuiteId extends string = string,\n> {\n  /** Selected target identifiers, unique within the selection. */\n  readonly targetIds: readonly TargetId[];\n  /** Selected suite identifiers, unique within the selection. */\n  readonly suiteIds: readonly SuiteId[];\n}\n\n/** One executed target of the release candidate. */\nexport interface TestRunTargetExecution<Id extends string = string> {\n  /** Stable target identifier from the candidate selection. */\n  readonly id: Id;\n  /** Kind of target that was exercised. */\n  readonly kind: TestRunTargetKind;\n  /** Environment identifier the target executed in. */\n  readonly environment: string;\n}\n\n/** One executed suite shard with its exact recorded results. */\nexport interface TestRunSuiteExecution<\n  Id extends string = string,\n  TargetId extends string = string,\n> {\n  /** Stable suite identifier from the candidate selection. */\n  readonly id: Id;\n  /** Target this shard executed against. */\n  readonly targetId: TargetId;\n  /** Semantic suite kind. */\n  readonly kind: TestRunSuiteKind;\n  /** One-based shard index within `shardCount`. */\n  readonly shardIndex: number;\n  /** Total number of shards the suite was split into. */\n  readonly shardCount: number;\n  /** Final shard outcome. */\n  readonly outcome: TestRunSuiteOutcome;\n  /** Number of passed tests. */\n  readonly passed: number;\n  /** Number of failed tests. */\n  readonly failed: number;\n  /** Number of skipped tests. */\n  readonly skipped: number;\n  /** Number of retried tests; retries must always be declared. */\n  readonly retries: number;\n  /** Wall-clock shard duration in milliseconds. */\n  readonly durationMs: number;\n  /** Lowercase SHA-256 fingerprint of the exact shard invocation. */\n  readonly invocationFingerprint: string;\n  /** Retained machine-readable report evidence. */\n  readonly report: TestRunRetainedEvidence;\n  /** Retained execution log evidence. */\n  readonly log: TestRunRetainedEvidence;\n}\n\n/** Independent verification summary over every recorded execution. */\nexport interface TestRunVerification {\n  /** Stable identity of the independent verifier. */\n  readonly verifier: string;\n  /** Millisecond-precision UTC time the verification completed. */\n  readonly completedAt: string;\n  /** Final verification outcome. */\n  readonly outcome: TestRunVerificationOutcome;\n  /** Exact number of recorded target executions. */\n  readonly targetCount: number;\n  /** Exact number of recorded suite executions. */\n  readonly suiteCount: number;\n  /** Total passed tests across every recorded suite execution. */\n  readonly passed: number;\n  /** Total failed tests across every recorded suite execution. */\n  readonly failed: number;\n  /** Total skipped tests across every recorded suite execution. */\n  readonly skipped: number;\n  /** Total retried tests across every recorded suite execution. */\n  readonly retries: number;\n  /** Retained evidence produced by the verification pass. */\n  readonly evidence: TestRunRetainedEvidence;\n}\n\n/**\n * Complete, versioned test-run evidence for one release candidate.\n *\n * The record binds application, environment, application contract, source\n * revision, release, and exact artifact fingerprint to bounded target and\n * suite executions, so a `tests` deployment check can only be satisfied by\n * retained, immutable facts instead of a mutable label or path.\n */\nexport interface TestRunEvidence {\n  /** Serialized format marker; always {@link TEST_RUN_EVIDENCE_FORMAT}. */\n  readonly format: typeof TEST_RUN_EVIDENCE_FORMAT;\n  /**\n   * Serialized format version.\n   *\n   * @default 1\n   */\n  readonly formatVersion?: typeof TEST_RUN_EVIDENCE_FORMAT_VERSION;\n  /** Stable record identifier. */\n  readonly id: string;\n  /** Application the run verified. */\n  readonly application: string;\n  /** Deployment environment the run verified the candidate for. */\n  readonly environment: string;\n  /** Lowercase SHA-256 fingerprint of the application contract. */\n  readonly contractFingerprint: string;\n  /** Exact source revision the candidate was built from. */\n  readonly sourceRevision: string;\n  /** Release the candidate belongs to. */\n  readonly release: string;\n  /** Exact artifact the recorded executions exercised. */\n  readonly artifact: TestRunArtifact;\n  /** Millisecond-precision UTC time the run started. */\n  readonly startedAt: string;\n  /** Millisecond-precision UTC time the run completed. */\n  readonly completedAt: string;\n  /** Millisecond-precision UTC time the record expires. */\n  readonly validUntil: string;\n  /** Authenticated runner that executed the run. */\n  readonly runner: TestRunRunner;\n  /** Complete candidate-selected target and suite coverage. */\n  readonly selection: TestRunSelection;\n  /** Recorded target executions. */\n  readonly targets: readonly TestRunTargetExecution[];\n  /** Recorded suite executions. */\n  readonly suites: readonly TestRunSuiteExecution[];\n  /** Independent verification summary. */\n  readonly verification: TestRunVerification;\n}\n\n/** Target identifiers recorded by one test-run evidence record. */\nexport type TestRunTargetId<Evidence extends TestRunEvidence> = Evidence[\"targets\"][number][\"id\"];\n\n/** Suite identifiers recorded by one test-run evidence record. */\nexport type TestRunSuiteId<Evidence extends TestRunEvidence> = Evidence[\"suites\"][number][\"id\"];\n"],"mappings":";;AACA,MAAa,2BAA2B;;AAGxC,MAAa,mCAAmC"}