stylegallery 0.1.0 → 0.1.2

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.
Files changed (230) hide show
  1. package/AGENTS.md +4 -1
  2. package/DOMAINS.md +2 -6
  3. package/GOVERNANCE.md +10 -9
  4. package/README.md +29 -127
  5. package/consumer-reference/agent-native/v2/admission-policy.json +646 -0
  6. package/consumer-reference/agent-native/v2/material-registry.json +1 -0
  7. package/consumer-reference/agent-native/v2/schema/admission-policy.schema.json +50 -0
  8. package/consumer-reference/agent-native/v2/schema/material-manifest.schema.json +17 -0
  9. package/consumer-reference/agent-native/v2/schema/material-record.schema.json +20 -0
  10. package/consumer-reference/contract.md +1 -1
  11. package/consumer-reference/index.md +5 -3
  12. package/layout/index.md +124 -0
  13. package/log.md +57 -0
  14. package/package.json +183 -22
  15. package/scripts/agent-native/v2/experimental-extension-registry.mjs +143 -0
  16. package/scripts/agent-native/v2/extensions/a2a-projection.mjs +264 -0
  17. package/scripts/agent-native/v2/extensions/agui-projection.mjs +191 -0
  18. package/scripts/agent-native/v2/material-admission.mjs +295 -0
  19. package/scripts/agent-native/v2/material-cli-adapter.mjs +134 -0
  20. package/scripts/agent-native/v2/material-context.mjs +251 -0
  21. package/scripts/agent-native/v2/material-identity.mjs +71 -0
  22. package/scripts/agent-native/v2/material-mcp-adapter.mjs +253 -0
  23. package/scripts/agent-native/v2/material-operation-registry.mjs +123 -0
  24. package/scripts/agent-native/v2/material-queries.mjs +398 -0
  25. package/scripts/agent-native/v2/material-registry.mjs +319 -0
  26. package/scripts/sg-material-mcp.mjs +98 -0
  27. package/scripts/sg-material.mjs +27 -0
  28. package/consumer-reference/adapters/style-dictionary.config.mjs +0 -36
  29. package/consumer-reference/baselines/calibration.json +0 -260
  30. package/consumer-reference/baselines/manifest.json +0 -21
  31. package/consumer-reference/fixtures/consumer-conformance/e2e-fixture.mjs +0 -282
  32. package/consumer-reference/fixtures/consumer-conformance/manifest.json +0 -102
  33. package/consumer-reference/fixtures/consumer-conformance/runtime-proof.mjs +0 -32
  34. package/consumer-reference/fixtures/consumer-conformance/valid-migration-result.json +0 -18
  35. package/consumer-reference/fixtures/consumer-conformance/valid-migration.json +0 -142
  36. package/consumer-reference/fixtures/invalid-stable-ended-support.json +0 -19
  37. package/consumer-reference/fixtures/promotion/invalid-blocking-evidence.json +0 -26
  38. package/consumer-reference/fixtures/promotion/invalid-count-only.json +0 -29
  39. package/consumer-reference/fixtures/promotion/invalid-missing-owner-migration.json +0 -25
  40. package/consumer-reference/fixtures/promotion/invalid-normative-bypass-no-regression.json +0 -25
  41. package/consumer-reference/fixtures/promotion/invalid-related-counted-independent.json +0 -45
  42. package/consumer-reference/fixtures/promotion/invalid-stable-ended-support.json +0 -26
  43. package/consumer-reference/fixtures/promotion/manifest.json +0 -15
  44. package/consumer-reference/fixtures/promotion/valid-deferred-example.json +0 -67
  45. package/consumer-reference/fixtures/promotion/valid-normative-bypass.json +0 -67
  46. package/consumer-reference/fixtures/token-portability/invalid-cycle.json +0 -7
  47. package/consumer-reference/fixtures/token-portability/invalid-dangling-alias.json +0 -6
  48. package/consumer-reference/fixtures/token-portability/invalid-extends.json +0 -4
  49. package/consumer-reference/fixtures/token-portability/invalid-json-pointer.json +0 -7
  50. package/consumer-reference/fixtures/token-portability/invalid-resolver.json +0 -9
  51. package/consumer-reference/fixtures/token-portability/invalid-type-mismatch.json +0 -10
  52. package/consumer-reference/fixtures/token-portability/invalid-unknown-reserved.json +0 -6
  53. package/consumer-reference/fixtures/token-portability/invalid-untested-type.json +0 -6
  54. package/consumer-reference/fixtures/token-portability/valid-border.json +0 -14
  55. package/consumer-reference/fixtures/token-portability/valid-reference.json +0 -32
  56. package/consumer-reference/fixtures/token-portability/valid-whole-alias.json +0 -7
  57. package/consumer-reference/fixtures/valid-deprecated.json +0 -21
  58. package/consumer-reference/fixtures/valid-experimental.json +0 -19
  59. package/consumer-reference/generated/manifest.json +0 -40
  60. package/consumer-reference/generated/tokens.css +0 -12
  61. package/consumer-reference/policies/shared-experimental.json +0 -37
  62. package/consumer-reference/schema/ax-evidence.schema.json +0 -30
  63. package/consumer-reference/schema/baseline-manifest.schema.json +0 -55
  64. package/consumer-reference/schema/calibration-record.schema.json +0 -190
  65. package/consumer-reference/schema/capture-session.schema.json +0 -161
  66. package/consumer-reference/schema/component-state.schema.json +0 -150
  67. package/consumer-reference/schema/consumer-conformance-record.schema.json +0 -365
  68. package/consumer-reference/schema/dom-evidence.schema.json +0 -38
  69. package/consumer-reference/schema/evidence-record.schema.json +0 -81
  70. package/consumer-reference/schema/fixture-manifest.schema.json +0 -32
  71. package/consumer-reference/schema/item.schema.json +0 -188
  72. package/consumer-reference/schema/page-evidence-manifest.schema.json +0 -216
  73. package/consumer-reference/schema/page-evidence-session.schema.json +0 -119
  74. package/consumer-reference/schema/portable-tokens.schema.json +0 -104
  75. package/consumer-reference/schema/promotion-rfc.schema.json +0 -219
  76. package/consumer-reference/schema/runtime-evidence-manifest.schema.json +0 -33
  77. package/consumer-reference/schema/visual-evidence.schema.json +0 -31
  78. package/design-engineering/consumer-migration-readiness.md +0 -124
  79. package/design-engineering/interface-craft.md +0 -107
  80. package/design-engineering/reference-profiles/external-adaptation/index.md +0 -12
  81. package/design-engineering/reference-profiles/governed-local/editorial/components/button.component.json +0 -125
  82. package/design-engineering/reference-profiles/governed-local/editorial/evidence/button.evidence.json +0 -3504
  83. package/design-engineering/reference-profiles/governed-local/editorial/fixtures/button.fixture.json +0 -65
  84. package/design-engineering/reference-profiles/governed-local/editorial/generated/evidence-coverage.md +0 -23
  85. package/design-engineering/reference-profiles/governed-local/editorial/generated/keyboard-matrix.md +0 -19
  86. package/design-engineering/reference-profiles/governed-local/editorial/generated/state-matrix.md +0 -21
  87. package/design-engineering/reference-profiles/governed-local/editorial/local-foundations.json +0 -12
  88. package/design-engineering/reference-profiles/governed-local/editorial/states/button.states.json +0 -195
  89. package/design-engineering/reference-profiles/governed-local/editorial/tokens.dtcg.json +0 -17
  90. package/design-engineering/reference-profiles/governed-local/terminal/components/button.component.json +0 -125
  91. package/design-engineering/reference-profiles/governed-local/terminal/evidence/button.evidence.json +0 -3504
  92. package/design-engineering/reference-profiles/governed-local/terminal/fixtures/button.fixture.json +0 -65
  93. package/design-engineering/reference-profiles/governed-local/terminal/generated/evidence-coverage.md +0 -23
  94. package/design-engineering/reference-profiles/governed-local/terminal/generated/keyboard-matrix.md +0 -19
  95. package/design-engineering/reference-profiles/governed-local/terminal/generated/state-matrix.md +0 -21
  96. package/design-engineering/reference-profiles/governed-local/terminal/local-foundations.json +0 -12
  97. package/design-engineering/reference-profiles/governed-local/terminal/profile.json +0 -43
  98. package/design-engineering/reference-profiles/governed-local/terminal/states/button.states.json +0 -195
  99. package/design-engineering/reference-profiles/governed-local/terminal/tokens.dtcg.json +0 -17
  100. package/game-ui/classification.md +0 -82
  101. package/game-ui/reference-record.md +0 -62
  102. package/game-ui/screen-hierarchy.md +0 -107
  103. package/game-ui/unity/architecture.md +0 -166
  104. package/game-ui/unity/cli-loop.md +0 -84
  105. package/game-ui/unity/data/unity-technologies-public-repositories.json +0 -26654
  106. package/game-ui/unity/org-wiki.md +0 -146
  107. package/game-ui/unity/repository-map.md +0 -102
  108. package/game-ui/unity/ui-systems.md +0 -85
  109. package/motion/practice-reference.md +0 -145
  110. package/motion/review-workflow.md +0 -86
  111. package/motion/vocabulary.md +0 -82
  112. package/platform-guides/apple-interaction.md +0 -89
  113. package/scripts/agent-native/events.mjs +0 -113
  114. package/scripts/agent-native/immutable-store.mjs +0 -102
  115. package/scripts/artifact-metadata.mjs +0 -20
  116. package/scripts/audit-evidence-freshness.mjs +0 -308
  117. package/scripts/baseline-contract.mjs +0 -189
  118. package/scripts/baseline-schema-parity.mjs +0 -40
  119. package/scripts/build-reference-artifacts.mjs +0 -127
  120. package/scripts/calibration-raw-contract.mjs +0 -172
  121. package/scripts/capture-session-contract.mjs +0 -187
  122. package/scripts/component-state-artifact-fixture.mjs +0 -44
  123. package/scripts/component-state-contract.mjs +0 -99
  124. package/scripts/component-state-semantics.mjs +0 -128
  125. package/scripts/component-state-workflow-contract.mjs +0 -67
  126. package/scripts/component-state-workflow-negative-cases.mjs +0 -64
  127. package/scripts/consumer-conformance-contract.mjs +0 -198
  128. package/scripts/consumer-evidence-governance-contract.mjs +0 -210
  129. package/scripts/consumer-reference-case-runner.mjs +0 -93
  130. package/scripts/consumer-reference-schema.mjs +0 -155
  131. package/scripts/create-component-state-session.mjs +0 -100
  132. package/scripts/create-page-evidence-session.mjs +0 -139
  133. package/scripts/domain-document-boundaries.mjs +0 -40
  134. package/scripts/domain-validation-checks.mjs +0 -141
  135. package/scripts/evidence-artifact-contract.mjs +0 -191
  136. package/scripts/finalize-component-state-evidence.mjs +0 -165
  137. package/scripts/finalize-page-evidence.mjs +0 -197
  138. package/scripts/generate-consumer-reference-evidence.mjs +0 -154
  139. package/scripts/generate-patterns.mjs +0 -218
  140. package/scripts/governance-matrix-contract.mjs +0 -73
  141. package/scripts/governance-matrix-negative-cases.mjs +0 -114
  142. package/scripts/governance-policy-contract.mjs +0 -49
  143. package/scripts/governance-test-fixture.mjs +0 -321
  144. package/scripts/governance-workflow-negative-cases.mjs +0 -241
  145. package/scripts/governed-profile-registry.mjs +0 -125
  146. package/scripts/json-schema-formats.mjs +0 -31
  147. package/scripts/markdown-structure.mjs +0 -45
  148. package/scripts/page-artifact-metadata.mjs +0 -124
  149. package/scripts/page-evidence-contract.mjs +0 -297
  150. package/scripts/page-evidence-fixture.mjs +0 -271
  151. package/scripts/pattern-data.mjs +0 -325
  152. package/scripts/profile-record-contract.mjs +0 -140
  153. package/scripts/promotion-attestation-contract.mjs +0 -91
  154. package/scripts/promotion-boundary-test-contract.mjs +0 -92
  155. package/scripts/promotion-fixture-inventory.mjs +0 -109
  156. package/scripts/promotion-governance-contract.mjs +0 -28
  157. package/scripts/reference-artifact-path-contract.mjs +0 -28
  158. package/scripts/reference-profile-contract.mjs +0 -114
  159. package/scripts/reference-token-contract.mjs +0 -156
  160. package/scripts/run-consumer-page-evidence-ci.mjs +0 -170
  161. package/scripts/summarize-sentinel-calibration.mjs +0 -98
  162. package/scripts/test-agent-adapter-conformance.mjs +0 -250
  163. package/scripts/test-agent-conformance-receipt.mjs +0 -106
  164. package/scripts/test-agent-events.mjs +0 -81
  165. package/scripts/test-agent-execution-effects.mjs +0 -114
  166. package/scripts/test-agent-execution-fixtures.mjs +0 -140
  167. package/scripts/test-agent-execution-kernel.mjs +0 -39
  168. package/scripts/test-agent-execution-learning.mjs +0 -130
  169. package/scripts/test-agent-execution-lifecycle.mjs +0 -143
  170. package/scripts/test-agent-execution-safety.mjs +0 -158
  171. package/scripts/test-agent-execution-views.mjs +0 -117
  172. package/scripts/test-agent-identity-integrity-cases.mjs +0 -160
  173. package/scripts/test-agent-knowledge-kernel.mjs +0 -183
  174. package/scripts/test-agent-learning.mjs +0 -246
  175. package/scripts/test-agent-mcp.mjs +0 -246
  176. package/scripts/test-agent-native-schemas.mjs +0 -215
  177. package/scripts/test-agent-projections.mjs +0 -249
  178. package/scripts/test-agent-registry-mcp-integrity.mjs +0 -215
  179. package/scripts/test-agent-registry-mutations.mjs +0 -110
  180. package/scripts/test-audit-evidence-freshness.mjs +0 -177
  181. package/scripts/test-component-state-sentinel.mjs +0 -35
  182. package/scripts/test-component-state-source-contract.mjs +0 -83
  183. package/scripts/test-consumer-conformance-sentinel.mjs +0 -165
  184. package/scripts/test-consumer-reference-sentinel.mjs +0 -31
  185. package/scripts/test-generate-consumer-reference-evidence.mjs +0 -124
  186. package/scripts/test-json-cli-output.mjs +0 -151
  187. package/scripts/test-json-schema-formats.mjs +0 -40
  188. package/scripts/test-reference-adapters.mjs +0 -199
  189. package/scripts/test-renderer-purity.mjs +0 -34
  190. package/scripts/test-sg-cli.mjs +0 -129
  191. package/scripts/test-summarize-sentinel-calibration.mjs +0 -226
  192. package/scripts/test-validate-baseline-manifest.mjs +0 -234
  193. package/scripts/test-validate-component-state-artifacts.mjs +0 -243
  194. package/scripts/test-validate-component-state.mjs +0 -106
  195. package/scripts/test-validate-consumer-conformance.mjs +0 -427
  196. package/scripts/test-validate-consumer-reference-cli.mjs +0 -69
  197. package/scripts/test-validate-consumer-reference.mjs +0 -263
  198. package/scripts/test-validate-domains.mjs +0 -357
  199. package/scripts/test-validate-governance.mjs +0 -292
  200. package/scripts/test-validate-ia.mjs +0 -262
  201. package/scripts/test-validate-okf.mjs +0 -73
  202. package/scripts/test-validate-page-evidence.mjs +0 -302
  203. package/scripts/test-validate-patterns.mjs +0 -157
  204. package/scripts/test-validate-promotion-rfc.mjs +0 -250
  205. package/scripts/test-validate-reference-profiles.mjs +0 -170
  206. package/scripts/test-validate-unity-org-wiki.mjs +0 -57
  207. package/scripts/test-validate-unity-source-contracts.mjs +0 -67
  208. package/scripts/test-validate-vocabulary.mjs +0 -174
  209. package/scripts/test-validate-webpage-workflow.mjs +0 -293
  210. package/scripts/validate-baseline-manifest.mjs +0 -44
  211. package/scripts/validate-catalog.mjs +0 -65
  212. package/scripts/validate-component-state.mjs +0 -141
  213. package/scripts/validate-consumer-conformance.mjs +0 -477
  214. package/scripts/validate-consumer-reference.mjs +0 -288
  215. package/scripts/validate-domains.mjs +0 -237
  216. package/scripts/validate-governance.mjs +0 -248
  217. package/scripts/validate-ia.mjs +0 -136
  218. package/scripts/validate-links.mjs +0 -66
  219. package/scripts/validate-okf.mjs +0 -104
  220. package/scripts/validate-page-evidence.mjs +0 -191
  221. package/scripts/validate-patterns.mjs +0 -246
  222. package/scripts/validate-promotion-rfc.mjs +0 -224
  223. package/scripts/validate-reference-artifacts.mjs +0 -125
  224. package/scripts/validate-renderer-purity.mjs +0 -56
  225. package/scripts/validate-unity-org-wiki.mjs +0 -146
  226. package/scripts/validate-unity-source-contracts.mjs +0 -107
  227. package/scripts/validate-vocabulary.mjs +0 -115
  228. package/scripts/validate-webpage-workflow.mjs +0 -254
  229. package/scripts/visual-expectation-contract.mjs +0 -20
  230. package/scripts/workflow-action-contract.mjs +0 -163
