@vizejs/marquette 0.302.0 → 0.303.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,148 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://vizejs.dev/schemas/marquette/test-run-transition.schema.json",
4
+ "title": "Vize Release Transition",
5
+ "description": "One durable atomic release transition: a single canonical record binding one release decision to the complete accepted anti-replay state, chained to its predecessor by canonical SHA-256 fingerprint. Host durability contract: a conforming host must write the complete canonical bytes to a temporary location, flush them to durable storage, then atomically rename or commit so exactly one complete chain tip exists at every instant; on recovery it must verify the tip against its retained predecessor before deciding anything new, and discard - never repair - a torn or partial record. Verification is fail-closed and identical across JavaScript, Rust, Go, and JVM hosts; the shared tests/fixtures/test-run-evidence transition-decision fixtures are the conformance source of truth for new host implementations.",
6
+ "$ref": "#/$defs/transition",
7
+ "$defs": {
8
+ "identifier": {
9
+ "type": "string",
10
+ "minLength": 1,
11
+ "maxLength": 128,
12
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
13
+ },
14
+ "digest": {
15
+ "type": "string",
16
+ "pattern": "^[a-f0-9]{64}$"
17
+ },
18
+ "admissionId": {
19
+ "description": "Exact test-run:<sha256> admission id; the only admissible form of accepted test evidence.",
20
+ "type": "string",
21
+ "pattern": "^test-run:[a-f0-9]{64}$"
22
+ },
23
+ "timestamp": {
24
+ "type": "string",
25
+ "format": "date-time",
26
+ "pattern": "^[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$"
27
+ },
28
+ "candidate": {
29
+ "description": "Exact release candidate the decision was made for. Application and environment must stay constant along one chain.",
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": [
33
+ "application",
34
+ "environment",
35
+ "contractFingerprint",
36
+ "sourceRevision",
37
+ "release",
38
+ "artifactFingerprint"
39
+ ],
40
+ "properties": {
41
+ "application": { "$ref": "#/$defs/identifier" },
42
+ "environment": { "$ref": "#/$defs/identifier" },
43
+ "contractFingerprint": { "$ref": "#/$defs/digest" },
44
+ "sourceRevision": {
45
+ "type": "string",
46
+ "pattern": "^[a-f0-9]{40,128}$"
47
+ },
48
+ "release": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 256
52
+ },
53
+ "artifactFingerprint": { "$ref": "#/$defs/digest" }
54
+ }
55
+ },
56
+ "diagnostic": {
57
+ "description": "One retained diagnostic, shaped and serialized exactly like a live diagnostic.",
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["code", "severity", "path", "message"],
61
+ "properties": {
62
+ "code": {
63
+ "type": "string",
64
+ "pattern": "^VIZE_MARQUETTE_[0-9]{3}$"
65
+ },
66
+ "severity": { "enum": ["error", "warning"] },
67
+ "path": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ },
71
+ "message": {
72
+ "type": "string",
73
+ "minLength": 1
74
+ }
75
+ }
76
+ },
77
+ "decision": {
78
+ "description": "Retained allow-or-deny decision exactly as it was produced. allowed must agree with the diagnostics, and denialCodes must equal the published mapping of the diagnostics; verification rejects a record claiming an outcome its own diagnostics contradict.",
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": ["allowed", "denialCodes", "diagnostics"],
82
+ "properties": {
83
+ "allowed": { "type": "boolean" },
84
+ "denialCodes": {
85
+ "type": "array",
86
+ "uniqueItems": true,
87
+ "items": {
88
+ "type": "string",
89
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
90
+ }
91
+ },
92
+ "diagnostics": {
93
+ "type": "array",
94
+ "items": { "$ref": "#/$defs/diagnostic" }
95
+ }
96
+ }
97
+ },
98
+ "transition": {
99
+ "type": "object",
100
+ "additionalProperties": false,
101
+ "required": [
102
+ "format",
103
+ "formatVersion",
104
+ "sequence",
105
+ "previous",
106
+ "decidedAt",
107
+ "candidate",
108
+ "evidence",
109
+ "decision",
110
+ "accepted"
111
+ ],
112
+ "properties": {
113
+ "format": {
114
+ "description": "Serialized format marker; readers must reject any other value.",
115
+ "const": "vize.test-run.transition"
116
+ },
117
+ "formatVersion": {
118
+ "description": "Serialized format version; readers must reject a higher value until they explicitly support it.",
119
+ "const": 1
120
+ },
121
+ "sequence": {
122
+ "description": "One-based chain position; each transition extends its predecessor by exactly one.",
123
+ "type": "integer",
124
+ "minimum": 1,
125
+ "maximum": 9007199254740991
126
+ },
127
+ "previous": {
128
+ "description": "Canonical SHA-256 fingerprint of the predecessor transition; null only at genesis (sequence 1).",
129
+ "anyOf": [{ "$ref": "#/$defs/digest" }, { "type": "null" }]
130
+ },
131
+ "decidedAt": {
132
+ "description": "Millisecond-precision UTC instant of the decision; never earlier than the predecessor's.",
133
+ "$ref": "#/$defs/timestamp"
134
+ },
135
+ "candidate": { "$ref": "#/$defs/candidate" },
136
+ "evidence": { "$ref": "#/$defs/admissionId" },
137
+ "decision": { "$ref": "#/$defs/decision" },
138
+ "accepted": {
139
+ "description": "Complete anti-replay state after this transition: every admission id ever accepted in this chain, sorted and unique. An allowed transition adds exactly its own evidence to its predecessor's state; a denied transition leaves the state unchanged; an already accepted id can never be accepted again.",
140
+ "type": "array",
141
+ "maxItems": 4096,
142
+ "uniqueItems": true,
143
+ "items": { "$ref": "#/$defs/admissionId" }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
@@ -26,8 +26,8 @@ function checkDigest(value, path, diagnostics) {
26
26
  if (!DIGEST.test(value)) diagnostics.push(error("VIZE_MARQUETTE_104", path, "fingerprint must be 64 lowercase hexadecimal characters"));
27
27
  }
28
28
  /** Validates an exact source revision digest. */
29
- function checkSourceRevision(value, diagnostics) {
30
- if (!SOURCE_REVISION.test(value)) diagnostics.push(error("VIZE_MARQUETTE_105", "sourceRevision", "source revision must be 40 to 128 lowercase hexadecimal characters"));
29
+ function checkSourceRevision(value, path, diagnostics) {
30
+ if (!SOURCE_REVISION.test(value)) diagnostics.push(error("VIZE_MARQUETTE_105", path, "source revision must be 40 to 128 lowercase hexadecimal characters"));
31
31
  }
32
32
  /** Returns whether `value` is a millisecond-precision UTC calendar instant. */
33
33
  function isStrictTimestamp(value) {
@@ -195,7 +195,7 @@ function validateTestRunEvidence(evidence) {
195
195
  checkIdentifier(evidence.application, "application", diagnostics);
196
196
  checkIdentifier(evidence.environment, "environment", diagnostics);
197
197
  checkDigest(evidence.contractFingerprint, "contractFingerprint", diagnostics);
198
- checkSourceRevision(evidence.sourceRevision, diagnostics);
198
+ checkSourceRevision(evidence.sourceRevision, "sourceRevision", diagnostics);
199
199
  if (evidence.release.length === 0 || evidence.release.length > 256) diagnostics.push(error("VIZE_MARQUETTE_106", "release", "release must be between 1 and 256 characters"));
200
200
  checkIdentifier(evidence.artifact.id, "artifact.id", diagnostics);
201
201
  checkDigest(evidence.artifact.fingerprint, "artifact.fingerprint", diagnostics);
@@ -224,6 +224,6 @@ function validateTestRunEvidence(evidence) {
224
224
  return diagnostics;
225
225
  }
226
226
  //#endregion
227
- export { error as a, TEST_RUN_MAX_TARGETS as i, TEST_RUN_MAX_SHARDS as n, isStrictTimestamp as o, TEST_RUN_MAX_SUITES as r, validateTestRunEvidence as t };
227
+ export { checkDigest as a, checkSourceRevision as c, isStrictTimestamp as d, TEST_RUN_MAX_TARGETS as i, checkTimestamp as l, TEST_RUN_MAX_SHARDS as n, checkIdentifier as o, TEST_RUN_MAX_SUITES as r, checkSafeInteger as s, validateTestRunEvidence as t, error as u };
228
228
 
229
- //# sourceMappingURL=test-run-validate-XF0vyoWI.mjs.map
229
+ //# sourceMappingURL=test-run-validate-C_KR031E.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-run-validate-C_KR031E.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;;;AAI1B,SAAgB,MACd,MACA,MACA,SACqB;CACrB,OAAO;EAAE;EAAM,UAAU;EAAS;EAAM;EAAS;;;AAInD,SAAgB,gBACd,IACA,MACA,aACM;CACN,IAAI,CAAC,WAAW,KAAK,GAAG,EACtB,YAAY,KACV,MACE,sBACA,MACA,gFACD,CACF;CAEH,IAAI,GAAG,WAAW,KAAK,GAAG,SAAS,KACjC,YAAY,KACV,MAAM,sBAAsB,MAAM,kDAAkD,CACrF;;;AAKL,SAAgB,YAAY,OAAe,MAAc,aAA0C;CACjG,IAAI,CAAC,OAAO,KAAK,MAAM,EACrB,YAAY,KACV,MAAM,sBAAsB,MAAM,0DAA0D,CAC7F;;;AAKL,SAAgB,oBACd,OACA,MACA,aACM;CACN,IAAI,CAAC,gBAAgB,KAAK,MAAM,EAC9B,YAAY,KACV,MACE,sBACA,MACA,qEACD,CACF;;;AAKL,SAAgB,kBAAkB,OAAwB;CACxD,MAAM,QAAQ,UAAU,KAAK,MAAM;CACnC,IAAI,UAAU,MACZ,OAAO;CAET,MAAM,OAAO,OAAO,MAAM,GAAG;CAC7B,MAAM,QAAQ,OAAO,MAAM,GAAG;CAU9B,OATY,OAAO,MAAM,GASf,KAPR,UAAU,IACN,OAAO,MAAM,MAAM,OAAO,QAAQ,KAAK,OAAO,QAAQ,KACpD,KACA,KACF,UAAU,KAAK,UA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AAA,KACxD,YAAY,KACV,MACE,sBACA,sBACA,kDACD,CACF;CAEH,KAAK,MAAM,MAAM,UAAU,WACzB,gBAAgB,IAAI,aAAa,uBAAuB,GAAG,EAAE,YAAY;CAE3E,KAAK,MAAM,MAAM,UAAU,UACzB,gBAAgB,IAAI,aAAa,sBAAsB,GAAG,EAAE,YAAY;CAG1E,gBAAgB,UAAU,YAAY;CACtC,eAAe,UAAU,YAAY;CACrC,qBAAqB,UAAU,YAAY;CAE3C,YAAY,MAAM,MAAM,UACtB,KAAK,SAAS,MAAM,OAChB,KAAK,OAAO,MAAM,OAChB,KACA,IACF,KAAK,SAAS,MAAM,OAClB,KAAK,OAAO,MAAM,OAChB,KACA,IACF,KAAK,UAAU,MAAM,UACnB,KACA,KAAK,UAAU,MAAM,UACnB,IACA,EACX;CACD,OAAO"}
@@ -1,2 +1,2 @@
1
- import { i as TEST_RUN_MAX_TARGETS, n as TEST_RUN_MAX_SHARDS, r as TEST_RUN_MAX_SUITES, t as validateTestRunEvidence } from "./test-run-validate-XF0vyoWI.mjs";
1
+ import { i as TEST_RUN_MAX_TARGETS, n as TEST_RUN_MAX_SHARDS, r as TEST_RUN_MAX_SUITES, t as validateTestRunEvidence } from "./test-run-validate-C_KR031E.mjs";
2
2
  export { TEST_RUN_MAX_SHARDS, TEST_RUN_MAX_SUITES, TEST_RUN_MAX_TARGETS, validateTestRunEvidence };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/marquette",
3
- "version": "0.302.0",
3
+ "version": "0.303.0",
4
4
  "description": "Typed application marquettes for every Vize target",
5
5
  "keywords": [
6
6
  "application-contract",
@@ -75,6 +75,16 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
+ "devDependencies": {
79
+ "@types/node": "25.9.2",
80
+ "@typescript/native-preview": "7.0.0-dev.20260602.1",
81
+ "tsx": "4.22.4",
82
+ "typescript": "6.0.3",
83
+ "vite-plus": "0.1.21"
84
+ },
85
+ "engines": {
86
+ "node": ">=22"
87
+ },
78
88
  "scripts": {
79
89
  "build": "vp pack && node scripts/check-size.mjs",
80
90
  "check": "vp check README.md package.json tsconfig.json src scripts vite.config.ts && tsgo --noEmit -p tsconfig.json",
@@ -84,15 +94,5 @@
84
94
  "dev": "vp pack --watch",
85
95
  "fmt": "vp fmt --write README.md package.json tsconfig.json src scripts vite.config.ts",
86
96
  "test": "vp exec tsx --test src/**/*.test.ts"
87
- },
88
- "devDependencies": {
89
- "@types/node": "catalog:typescript",
90
- "@typescript/native-preview": "catalog:typescript",
91
- "tsx": "catalog:typescript",
92
- "typescript": "catalog:typescript",
93
- "vite-plus": "catalog:vite-stack"
94
- },
95
- "engines": {
96
- "node": ">=22"
97
97
  }
98
- }
98
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-run-canonical.d.mts","names":[],"sources":["../src/test-run-canonical.ts"],"mappings":";;;;cAQa,yBAAA;AAAb;;;;;AAwCA;;;;AAxCA,iBAwCgB,oBAAA,CAAqB,QAAA,EAAU,eAAA;AA6D/C;;;;;;;AAAA,iBAAsB,kBAAA,CAAmB,QAAA,EAAU,eAAA,GAAkB,OAAA;;iBAW/C,kBAAA,CAAmB,QAAA,EAAU,eAAA,GAAkB,OAAA;;;;;;;iBAUrD,uBAAA,CAAwB,EAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-run-validate-XF0vyoWI.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(value: string, diagnostics: MarquetteDiagnostic[]): void {\n if (!SOURCE_REVISION.test(value)) {\n diagnostics.push(\n error(\n \"VIZE_MARQUETTE_105\",\n \"sourceRevision\",\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, 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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