@vizejs/marquette 0.299.1
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.
- package/README.md +129 -0
- package/dist/index.d.mts +52 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +33 -0
- package/dist/index.mjs.map +1 -0
- package/dist/model-DWcxWbC1.d.mts +197 -0
- package/dist/model-DWcxWbC1.d.mts.map +1 -0
- package/dist/test-run-admission.d.mts +48 -0
- package/dist/test-run-admission.d.mts.map +1 -0
- package/dist/test-run-admission.mjs +72 -0
- package/dist/test-run-admission.mjs.map +1 -0
- package/dist/test-run-canonical.d.mts +35 -0
- package/dist/test-run-canonical.d.mts.map +1 -0
- package/dist/test-run-canonical.mjs +124 -0
- package/dist/test-run-canonical.mjs.map +1 -0
- package/dist/test-run-model-B2INFVlw.mjs +9 -0
- package/dist/test-run-model-B2INFVlw.mjs.map +1 -0
- package/dist/test-run-model-DkllmEsY.d.mts +181 -0
- package/dist/test-run-model-DkllmEsY.d.mts.map +1 -0
- package/dist/test-run-validate-XF0vyoWI.mjs +229 -0
- package/dist/test-run-validate-XF0vyoWI.mjs.map +1 -0
- package/dist/test-run-validate.d.mts +24 -0
- package/dist/test-run-validate.d.mts.map +1 -0
- package/dist/test-run-validate.mjs +2 -0
- package/dist/test-run.d.mts +40 -0
- package/dist/test-run.d.mts.map +1 -0
- package/dist/test-run.mjs +27 -0
- package/dist/test-run.mjs.map +1 -0
- package/dist/validate.d.mts +29 -0
- package/dist/validate.d.mts.map +1 -0
- package/dist/validate.mjs +146 -0
- package/dist/validate.mjs.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1 @@
|
|
|
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 : 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,oBAAoB,OAAe,aAA0C;CAC3F,IAAI,CAAC,gBAAgB,KAAK,MAAM,EAC9B,YAAY,KACV,MACE,sBACA,kBACA,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,U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xD,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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { i as TestRunEvidence } from "./test-run-model-DkllmEsY.mjs";
|
|
2
|
+
import { MarquetteDiagnostic, MarquetteDiagnosticSeverity } from "./validate.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/test-run-validate-executions.d.ts
|
|
5
|
+
/** Maximum recorded target executions and selected target identifiers. */
|
|
6
|
+
declare const TEST_RUN_MAX_TARGETS = 32;
|
|
7
|
+
/** Maximum recorded suite executions and selected suite identifiers. */
|
|
8
|
+
declare const TEST_RUN_MAX_SUITES = 512;
|
|
9
|
+
/** Maximum shard index and shard count for one suite execution. */
|
|
10
|
+
declare const TEST_RUN_MAX_SHARDS = 1024;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/test-run-validate.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* Validates a complete test-run evidence record.
|
|
15
|
+
*
|
|
16
|
+
* Diagnostics are deterministic and sorted by path, code, and message so the
|
|
17
|
+
* same record produces identical CLI, promotion, test, and CI output in
|
|
18
|
+
* every consuming language. A record with any error diagnostic must never
|
|
19
|
+
* satisfy a deployment check.
|
|
20
|
+
*/
|
|
21
|
+
declare function validateTestRunEvidence(evidence: TestRunEvidence): MarquetteDiagnostic[];
|
|
22
|
+
//#endregion
|
|
23
|
+
export { type MarquetteDiagnostic, type MarquetteDiagnosticSeverity, TEST_RUN_MAX_SHARDS, TEST_RUN_MAX_SUITES, TEST_RUN_MAX_TARGETS, validateTestRunEvidence };
|
|
24
|
+
//# sourceMappingURL=test-run-validate.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-run-validate.d.mts","names":[],"sources":["../src/test-run-validate-executions.ts","../src/test-run-validate.ts"],"mappings":";;;;;cAaa,oBAAA;AAAb;AAAA,cAGa,mBAAA;;cAGA,mBAAA;;;AANb;;;;;AAGA;;;AAHA,iBCuBgB,uBAAA,CAAwB,QAAA,EAAU,eAAA,GAAkB,mBAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { _ as TestRunVerificationOutcome, a as TestRunIsolation, c as TestRunSelection, d as TestRunSuiteKind, f as TestRunSuiteOutcome, g as TestRunVerification, h as TestRunTargetKind, i as TestRunEvidence, l as TestRunSuiteExecution, m as TestRunTargetId, n as TEST_RUN_EVIDENCE_FORMAT_VERSION, o as TestRunRetainedEvidence, p as TestRunTargetExecution, r as TestRunArtifact, s as TestRunRunner, t as TEST_RUN_EVIDENCE_FORMAT, u as TestRunSuiteId } from "./test-run-model-DkllmEsY.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/test-run.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Cross-reference constraints derived from the literals in one record.
|
|
6
|
+
*
|
|
7
|
+
* Keeping this type separate makes editor diagnostics point at the authored
|
|
8
|
+
* reference instead of widening every identifier to `string`.
|
|
9
|
+
*/
|
|
10
|
+
type TestRunReferenceConstraints<Evidence extends TestRunEvidence> = {
|
|
11
|
+
readonly selection?: {
|
|
12
|
+
readonly targetIds: readonly TestRunTargetId<Evidence>[];
|
|
13
|
+
readonly suiteIds: readonly TestRunSuiteId<Evidence>[];
|
|
14
|
+
};
|
|
15
|
+
readonly suites?: readonly (TestRunSuiteExecution<string, TestRunTargetId<Evidence>> & {
|
|
16
|
+
readonly targetId: TestRunTargetId<Evidence>;
|
|
17
|
+
})[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Defines a test-run evidence record while preserving every authored literal.
|
|
21
|
+
*
|
|
22
|
+
* The candidate selection and every suite's target reference are checked
|
|
23
|
+
* against identifiers recorded in the same object. The function returns its
|
|
24
|
+
* input without allocation or runtime work; use the `/test-run/validate`
|
|
25
|
+
* entry before trusting a record.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const evidence = defineTestRunEvidence({
|
|
30
|
+
* format: "vize.test-run.evidence",
|
|
31
|
+
* id: "run-1",
|
|
32
|
+
* application: "shop",
|
|
33
|
+
* // ...bindings, runner, selection, targets, suites, verification
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare function defineTestRunEvidence<const Evidence extends TestRunEvidence>(evidence: Evidence & TestRunReferenceConstraints<NoInfer<Evidence>>): Evidence;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { TEST_RUN_EVIDENCE_FORMAT, TEST_RUN_EVIDENCE_FORMAT_VERSION, type TestRunArtifact, type TestRunEvidence, type TestRunIsolation, TestRunReferenceConstraints, type TestRunRetainedEvidence, type TestRunRunner, type TestRunSelection, type TestRunSuiteExecution, type TestRunSuiteId, type TestRunSuiteKind, type TestRunSuiteOutcome, type TestRunTargetExecution, type TestRunTargetId, type TestRunTargetKind, type TestRunVerification, type TestRunVerificationOutcome, defineTestRunEvidence };
|
|
40
|
+
//# sourceMappingURL=test-run.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-run.d.mts","names":[],"sources":["../src/test-run.ts"],"mappings":";;;;AAiCA;;;;;KAAY,2BAAA,kBAA6C,eAAA;EAAA,SAC9C,SAAA;IAAA,SACE,SAAA,WAAoB,eAAA,CAAgB,QAAA;IAAA,SACpC,QAAA,WAAmB,cAAA,CAAe,QAAA;EAAA;EAAA,SAEpC,MAAA,aAAmB,qBAAA,SAA8B,eAAA,CAAgB,QAAA;IAAA,SAC/D,QAAA,EAAU,eAAA,CAAgB,QAAA;EAAA;AAAA;;;;;;;;;;;;;;;;;;;iBAsBvB,qBAAA,wBAA6C,eAAA,CAAA,CAC3D,QAAA,EAAU,QAAA,GAAW,2BAAA,CAA4B,OAAA,CAAQ,QAAA,KACxD,QAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { n as TEST_RUN_EVIDENCE_FORMAT_VERSION, t as TEST_RUN_EVIDENCE_FORMAT } from "./test-run-model-B2INFVlw.mjs";
|
|
2
|
+
//#region src/test-run.ts
|
|
3
|
+
/**
|
|
4
|
+
* Defines a test-run evidence record while preserving every authored literal.
|
|
5
|
+
*
|
|
6
|
+
* The candidate selection and every suite's target reference are checked
|
|
7
|
+
* against identifiers recorded in the same object. The function returns its
|
|
8
|
+
* input without allocation or runtime work; use the `/test-run/validate`
|
|
9
|
+
* entry before trusting a record.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const evidence = defineTestRunEvidence({
|
|
14
|
+
* format: "vize.test-run.evidence",
|
|
15
|
+
* id: "run-1",
|
|
16
|
+
* application: "shop",
|
|
17
|
+
* // ...bindings, runner, selection, targets, suites, verification
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
function defineTestRunEvidence(evidence) {
|
|
22
|
+
return evidence;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TEST_RUN_EVIDENCE_FORMAT, TEST_RUN_EVIDENCE_FORMAT_VERSION, defineTestRunEvidence };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=test-run.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-run.mjs","names":[],"sources":["../src/test-run.ts"],"sourcesContent":["import type {\n TestRunEvidence,\n TestRunSuiteExecution,\n TestRunSuiteId,\n TestRunTargetId,\n} from \"./test-run-model.js\";\n\nexport {\n TEST_RUN_EVIDENCE_FORMAT,\n TEST_RUN_EVIDENCE_FORMAT_VERSION,\n type TestRunArtifact,\n type TestRunEvidence,\n type TestRunIsolation,\n type TestRunRetainedEvidence,\n type TestRunRunner,\n type TestRunSelection,\n type TestRunSuiteExecution,\n type TestRunSuiteId,\n type TestRunSuiteKind,\n type TestRunSuiteOutcome,\n type TestRunTargetExecution,\n type TestRunTargetId,\n type TestRunTargetKind,\n type TestRunVerification,\n type TestRunVerificationOutcome,\n} from \"./test-run-model.js\";\n\n/**\n * Cross-reference constraints derived from the literals in one record.\n *\n * Keeping this type separate makes editor diagnostics point at the authored\n * reference instead of widening every identifier to `string`.\n */\nexport type TestRunReferenceConstraints<Evidence extends TestRunEvidence> = {\n readonly selection?: {\n readonly targetIds: readonly TestRunTargetId<Evidence>[];\n readonly suiteIds: readonly TestRunSuiteId<Evidence>[];\n };\n readonly suites?: readonly (TestRunSuiteExecution<string, TestRunTargetId<Evidence>> & {\n readonly targetId: TestRunTargetId<Evidence>;\n })[];\n};\n\n/**\n * Defines a test-run evidence record while preserving every authored literal.\n *\n * The candidate selection and every suite's target reference are checked\n * against identifiers recorded in the same object. The function returns its\n * input without allocation or runtime work; use the `/test-run/validate`\n * entry before trusting a record.\n *\n * @example\n * ```ts\n * const evidence = defineTestRunEvidence({\n * format: \"vize.test-run.evidence\",\n * id: \"run-1\",\n * application: \"shop\",\n * // ...bindings, runner, selection, targets, suites, verification\n * });\n * ```\n */\nexport function defineTestRunEvidence<const Evidence extends TestRunEvidence>(\n evidence: Evidence & TestRunReferenceConstraints<NoInfer<Evidence>>,\n): Evidence {\n return evidence;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,sBACd,UACU;CACV,OAAO"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { t as ApplicationMarquette } from "./model-DWcxWbC1.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/validate.d.ts
|
|
4
|
+
/** Severity of an application-marquette diagnostic. */
|
|
5
|
+
type MarquetteDiagnosticSeverity = "error" | "warning";
|
|
6
|
+
/** Stable, source-addressable application-marquette diagnostic. */
|
|
7
|
+
interface MarquetteDiagnostic {
|
|
8
|
+
/** Stable machine-readable diagnostic code. */
|
|
9
|
+
readonly code: `VIZE_MARQUETTE_${string}`;
|
|
10
|
+
/** Severity used by CLI, editor, test, and CI consumers. */
|
|
11
|
+
readonly severity: MarquetteDiagnosticSeverity;
|
|
12
|
+
/** JSON-style path into the authored marquette. */
|
|
13
|
+
readonly path: string;
|
|
14
|
+
/** Human-readable explanation and next action. */
|
|
15
|
+
readonly message: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Validates a complete application marquette.
|
|
19
|
+
*
|
|
20
|
+
* Diagnostics cover structural, reference, capability, target, and dependency
|
|
21
|
+
* invariants. Results are sorted by path, code, and message so identical input
|
|
22
|
+
* produces stable editor, CLI, test, and CI output.
|
|
23
|
+
*
|
|
24
|
+
* This function does not mutate the authored object and does not throw.
|
|
25
|
+
*/
|
|
26
|
+
declare function validateApplicationMarquette(marquette: ApplicationMarquette): MarquetteDiagnostic[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { MarquetteDiagnostic, MarquetteDiagnosticSeverity, validateApplicationMarquette };
|
|
29
|
+
//# sourceMappingURL=validate.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.mts","names":[],"sources":["../src/validate.ts"],"mappings":";;;;KAUY,2BAAA;AAAZ;AAAA,UAGiB,mBAAA;;WAEN,IAAA;EAL4B;EAAA,SAO5B,QAAA,EAAU,2BAAA;EAJe;EAAA,SAMzB,IAAA;EAFqC;EAAA,SAIrC,OAAA;AAAA;;;;;;AAeX;;;;iBAAgB,4BAAA,CACd,SAAA,EAAW,oBAAA,GACV,mBAAA"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//#region src/validate.ts
|
|
2
|
+
const IDENTIFIER = /^[a-z0-9][a-z0-9._-]*$/;
|
|
3
|
+
const SUPPORTED_FORMAT_VERSION = 1;
|
|
4
|
+
/**
|
|
5
|
+
* Validates a complete application marquette.
|
|
6
|
+
*
|
|
7
|
+
* Diagnostics cover structural, reference, capability, target, and dependency
|
|
8
|
+
* invariants. Results are sorted by path, code, and message so identical input
|
|
9
|
+
* produces stable editor, CLI, test, and CI output.
|
|
10
|
+
*
|
|
11
|
+
* This function does not mutate the authored object and does not throw.
|
|
12
|
+
*/
|
|
13
|
+
function validateApplicationMarquette(marquette) {
|
|
14
|
+
const diagnostics = [];
|
|
15
|
+
const environments = marquette.environments ?? [];
|
|
16
|
+
const backends = marquette.backends ?? [];
|
|
17
|
+
const protocols = marquette.protocols ?? [];
|
|
18
|
+
const routes = marquette.routes ?? [];
|
|
19
|
+
const targets = new Set(marquette.targets ?? []);
|
|
20
|
+
const capabilityIds = new Set(Object.keys(marquette.capabilities ?? {}));
|
|
21
|
+
if ((marquette.formatVersion ?? SUPPORTED_FORMAT_VERSION) !== SUPPORTED_FORMAT_VERSION) diagnostics.push(error("VIZE_MARQUETTE_001", "formatVersion", "unsupported marquette format version"));
|
|
22
|
+
validateIdentifier(marquette.application, "application", "VIZE_MARQUETTE_002", diagnostics);
|
|
23
|
+
for (const [key, capability] of Object.entries(marquette.capabilities ?? {})) {
|
|
24
|
+
const path = contractPath("capabilities", key);
|
|
25
|
+
validateIdentifier(key, path, "VIZE_MARQUETTE_003", diagnostics);
|
|
26
|
+
if (key !== capability.id) diagnostics.push(error("VIZE_MARQUETTE_004", path, "capability map key must equal capability.id"));
|
|
27
|
+
const version = capability.version ?? 1;
|
|
28
|
+
if (!Number.isInteger(version) || version < 1) diagnostics.push(error("VIZE_MARQUETTE_005", path, "capability version must be greater than zero"));
|
|
29
|
+
if (capability.description.trim().length === 0) diagnostics.push(error("VIZE_MARQUETTE_024", path, "capability description must not be empty"));
|
|
30
|
+
}
|
|
31
|
+
const environmentIds = collectUniqueIds("environments", environments, diagnostics);
|
|
32
|
+
const backendIds = collectUniqueIds("backends", backends, diagnostics);
|
|
33
|
+
const protocolIds = collectUniqueIds("protocols", protocols, diagnostics);
|
|
34
|
+
collectUniqueIds("routes", routes, diagnostics);
|
|
35
|
+
for (const environment of environments) {
|
|
36
|
+
const path = contractPath("environments", environment.id);
|
|
37
|
+
if (!targets.has(environment.target)) diagnostics.push(error("VIZE_MARQUETTE_007", path, "environment target must be declared in targets"));
|
|
38
|
+
for (const dependency of [...new Set(environment.dependsOn ?? [])].sort()) if (dependency === environment.id) diagnostics.push(error("VIZE_MARQUETTE_008", path, "environment cannot depend on itself"));
|
|
39
|
+
else if (!environmentIds.has(dependency)) diagnostics.push(error("VIZE_MARQUETTE_009", path, "environment dependency does not exist"));
|
|
40
|
+
validateCapabilities(path, environment.capabilities, capabilityIds, diagnostics);
|
|
41
|
+
if (environment.consumer === "client" && (environment.runtime === "rust" || environment.runtime === "go" || environment.runtime === "jvm")) diagnostics.push(warning("VIZE_MARQUETTE_010", path, "client environment uses a server-oriented runtime; declare an adapter capability if this is intentional"));
|
|
42
|
+
}
|
|
43
|
+
validateEnvironmentCycles(environments, diagnostics);
|
|
44
|
+
for (const backend of backends) {
|
|
45
|
+
const path = contractPath("backends", backend.id);
|
|
46
|
+
if (backend.environment != null) {
|
|
47
|
+
const environment = environments.find((candidate) => candidate.id === backend.environment);
|
|
48
|
+
if (environment == null) diagnostics.push(error("VIZE_MARQUETTE_011", path, "backend environment does not exist"));
|
|
49
|
+
else if (environment.consumer !== "server") diagnostics.push(error("VIZE_MARQUETTE_012", path, "backend environment must be a server consumer"));
|
|
50
|
+
}
|
|
51
|
+
validateCapabilities(path, backend.capabilities, capabilityIds, diagnostics);
|
|
52
|
+
}
|
|
53
|
+
for (const protocol of protocols) {
|
|
54
|
+
const path = contractPath("protocols", protocol.id);
|
|
55
|
+
if (!backendIds.has(protocol.backend)) diagnostics.push(error("VIZE_MARQUETTE_013", path, "protocol backend does not exist"));
|
|
56
|
+
validateCapabilities(path, protocol.capabilities, capabilityIds, diagnostics);
|
|
57
|
+
}
|
|
58
|
+
const routePaths = /* @__PURE__ */ new Map();
|
|
59
|
+
for (const route of routes) {
|
|
60
|
+
const path = contractPath("routes", route.id);
|
|
61
|
+
if (!route.path.startsWith("/")) diagnostics.push(error("VIZE_MARQUETTE_014", path, "route path must start with /"));
|
|
62
|
+
const environment = environments.find((candidate) => candidate.id === route.environment);
|
|
63
|
+
if (environment == null) diagnostics.push(error("VIZE_MARQUETTE_015", path, "route environment does not exist"));
|
|
64
|
+
if (route.backend != null && !backendIds.has(route.backend)) diagnostics.push(error("VIZE_MARQUETTE_016", path, "route backend does not exist"));
|
|
65
|
+
if (route.protocol != null) {
|
|
66
|
+
const protocol = protocols.find((candidate) => candidate.id === route.protocol);
|
|
67
|
+
if (!protocolIds.has(route.protocol) || protocol == null) diagnostics.push(error("VIZE_MARQUETTE_017", path, "route protocol does not exist"));
|
|
68
|
+
else if (route.backend != null && protocol.backend !== route.backend) diagnostics.push(error("VIZE_MARQUETTE_018", path, "route protocol and backend must refer to the same service"));
|
|
69
|
+
}
|
|
70
|
+
if (environment != null && !renderingMatchesTarget(route, environment.target)) diagnostics.push(error("VIZE_MARQUETTE_023", path, "rendering mode is not compatible with the route environment target"));
|
|
71
|
+
validateCapabilities(path, route.capabilities, capabilityIds, diagnostics);
|
|
72
|
+
const routeKey = `${route.environment}\u0000${route.path}`;
|
|
73
|
+
const previous = routePaths.get(routeKey);
|
|
74
|
+
if (previous != null) diagnostics.push(error("VIZE_MARQUETTE_019", path, `route path is already used by route "${previous}"`));
|
|
75
|
+
routePaths.set(routeKey, route.id);
|
|
76
|
+
}
|
|
77
|
+
for (const target of targets) if (!environments.some((environment) => environment.target === target)) diagnostics.push(warning("VIZE_MARQUETTE_020", "targets", "declared target has no environment"));
|
|
78
|
+
return diagnostics.sort(compareDiagnostics);
|
|
79
|
+
}
|
|
80
|
+
function collectUniqueIds(collection, values, diagnostics) {
|
|
81
|
+
const ids = /* @__PURE__ */ new Set();
|
|
82
|
+
for (const value of values) {
|
|
83
|
+
const path = contractPath(collection, value.id);
|
|
84
|
+
validateIdentifier(value.id, path, "VIZE_MARQUETTE_006", diagnostics);
|
|
85
|
+
if (ids.has(value.id)) diagnostics.push(error("VIZE_MARQUETTE_006", path, "identifier must be unique within its collection"));
|
|
86
|
+
ids.add(value.id);
|
|
87
|
+
}
|
|
88
|
+
return ids;
|
|
89
|
+
}
|
|
90
|
+
function validateIdentifier(id, path, code, diagnostics) {
|
|
91
|
+
if (!IDENTIFIER.test(id)) diagnostics.push(error(code, path, "identifier must use lowercase ASCII letters, digits, dash, underscore, or dot"));
|
|
92
|
+
}
|
|
93
|
+
function validateCapabilities(path, capabilities, declared, diagnostics) {
|
|
94
|
+
for (const capability of [...new Set(capabilities ?? [])].sort()) if (!declared.has(capability)) diagnostics.push(error("VIZE_MARQUETTE_021", path, "referenced capability is not declared"));
|
|
95
|
+
}
|
|
96
|
+
function validateEnvironmentCycles(environments, diagnostics) {
|
|
97
|
+
const graph = new Map(environments.map((value) => [value.id, value.dependsOn ?? []]));
|
|
98
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
99
|
+
const visited = /* @__PURE__ */ new Set();
|
|
100
|
+
for (const id of [...graph.keys()].sort()) if (hasCycle(id, graph, visiting, visited)) diagnostics.push(error("VIZE_MARQUETTE_022", contractPath("environments", id), "environment dependency graph must be acyclic"));
|
|
101
|
+
}
|
|
102
|
+
function hasCycle(id, graph, visiting, visited) {
|
|
103
|
+
if (visited.has(id)) return false;
|
|
104
|
+
if (visiting.has(id)) return true;
|
|
105
|
+
visiting.add(id);
|
|
106
|
+
const cyclic = [...graph.get(id) ?? []].sort().some((dependency) => graph.has(dependency) && hasCycle(dependency, graph, visiting, visited));
|
|
107
|
+
visiting.delete(id);
|
|
108
|
+
visited.add(id);
|
|
109
|
+
return cyclic;
|
|
110
|
+
}
|
|
111
|
+
function renderingMatchesTarget(route, target) {
|
|
112
|
+
return ({
|
|
113
|
+
native: "native",
|
|
114
|
+
desktop: "desktop",
|
|
115
|
+
terminal: "terminal"
|
|
116
|
+
}[route.rendering] ?? "web") === target;
|
|
117
|
+
}
|
|
118
|
+
function compareDiagnostics(left, right) {
|
|
119
|
+
return compareText(left.path, right.path) || compareText(left.code, right.code) || compareText(left.message, right.message);
|
|
120
|
+
}
|
|
121
|
+
function compareText(left, right) {
|
|
122
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
123
|
+
}
|
|
124
|
+
function contractPath(collection, id) {
|
|
125
|
+
return `${collection}.${id}`;
|
|
126
|
+
}
|
|
127
|
+
function error(code, path, message) {
|
|
128
|
+
return {
|
|
129
|
+
code,
|
|
130
|
+
severity: "error",
|
|
131
|
+
path,
|
|
132
|
+
message
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function warning(code, path, message) {
|
|
136
|
+
return {
|
|
137
|
+
code,
|
|
138
|
+
severity: "warning",
|
|
139
|
+
path,
|
|
140
|
+
message
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { validateApplicationMarquette };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=validate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.mjs","names":[],"sources":["../src/validate.ts"],"sourcesContent":["import type {\n ApplicationMarquette,\n MARQUETTE_FORMAT_VERSION,\n MarquetteEnvironment,\n MarquetteRoute,\n MarquetteTarget,\n RenderingMode,\n} from \"./model.js\";\n\n/** Severity of an application-marquette diagnostic. */\nexport type MarquetteDiagnosticSeverity = \"error\" | \"warning\";\n\n/** Stable, source-addressable application-marquette diagnostic. */\nexport interface MarquetteDiagnostic {\n /** Stable machine-readable diagnostic code. */\n readonly code: `VIZE_MARQUETTE_${string}`;\n /** Severity used by CLI, editor, test, and CI consumers. */\n readonly severity: MarquetteDiagnosticSeverity;\n /** JSON-style path into the authored marquette. */\n readonly path: string;\n /** Human-readable explanation and next action. */\n readonly message: string;\n}\n\nconst IDENTIFIER = /^[a-z0-9][a-z0-9._-]*$/;\nconst SUPPORTED_FORMAT_VERSION: typeof MARQUETTE_FORMAT_VERSION = 1;\n\n/**\n * Validates a complete application marquette.\n *\n * Diagnostics cover structural, reference, capability, target, and dependency\n * invariants. Results are sorted by path, code, and message so identical input\n * produces stable editor, CLI, test, and CI output.\n *\n * This function does not mutate the authored object and does not throw.\n */\nexport function validateApplicationMarquette(\n marquette: ApplicationMarquette,\n): MarquetteDiagnostic[] {\n const diagnostics: MarquetteDiagnostic[] = [];\n const environments = marquette.environments ?? [];\n const backends = marquette.backends ?? [];\n const protocols = marquette.protocols ?? [];\n const routes = marquette.routes ?? [];\n const targets = new Set(marquette.targets ?? []);\n const capabilityIds = new Set(Object.keys(marquette.capabilities ?? {}));\n\n if ((marquette.formatVersion ?? SUPPORTED_FORMAT_VERSION) !== SUPPORTED_FORMAT_VERSION) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_001\", \"formatVersion\", \"unsupported marquette format version\"),\n );\n }\n\n validateIdentifier(marquette.application, \"application\", \"VIZE_MARQUETTE_002\", diagnostics);\n\n for (const [key, capability] of Object.entries(marquette.capabilities ?? {})) {\n const path = contractPath(\"capabilities\", key);\n validateIdentifier(key, path, \"VIZE_MARQUETTE_003\", diagnostics);\n if (key !== capability.id) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_004\", path, \"capability map key must equal capability.id\"),\n );\n }\n const version = capability.version ?? 1;\n if (!Number.isInteger(version) || version < 1) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_005\", path, \"capability version must be greater than zero\"),\n );\n }\n if (capability.description.trim().length === 0) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_024\", path, \"capability description must not be empty\"),\n );\n }\n }\n\n const environmentIds = collectUniqueIds(\"environments\", environments, diagnostics);\n const backendIds = collectUniqueIds(\"backends\", backends, diagnostics);\n const protocolIds = collectUniqueIds(\"protocols\", protocols, diagnostics);\n collectUniqueIds(\"routes\", routes, diagnostics);\n\n for (const environment of environments) {\n const path = contractPath(\"environments\", environment.id);\n if (!targets.has(environment.target)) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_007\", path, \"environment target must be declared in targets\"),\n );\n }\n for (const dependency of [...new Set(environment.dependsOn ?? [])].sort()) {\n if (dependency === environment.id) {\n diagnostics.push(error(\"VIZE_MARQUETTE_008\", path, \"environment cannot depend on itself\"));\n } else if (!environmentIds.has(dependency)) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_009\", path, \"environment dependency does not exist\"),\n );\n }\n }\n validateCapabilities(path, environment.capabilities, capabilityIds, diagnostics);\n\n if (\n environment.consumer === \"client\" &&\n (environment.runtime === \"rust\" ||\n environment.runtime === \"go\" ||\n environment.runtime === \"jvm\")\n ) {\n diagnostics.push(\n warning(\n \"VIZE_MARQUETTE_010\",\n path,\n \"client environment uses a server-oriented runtime; declare an adapter capability if this is intentional\",\n ),\n );\n }\n }\n\n validateEnvironmentCycles(environments, diagnostics);\n\n for (const backend of backends) {\n const path = contractPath(\"backends\", backend.id);\n if (backend.environment != null) {\n const environment = environments.find((candidate) => candidate.id === backend.environment);\n if (environment == null) {\n diagnostics.push(error(\"VIZE_MARQUETTE_011\", path, \"backend environment does not exist\"));\n } else if (environment.consumer !== \"server\") {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_012\", path, \"backend environment must be a server consumer\"),\n );\n }\n }\n validateCapabilities(path, backend.capabilities, capabilityIds, diagnostics);\n }\n\n for (const protocol of protocols) {\n const path = contractPath(\"protocols\", protocol.id);\n if (!backendIds.has(protocol.backend)) {\n diagnostics.push(error(\"VIZE_MARQUETTE_013\", path, \"protocol backend does not exist\"));\n }\n validateCapabilities(path, protocol.capabilities, capabilityIds, diagnostics);\n }\n\n const routePaths = new Map<string, string>();\n for (const route of routes) {\n const path = contractPath(\"routes\", route.id);\n if (!route.path.startsWith(\"/\")) {\n diagnostics.push(error(\"VIZE_MARQUETTE_014\", path, \"route path must start with /\"));\n }\n const environment = environments.find((candidate) => candidate.id === route.environment);\n if (environment == null) {\n diagnostics.push(error(\"VIZE_MARQUETTE_015\", path, \"route environment does not exist\"));\n }\n if (route.backend != null && !backendIds.has(route.backend)) {\n diagnostics.push(error(\"VIZE_MARQUETTE_016\", path, \"route backend does not exist\"));\n }\n if (route.protocol != null) {\n const protocol = protocols.find((candidate) => candidate.id === route.protocol);\n if (!protocolIds.has(route.protocol) || protocol == null) {\n diagnostics.push(error(\"VIZE_MARQUETTE_017\", path, \"route protocol does not exist\"));\n } else if (route.backend != null && protocol.backend !== route.backend) {\n diagnostics.push(\n error(\n \"VIZE_MARQUETTE_018\",\n path,\n \"route protocol and backend must refer to the same service\",\n ),\n );\n }\n }\n if (environment != null && !renderingMatchesTarget(route, environment.target)) {\n diagnostics.push(\n error(\n \"VIZE_MARQUETTE_023\",\n path,\n \"rendering mode is not compatible with the route environment target\",\n ),\n );\n }\n validateCapabilities(path, route.capabilities, capabilityIds, diagnostics);\n\n const routeKey = `${route.environment}\\u0000${route.path}`;\n const previous = routePaths.get(routeKey);\n if (previous != null) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_019\", path, `route path is already used by route \"${previous}\"`),\n );\n }\n routePaths.set(routeKey, route.id);\n }\n\n for (const target of targets) {\n if (!environments.some((environment) => environment.target === target)) {\n diagnostics.push(\n warning(\"VIZE_MARQUETTE_020\", \"targets\", \"declared target has no environment\"),\n );\n }\n }\n\n return diagnostics.sort(compareDiagnostics);\n}\n\nfunction collectUniqueIds(\n collection: string,\n values: readonly { readonly id: string }[],\n diagnostics: MarquetteDiagnostic[],\n): Set<string> {\n const ids = new Set<string>();\n for (const value of values) {\n const path = contractPath(collection, value.id);\n validateIdentifier(value.id, path, \"VIZE_MARQUETTE_006\", diagnostics);\n if (ids.has(value.id)) {\n diagnostics.push(\n error(\"VIZE_MARQUETTE_006\", path, \"identifier must be unique within its collection\"),\n );\n }\n ids.add(value.id);\n }\n return ids;\n}\n\nfunction validateIdentifier(\n id: string,\n path: string,\n code: `VIZE_MARQUETTE_${string}`,\n diagnostics: MarquetteDiagnostic[],\n): void {\n if (!IDENTIFIER.test(id)) {\n diagnostics.push(\n error(\n code,\n path,\n \"identifier must use lowercase ASCII letters, digits, dash, underscore, or dot\",\n ),\n );\n }\n}\n\nfunction validateCapabilities(\n path: string,\n capabilities: readonly string[] | undefined,\n declared: ReadonlySet<string>,\n diagnostics: MarquetteDiagnostic[],\n): void {\n for (const capability of [...new Set(capabilities ?? [])].sort()) {\n if (!declared.has(capability)) {\n diagnostics.push(error(\"VIZE_MARQUETTE_021\", path, \"referenced capability is not declared\"));\n }\n }\n}\n\nfunction validateEnvironmentCycles(\n environments: readonly MarquetteEnvironment[],\n diagnostics: MarquetteDiagnostic[],\n): void {\n const graph = new Map(environments.map((value) => [value.id, value.dependsOn ?? []]));\n const visiting = new Set<string>();\n const visited = new Set<string>();\n\n for (const id of [...graph.keys()].sort()) {\n if (hasCycle(id, graph, visiting, visited)) {\n diagnostics.push(\n error(\n \"VIZE_MARQUETTE_022\",\n contractPath(\"environments\", id),\n \"environment dependency graph must be acyclic\",\n ),\n );\n }\n }\n}\n\nfunction hasCycle(\n id: string,\n graph: ReadonlyMap<string, readonly string[]>,\n visiting: Set<string>,\n visited: Set<string>,\n): boolean {\n if (visited.has(id)) return false;\n if (visiting.has(id)) return true;\n visiting.add(id);\n const cyclic = [...(graph.get(id) ?? [])]\n .sort()\n .some((dependency) => graph.has(dependency) && hasCycle(dependency, graph, visiting, visited));\n visiting.delete(id);\n visited.add(id);\n return cyclic;\n}\n\nfunction renderingMatchesTarget(route: MarquetteRoute, target: MarquetteTarget): boolean {\n const targetRendering: Partial<Record<RenderingMode, MarquetteTarget>> = {\n native: \"native\",\n desktop: \"desktop\",\n terminal: \"terminal\",\n };\n return (targetRendering[route.rendering] ?? \"web\") === target;\n}\n\nfunction compareDiagnostics(left: MarquetteDiagnostic, right: MarquetteDiagnostic): number {\n return (\n compareText(left.path, right.path) ||\n compareText(left.code, right.code) ||\n compareText(left.message, right.message)\n );\n}\n\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\nfunction contractPath(collection: string, id: string): string {\n return `${collection}.${id}`;\n}\n\nfunction error(\n code: `VIZE_MARQUETTE_${string}`,\n path: string,\n message: string,\n): MarquetteDiagnostic {\n return { code, severity: \"error\", path, message };\n}\n\nfunction warning(\n code: `VIZE_MARQUETTE_${string}`,\n path: string,\n message: string,\n): MarquetteDiagnostic {\n return { code, severity: \"warning\", path, message };\n}\n"],"mappings":";AAwBA,MAAM,aAAa;AACnB,MAAM,2BAA4D;;;;;;;;;;AAWlE,SAAgB,6BACd,WACuB;CACvB,MAAM,cAAqC,EAAE;CAC7C,MAAM,eAAe,UAAU,gBAAgB,EAAE;CACjD,MAAM,WAAW,UAAU,YAAY,EAAE;CACzC,MAAM,YAAY,UAAU,aAAa,EAAE;CAC3C,MAAM,SAAS,UAAU,UAAU,EAAE;CACrC,MAAM,UAAU,IAAI,IAAI,UAAU,WAAW,EAAE,CAAC;CAChD,MAAM,gBAAgB,IAAI,IAAI,OAAO,KAAK,UAAU,gBAAgB,EAAE,CAAC,CAAC;CAExE,KAAK,UAAU,iBAAiB,8BAA8B,0BAC5D,YAAY,KACV,MAAM,sBAAsB,iBAAiB,uCAAuC,CACrF;CAGH,mBAAmB,UAAU,aAAa,eAAe,sBAAsB,YAAY;CAE3F,KAAK,MAAM,CAAC,KAAK,eAAe,OAAO,QAAQ,UAAU,gBAAgB,EAAE,CAAC,EAAE;EAC5E,MAAM,OAAO,aAAa,gBAAgB,IAAI;EAC9C,mBAAmB,KAAK,MAAM,sBAAsB,YAAY;EAChE,IAAI,QAAQ,WAAW,IACrB,YAAY,KACV,MAAM,sBAAsB,MAAM,8CAA8C,CACjF;EAEH,MAAM,UAAU,WAAW,WAAW;EACtC,IAA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
+
"description": "Typed application marquettes for every Vize target",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"application-contract",
|
|
7
|
+
"marquette",
|
|
8
|
+
"type-safe",
|
|
9
|
+
"vize"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/ubugeeei-prod/vize",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ubugeeei-prod/vize/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/ubugeeei-prod/vize.git",
|
|
19
|
+
"directory": "npm/marquette"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"main": "./dist/index.mjs",
|
|
27
|
+
"types": "./dist/index.d.mts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"import": "./dist/index.mjs",
|
|
32
|
+
"default": "./dist/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./validate": {
|
|
35
|
+
"types": "./dist/validate.d.mts",
|
|
36
|
+
"import": "./dist/validate.mjs",
|
|
37
|
+
"default": "./dist/validate.mjs"
|
|
38
|
+
},
|
|
39
|
+
"./test-run": {
|
|
40
|
+
"types": "./dist/test-run.d.mts",
|
|
41
|
+
"import": "./dist/test-run.mjs",
|
|
42
|
+
"default": "./dist/test-run.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./test-run/validate": {
|
|
45
|
+
"types": "./dist/test-run-validate.d.mts",
|
|
46
|
+
"import": "./dist/test-run-validate.mjs",
|
|
47
|
+
"default": "./dist/test-run-validate.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./test-run/canonical": {
|
|
50
|
+
"types": "./dist/test-run-canonical.d.mts",
|
|
51
|
+
"import": "./dist/test-run-canonical.mjs",
|
|
52
|
+
"default": "./dist/test-run-canonical.mjs"
|
|
53
|
+
},
|
|
54
|
+
"./test-run/admission": {
|
|
55
|
+
"types": "./dist/test-run-admission.d.mts",
|
|
56
|
+
"import": "./dist/test-run-admission.mjs",
|
|
57
|
+
"default": "./dist/test-run-admission.mjs"
|
|
58
|
+
},
|
|
59
|
+
"./schema": "./dist/application-contract.schema.json",
|
|
60
|
+
"./test-run/schema": "./dist/test-run-evidence.schema.json"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "vp pack && node scripts/copy-schema.mjs && node scripts/check-size.mjs",
|
|
67
|
+
"check": "vp check README.md package.json tsconfig.json src scripts vite.config.ts && tsgo --noEmit -p tsconfig.json",
|
|
68
|
+
"check:fix": "vp check --fix README.md package.json tsconfig.json src scripts vite.config.ts",
|
|
69
|
+
"check:size": "node scripts/check-size.mjs",
|
|
70
|
+
"check:types": "tsgo --noEmit -p tsconfig.json",
|
|
71
|
+
"dev": "vp pack --watch",
|
|
72
|
+
"fmt": "vp fmt --write README.md package.json tsconfig.json src scripts vite.config.ts",
|
|
73
|
+
"test": "vp exec tsx --test src/**/*.test.ts"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "catalog:typescript",
|
|
77
|
+
"@typescript/native-preview": "catalog:typescript",
|
|
78
|
+
"tsx": "catalog:typescript",
|
|
79
|
+
"typescript": "catalog:typescript",
|
|
80
|
+
"vite-plus": "catalog:vite-stack"
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"node": ">=22"
|
|
84
|
+
}
|
|
85
|
+
}
|