@@ -1,218 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from "node:fs";
4
- import path from "node:path";
5
- import { patterns, samples } from "./pattern-data.mjs";
6
-
7
- const root = process.cwd();
8
- const patternsDir = path.join(root, "patterns");
9
- const generatedWarning = "<!-- Generated from `scripts/generate-patterns.mjs` and `scripts/pattern-data.mjs`. Do not hand-edit generated catalog or pattern docs; edit the source files and regenerate. -->";
10
-
11
- function rule(selector, declarations) {
12
- const body = Object.entries(declarations)
13
- .sort(([a], [b]) => a.localeCompare(b))
14
- .map(([property, value]) => ` ${property}: ${value};`)
15
- .join("\n");
16
- return `${selector} {\n${body}\n}`;
17
- }
18
-
19
- function sampleHtml(slug) {
20
- const html = samples[slug];
21
- if (!html) throw new Error(`missing sample HTML for ${slug}`);
22
- return html.trim();
23
- }
24
-
25
- function slugDir(category) {
26
- return category.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
27
- }
28
-
29
- function normalize(raw) {
30
- const [slug, category, problem, axis, responsiveness, source, rawRules, scrollOwnership] = raw;
31
- const css = rawRules.map(([selector, declarations]) => rule(selector, declarations)).join("\n\n");
32
- return { axis, category, css, problem, responsiveness, rules: rawRules, scrollOwnership, slug, source };
33
- }
34
-
35
- function declarationNames(pattern) {
36
- return [...new Set(pattern.rules.flatMap(([, declarations]) => Object.keys(declarations)))];
37
- }
38
-
39
- function inlineCodeList(values) {
40
- return values.map((value) => `\`${value}\``).join(", ");
41
- }
42
-
43
- function cognitiveRisk(pattern) {
44
- if (pattern.scrollOwnership && !pattern.scrollOwnership.startsWith("No internal")) {
45
- return "Medium: scroll ownership can hide context, controls, or return points if it is not named in the consuming layout.";
46
- }
47
- if (pattern.responsiveness === "reflow") {
48
- return "Medium: reflow can change spatial adjacency, so labels, controls, and related content must remain adjacent in DOM order.";
49
- }
50
- return "Low: the pattern should preserve ordinary reading flow when semantic order is already correct.";
51
- }
52
-
53
- function contractSections(pattern, rootClass) {
54
- const properties = declarationNames(pattern);
55
- const core = inlineCodeList(properties);
56
- return [
57
- "## Core Properties",
58
- "",
59
- `- ${core} define the spatial behavior for this pattern.`,
60
- "",
61
- "## Properties That Break The Layout If Removed",
62
- "",
63
- `- Removing ${core} changes the pattern from its documented layout responsibility back toward ordinary flow or an unsafe fixed arrangement.`,
64
- "",
65
- "## Constraints And Change Points",
66
- "",
67
- `- ${pattern.responsiveness} responsiveness is part of the contract; change sizing values only when the new minimum, maximum, or wrap point is documented with the pattern.`,
68
- "- Keep the HTML class hooks and CSS selectors in one-to-one agreement.",
69
- "",
70
- "## Scroll Ownership",
71
- "",
72
- pattern.scrollOwnership ?? "No internal scroll container.",
73
- "",
74
- "## Accessibility And Source Order Notes",
75
- "",
76
- "- Semantic role expectation: Preserve the HTML sample's landmark, list, navigation, form, figure, or article roles; layout classes must not replace semantic elements.",
77
- "- DOM order expectation: Keep semantic elements, DOM order, reading order, and focus order independent from the visual placement created by the layout classes.",
78
- "- Focus risk: Any interactive descendants follow DOM order; do not use this pattern to create a visual order that keyboard focus cannot follow.",
79
- `- Scroll expectation: ${pattern.scrollOwnership ?? "No internal scroll container."}`,
80
- `- Cognitive risk: ${cognitiveRisk(pattern)}`,
81
- "",
82
- "## Browser And Fallback Notes",
83
- "",
84
- "The CSS uses modern grid, flex, intrinsic sizing, logical properties, or positioning. If a target browser cannot support a property, fall back to ordinary block flow before adding decorative or script-driven layout behavior.",
85
- "",
86
- "## Composition Notes",
87
- "",
88
- `Use \`${rootClass}\` as the stable pattern root and compose additional layout behavior outside that root unless the child class is part of the documented relationship.`,
89
- "",
90
- "## Anti-patterns",
91
- "",
92
- "- Do not add color, border, shadow, typography, or animation rules to reusable pattern CSS.",
93
- "- Do not use this pattern to repair unclear HTML structure; make the DOM roles legible first.",
94
- "",
95
- "## IA Navigation",
96
- "",
97
- `Parent: [${pattern.category} patterns](index.md) in [Pattern Categories](../index.md).`,
98
- "Next: [Layout Recipes](../../recipes/index.md) for screen-level composition, or return to the [Layout Pattern Catalog](../../CATALOG.md) when choosing another primitive.",
99
- "",
100
- ];
101
- }
102
-
103
- function render(raw) {
104
- const pattern = normalize(raw);
105
- const rootClass = pattern.slug.replaceAll("-", "_");
106
- const html = sampleHtml(pattern.slug);
107
- return [
108
- "---",
109
- "type: Layout Pattern",
110
- `name: ${pattern.slug}`,
111
- `title: ${pattern.slug}`,
112
- `category: ${pattern.category}`,
113
- `description: ${pattern.problem}`,
114
- `primary_spatial_problem: ${pattern.problem}`,
115
- "secondary_spatial_problems: none",
116
- `layout_axis: ${pattern.axis}`,
117
- "content_shape: mixed",
118
- `responsiveness: ${pattern.responsiveness}`,
119
- "constraints: Uses only local class hooks and explicit layout constraints.",
120
- `scroll_ownership: ${pattern.scrollOwnership ?? "No internal scroll container."}`,
121
- `source_lineage: ${pattern.source}`,
122
- "lifecycle: generated",
123
- "generated_from: scripts/generate-patterns.mjs, scripts/pattern-data.mjs",
124
- "---",
125
- "",
126
- generatedWarning,
127
- "",
128
- `# ${pattern.slug}`,
129
- "",
130
- "## When To Use",
131
- "",
132
- `Use this pattern when you need to ${pattern.problem.charAt(0).toLowerCase()}${pattern.problem.slice(1)}`,
133
- "",
134
- "## HTML",
135
- "",
136
- "```html",
137
- html,
138
- "```",
139
- "",
140
- "## CSS",
141
- "",
142
- "```css",
143
- pattern.css,
144
- "```",
145
- "",
146
- ...contractSections(pattern, rootClass),
147
- ].join("\n");
148
- }
149
-
150
- fs.rmSync(patternsDir, { force: true, recursive: true });
151
- for (const pattern of patterns) {
152
- const [slug, category] = pattern;
153
- const dir = path.join(patternsDir, slugDir(category));
154
- fs.mkdirSync(dir, { recursive: true });
155
- fs.writeFileSync(path.join(dir, `${slug}.md`), render(pattern));
156
- }
157
-
158
- for (const category of [...new Set(patterns.map(([, category]) => category))]) {
159
- const categoryPatterns = patterns.filter(([, patternCategory]) => patternCategory === category);
160
- const dir = path.join(patternsDir, slugDir(category));
161
- fs.writeFileSync(
162
- path.join(dir, "index.md"),
163
- [
164
- `# ${category}`,
165
- "",
166
- generatedWarning,
167
- "",
168
- ...categoryPatterns.map(([slug, , problem]) => `- [${slug}](${slug}.md) - ${problem}`),
169
- "",
170
- ].join("\n"),
171
- );
172
- }
173
-
174
- fs.writeFileSync(
175
- path.join(patternsDir, "index.md"),
176
- [
177
- "# Pattern Categories",
178
- "",
179
- generatedWarning,
180
- "",
181
- ...[...new Set(patterns.map(([, category]) => category))]
182
- .map((category) => `- [${category}](${slugDir(category)}/index.md)`),
183
- "",
184
- ].join("\n"),
185
- );
186
-
187
- fs.writeFileSync(
188
- path.join(root, "CATALOG.md"),
189
- [
190
- "---",
191
- "type: Catalog",
192
- "title: Layout Pattern Catalog",
193
- "description: Generated index of layout-gallery patterns.",
194
- "---",
195
- "",
196
- "# Layout Pattern Catalog",
197
- "",
198
- "Primary role: pattern lookup.",
199
- "",
200
- generatedWarning,
201
- "",
202
- "Generated from `scripts/generate-patterns.mjs` and `scripts/pattern-data.mjs`.",
203
- "",
204
- "## Planning Layer",
205
- "",
206
- "- [Layout Planning Guide](GUIDE.md) - Pre-design entry point for choosing and composing patterns.",
207
- "- [Decision Tree](guides/decision-tree.md) - Question-driven route from screen constraints to pattern categories.",
208
- "- [Layout Brief](guides/layout-brief.md) - Questions to answer before selecting a pattern stack.",
209
- "- [Layout Recipes](recipes/index.md) - Screen-level compositions built from reusable patterns.",
210
- "",
211
- "## Patterns",
212
- "",
213
- ...patterns.map(([slug, category, problem]) => `- [${slug}](patterns/${slugDir(category)}/${slug}.md) - ${category}: ${problem}`),
214
- "",
215
- ].join("\n"),
216
- );
217
-
218
- console.log(`generated ${patterns.length} patterns`);
@@ -1,73 +0,0 @@
1
- const governedProfileSources = [
2
- "design-engineering/reference-profiles/governed-local/editorial/profile.json",
3
- "design-engineering/reference-profiles/governed-local/editorial/tokens.dtcg.json",
4
- "design-engineering/reference-profiles/governed-local/editorial/local-foundations.json",
5
- "design-engineering/reference-profiles/governed-local/terminal/profile.json",
6
- "design-engineering/reference-profiles/governed-local/terminal/tokens.dtcg.json",
7
- "design-engineering/reference-profiles/governed-local/terminal/local-foundations.json",
8
- ];
9
-
10
- const componentStateSources = ["components/*.component.json", "states/*.states.json", "fixtures/*.fixture.json", "evidence/*.evidence.json"];
11
- const componentStateArtifacts = ["editorial", "terminal"].flatMap((profile) =>
12
- ["state-matrix.md", "keyboard-matrix.md", "evidence-coverage.md"].map(
13
- (artifact) => `design-engineering/reference-profiles/governed-local/${profile}/generated/${artifact}`,
14
- ),
15
- );
16
-
17
- function matrixRows(governance, family) {
18
- return governance
19
- .split("\n")
20
- .filter((candidate) => /^ {0,3}\|/.test(candidate) && candidate.trimStart().startsWith(`| ${family} |`))
21
- .map((line) => line.split("|").slice(1, -1).map((cell) => cell.trim()));
22
- }
23
-
24
- function codeListValues(cell, finalAnd) {
25
- if (typeof cell !== "string" || cell.length === 0) return null;
26
- const parts = cell.split(", ");
27
- if (finalAnd) {
28
- const last = parts.at(-1);
29
- if (parts.length < 2 || !last?.startsWith("and ")) return null;
30
- parts[parts.length - 1] = last.slice(4);
31
- } else if (parts.some((part) => part.startsWith("and "))) {
32
- return null;
33
- }
34
- const actual = [];
35
- for (const part of parts) {
36
- const match = part.match(/^`([^`]+)`$/);
37
- if (!match) return null;
38
- actual.push(match[1]);
39
- }
40
- return actual;
41
- }
42
-
43
- function hasExpectedValues(actual, expected) {
44
- if (!actual) return false;
45
- return actual.length === expected.length && new Set(actual).size === expected.length && expected.every((value) => actual.includes(value));
46
- }
47
-
48
- export function referenceOwnershipFailures(governance) {
49
- const failures = [];
50
- const profileRows = matrixRows(governance, "Governed local reference profiles");
51
- if (profileRows.length !== 1) {
52
- failures.push("GOVERNANCE.md: Governed local reference profiles row must appear exactly once");
53
- } else {
54
- const profileRow = profileRows[0];
55
- if (!hasExpectedValues(codeListValues(profileRow[1], false), governedProfileSources)) failures.push("GOVERNANCE.md: governed local reference profile sources must be the six explicit canonical profile files");
56
- if (profileRow[2] !== "Manual" || profileRow[3] !== "None") failures.push("GOVERNANCE.md: governed local reference profiles must be manual sources with no generated artifacts");
57
- }
58
- const stateRows = matrixRows(governance, "Component-state evidence matrices");
59
- if (stateRows.length !== 1) {
60
- failures.push("GOVERNANCE.md: Component-state evidence matrices row must appear exactly once");
61
- } else {
62
- const stateRow = stateRows[0];
63
- const sourceCell = stateRow[1];
64
- const sourcePrefix = "Each profile's declared ";
65
- const sourceSuffix = " records";
66
- const sourceValues = sourceCell?.startsWith(sourcePrefix) && sourceCell.endsWith(sourceSuffix)
67
- ? codeListValues(sourceCell.slice(sourcePrefix.length, -sourceSuffix.length), true)
68
- : null;
69
- if (!hasExpectedValues(sourceValues, componentStateSources)) failures.push("GOVERNANCE.md: component-state evidence sources must be the four declared record families");
70
- if (!hasExpectedValues(codeListValues(stateRow[3], false), componentStateArtifacts)) failures.push("GOVERNANCE.md: component-state generated artifacts must be the six declared matrices");
71
- }
72
- return failures;
73
- }
@@ -1,114 +0,0 @@
1
- function matrixRow(governance, family) {
2
- return governance.split("\n").find((line) => line.startsWith(`| ${family} |`));
3
- }
4
-
5
- function duplicateRow(governance, row, replacement = row) {
6
- return governance.replace(row, `${row}\n${replacement}`);
7
- }
8
-
9
- function mutateCell(row, index, mutate) {
10
- const cells = row.split("|");
11
- cells[index] = ` ${mutate(cells[index].trim())} `;
12
- return cells.join("|");
13
- }
14
-
15
- function reverseCodeValues(cell) {
16
- const values = [...cell.matchAll(/`([^`]+)`/g)].map((match) => match[1]).reverse();
17
- return values.map((value) => `\`${value}\``).join(", ");
18
- }
19
-
20
- export function governanceMatrixCases(governance) {
21
- const profileRow = matrixRow(governance, "Governed local reference profiles");
22
- const stateRow = matrixRow(governance, "Component-state evidence matrices");
23
- if (!profileRow || !stateRow) throw new Error("canonical governance fixture must contain both reference ownership rows");
24
-
25
- const conflictingProfileRow = profileRow.replace(
26
- "`design-engineering/reference-profiles/governed-local/editorial/profile.json`",
27
- "`design-engineering/reference-profiles/governed-local/**`",
28
- );
29
- const reorderedProfileRow = mutateCell(profileRow, 2, reverseCodeValues);
30
- const reorderedStateSources = mutateCell(stateRow, 2, (cell) => {
31
- const values = reverseCodeValues(cell);
32
- return `Each profile's declared ${values.replace(/, ([^,]+)$/, ", and $1")} records`;
33
- });
34
- const reorderedStateRow = mutateCell(reorderedStateSources, 4, reverseCodeValues);
35
-
36
- return [
37
- {
38
- name: "duplicate_governed_profile_row",
39
- mutate: { "GOVERNANCE.md": duplicateRow(governance, profileRow) },
40
- expect: "GOVERNANCE.md: Governed local reference profiles row must appear exactly once",
41
- },
42
- {
43
- name: "conflicting_duplicate_governed_profile_row",
44
- mutate: { "GOVERNANCE.md": duplicateRow(governance, profileRow, conflictingProfileRow) },
45
- expect: "GOVERNANCE.md: Governed local reference profiles row must appear exactly once",
46
- },
47
- {
48
- name: "one_space_duplicate_governed_profile_row",
49
- mutate: { "GOVERNANCE.md": duplicateRow(governance, profileRow, ` ${profileRow}`) },
50
- expect: "GOVERNANCE.md: Governed local reference profiles row must appear exactly once",
51
- },
52
- {
53
- name: "three_space_conflicting_governed_profile_row",
54
- mutate: { "GOVERNANCE.md": duplicateRow(governance, profileRow, ` ${conflictingProfileRow}`) },
55
- expect: "GOVERNANCE.md: Governed local reference profiles row must appear exactly once",
56
- },
57
- {
58
- name: "duplicate_component_state_row",
59
- mutate: { "GOVERNANCE.md": duplicateRow(governance, stateRow) },
60
- expect: "GOVERNANCE.md: Component-state evidence matrices row must appear exactly once",
61
- },
62
- {
63
- name: "one_space_duplicate_component_state_row",
64
- mutate: { "GOVERNANCE.md": duplicateRow(governance, stateRow, ` ${stateRow}`) },
65
- expect: "GOVERNANCE.md: Component-state evidence matrices row must appear exactly once",
66
- },
67
- {
68
- name: "three_space_conflicting_component_state_row",
69
- mutate: { "GOVERNANCE.md": duplicateRow(governance, stateRow, ` ${mutateCell(stateRow, 2, () => "Each profile's declared `components/**` records")}`) },
70
- expect: "GOVERNANCE.md: Component-state evidence matrices row must appear exactly once",
71
- },
72
- {
73
- name: "duplicate_both_reference_rows",
74
- mutate: { "GOVERNANCE.md": duplicateRow(duplicateRow(governance, profileRow), stateRow) },
75
- expect: "GOVERNANCE.md: Governed local reference profiles row must appear exactly once",
76
- },
77
- {
78
- name: "four_space_reference_rows_are_code_blocks",
79
- mutate: {
80
- "GOVERNANCE.md": duplicateRow(
81
- duplicateRow(governance, profileRow, ` ${conflictingProfileRow}`),
82
- stateRow,
83
- ` ${mutateCell(stateRow, 2, () => "Each profile's declared `components/**` records")}`,
84
- ),
85
- },
86
- expect: null,
87
- },
88
- {
89
- name: "profile_source_extra_prose",
90
- mutate: { "GOVERNANCE.md": governance.replace(profileRow, mutateCell(profileRow, 2, (cell) => `${cell} plus every generated matrix and evidence receipt`)) },
91
- expect: "GOVERNANCE.md: governed local reference profile sources must be the six explicit canonical profile files",
92
- },
93
- {
94
- name: "profile_artifact_extra_prose",
95
- mutate: { "GOVERNANCE.md": governance.replace(profileRow, mutateCell(profileRow, 4, (cell) => `${cell} plus every generated matrix`)) },
96
- expect: "GOVERNANCE.md: governed local reference profiles must be manual sources with no generated artifacts",
97
- },
98
- {
99
- name: "component_source_extra_prose",
100
- mutate: { "GOVERNANCE.md": governance.replace(stateRow, mutateCell(stateRow, 2, (cell) => `${cell} plus every related record`)) },
101
- expect: "GOVERNANCE.md: component-state evidence sources must be the four declared record families",
102
- },
103
- {
104
- name: "component_artifact_extra_prose",
105
- mutate: { "GOVERNANCE.md": governance.replace(stateRow, mutateCell(stateRow, 4, (cell) => `${cell} plus every generated matrix and evidence receipt`)) },
106
- expect: "GOVERNANCE.md: component-state generated artifacts must be the six declared matrices",
107
- },
108
- {
109
- name: "reordered_reference_matrix_cells",
110
- mutate: { "GOVERNANCE.md": governance.replace(profileRow, reorderedProfileRow).replace(stateRow, reorderedStateRow) },
111
- expect: null,
112
- },
113
- ];
114
- }
@@ -1,49 +0,0 @@
1
- export const sentinelProvenanceClauses = [
2
- "Completed-CI repository, workflow, run ID and attempt, SHA, and artifact-name fields are workflow-recorded, self-asserted metadata, not an external attestation.",
3
- "The self-asserted repository field names the canonical upstream changeroa/StyleGallery; the self-asserted execution_repository field names the actual GitHub Actions repository and is limited to changeroa/StyleGallery or ark-jo/StyleGallery.",
4
- "The committed calibration's external_verification object records an independently checked GitHub Actions run and artifact API identity; artifact.api_digest is distinct from committed_ci.raw_evidence_sha256.",
5
- "Future CI aggregates remain awaiting_external_verification until their uploaded artifact API identity is independently checked.",
6
- "Linux/amd64 repeatability is externally verified only for committed run 29260372260; it does not establish baseline-owner approval or product suitability.",
7
- "Baseline-owner approval remains unclaimed until the named owner explicitly approves it.",
8
- "Synthetic fixtures validate rejection and acceptance behavior only; they are not authenticated provenance.",
9
- ];
10
-
11
- export const requiredCodeowners = [
12
- "* @changeroa",
13
- "/GOVERNANCE.md @changeroa",
14
- "/README.md @changeroa",
15
- "/index.md @changeroa",
16
- "/AGENTS.md @changeroa",
17
- "/DOMAINS.md @changeroa",
18
- "/layout/ @changeroa",
19
- "/motion/ @changeroa",
20
- "/design-engineering/ @changeroa",
21
- "/game-ui/ @changeroa",
22
- "/platform-guides/ @changeroa",
23
- "/consumer-reference/ @changeroa",
24
- "/consumer-reference/baselines/ @changeroa",
25
- "/consumer-reference/policies/ @changeroa",
26
- "/consumer-reference/fixtures/promotion/ @changeroa",
27
- "/consumer-reference/schema/promotion-rfc.schema.json @changeroa",
28
- "/tests/ @changeroa",
29
- "/playwright.config.mjs @changeroa",
30
- "/GUIDE.md @changeroa",
31
- "/guides/ @changeroa",
32
- "/recipes/ @changeroa",
33
- "/quality/ @changeroa",
34
- "/scripts/pattern-data.mjs @changeroa",
35
- "/scripts/generate-patterns.mjs @changeroa",
36
- "/patterns/ @changeroa",
37
- "/CATALOG.md @changeroa",
38
- "/.github/workflows/validate.yml @changeroa",
39
- "/.github/ @changeroa",
40
- "/scripts/ @changeroa",
41
- "/scripts/validate-*.mjs @changeroa",
42
- "/scripts/test-validate-*.mjs @changeroa",
43
- ];
44
-
45
- export const immutableActionPins = [
46
- "uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4",
47
- "uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4",
48
- "uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4",
49
- ];