stylegallery 0.1.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.
- package/AGENTS.md +156 -0
- package/CATALOG.md +69 -0
- package/DOMAINS.md +65 -0
- package/GOVERNANCE.md +222 -0
- package/GUIDE.md +59 -0
- package/README.md +313 -0
- package/consumer-reference/adapters/style-dictionary.config.mjs +36 -0
- package/consumer-reference/agent-native/README.md +157 -0
- package/consumer-reference/agent-native/registry.json +640 -0
- package/consumer-reference/agent-native/schema/agent-native.schema.json +848 -0
- package/consumer-reference/agent-native/schema/epistemic.schema.json +14 -0
- package/consumer-reference/agent-native/schema/execution.schema.json +12 -0
- package/consumer-reference/agent-native/schema/identity.schema.json +10 -0
- package/consumer-reference/agent-native/schema/learning.schema.json +12 -0
- package/consumer-reference/agent-native/schema/manifest.schema.json +6 -0
- package/consumer-reference/agent-native/schema/operation.schema.json +12 -0
- package/consumer-reference/agent-native/schema/protocol-binding.schema.json +9 -0
- package/consumer-reference/agent-native/schema/retrieval.schema.json +10 -0
- package/consumer-reference/baselines/calibration.json +260 -0
- package/consumer-reference/baselines/manifest.json +21 -0
- package/consumer-reference/contract.md +83 -0
- package/consumer-reference/fixtures/consumer-conformance/e2e-fixture.mjs +282 -0
- package/consumer-reference/fixtures/consumer-conformance/manifest.json +102 -0
- package/consumer-reference/fixtures/consumer-conformance/runtime-proof.mjs +32 -0
- package/consumer-reference/fixtures/consumer-conformance/valid-migration-result.json +18 -0
- package/consumer-reference/fixtures/consumer-conformance/valid-migration.json +142 -0
- package/consumer-reference/fixtures/invalid-stable-ended-support.json +19 -0
- package/consumer-reference/fixtures/promotion/invalid-blocking-evidence.json +26 -0
- package/consumer-reference/fixtures/promotion/invalid-count-only.json +29 -0
- package/consumer-reference/fixtures/promotion/invalid-missing-owner-migration.json +25 -0
- package/consumer-reference/fixtures/promotion/invalid-normative-bypass-no-regression.json +25 -0
- package/consumer-reference/fixtures/promotion/invalid-related-counted-independent.json +45 -0
- package/consumer-reference/fixtures/promotion/invalid-stable-ended-support.json +26 -0
- package/consumer-reference/fixtures/promotion/manifest.json +15 -0
- package/consumer-reference/fixtures/promotion/valid-deferred-example.json +67 -0
- package/consumer-reference/fixtures/promotion/valid-normative-bypass.json +67 -0
- package/consumer-reference/fixtures/token-portability/invalid-cycle.json +7 -0
- package/consumer-reference/fixtures/token-portability/invalid-dangling-alias.json +6 -0
- package/consumer-reference/fixtures/token-portability/invalid-extends.json +4 -0
- package/consumer-reference/fixtures/token-portability/invalid-json-pointer.json +7 -0
- package/consumer-reference/fixtures/token-portability/invalid-resolver.json +9 -0
- package/consumer-reference/fixtures/token-portability/invalid-type-mismatch.json +10 -0
- package/consumer-reference/fixtures/token-portability/invalid-unknown-reserved.json +6 -0
- package/consumer-reference/fixtures/token-portability/invalid-untested-type.json +6 -0
- package/consumer-reference/fixtures/token-portability/valid-border.json +14 -0
- package/consumer-reference/fixtures/token-portability/valid-reference.json +32 -0
- package/consumer-reference/fixtures/token-portability/valid-whole-alias.json +7 -0
- package/consumer-reference/fixtures/valid-deprecated.json +21 -0
- package/consumer-reference/fixtures/valid-experimental.json +19 -0
- package/consumer-reference/generated/manifest.json +40 -0
- package/consumer-reference/generated/tokens.css +12 -0
- package/consumer-reference/index.md +32 -0
- package/consumer-reference/policies/shared-experimental.json +37 -0
- package/consumer-reference/schema/ax-evidence.schema.json +30 -0
- package/consumer-reference/schema/baseline-manifest.schema.json +55 -0
- package/consumer-reference/schema/calibration-record.schema.json +190 -0
- package/consumer-reference/schema/capture-session.schema.json +161 -0
- package/consumer-reference/schema/component-state.schema.json +150 -0
- package/consumer-reference/schema/consumer-conformance-record.schema.json +365 -0
- package/consumer-reference/schema/dom-evidence.schema.json +38 -0
- package/consumer-reference/schema/evidence-record.schema.json +81 -0
- package/consumer-reference/schema/fixture-manifest.schema.json +32 -0
- package/consumer-reference/schema/item.schema.json +188 -0
- package/consumer-reference/schema/page-evidence-manifest.schema.json +216 -0
- package/consumer-reference/schema/page-evidence-session.schema.json +119 -0
- package/consumer-reference/schema/portable-tokens.schema.json +104 -0
- package/consumer-reference/schema/promotion-rfc.schema.json +219 -0
- package/consumer-reference/schema/runtime-evidence-manifest.schema.json +33 -0
- package/consumer-reference/schema/visual-evidence.schema.json +31 -0
- package/design-engineering/consumer-migration-readiness.md +124 -0
- package/design-engineering/index.md +28 -0
- package/design-engineering/interface-craft.md +107 -0
- package/design-engineering/reference-profiles/external-adaptation/index.md +12 -0
- package/design-engineering/reference-profiles/governed-local/editorial/components/button.component.json +125 -0
- package/design-engineering/reference-profiles/governed-local/editorial/evidence/button.evidence.json +3504 -0
- package/design-engineering/reference-profiles/governed-local/editorial/fixtures/button.fixture.json +65 -0
- package/design-engineering/reference-profiles/governed-local/editorial/generated/evidence-coverage.md +23 -0
- package/design-engineering/reference-profiles/governed-local/editorial/generated/keyboard-matrix.md +19 -0
- package/design-engineering/reference-profiles/governed-local/editorial/generated/state-matrix.md +21 -0
- package/design-engineering/reference-profiles/governed-local/editorial/local-foundations.json +12 -0
- package/design-engineering/reference-profiles/governed-local/editorial/profile.json +43 -0
- package/design-engineering/reference-profiles/governed-local/editorial/states/button.states.json +195 -0
- package/design-engineering/reference-profiles/governed-local/editorial/tokens.dtcg.json +17 -0
- package/design-engineering/reference-profiles/governed-local/index.md +26 -0
- package/design-engineering/reference-profiles/governed-local/terminal/components/button.component.json +125 -0
- package/design-engineering/reference-profiles/governed-local/terminal/evidence/button.evidence.json +3504 -0
- package/design-engineering/reference-profiles/governed-local/terminal/fixtures/button.fixture.json +65 -0
- package/design-engineering/reference-profiles/governed-local/terminal/generated/evidence-coverage.md +23 -0
- package/design-engineering/reference-profiles/governed-local/terminal/generated/keyboard-matrix.md +19 -0
- package/design-engineering/reference-profiles/governed-local/terminal/generated/state-matrix.md +21 -0
- package/design-engineering/reference-profiles/governed-local/terminal/local-foundations.json +12 -0
- package/design-engineering/reference-profiles/governed-local/terminal/profile.json +43 -0
- package/design-engineering/reference-profiles/governed-local/terminal/states/button.states.json +195 -0
- package/design-engineering/reference-profiles/governed-local/terminal/tokens.dtcg.json +17 -0
- package/design-engineering/reference-profiles/index.md +19 -0
- package/game-ui/classification.md +82 -0
- package/game-ui/index.md +35 -0
- package/game-ui/reference-record.md +62 -0
- package/game-ui/screen-hierarchy.md +107 -0
- package/game-ui/unity/architecture.md +166 -0
- package/game-ui/unity/cli-loop.md +84 -0
- package/game-ui/unity/data/unity-technologies-public-repositories.json +26654 -0
- package/game-ui/unity/org-wiki.md +146 -0
- package/game-ui/unity/repository-map.md +102 -0
- package/game-ui/unity/ui-systems.md +85 -0
- package/guides/decision-tree.md +149 -0
- package/guides/documentation-mode-taxonomy.md +157 -0
- package/guides/layout-brief.md +220 -0
- package/guides/vocabulary.md +148 -0
- package/guides/webpage-generation-workflow.md +185 -0
- package/index.md +36 -0
- package/layout/index.md +26 -0
- package/motion/index.md +24 -0
- package/motion/practice-reference.md +145 -0
- package/motion/review-workflow.md +86 -0
- package/motion/vocabulary.md +82 -0
- package/package.json +78 -0
- package/patterns/centering/center.md +87 -0
- package/patterns/centering/index.md +6 -0
- package/patterns/centering/super-center.md +89 -0
- package/patterns/containment/box.md +87 -0
- package/patterns/containment/clamped-card.md +86 -0
- package/patterns/containment/content-limiter.md +87 -0
- package/patterns/containment/fluid-styles.md +86 -0
- package/patterns/containment/index.md +8 -0
- package/patterns/grid-repetition/card-grid.md +88 -0
- package/patterns/grid-repetition/columns.md +87 -0
- package/patterns/grid-repetition/dense-grid.md +88 -0
- package/patterns/grid-repetition/grid-wrapper.md +89 -0
- package/patterns/grid-repetition/index.md +12 -0
- package/patterns/grid-repetition/masonry-approx.md +87 -0
- package/patterns/grid-repetition/page-grid.md +90 -0
- package/patterns/grid-repetition/ram-grid.md +88 -0
- package/patterns/grid-repetition/twelve-span-grid.md +92 -0
- package/patterns/in-line-grouping/badge-list.md +94 -0
- package/patterns/in-line-grouping/breadcrumb.md +89 -0
- package/patterns/in-line-grouping/cluster.md +89 -0
- package/patterns/in-line-grouping/deconstructed-pancake.md +92 -0
- package/patterns/in-line-grouping/index.md +13 -0
- package/patterns/in-line-grouping/pagination.md +89 -0
- package/patterns/in-line-grouping/reel.md +90 -0
- package/patterns/in-line-grouping/split-nav.md +97 -0
- package/patterns/in-line-grouping/tab-strip.md +88 -0
- package/patterns/in-line-grouping/wrap-row.md +89 -0
- package/patterns/index.md +13 -0
- package/patterns/media-fit/frame.md +95 -0
- package/patterns/media-fit/icon-frame.md +87 -0
- package/patterns/media-fit/index.md +6 -0
- package/patterns/overlay-exception/imposter.md +95 -0
- package/patterns/overlay-exception/index.md +6 -0
- package/patterns/overlay-exception/overlay-stack.md +89 -0
- package/patterns/split-sidebar/index.md +12 -0
- package/patterns/split-sidebar/list-detail.md +95 -0
- package/patterns/split-sidebar/main-with-rail.md +95 -0
- package/patterns/split-sidebar/media-object.md +102 -0
- package/patterns/split-sidebar/sidebar.md +101 -0
- package/patterns/split-sidebar/split-screen.md +92 -0
- package/patterns/split-sidebar/sticky-aside.md +97 -0
- package/patterns/split-sidebar/supporting-pane.md +95 -0
- package/patterns/split-sidebar/switcher.md +93 -0
- package/patterns/stacking/feed.md +88 -0
- package/patterns/stacking/index.md +8 -0
- package/patterns/stacking/line-up.md +95 -0
- package/patterns/stacking/stack.md +87 -0
- package/patterns/stacking/step-nav.md +88 -0
- package/patterns/viewport-shell/cover.md +90 -0
- package/patterns/viewport-shell/fixed-sidenav-shell.md +97 -0
- package/patterns/viewport-shell/holy-grail.md +112 -0
- package/patterns/viewport-shell/index.md +11 -0
- package/patterns/viewport-shell/panel-layout.md +95 -0
- package/patterns/viewport-shell/scroll-body-shell.md +93 -0
- package/patterns/viewport-shell/sticky-footer.md +92 -0
- package/patterns/viewport-shell/sticky-header.md +86 -0
- package/platform-guides/apple-interaction.md +89 -0
- package/platform-guides/index.md +26 -0
- package/quality/claim-records/index.md +3 -0
- package/quality/claim-records/samples.md +92 -0
- package/quality/claim-records/stylegallery-multidomain-scope.md +42 -0
- package/quality/claims.md +77 -0
- package/quality/evidence/accessibility.md +58 -0
- package/quality/evidence/consumer-migration.md +42 -0
- package/quality/evidence/design-rationale.md +34 -0
- package/quality/evidence/executable-evidence.md +79 -0
- package/quality/evidence/families.md +56 -0
- package/quality/evidence/hci-evaluation.md +36 -0
- package/quality/evidence/index.md +16 -0
- package/quality/evidence/pattern-contract-audit.md +96 -0
- package/quality/evidence/search-metadata-polyhierarchy.md +86 -0
- package/quality/evidence/sources.md +43 -0
- package/quality/evidence/tokens.md +33 -0
- package/quality/evidence/visual-qa.md +41 -0
- package/quality/gates/accessibility-evidence.md +60 -0
- package/quality/gates/consumer-migration-evidence.md +53 -0
- package/quality/gates/design-claim.md +56 -0
- package/quality/gates/harmony-evaluation.md +78 -0
- package/quality/gates/index.md +13 -0
- package/quality/gates/layout.md +52 -0
- package/quality/gates/rationale.md +53 -0
- package/quality/gates/visual-evidence.md +47 -0
- package/quality/index.md +55 -0
- package/quality/principles.md +58 -0
- package/recipes/article-page.md +52 -0
- package/recipes/command-surface.md +55 -0
- package/recipes/dashboard.md +56 -0
- package/recipes/form-flow.md +55 -0
- package/recipes/homepage.md +89 -0
- package/recipes/index.md +13 -0
- package/recipes/list-detail.md +55 -0
- package/recipes/primitive-to-recipe-matrix.md +83 -0
- package/recipes/saas-settings.md +52 -0
- package/scripts/agent-native/a2a-projection.mjs +248 -0
- package/scripts/agent-native/agui-projection.mjs +178 -0
- package/scripts/agent-native/canonical-json.mjs +109 -0
- package/scripts/agent-native/cli-adapter.mjs +68 -0
- package/scripts/agent-native/events.mjs +113 -0
- package/scripts/agent-native/execution.mjs +227 -0
- package/scripts/agent-native/fixture.mjs +159 -0
- package/scripts/agent-native/identity.mjs +184 -0
- package/scripts/agent-native/immutable-store.mjs +102 -0
- package/scripts/agent-native/knowledge.mjs +168 -0
- package/scripts/agent-native/learning-records.mjs +244 -0
- package/scripts/agent-native/learning.mjs +247 -0
- package/scripts/agent-native/mcp-adapter.mjs +173 -0
- package/scripts/agent-native/queries.mjs +173 -0
- package/scripts/agent-native/registry.mjs +154 -0
- package/scripts/agent-native/retrieval.mjs +171 -0
- package/scripts/agent-native/self-description.mjs +160 -0
- package/scripts/artifact-metadata.mjs +20 -0
- package/scripts/audit-evidence-freshness.mjs +308 -0
- package/scripts/baseline-contract.mjs +189 -0
- package/scripts/baseline-schema-parity.mjs +40 -0
- package/scripts/build-reference-artifacts.mjs +127 -0
- package/scripts/calibration-raw-contract.mjs +172 -0
- package/scripts/capture-session-contract.mjs +187 -0
- package/scripts/component-state-artifact-fixture.mjs +44 -0
- package/scripts/component-state-contract.mjs +99 -0
- package/scripts/component-state-semantics.mjs +128 -0
- package/scripts/component-state-workflow-contract.mjs +67 -0
- package/scripts/component-state-workflow-negative-cases.mjs +64 -0
- package/scripts/consumer-conformance-contract.mjs +198 -0
- package/scripts/consumer-evidence-governance-contract.mjs +210 -0
- package/scripts/consumer-reference-case-runner.mjs +93 -0
- package/scripts/consumer-reference-schema.mjs +155 -0
- package/scripts/create-component-state-session.mjs +100 -0
- package/scripts/create-page-evidence-session.mjs +139 -0
- package/scripts/domain-document-boundaries.mjs +40 -0
- package/scripts/domain-validation-checks.mjs +141 -0
- package/scripts/evidence-artifact-contract.mjs +191 -0
- package/scripts/finalize-component-state-evidence.mjs +165 -0
- package/scripts/finalize-page-evidence.mjs +197 -0
- package/scripts/generate-consumer-reference-evidence.mjs +154 -0
- package/scripts/generate-patterns.mjs +218 -0
- package/scripts/governance-matrix-contract.mjs +73 -0
- package/scripts/governance-matrix-negative-cases.mjs +114 -0
- package/scripts/governance-policy-contract.mjs +49 -0
- package/scripts/governance-test-fixture.mjs +321 -0
- package/scripts/governance-workflow-negative-cases.mjs +241 -0
- package/scripts/governed-profile-registry.mjs +125 -0
- package/scripts/json-schema-formats.mjs +31 -0
- package/scripts/markdown-structure.mjs +45 -0
- package/scripts/page-artifact-metadata.mjs +124 -0
- package/scripts/page-evidence-contract.mjs +297 -0
- package/scripts/page-evidence-fixture.mjs +271 -0
- package/scripts/pattern-data.mjs +325 -0
- package/scripts/profile-record-contract.mjs +140 -0
- package/scripts/promotion-attestation-contract.mjs +91 -0
- package/scripts/promotion-boundary-test-contract.mjs +92 -0
- package/scripts/promotion-fixture-inventory.mjs +109 -0
- package/scripts/promotion-governance-contract.mjs +28 -0
- package/scripts/reference-artifact-path-contract.mjs +28 -0
- package/scripts/reference-profile-contract.mjs +114 -0
- package/scripts/reference-token-contract.mjs +156 -0
- package/scripts/run-consumer-page-evidence-ci.mjs +170 -0
- package/scripts/sg-mcp.mjs +16 -0
- package/scripts/sg.mjs +27 -0
- package/scripts/strict-json.mjs +72 -0
- package/scripts/summarize-sentinel-calibration.mjs +98 -0
- package/scripts/test-agent-adapter-conformance.mjs +250 -0
- package/scripts/test-agent-conformance-receipt.mjs +106 -0
- package/scripts/test-agent-events.mjs +81 -0
- package/scripts/test-agent-execution-effects.mjs +114 -0
- package/scripts/test-agent-execution-fixtures.mjs +140 -0
- package/scripts/test-agent-execution-kernel.mjs +39 -0
- package/scripts/test-agent-execution-learning.mjs +130 -0
- package/scripts/test-agent-execution-lifecycle.mjs +143 -0
- package/scripts/test-agent-execution-safety.mjs +158 -0
- package/scripts/test-agent-execution-views.mjs +117 -0
- package/scripts/test-agent-identity-integrity-cases.mjs +160 -0
- package/scripts/test-agent-knowledge-kernel.mjs +183 -0
- package/scripts/test-agent-learning.mjs +246 -0
- package/scripts/test-agent-mcp.mjs +246 -0
- package/scripts/test-agent-native-schemas.mjs +215 -0
- package/scripts/test-agent-projections.mjs +249 -0
- package/scripts/test-agent-registry-mcp-integrity.mjs +215 -0
- package/scripts/test-agent-registry-mutations.mjs +110 -0
- package/scripts/test-audit-evidence-freshness.mjs +177 -0
- package/scripts/test-component-state-sentinel.mjs +35 -0
- package/scripts/test-component-state-source-contract.mjs +83 -0
- package/scripts/test-consumer-conformance-sentinel.mjs +165 -0
- package/scripts/test-consumer-reference-sentinel.mjs +31 -0
- package/scripts/test-generate-consumer-reference-evidence.mjs +124 -0
- package/scripts/test-json-cli-output.mjs +151 -0
- package/scripts/test-json-schema-formats.mjs +40 -0
- package/scripts/test-reference-adapters.mjs +199 -0
- package/scripts/test-renderer-purity.mjs +34 -0
- package/scripts/test-sg-cli.mjs +129 -0
- package/scripts/test-summarize-sentinel-calibration.mjs +226 -0
- package/scripts/test-validate-baseline-manifest.mjs +234 -0
- package/scripts/test-validate-component-state-artifacts.mjs +243 -0
- package/scripts/test-validate-component-state.mjs +106 -0
- package/scripts/test-validate-consumer-conformance.mjs +427 -0
- package/scripts/test-validate-consumer-reference-cli.mjs +69 -0
- package/scripts/test-validate-consumer-reference.mjs +263 -0
- package/scripts/test-validate-domains.mjs +357 -0
- package/scripts/test-validate-governance.mjs +292 -0
- package/scripts/test-validate-ia.mjs +262 -0
- package/scripts/test-validate-okf.mjs +73 -0
- package/scripts/test-validate-page-evidence.mjs +302 -0
- package/scripts/test-validate-patterns.mjs +157 -0
- package/scripts/test-validate-promotion-rfc.mjs +250 -0
- package/scripts/test-validate-reference-profiles.mjs +170 -0
- package/scripts/test-validate-unity-org-wiki.mjs +57 -0
- package/scripts/test-validate-unity-source-contracts.mjs +67 -0
- package/scripts/test-validate-vocabulary.mjs +174 -0
- package/scripts/test-validate-webpage-workflow.mjs +293 -0
- package/scripts/validate-baseline-manifest.mjs +44 -0
- package/scripts/validate-catalog.mjs +65 -0
- package/scripts/validate-component-state.mjs +141 -0
- package/scripts/validate-consumer-conformance.mjs +477 -0
- package/scripts/validate-consumer-reference.mjs +288 -0
- package/scripts/validate-domains.mjs +237 -0
- package/scripts/validate-governance.mjs +248 -0
- package/scripts/validate-ia.mjs +136 -0
- package/scripts/validate-links.mjs +66 -0
- package/scripts/validate-okf.mjs +104 -0
- package/scripts/validate-page-evidence.mjs +191 -0
- package/scripts/validate-patterns.mjs +246 -0
- package/scripts/validate-promotion-rfc.mjs +224 -0
- package/scripts/validate-reference-artifacts.mjs +125 -0
- package/scripts/validate-renderer-purity.mjs +56 -0
- package/scripts/validate-unity-org-wiki.mjs +146 -0
- package/scripts/validate-unity-source-contracts.mjs +107 -0
- package/scripts/validate-vocabulary.mjs +115 -0
- package/scripts/validate-webpage-workflow.mjs +254 -0
- package/scripts/visual-expectation-contract.mjs +20 -0
- package/scripts/workflow-action-contract.mjs +163 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { canonicalSourceManifest, digest } from "../../../scripts/page-evidence-contract.mjs";
|
|
6
|
+
import {
|
|
7
|
+
cleanupFixture,
|
|
8
|
+
finalizeSession,
|
|
9
|
+
initializeConsumer,
|
|
10
|
+
startSession,
|
|
11
|
+
writeJson,
|
|
12
|
+
writeRunner,
|
|
13
|
+
} from "../../../scripts/page-evidence-fixture.mjs";
|
|
14
|
+
|
|
15
|
+
const styleGalleryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
|
|
16
|
+
const validator = path.join(styleGalleryRoot, "scripts", "validate-consumer-conformance.mjs");
|
|
17
|
+
|
|
18
|
+
function runValidator(root, record, { artifactRoot, priorManifest } = {}) {
|
|
19
|
+
const args = [validator, "--root", root, "--record", record];
|
|
20
|
+
if (artifactRoot) args.push("--artifact-root", artifactRoot);
|
|
21
|
+
if (priorManifest) args.push("--prior-manifest", priorManifest);
|
|
22
|
+
args.push("--json");
|
|
23
|
+
const child = spawnSync(process.execPath, args, { cwd: styleGalleryRoot, encoding: "utf8" });
|
|
24
|
+
let output;
|
|
25
|
+
try { output = JSON.parse(child.stdout); }
|
|
26
|
+
catch { output = { failures: [], parse_error: child.stderr || child.stdout }; }
|
|
27
|
+
return { output, status: child.status };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function codes(child) {
|
|
31
|
+
return child?.report?.failures?.map((entry) => entry.code)
|
|
32
|
+
?? child?.output?.failures?.map((entry) => entry.code)
|
|
33
|
+
?? [];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function outcome(name, expected, child, observe = {}) {
|
|
37
|
+
const actualCodes = codes(child);
|
|
38
|
+
const childOk = expected === "ok:true"
|
|
39
|
+
? child?.status === 0 && (child.report?.ok === true || child.output?.ok === true)
|
|
40
|
+
: child?.status !== 0 && actualCodes.includes(expected);
|
|
41
|
+
const ok = childOk && !Object.values(observe).includes(false);
|
|
42
|
+
return { actual: { codes: actualCodes, status: child?.status, ...observe }, expected, name, ok };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function sourceManifest(fixture) {
|
|
46
|
+
const failures = [];
|
|
47
|
+
const source = canonicalSourceManifest(fixture.root, fixture.relevantSources, failures);
|
|
48
|
+
if (!source || failures.length > 0) throw new Error(`source fixture failed: ${JSON.stringify(failures)}`);
|
|
49
|
+
return source;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function createSession(fixture, template, options = {}) {
|
|
53
|
+
const artifactName = options.artifactName ?? "migration";
|
|
54
|
+
const scenarioId = options.scenarioId ?? "migration-round-trip";
|
|
55
|
+
const session = {
|
|
56
|
+
artifactRoot: path.join(fixture.root, "evidence", artifactName),
|
|
57
|
+
handoffFile: path.join(fixture.root, "records", `${artifactName}-handoff.json`),
|
|
58
|
+
recordFile: path.join(fixture.root, "records", `${artifactName}.json`),
|
|
59
|
+
runId: options.runId ?? `run-${artifactName}`,
|
|
60
|
+
scenarioId,
|
|
61
|
+
sessionId: options.sessionId ?? `session-${artifactName}`,
|
|
62
|
+
};
|
|
63
|
+
const value = structuredClone(template);
|
|
64
|
+
const styleGalleryRevision = execFileSync("git", ["rev-parse", "HEAD"], { cwd: styleGalleryRoot, encoding: "utf8" }).trim();
|
|
65
|
+
value.id = `${artifactName}-migration`;
|
|
66
|
+
value.consumer = { relevant_sources: fixture.relevantSources, repository: fixture.repository, revision: fixture.revision };
|
|
67
|
+
value.page_evidence = { manifest: `evidence/${artifactName}/page-evidence-manifest.json`, status: "applicable" };
|
|
68
|
+
value.scenarios[0] = {
|
|
69
|
+
...value.scenarios[0],
|
|
70
|
+
argv: ["node", "tests/page.spec.js"],
|
|
71
|
+
evidence_method: "browser",
|
|
72
|
+
id: scenarioId,
|
|
73
|
+
result_artifact: `evidence/${artifactName}/runner/${scenarioId}.json`,
|
|
74
|
+
run_id: session.runId,
|
|
75
|
+
session_id: session.sessionId,
|
|
76
|
+
source_digest: sourceManifest(fixture).sha256,
|
|
77
|
+
};
|
|
78
|
+
for (const dimension of Object.values(value.migration_dimensions)) if (dimension.status === "applicable") dimension.scenario_ids = [scenarioId];
|
|
79
|
+
for (const mapping of value.adoption_mappings) {
|
|
80
|
+
mapping.scenario_ids = [scenarioId];
|
|
81
|
+
mapping.stylegallery.revision = styleGalleryRevision;
|
|
82
|
+
}
|
|
83
|
+
options.mutateRecord?.(value);
|
|
84
|
+
writeJson(session.recordFile, value);
|
|
85
|
+
writeJson(session.handoffFile, { consumer_conformance_record: `records/${artifactName}.json`, consumer_migration_readiness: "declared" });
|
|
86
|
+
return session;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function startedSession(fixture, template, options) {
|
|
90
|
+
const session = createSession(fixture, template, options);
|
|
91
|
+
const start = startSession(fixture, session);
|
|
92
|
+
if (start.status !== 0) throw new Error(`session start failed: ${JSON.stringify(start.report)}`);
|
|
93
|
+
return session;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function isolated(template, run) {
|
|
97
|
+
const fixture = initializeConsumer();
|
|
98
|
+
try { return run(fixture, template); }
|
|
99
|
+
finally { cleanupFixture(fixture); }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function initializeCompletedConsumer(template) {
|
|
103
|
+
const fixture = initializeConsumer();
|
|
104
|
+
try {
|
|
105
|
+
const session = startedSession(fixture, template);
|
|
106
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
107
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
108
|
+
return { ...fixture, artifactRoot: session.artifactRoot, recordReference: "records/migration.json" };
|
|
109
|
+
} catch (error) {
|
|
110
|
+
cleanupFixture(fixture);
|
|
111
|
+
throw error;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function cleanupCompletedConsumer(fixture) {
|
|
116
|
+
cleanupFixture(fixture);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function mutatedCompletedPacket(template, { caseName, expected, mutateRecord }) {
|
|
120
|
+
return isolated(template, (fixture, source) => {
|
|
121
|
+
const session = startedSession(fixture, source, { artifactName: caseName });
|
|
122
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
123
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
124
|
+
const value = JSON.parse(fs.readFileSync(session.recordFile, "utf8"));
|
|
125
|
+
mutateRecord(value);
|
|
126
|
+
writeJson(session.recordFile, value);
|
|
127
|
+
return outcome(caseName, expected, runValidator(fixture.root, `records/${caseName}.json`, { artifactRoot: session.artifactRoot }));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const cases = {
|
|
132
|
+
"end-to-end-consumer": (template) => isolated(template, (fixture, source) => {
|
|
133
|
+
const session = startedSession(fixture, source);
|
|
134
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
135
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
136
|
+
const handoff = JSON.parse(fs.readFileSync(session.handoffFile, "utf8"));
|
|
137
|
+
const child = runValidator(fixture.root, handoff.consumer_conformance_record, { artifactRoot: session.artifactRoot });
|
|
138
|
+
return outcome("end-to-end-consumer", "ok:true", child, {
|
|
139
|
+
artifactRootOutsideStyleGallery: !session.artifactRoot.startsWith(styleGalleryRoot),
|
|
140
|
+
checkedDimensions: child.output.checkedDimensions,
|
|
141
|
+
checkedMappings: child.output.checkedMappings,
|
|
142
|
+
checkedPageArtifacts: child.output.checkedPageArtifacts,
|
|
143
|
+
checkedPageScenarios: child.output.checkedPageScenarios,
|
|
144
|
+
handoffLinked: handoff.consumer_migration_readiness === "declared" && handoff.consumer_conformance_record === "records/migration.json",
|
|
145
|
+
pageSessionId: child.output.pageSessionId,
|
|
146
|
+
});
|
|
147
|
+
}),
|
|
148
|
+
"missing-mapping": (template) => isolated(template, (fixture, source) => {
|
|
149
|
+
const session = startedSession(fixture, source, { mutateRecord: (value) => {
|
|
150
|
+
const unit = { ...value.scenarios[0], evidence_method: "unit", id: "unit-migration", result_artifact: "evidence/results/unit-migration.json" };
|
|
151
|
+
value.scenarios.push(unit);
|
|
152
|
+
value.adoption_mappings[0].scenario_ids = [unit.id];
|
|
153
|
+
} });
|
|
154
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
155
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
156
|
+
return outcome("missing-mapping", "page_evidence_adoption_mapping_missing", runValidator(fixture.root, "records/migration.json", { artifactRoot: session.artifactRoot }));
|
|
157
|
+
}),
|
|
158
|
+
"applicable-without-runtime": (template) => isolated(template, (fixture, source) => {
|
|
159
|
+
const session = createSession(fixture, source, { mutateRecord: (value) => { value.scenarios[0].evidence_method = "unit"; } });
|
|
160
|
+
fs.mkdirSync(session.artifactRoot, { recursive: true });
|
|
161
|
+
return outcome("applicable-without-runtime", "page_evidence_runtime_scenario_required", runValidator(fixture.root, "records/migration.json", { artifactRoot: session.artifactRoot }));
|
|
162
|
+
}),
|
|
163
|
+
"dirty-source": (template) => isolated(template, (fixture, source) => {
|
|
164
|
+
const session = createSession(fixture, source);
|
|
165
|
+
fs.appendFileSync(path.join(fixture.root, fixture.relevantSources[0]), "// dirty\n");
|
|
166
|
+
return outcome("dirty-source", "page_evidence_source_dirty", startSession(fixture, session));
|
|
167
|
+
}),
|
|
168
|
+
"failed-runner": (template) => isolated(template, (fixture, source) => {
|
|
169
|
+
const session = startedSession(fixture, source);
|
|
170
|
+
return outcome("failed-runner", "page_evidence_runner_failed", finalizeSession(fixture, session, writeRunner(fixture, session, { status: "failed" })));
|
|
171
|
+
}),
|
|
172
|
+
"cross-session-reuse": (template) => isolated(template, (fixture, source) => {
|
|
173
|
+
const target = startedSession(fixture, source, { artifactName: "target" });
|
|
174
|
+
const alternate = startedSession(fixture, source, { artifactName: "alternate" });
|
|
175
|
+
const targetRunner = writeRunner(fixture, target);
|
|
176
|
+
const alternateRunner = writeRunner(fixture, alternate);
|
|
177
|
+
fs.copyFileSync(alternateRunner.runnerFile, targetRunner.runnerFile);
|
|
178
|
+
fs.copyFileSync(path.join(alternate.artifactRoot, alternateRunner.artifactReference), path.join(target.artifactRoot, targetRunner.artifactReference));
|
|
179
|
+
return outcome("cross-session-reuse", "page_evidence_session_mismatch", finalizeSession(fixture, target, targetRunner));
|
|
180
|
+
}),
|
|
181
|
+
"unmanifested-artifact": (template) => isolated(template, (fixture, source) => {
|
|
182
|
+
const session = startedSession(fixture, source);
|
|
183
|
+
const runner = writeRunner(fixture, session);
|
|
184
|
+
fs.writeFileSync(path.join(session.artifactRoot, "rogue.png"), "rogue");
|
|
185
|
+
return outcome("unmanifested-artifact", "page_evidence_artifact_unmanifested", finalizeSession(fixture, session, runner));
|
|
186
|
+
}),
|
|
187
|
+
"reuse-source-drift": (template) => isolated(template, (fixture, source) => {
|
|
188
|
+
const prior = startedSession(fixture, source, { artifactName: "prior" });
|
|
189
|
+
const priorFinalized = finalizeSession(fixture, prior, writeRunner(fixture, prior));
|
|
190
|
+
if (priorFinalized.status !== 0) throw new Error(`prior finalize failed: ${JSON.stringify(priorFinalized.report)}`);
|
|
191
|
+
fs.appendFileSync(path.join(fixture.root, fixture.relevantSources[0]), "// next revision\n");
|
|
192
|
+
execFileSync("git", ["add", fixture.relevantSources[0]], { cwd: fixture.root });
|
|
193
|
+
execFileSync("git", ["commit", "-m", "next fixture revision"], { cwd: fixture.root, stdio: "ignore" });
|
|
194
|
+
fixture.revision = execFileSync("git", ["rev-parse", "HEAD"], { cwd: fixture.root, encoding: "utf8" }).trim();
|
|
195
|
+
const current = startedSession(fixture, source, { artifactName: "current" });
|
|
196
|
+
const priorManifest = path.join(prior.artifactRoot, "page-evidence-manifest.json");
|
|
197
|
+
const evidence = {
|
|
198
|
+
kind: "reused",
|
|
199
|
+
prior_manifest_sha256: digest(fs.readFileSync(priorManifest)),
|
|
200
|
+
prior_run_id: prior.runId,
|
|
201
|
+
prior_scenario_id: prior.scenarioId,
|
|
202
|
+
prior_session_id: prior.sessionId,
|
|
203
|
+
};
|
|
204
|
+
const runner = writeRunner(fixture, current, { evidence, writeArtifact: false });
|
|
205
|
+
return outcome("reuse-source-drift", "page_evidence_reuse_source_mismatch", finalizeSession(fixture, current, runner, priorManifest));
|
|
206
|
+
}),
|
|
207
|
+
"source-set-mismatch": (template) => mutatedCompletedPacket(template, {
|
|
208
|
+
caseName: "source-set-mismatch",
|
|
209
|
+
expected: "page_evidence_source_set_mismatch",
|
|
210
|
+
mutateRecord: (value) => { value.consumer.relevant_sources = value.consumer.relevant_sources.slice(0, 1); },
|
|
211
|
+
}),
|
|
212
|
+
"repository-mismatch": (template) => mutatedCompletedPacket(template, {
|
|
213
|
+
caseName: "repository-mismatch",
|
|
214
|
+
expected: "page_evidence_repository_mismatch",
|
|
215
|
+
mutateRecord: (value) => { value.consumer.repository = "other/consumer"; },
|
|
216
|
+
}),
|
|
217
|
+
"revision-mismatch": (template) => mutatedCompletedPacket(template, {
|
|
218
|
+
caseName: "revision-mismatch",
|
|
219
|
+
expected: "page_evidence_revision_mismatch",
|
|
220
|
+
mutateRecord: (value) => { value.consumer.revision = "0".repeat(40); },
|
|
221
|
+
}),
|
|
222
|
+
"source-digest-mismatch": (template) => mutatedCompletedPacket(template, {
|
|
223
|
+
caseName: "source-digest-mismatch",
|
|
224
|
+
expected: "page_evidence_source_mismatch",
|
|
225
|
+
mutateRecord: (value) => { value.scenarios[0].source_digest = "0".repeat(64); },
|
|
226
|
+
}),
|
|
227
|
+
"intent-scenario-mismatch": (template) => mutatedCompletedPacket(template, {
|
|
228
|
+
caseName: "intent-scenario-mismatch",
|
|
229
|
+
expected: "page_evidence_intent_scenario_mismatch",
|
|
230
|
+
mutateRecord: (value) => {
|
|
231
|
+
const additional = { ...value.scenarios[0], id: "secondary-browser", result_artifact: "evidence/intent-scenario-mismatch/runner/secondary-browser.json" };
|
|
232
|
+
value.scenarios.push(additional);
|
|
233
|
+
value.migration_dimensions.route_parity.scenario_ids.push(additional.id);
|
|
234
|
+
value.adoption_mappings[0].scenario_ids.push(additional.id);
|
|
235
|
+
},
|
|
236
|
+
}),
|
|
237
|
+
"review-by-missing": (template) => isolated(template, (fixture, source) => {
|
|
238
|
+
const session = startedSession(fixture, source, { artifactName: "review-by-missing" });
|
|
239
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
240
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
241
|
+
const manifestFile = path.join(session.artifactRoot, "page-evidence-manifest.json");
|
|
242
|
+
const manifest = JSON.parse(fs.readFileSync(manifestFile, "utf8"));
|
|
243
|
+
delete manifest.review_by;
|
|
244
|
+
writeJson(manifestFile, manifest);
|
|
245
|
+
return outcome("review-by-missing", "page_evidence_manifest_schema_invalid", runValidator(fixture.root, "records/review-by-missing.json", { artifactRoot: session.artifactRoot }));
|
|
246
|
+
}),
|
|
247
|
+
"manifest-network-url": (template) => isolated(template, (fixture, source) => {
|
|
248
|
+
const session = createSession(fixture, source, { artifactName: "manifest-network-url", mutateRecord: (value) => {
|
|
249
|
+
value.page_evidence.manifest = "https://example.com/page-evidence-manifest.json";
|
|
250
|
+
} });
|
|
251
|
+
fs.mkdirSync(session.artifactRoot, { recursive: true });
|
|
252
|
+
const child = runValidator(fixture.root, "records/manifest-network-url.json", { artifactRoot: session.artifactRoot });
|
|
253
|
+
return outcome("manifest-network-url", "consumer_conformance_schema_invalid", child, {
|
|
254
|
+
noRuntimeExecution: child.output.checkedRuntimeCommands === 0,
|
|
255
|
+
});
|
|
256
|
+
}),
|
|
257
|
+
"manifest-symlink": (template) => isolated(template, (fixture, source) => {
|
|
258
|
+
const session = startedSession(fixture, source, { artifactName: "manifest-symlink" });
|
|
259
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
260
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
261
|
+
const manifest = path.join(session.artifactRoot, "page-evidence-manifest.json");
|
|
262
|
+
const redirected = path.join(session.artifactRoot, "redirected-manifest.json");
|
|
263
|
+
fs.renameSync(manifest, redirected);
|
|
264
|
+
fs.symlinkSync(redirected, manifest);
|
|
265
|
+
return outcome("manifest-symlink", "page_evidence_manifest_symlink", runValidator(fixture.root, "records/manifest-symlink.json", { artifactRoot: session.artifactRoot }));
|
|
266
|
+
}),
|
|
267
|
+
"artifact-root-redirect": (template) => isolated(template, (fixture, source) => {
|
|
268
|
+
const session = startedSession(fixture, source, { artifactName: "artifact-root-redirect" });
|
|
269
|
+
const finalized = finalizeSession(fixture, session, writeRunner(fixture, session));
|
|
270
|
+
if (finalized.status !== 0) throw new Error(`session finalize failed: ${JSON.stringify(finalized.report)}`);
|
|
271
|
+
const redirected = `${session.artifactRoot}-redirected`;
|
|
272
|
+
fs.renameSync(session.artifactRoot, redirected);
|
|
273
|
+
fs.symlinkSync(redirected, session.artifactRoot);
|
|
274
|
+
return outcome("artifact-root-redirect", "page_evidence_artifact_symlink", runValidator(fixture.root, "records/artifact-root-redirect.json", { artifactRoot: session.artifactRoot }));
|
|
275
|
+
}),
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export const endToEndCaseNames = Object.freeze(Object.keys(cases));
|
|
279
|
+
|
|
280
|
+
export function runEndToEndCase(name, template) {
|
|
281
|
+
return cases[name](template);
|
|
282
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "consumer-conformance-fixture-inventory",
|
|
3
|
+
"invalid_cases": [
|
|
4
|
+
{
|
|
5
|
+
"expected_code": "migration_dimension_required",
|
|
6
|
+
"name": "omitted-dimension"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"expected_code": "migration_dimension_scenario_required",
|
|
10
|
+
"name": "applicable-without-scenario"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"expected_code": "runtime_evidence_method_invalid",
|
|
14
|
+
"name": "source-regex-runtime-proof"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"expected_code": "adoption_scenario_unknown",
|
|
18
|
+
"name": "orphan-adoption-scenario"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"expected_code": "adoption_consumer_target_invalid",
|
|
22
|
+
"name": "malformed-local-target"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"expected_code": "adoption_stylegallery_revision_unpinned",
|
|
26
|
+
"name": "unpinned-stylegallery-revision"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"expected_code": "adoption_stylegallery_revision_unknown",
|
|
30
|
+
"name": "unknown-stylegallery-revision"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"expected_code": "adoption_stylegallery_path_missing",
|
|
34
|
+
"name": "missing-stylegallery-path"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"expected_code": "adoption_stylegallery_anchor_missing",
|
|
38
|
+
"name": "missing-stylegallery-anchor"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"expected_code": "adoption_debt_incomplete",
|
|
42
|
+
"name": "debt-without-lifecycle"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"expected_code": "consumer_source_missing",
|
|
46
|
+
"name": "missing-source"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"expected_code": "consumer_source_symlink",
|
|
50
|
+
"name": "symlink-source"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"expected_code": "runtime_command_checkout_symlink",
|
|
54
|
+
"name": "checkout-symlink"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"expected_code": "runtime_result_artifact_missing",
|
|
58
|
+
"name": "missing-result-artifact"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"expected_code": "runtime_result_artifact_symlink",
|
|
62
|
+
"name": "symlink-result-artifact"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"expected_code": "runtime_result_artifact_json_invalid",
|
|
66
|
+
"name": "invalid-result-artifact-json"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"expected_code": "runtime_result_artifact_mismatch",
|
|
70
|
+
"name": "fabricated-result-artifact"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"expected_code": "consumer_repository_mismatch",
|
|
74
|
+
"name": "fabricated-repository"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"expected_code": "consumer_revision_unknown",
|
|
78
|
+
"name": "fabricated-revision"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"expected_code": "runtime_source_digest_mismatch",
|
|
82
|
+
"name": "fabricated-source-digest"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"expected_code": "runtime_command_failed",
|
|
86
|
+
"name": "nonzero-command"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"expected_code": "runtime_command_result_missing",
|
|
90
|
+
"name": "forged-noop-result"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"expected_code": "consumer_repository_mismatch",
|
|
94
|
+
"name": "github-repository-spoof"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"schema_record": "consumer-reference/schema/consumer-conformance-record.schema.json",
|
|
98
|
+
"schema_version": "1.0",
|
|
99
|
+
"valid_records": [
|
|
100
|
+
"valid-migration.json"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
|
|
8
|
+
const resultReference = process.env.STYLEGALLERY_RESULT_ARTIFACT;
|
|
9
|
+
const contextValue = process.env.STYLEGALLERY_RUNTIME_CONTEXT;
|
|
10
|
+
assert.ok(resultReference && contextValue, "the validator must provide the result path and runtime context");
|
|
11
|
+
assert.equal(path.posix.normalize(resultReference), resultReference);
|
|
12
|
+
assert.ok(!path.posix.isAbsolute(resultReference) && !resultReference.split("/").includes(".."));
|
|
13
|
+
|
|
14
|
+
if (process.argv.includes("--lock-worktree")) {
|
|
15
|
+
const locked = spawnSync("git", ["worktree", "lock", "."], { encoding: "utf8" });
|
|
16
|
+
assert.equal(locked.status, 0, locked.stderr);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const context = JSON.parse(contextValue);
|
|
20
|
+
const persisted = JSON.parse(JSON.stringify({ drawer: "open", route: "/gallery", selection: null }));
|
|
21
|
+
assert.deepEqual(persisted, { drawer: "open", route: "/gallery", selection: null });
|
|
22
|
+
|
|
23
|
+
const output = {
|
|
24
|
+
...context,
|
|
25
|
+
record_kind: "consumer_migration_scenario_result",
|
|
26
|
+
recorded_at: "2026-07-21T00:00:00Z",
|
|
27
|
+
schema_version: "1.0",
|
|
28
|
+
status: "passed",
|
|
29
|
+
};
|
|
30
|
+
const resultFile = path.resolve(process.cwd(), resultReference);
|
|
31
|
+
fs.mkdirSync(path.dirname(resultFile), { recursive: true });
|
|
32
|
+
fs.writeFileSync(resultFile, `${JSON.stringify(output, null, 2)}\n`, { flag: "wx" });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"argv": [
|
|
3
|
+
"node",
|
|
4
|
+
"consumer-reference/fixtures/consumer-conformance/runtime-proof.mjs"
|
|
5
|
+
],
|
|
6
|
+
"evidence_method": "integration",
|
|
7
|
+
"exit_code": 0,
|
|
8
|
+
"record_kind": "consumer_migration_scenario_result",
|
|
9
|
+
"recorded_at": "2026-07-21T00:00:00Z",
|
|
10
|
+
"repository": "changeroa/StyleGallery",
|
|
11
|
+
"revision": "84bf420d568f68021117f8142e6d982b4966de2f",
|
|
12
|
+
"run_id": "run-20260721-001",
|
|
13
|
+
"scenario_id": "migration-round-trip",
|
|
14
|
+
"schema_version": "1.0",
|
|
15
|
+
"session_id": "session-20260721-001",
|
|
16
|
+
"source_digest": "6d90893774e2228ffe9ae0286f5b3392b103ea1bf5e571fcde2f7a861d76372c",
|
|
17
|
+
"status": "passed"
|
|
18
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"adoption_mappings": [
|
|
3
|
+
{
|
|
4
|
+
"consumer_target": {
|
|
5
|
+
"identity": "GalleryShell",
|
|
6
|
+
"kind": "component"
|
|
7
|
+
},
|
|
8
|
+
"debt": [],
|
|
9
|
+
"deviations": [],
|
|
10
|
+
"local_decision": {
|
|
11
|
+
"decision": "Keep the spacing value consumer-local and map only the layout unit role.",
|
|
12
|
+
"identity": "--space-shell-gap",
|
|
13
|
+
"kind": "token"
|
|
14
|
+
},
|
|
15
|
+
"scenario_ids": [
|
|
16
|
+
"migration-round-trip"
|
|
17
|
+
],
|
|
18
|
+
"stylegallery": {
|
|
19
|
+
"anchor": "#recommended-pattern-stack",
|
|
20
|
+
"path": "recipes/dashboard.md",
|
|
21
|
+
"revision": "66601da6e81c69674edf5c1b9b1b0862d4597fe9"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"claim_boundary": {
|
|
26
|
+
"certifies_accessibility": false,
|
|
27
|
+
"certifies_product_correctness": false,
|
|
28
|
+
"scope": "This record binds migration scenarios to consumer-owned runtime evidence only."
|
|
29
|
+
},
|
|
30
|
+
"consumer": {
|
|
31
|
+
"relevant_sources": [
|
|
32
|
+
"consumer-reference/fixtures/consumer-conformance/runtime-proof.mjs",
|
|
33
|
+
"consumer-reference/schema/consumer-conformance-record.schema.json",
|
|
34
|
+
"scripts/consumer-conformance-contract.mjs",
|
|
35
|
+
"scripts/validate-consumer-conformance.mjs"
|
|
36
|
+
],
|
|
37
|
+
"repository": "changeroa/StyleGallery",
|
|
38
|
+
"revision": "84bf420d568f68021117f8142e6d982b4966de2f"
|
|
39
|
+
},
|
|
40
|
+
"id": "example-consumer-migration",
|
|
41
|
+
"migration_dimensions": {
|
|
42
|
+
"action_parity": {
|
|
43
|
+
"scenario_ids": [
|
|
44
|
+
"migration-round-trip"
|
|
45
|
+
],
|
|
46
|
+
"status": "applicable"
|
|
47
|
+
},
|
|
48
|
+
"atomic_batch_behavior": {
|
|
49
|
+
"reason": "The migrated surface exposes no batch operation in this scope.",
|
|
50
|
+
"status": "not_applicable"
|
|
51
|
+
},
|
|
52
|
+
"behavior_inventory": {
|
|
53
|
+
"scenario_ids": [
|
|
54
|
+
"migration-round-trip"
|
|
55
|
+
],
|
|
56
|
+
"status": "applicable"
|
|
57
|
+
},
|
|
58
|
+
"contract_precedence": {
|
|
59
|
+
"scenario_ids": [
|
|
60
|
+
"migration-round-trip"
|
|
61
|
+
],
|
|
62
|
+
"status": "applicable"
|
|
63
|
+
},
|
|
64
|
+
"defaults_tri_state_mapping": {
|
|
65
|
+
"reason": "The migrated fields do not have defaults or tri-state semantics.",
|
|
66
|
+
"status": "not_applicable"
|
|
67
|
+
},
|
|
68
|
+
"direct_mutation": {
|
|
69
|
+
"scenario_ids": [
|
|
70
|
+
"migration-round-trip"
|
|
71
|
+
],
|
|
72
|
+
"status": "applicable"
|
|
73
|
+
},
|
|
74
|
+
"exact_time_boundary": {
|
|
75
|
+
"reason": "The migrated behavior has no exact-time scheduling boundary.",
|
|
76
|
+
"status": "not_applicable"
|
|
77
|
+
},
|
|
78
|
+
"field_parity": {
|
|
79
|
+
"scenario_ids": [
|
|
80
|
+
"migration-round-trip"
|
|
81
|
+
],
|
|
82
|
+
"status": "applicable"
|
|
83
|
+
},
|
|
84
|
+
"indirect_mutation": {
|
|
85
|
+
"scenario_ids": [
|
|
86
|
+
"migration-round-trip"
|
|
87
|
+
],
|
|
88
|
+
"status": "applicable"
|
|
89
|
+
},
|
|
90
|
+
"persistence_round_trip": {
|
|
91
|
+
"scenario_ids": [
|
|
92
|
+
"migration-round-trip"
|
|
93
|
+
],
|
|
94
|
+
"status": "applicable"
|
|
95
|
+
},
|
|
96
|
+
"reset_boundary": {
|
|
97
|
+
"scenario_ids": [
|
|
98
|
+
"migration-round-trip"
|
|
99
|
+
],
|
|
100
|
+
"status": "applicable"
|
|
101
|
+
},
|
|
102
|
+
"route_parity": {
|
|
103
|
+
"scenario_ids": [
|
|
104
|
+
"migration-round-trip"
|
|
105
|
+
],
|
|
106
|
+
"status": "applicable"
|
|
107
|
+
},
|
|
108
|
+
"state_transitions": {
|
|
109
|
+
"scenario_ids": [
|
|
110
|
+
"migration-round-trip"
|
|
111
|
+
],
|
|
112
|
+
"status": "applicable"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"page_evidence": {
|
|
116
|
+
"reason": "Page evidence is supplied by the consumer during end-to-end composition.",
|
|
117
|
+
"status": "not_applicable"
|
|
118
|
+
},
|
|
119
|
+
"record_kind": "consumer_migration_conformance",
|
|
120
|
+
"scenarios": [
|
|
121
|
+
{
|
|
122
|
+
"assertions": [
|
|
123
|
+
"The drawer state and persisted route data match after a reload."
|
|
124
|
+
],
|
|
125
|
+
"argv": [
|
|
126
|
+
"node",
|
|
127
|
+
"consumer-reference/fixtures/consumer-conformance/runtime-proof.mjs"
|
|
128
|
+
],
|
|
129
|
+
"evidence_method": "integration",
|
|
130
|
+
"exit_code": 0,
|
|
131
|
+
"id": "migration-round-trip",
|
|
132
|
+
"observable_actions": [
|
|
133
|
+
"Run the synthetic migration fixture and inspect its machine-readable result."
|
|
134
|
+
],
|
|
135
|
+
"result_artifact": "consumer-reference/fixtures/consumer-conformance/valid-migration-result.json",
|
|
136
|
+
"run_id": "run-20260721-001",
|
|
137
|
+
"session_id": "session-20260721-001",
|
|
138
|
+
"source_digest": "6d90893774e2228ffe9ae0286f5b3392b103ea1bf5e571fcde2f7a861d76372c"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"schema_version": "1.0"
|
|
142
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"artifact_mode": "schema_only",
|
|
3
|
+
"fixture_independence": "related",
|
|
4
|
+
"handoff": {
|
|
5
|
+
"record": "consumer-reference/fixtures/invalid-stable-ended-support.json",
|
|
6
|
+
"status": "declared"
|
|
7
|
+
},
|
|
8
|
+
"id": "invalid-stable-ended-support",
|
|
9
|
+
"maturity": "stable",
|
|
10
|
+
"owner": {
|
|
11
|
+
"enforcement": "placeholder",
|
|
12
|
+
"name": "Repository governance owner"
|
|
13
|
+
},
|
|
14
|
+
"review_independence": "single_account",
|
|
15
|
+
"schema_version": "1.0",
|
|
16
|
+
"support": {
|
|
17
|
+
"status": "ended"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"attestations": [],
|
|
3
|
+
"compatibility": { "breaking": false, "surface": "Synthetic invariant contract surface." },
|
|
4
|
+
"decision": "deferred",
|
|
5
|
+
"deprecation": { "plan": "No deprecation while deferred.", "required": false },
|
|
6
|
+
"eligibility_basis": "full_contract",
|
|
7
|
+
"evidence": [
|
|
8
|
+
{ "id": "blocking", "kind": "blocking", "reference": "synthetic-fixture:blocking", "status": "failed" },
|
|
9
|
+
{ "id": "regression", "kind": "regression", "reference": "synthetic-fixture:regression", "status": "passed" }
|
|
10
|
+
],
|
|
11
|
+
"example_only": true,
|
|
12
|
+
"exceptions": [],
|
|
13
|
+
"id": "invalid-blocking-evidence",
|
|
14
|
+
"known_issues": ["The blocking evidence failed."],
|
|
15
|
+
"migration": { "plan": "No migration while deferred.", "required": false },
|
|
16
|
+
"normative_bypass": "none",
|
|
17
|
+
"owner": { "enforcement": "placeholder", "migration": "Synthetic migration owner", "rollback": "Synthetic rollback owner", "scope": "Repository governance owner", "support": "Synthetic support owner" },
|
|
18
|
+
"provenance": { "debt_resolved": false, "source": "Synthetic fixture only" },
|
|
19
|
+
"review_independence": "single_account",
|
|
20
|
+
"rollback": { "action": "Keep deferred.", "triggers": ["Blocking evidence fails."] },
|
|
21
|
+
"schema_version": "1.0",
|
|
22
|
+
"scope": { "aesthetic": false, "kind": "invariant", "summary": "Incorrectly proceed while blocking evidence is failed." },
|
|
23
|
+
"stable_scope_decision": false,
|
|
24
|
+
"support": { "capacity": "committed", "status": "active" },
|
|
25
|
+
"transition": { "from": "consumer_local", "to": "shared_experimental" }
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"attestations": [
|
|
3
|
+
{ "attested_by": "Synthetic owner A", "context_id": "context-a", "consumer_id": "consumer-a", "count_toward_gate": true, "organization_id": "organization-a", "relationship": "independent" },
|
|
4
|
+
{ "attested_by": "Synthetic owner B", "context_id": "context-b", "consumer_id": "consumer-b", "count_toward_gate": true, "organization_id": "organization-b", "relationship": "independent" }
|
|
5
|
+
],
|
|
6
|
+
"compatibility": { "breaking": false, "surface": "Synthetic invariant contract surface." },
|
|
7
|
+
"decision": "deferred",
|
|
8
|
+
"deprecation": { "plan": "No deprecation while deferred.", "required": false },
|
|
9
|
+
"eligibility_basis": "consumer_count_only",
|
|
10
|
+
"evidence": [
|
|
11
|
+
{ "id": "claim", "kind": "claim_scoped", "reference": "synthetic-fixture:claim", "status": "passed" },
|
|
12
|
+
{ "id": "regression", "kind": "regression", "reference": "synthetic-fixture:regression", "status": "passed" }
|
|
13
|
+
],
|
|
14
|
+
"example_only": true,
|
|
15
|
+
"exceptions": [],
|
|
16
|
+
"id": "invalid-count-only",
|
|
17
|
+
"known_issues": [],
|
|
18
|
+
"migration": { "plan": "No migration while deferred.", "required": false },
|
|
19
|
+
"normative_bypass": "none",
|
|
20
|
+
"owner": { "enforcement": "placeholder", "migration": "Synthetic migration owner", "rollback": "Synthetic rollback owner", "scope": "Repository governance owner", "support": "Synthetic support owner" },
|
|
21
|
+
"provenance": { "debt_resolved": false, "source": "Synthetic fixture only" },
|
|
22
|
+
"review_independence": "single_account",
|
|
23
|
+
"rollback": { "action": "Keep deferred.", "triggers": ["Operational duties are incomplete."] },
|
|
24
|
+
"schema_version": "1.0",
|
|
25
|
+
"scope": { "aesthetic": false, "kind": "invariant", "summary": "Incorrectly use adoption count as the whole promotion decision." },
|
|
26
|
+
"stable_scope_decision": false,
|
|
27
|
+
"support": { "capacity": "committed", "status": "active" },
|
|
28
|
+
"transition": { "from": "consumer_local", "to": "shared_experimental" }
|
|
29
|
+
}
|