@ryuenn3123/agentic-senior-core 3.0.49 → 4.0.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/.agent-context/prompts/bootstrap-design.md +2 -1
- package/.agent-context/review-checklists/pr-checklist.md +1 -0
- package/.agent-context/rules/api-docs.md +63 -45
- package/.agent-context/rules/architecture.md +133 -118
- package/.agent-context/rules/database-design.md +36 -16
- package/.agent-context/rules/docker-runtime.md +66 -43
- package/.agent-context/rules/efficiency-vs-hype.md +38 -17
- package/.agent-context/rules/error-handling.md +35 -14
- package/.agent-context/rules/event-driven.md +35 -18
- package/.agent-context/rules/frontend-architecture.md +103 -74
- package/.agent-context/rules/git-workflow.md +81 -197
- package/.agent-context/rules/microservices.md +42 -41
- package/.agent-context/rules/naming-conv.md +27 -6
- package/.agent-context/rules/performance.md +32 -10
- package/.agent-context/rules/realtime.md +26 -9
- package/.agent-context/rules/security.md +39 -19
- package/.agent-context/rules/testing.md +36 -15
- package/AGENTS.md +9 -9
- package/README.md +10 -1
- package/lib/cli/commands/init.mjs +1 -0
- package/lib/cli/compiler.mjs +1 -0
- package/lib/cli/detector/constants.mjs +135 -0
- package/lib/cli/detector/design-evidence/collector.mjs +256 -0
- package/lib/cli/detector/design-evidence/constants.mjs +39 -0
- package/lib/cli/detector/design-evidence/file-traversal.mjs +83 -0
- package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +117 -0
- package/lib/cli/detector/design-evidence/summary.mjs +109 -0
- package/lib/cli/detector/design-evidence/utility-helpers.mjs +122 -0
- package/lib/cli/detector/design-evidence.mjs +25 -610
- package/lib/cli/detector/stack-detection.mjs +243 -0
- package/lib/cli/detector/ui-signals.mjs +150 -0
- package/lib/cli/detector/workspace-scan.mjs +177 -0
- package/lib/cli/detector.mjs +20 -688
- package/lib/cli/memory-continuity.mjs +1 -0
- package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +96 -0
- package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +116 -0
- package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +211 -0
- package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +79 -0
- package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +64 -0
- package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +222 -0
- package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +117 -0
- package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +83 -0
- package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +328 -0
- package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +8 -0
- package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +79 -0
- package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +256 -0
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +59 -896
- package/lib/cli/project-scaffolder/design-contract.mjs +147 -557
- package/mcp.json +30 -9
- package/package.json +17 -2
- package/scripts/audit-cache-layer-contract.mjs +258 -0
- package/scripts/audit-caching-scope-hygiene.mjs +263 -0
- package/scripts/audit-file-size.mjs +219 -0
- package/scripts/audit-reflection-citations.mjs +163 -0
- package/scripts/audit-release-bundle.mjs +170 -0
- package/scripts/audit-rule-id-uniqueness.mjs +313 -0
- package/scripts/benchmark-evidence-bundle.mjs +1 -0
- package/scripts/build-release-benchmark-bundle.mjs +204 -0
- package/scripts/context-triggered-audit.mjs +1 -0
- package/scripts/documentation-boundary-audit.mjs +1 -0
- package/scripts/explain-on-demand-audit.mjs +2 -1
- package/scripts/frontend-usability-audit.mjs +10 -10
- package/scripts/llm-judge/checklist-loader.mjs +45 -0
- package/scripts/llm-judge/constants.mjs +66 -0
- package/scripts/llm-judge/diff-collection.mjs +74 -0
- package/scripts/llm-judge/prompting.mjs +78 -0
- package/scripts/llm-judge/providers.mjs +111 -0
- package/scripts/llm-judge/verdict.mjs +134 -0
- package/scripts/llm-judge.mjs +21 -482
- package/scripts/mcp-server/tool-registry.mjs +55 -0
- package/scripts/mcp-server/tools.mjs +137 -1
- package/scripts/migrate-rule-format/id-prefix-table.mjs +37 -0
- package/scripts/migrate-rule-format/parse-legacy.mjs +180 -0
- package/scripts/migrate-rule-format/render-new.mjs +169 -0
- package/scripts/migrate-rule-format/roundtrip-validate.mjs +89 -0
- package/scripts/migrate-rule-format.mjs +192 -0
- package/scripts/release-gate/constants.mjs +1 -1
- package/scripts/release-gate/static-checks.mjs +1 -1
- package/scripts/rules-guardian-audit.mjs +5 -2
- package/scripts/single-source-lazy-loading-audit.mjs +2 -1
- package/scripts/ui-design-judge/git-input.mjs +3 -0
- package/scripts/validate/config.mjs +3 -2
- package/scripts/validate/coverage-checks.mjs +1 -1
- package/scripts/validate.mjs +93 -1
|
@@ -1,83 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
hasNonEmptyString(derivedTokenLogic.validationRule)
|
|
43
|
-
&& !derivedTokenLogic.validationRule.includes('anchorReference')
|
|
44
|
-
) {
|
|
45
|
-
validationIssues.push('designIntent.derivedTokenLogic.validationRule must require traceability to anchorReference.');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!['verified', 'pending-verification', 'no-external-library-needed'].includes(designIntentContract?.libraryResearchStatus)) {
|
|
50
|
-
validationIssues.push('designIntent.libraryResearchStatus must be verified, pending-verification, or no-external-library-needed.');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (!Array.isArray(libraryDecisions)) {
|
|
54
|
-
validationIssues.push('designIntent.libraryDecisions must be an array.');
|
|
55
|
-
} else {
|
|
56
|
-
for (const [libraryIndex, libraryDecision] of libraryDecisions.entries()) {
|
|
57
|
-
if (!libraryDecision || typeof libraryDecision !== 'object') {
|
|
58
|
-
validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}] must be an object.`);
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (!hasNonEmptyString(libraryDecision.library)) {
|
|
63
|
-
validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}].library must be a non-empty string.`);
|
|
64
|
-
}
|
|
65
|
-
if (!hasNonEmptyString(libraryDecision.purpose)) {
|
|
66
|
-
validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}].purpose must be a non-empty string.`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const hasVerification = hasNonEmptyString(libraryDecision.verifiedAt)
|
|
70
|
-
&& hasNonEmptyString(libraryDecision.sourceUrl);
|
|
71
|
-
const hasFallback = hasNonEmptyString(libraryDecision.fallbackIfUnavailable);
|
|
72
|
-
|
|
73
|
-
if (!hasVerification && !hasFallback) {
|
|
74
|
-
validationIssues.push(`designIntent.libraryDecisions[${libraryIndex}] must either record verification source or provide fallbackIfUnavailable.`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return validationIssues;
|
|
80
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Design intent contract validators. Composed from focused sub-modules under
|
|
3
|
+
* `validation/` so each validation domain (anchor, audits, execution handoff,
|
|
4
|
+
* structural systems) can be reviewed in isolation.
|
|
5
|
+
*
|
|
6
|
+
* Public exports preserve the original surface:
|
|
7
|
+
* validateDesignContractCompleteness — incremental shape check used by seeds
|
|
8
|
+
* validateDesignIntentContract — full sequential validation pipeline
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { validateDesignContractCompleteness } from './validation/completeness.mjs';
|
|
12
|
+
import {
|
|
13
|
+
validateDesignFlexibilityPolicy,
|
|
14
|
+
validateExternalResearchIntake,
|
|
15
|
+
validateModeAndProjectShape,
|
|
16
|
+
} from './validation/structural-validators.mjs';
|
|
17
|
+
import {
|
|
18
|
+
validateConceptualAnchor,
|
|
19
|
+
validateMathSystems,
|
|
20
|
+
} from './validation/anchor-validators.mjs';
|
|
21
|
+
import {
|
|
22
|
+
validateAiSafeUiAudit,
|
|
23
|
+
validateProductionContentPolicy,
|
|
24
|
+
} from './validation/audit-validators.mjs';
|
|
25
|
+
import {
|
|
26
|
+
validateAccessibilityPolicy,
|
|
27
|
+
validateColorTruth,
|
|
28
|
+
validateComponentMorphology,
|
|
29
|
+
validateContextHygiene,
|
|
30
|
+
validateCrossViewportAdaptation,
|
|
31
|
+
validateMotionSystem,
|
|
32
|
+
validateTokenSystem,
|
|
33
|
+
} from './validation/system-validators.mjs';
|
|
34
|
+
import {
|
|
35
|
+
validateDesignExecutionHandoff,
|
|
36
|
+
validateDesignExecutionPolicy,
|
|
37
|
+
validateRequiredSectionsAndForbiddenPatterns,
|
|
38
|
+
validateReviewRubric,
|
|
39
|
+
} from './validation/execution-validators.mjs';
|
|
40
|
+
|
|
41
|
+
export { validateDesignContractCompleteness };
|
|
81
42
|
|
|
82
43
|
export function validateDesignIntentContract(designIntentContract) {
|
|
83
44
|
const validationErrors = [];
|
|
@@ -88,822 +49,24 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
88
49
|
|
|
89
50
|
validationErrors.push(...validateDesignContractCompleteness(designIntentContract));
|
|
90
51
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (designIntentContract.externalResearchIntake.requireOfficialDocsVerificationForTechnologyClaims !== true) {
|
|
110
|
-
validationErrors.push('designIntent.externalResearchIntake.requireOfficialDocsVerificationForTechnologyClaims must equal true.');
|
|
111
|
-
}
|
|
112
|
-
if (
|
|
113
|
-
!Array.isArray(designIntentContract.externalResearchIntake.candidateDomains)
|
|
114
|
-
|| !designIntentContract.externalResearchIntake.candidateDomains.includes('motion-and-scroll')
|
|
115
|
-
) {
|
|
116
|
-
validationErrors.push('designIntent.externalResearchIntake.candidateDomains must include motion-and-scroll.');
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (!designIntentContract.designFlexibilityPolicy || typeof designIntentContract.designFlexibilityPolicy !== 'object') {
|
|
121
|
-
validationErrors.push('designIntent.designFlexibilityPolicy must exist.');
|
|
122
|
-
} else {
|
|
123
|
-
const designFlexibilityPolicy = designIntentContract.designFlexibilityPolicy;
|
|
124
|
-
if (designFlexibilityPolicy.mode !== 'locked-outcomes-flexible-expression') {
|
|
125
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.mode must equal "locked-outcomes-flexible-expression".');
|
|
126
|
-
}
|
|
127
|
-
if (!hasNonEmptyString(designFlexibilityPolicy.contractRole)) {
|
|
128
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.contractRole must be a non-empty string.');
|
|
129
|
-
}
|
|
130
|
-
if (!Array.isArray(designFlexibilityPolicy.lockedOutcomeTypes) || designFlexibilityPolicy.lockedOutcomeTypes.length < 4) {
|
|
131
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.lockedOutcomeTypes must list the locked outcome categories.');
|
|
132
|
-
}
|
|
133
|
-
if (!Array.isArray(designFlexibilityPolicy.flexibleExpressionAxes) || designFlexibilityPolicy.flexibleExpressionAxes.length < 4) {
|
|
134
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.flexibleExpressionAxes must list flexible expression axes.');
|
|
135
|
-
}
|
|
136
|
-
if (!hasNonEmptyString(designFlexibilityPolicy.tokenLockingRule)) {
|
|
137
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.tokenLockingRule must be a non-empty string.');
|
|
138
|
-
}
|
|
139
|
-
if (!String(designFlexibilityPolicy.signatureMovePolicy || '').includes('candidate')) {
|
|
140
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.signatureMovePolicy must separate candidate moves from required outcomes.');
|
|
141
|
-
}
|
|
142
|
-
if (!String(designFlexibilityPolicy.libraryVisualLanguagePolicy || '').includes('Libraries supply')) {
|
|
143
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.libraryVisualLanguagePolicy must keep libraries from dictating visual language.');
|
|
144
|
-
}
|
|
145
|
-
if (!String(designFlexibilityPolicy.literalAnchorPolicy || '').includes('Translate anchors')) {
|
|
146
|
-
validationErrors.push('designIntent.designFlexibilityPolicy.literalAnchorPolicy must require non-literal anchor translation.');
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (!designIntentContract.conceptualAnchor || typeof designIntentContract.conceptualAnchor !== 'object') {
|
|
151
|
-
validationErrors.push('designIntent.conceptualAnchor must exist.');
|
|
152
|
-
} else {
|
|
153
|
-
const conceptualAnchor = designIntentContract.conceptualAnchor;
|
|
154
|
-
if (conceptualAnchor.mode !== 'required-when-no-external-research') {
|
|
155
|
-
validationErrors.push('designIntent.conceptualAnchor.mode must equal "required-when-no-external-research".');
|
|
156
|
-
}
|
|
157
|
-
if (conceptualAnchor.seedMode !== 'selection-policy-only') {
|
|
158
|
-
validationErrors.push('designIntent.conceptualAnchor.seedMode must equal "selection-policy-only".');
|
|
159
|
-
}
|
|
160
|
-
if (conceptualAnchor.requiresAgentSelectionBeforeUiImplementation !== true) {
|
|
161
|
-
validationErrors.push('designIntent.conceptualAnchor.requiresAgentSelectionBeforeUiImplementation must equal true.');
|
|
162
|
-
}
|
|
163
|
-
if (!hasNonEmptyString(conceptualAnchor.anchorReference)) {
|
|
164
|
-
validationErrors.push('designIntent.conceptualAnchor.anchorReference must be a stable non-empty ID.');
|
|
165
|
-
}
|
|
166
|
-
const userResearchAbsencePolicy = conceptualAnchor.userResearchAbsencePolicy;
|
|
167
|
-
if (!userResearchAbsencePolicy || typeof userResearchAbsencePolicy !== 'object') {
|
|
168
|
-
validationErrors.push('designIntent.conceptualAnchor.userResearchAbsencePolicy must exist.');
|
|
169
|
-
} else {
|
|
170
|
-
if (userResearchAbsencePolicy.userSuppliedResearchOnly !== true) {
|
|
171
|
-
validationErrors.push('designIntent.conceptualAnchor.userResearchAbsencePolicy.userSuppliedResearchOnly must equal true.');
|
|
172
|
-
}
|
|
173
|
-
if (userResearchAbsencePolicy.scaffoldSeedDoesNotCountAsResearch !== true) {
|
|
174
|
-
validationErrors.push('designIntent.conceptualAnchor.userResearchAbsencePolicy.scaffoldSeedDoesNotCountAsResearch must equal true.');
|
|
175
|
-
}
|
|
176
|
-
if (userResearchAbsencePolicy.priorUiDoesNotCountAsResearch !== true) {
|
|
177
|
-
validationErrors.push('designIntent.conceptualAnchor.userResearchAbsencePolicy.priorUiDoesNotCountAsResearch must equal true.');
|
|
178
|
-
}
|
|
179
|
-
if (userResearchAbsencePolicy.requireAgentLedResearchWhenAvailable !== true) {
|
|
180
|
-
validationErrors.push('designIntent.conceptualAnchor.userResearchAbsencePolicy.requireAgentLedResearchWhenAvailable must equal true.');
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
const candidateSelectionPolicy = conceptualAnchor.candidateSelectionPolicy;
|
|
184
|
-
if (!candidateSelectionPolicy || typeof candidateSelectionPolicy !== 'object') {
|
|
185
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy must exist.');
|
|
186
|
-
} else {
|
|
187
|
-
if (candidateSelectionPolicy.considerAtLeast < 3) {
|
|
188
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.considerAtLeast must be at least 3.');
|
|
189
|
-
}
|
|
190
|
-
if (candidateSelectionPolicy.discardObviousCandidateCount < 2) {
|
|
191
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.discardObviousCandidateCount must be at least 2.');
|
|
192
|
-
}
|
|
193
|
-
if (candidateSelectionPolicy.minimumCandidateDistance !== 'high') {
|
|
194
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.minimumCandidateDistance must equal "high".');
|
|
195
|
-
}
|
|
196
|
-
if (candidateSelectionPolicy.discardPredictableCandidates !== true) {
|
|
197
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.discardPredictableCandidates must equal true.');
|
|
198
|
-
}
|
|
199
|
-
if (candidateSelectionPolicy.preferDistinctiveOverSafe !== true) {
|
|
200
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.preferDistinctiveOverSafe must equal true.');
|
|
201
|
-
}
|
|
202
|
-
if (candidateSelectionPolicy.doNotRevealHiddenCandidateList !== true) {
|
|
203
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.doNotRevealHiddenCandidateList must equal true.');
|
|
204
|
-
}
|
|
205
|
-
if (candidateSelectionPolicy.outputOnlyChosenAnchor !== true) {
|
|
206
|
-
validationErrors.push('designIntent.conceptualAnchor.candidateSelectionPolicy.outputOnlyChosenAnchor must equal true.');
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
const creativeCommitmentPolicy = conceptualAnchor.creativeCommitmentPolicy;
|
|
210
|
-
if (!creativeCommitmentPolicy || typeof creativeCommitmentPolicy !== 'object') {
|
|
211
|
-
validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy must exist.');
|
|
212
|
-
} else {
|
|
213
|
-
if (creativeCommitmentPolicy.requiredBeforeComplianceReview !== true) {
|
|
214
|
-
validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.requiredBeforeComplianceReview must equal true.');
|
|
215
|
-
}
|
|
216
|
-
if (creativeCommitmentPolicy.recordInDesignDocs !== true) {
|
|
217
|
-
validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.recordInDesignDocs must equal true.');
|
|
218
|
-
}
|
|
219
|
-
if (
|
|
220
|
-
!Array.isArray(creativeCommitmentPolicy.requiredCommitmentFields)
|
|
221
|
-
|| !creativeCommitmentPolicy.requiredCommitmentFields.includes('specificReferencePoint')
|
|
222
|
-
|| !creativeCommitmentPolicy.requiredCommitmentFields.includes('signatureMotion')
|
|
223
|
-
|| !creativeCommitmentPolicy.requiredCommitmentFields.includes('typographicDecision')
|
|
224
|
-
) {
|
|
225
|
-
validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.requiredCommitmentFields must include specificReferencePoint, signatureMotion, and typographicDecision.');
|
|
226
|
-
}
|
|
227
|
-
if (creativeCommitmentPolicy.rejectGenericQualityWordsOnly !== true) {
|
|
228
|
-
validationErrors.push('designIntent.conceptualAnchor.creativeCommitmentPolicy.rejectGenericQualityWordsOnly must equal true.');
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (
|
|
232
|
-
!Array.isArray(conceptualAnchor.forbiddenFinalAnchorTerms)
|
|
233
|
-
|| !conceptualAnchor.forbiddenFinalAnchorTerms.includes('dashboard')
|
|
234
|
-
|| !conceptualAnchor.forbiddenFinalAnchorTerms.includes('cards')
|
|
235
|
-
|| !conceptualAnchor.forbiddenFinalAnchorTerms.includes('safe-admin-layout')
|
|
236
|
-
) {
|
|
237
|
-
validationErrors.push('designIntent.conceptualAnchor.forbiddenFinalAnchorTerms must reject basic UI labels.');
|
|
238
|
-
}
|
|
239
|
-
if (
|
|
240
|
-
!Array.isArray(conceptualAnchor.sourceDomains)
|
|
241
|
-
|| conceptualAnchor.sourceDomains.length < 4
|
|
242
|
-
|| !conceptualAnchor.sourceDomains.includes('complex-physical-engineering')
|
|
243
|
-
|| !conceptualAnchor.sourceDomains.includes('cinematic-behavior-and-transition-systems')
|
|
244
|
-
|| !conceptualAnchor.sourceDomains.includes('workflow-and-custody-systems')
|
|
245
|
-
|| !conceptualAnchor.sourceDomains.includes('premium-interactive-web-experiences')
|
|
246
|
-
) {
|
|
247
|
-
validationErrors.push('designIntent.conceptualAnchor.sourceDomains must list broad non-template anchor domains.');
|
|
248
|
-
}
|
|
249
|
-
const visualRiskBudget = conceptualAnchor.visualRiskBudget;
|
|
250
|
-
if (!visualRiskBudget || typeof visualRiskBudget !== 'object') {
|
|
251
|
-
validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget must exist.');
|
|
252
|
-
} else {
|
|
253
|
-
if (visualRiskBudget.mode !== 'high-distinctiveness-with-accessibility-and-performance-guardrails') {
|
|
254
|
-
validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget.mode must preserve high-distinctiveness guardrails.');
|
|
255
|
-
}
|
|
256
|
-
if (visualRiskBudget.allowRichMotionAndMicroInteraction !== true) {
|
|
257
|
-
validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget.allowRichMotionAndMicroInteraction must equal true.');
|
|
258
|
-
}
|
|
259
|
-
if (visualRiskBudget.rejectTimidDefaultWhenAnchorSupportsExpressiveUi !== true) {
|
|
260
|
-
validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget.rejectTimidDefaultWhenAnchorSupportsExpressiveUi must equal true.');
|
|
261
|
-
}
|
|
262
|
-
if (visualRiskBudget.requireReducedMotionFallback !== true) {
|
|
263
|
-
validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget.requireReducedMotionFallback must equal true.');
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
const literalTranslationPolicy = conceptualAnchor.literalTranslationPolicy;
|
|
267
|
-
if (!literalTranslationPolicy || typeof literalTranslationPolicy !== 'object') {
|
|
268
|
-
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy must exist.');
|
|
269
|
-
} else {
|
|
270
|
-
if (literalTranslationPolicy.preferNonLiteralTranslation !== true) {
|
|
271
|
-
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.preferNonLiteralTranslation must equal true.');
|
|
272
|
-
}
|
|
273
|
-
if (!hasNonEmptyString(literalTranslationPolicy.allowedLiteralUse)) {
|
|
274
|
-
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.allowedLiteralUse must be a non-empty string.');
|
|
275
|
-
}
|
|
276
|
-
if (!String(literalTranslationPolicy.forbiddenLiteralUse || '').includes('decorative wallpaper')) {
|
|
277
|
-
validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.forbiddenLiteralUse must reject decorative wallpaper.');
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
if (
|
|
281
|
-
!Array.isArray(conceptualAnchor.requiredDerivedAxes)
|
|
282
|
-
|| !conceptualAnchor.requiredDerivedAxes.includes('typography')
|
|
283
|
-
|| !conceptualAnchor.requiredDerivedAxes.includes('responsive-composition')
|
|
284
|
-
) {
|
|
285
|
-
validationErrors.push('designIntent.conceptualAnchor.requiredDerivedAxes must include typography and responsive-composition.');
|
|
286
|
-
}
|
|
287
|
-
const finalAnchorContract = conceptualAnchor.finalAnchorContract;
|
|
288
|
-
if (!finalAnchorContract || typeof finalAnchorContract !== 'object') {
|
|
289
|
-
validationErrors.push('designIntent.conceptualAnchor.finalAnchorContract must exist.');
|
|
290
|
-
} else {
|
|
291
|
-
if (
|
|
292
|
-
!Array.isArray(finalAnchorContract.requiredFields)
|
|
293
|
-
|| !finalAnchorContract.requiredFields.includes('anchorReference')
|
|
294
|
-
|| !finalAnchorContract.requiredFields.includes('agentResearchMode')
|
|
295
|
-
|| !finalAnchorContract.requiredFields.includes('specificReferencePoint')
|
|
296
|
-
|| !finalAnchorContract.requiredFields.includes('signatureMotion')
|
|
297
|
-
|| !finalAnchorContract.requiredFields.includes('typographicDecision')
|
|
298
|
-
|| !finalAnchorContract.requiredFields.includes('derivedTokenLogic')
|
|
299
|
-
|| !finalAnchorContract.requiredFields.includes('visualRiskBudget')
|
|
300
|
-
|| !finalAnchorContract.requiredFields.includes('motionRiskBudget')
|
|
301
|
-
|| !finalAnchorContract.requiredFields.includes('cohesionChecks')
|
|
302
|
-
) {
|
|
303
|
-
validationErrors.push('designIntent.conceptualAnchor.finalAnchorContract.requiredFields must require anchorReference, agentResearchMode, specificReferencePoint, signatureMotion, typographicDecision, derivedTokenLogic, visualRiskBudget, motionRiskBudget, and cohesionChecks.');
|
|
304
|
-
}
|
|
305
|
-
if (
|
|
306
|
-
!Array.isArray(finalAnchorContract.derivedTokenLogicAxes)
|
|
307
|
-
|| !finalAnchorContract.derivedTokenLogicAxes.includes('motion')
|
|
308
|
-
|| !finalAnchorContract.derivedTokenLogicAxes.includes('morphology')
|
|
309
|
-
) {
|
|
310
|
-
validationErrors.push('designIntent.conceptualAnchor.finalAnchorContract.derivedTokenLogicAxes must include motion and morphology.');
|
|
311
|
-
}
|
|
312
|
-
if (
|
|
313
|
-
!Array.isArray(finalAnchorContract.cohesionChecks)
|
|
314
|
-
|| !finalAnchorContract.cohesionChecks.includes('no-dashboard-mental-model')
|
|
315
|
-
|| !finalAnchorContract.cohesionChecks.includes('motion-derived-from-anchor')
|
|
316
|
-
) {
|
|
317
|
-
validationErrors.push('designIntent.conceptualAnchor.finalAnchorContract.cohesionChecks must reject dashboard mental models and require motion derivation.');
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
if (!designIntentContract.mathSystems || typeof designIntentContract.mathSystems !== 'object') {
|
|
323
|
-
validationErrors.push('designIntent.mathSystems must exist.');
|
|
324
|
-
} else {
|
|
325
|
-
if (!String(designIntentContract.mathSystems.typographyScaleRatio || '').trim()) {
|
|
326
|
-
validationErrors.push('designIntent.mathSystems.typographyScaleRatio must describe the chosen or pending type scale decision.');
|
|
327
|
-
}
|
|
328
|
-
if (!String(designIntentContract.mathSystems.baseGridUnit || '').trim()) {
|
|
329
|
-
validationErrors.push('designIntent.mathSystems.baseGridUnit must describe the chosen or pending spacing grid decision.');
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
if (!designIntentContract.aiSafeUiAudit || typeof designIntentContract.aiSafeUiAudit !== 'object') {
|
|
334
|
-
validationErrors.push('designIntent.aiSafeUiAudit must exist.');
|
|
335
|
-
} else {
|
|
336
|
-
const aiSafeUiAudit = designIntentContract.aiSafeUiAudit;
|
|
337
|
-
if (aiSafeUiAudit.status !== 'agent-must-complete-before-ui-implementation') {
|
|
338
|
-
validationErrors.push('designIntent.aiSafeUiAudit.status must require completion before UI implementation.');
|
|
339
|
-
}
|
|
340
|
-
if (!String(aiSafeUiAudit.failureDefinition || '').includes('AI-safe')) {
|
|
341
|
-
validationErrors.push('designIntent.aiSafeUiAudit.failureDefinition must define AI-safe UI drift.');
|
|
342
|
-
}
|
|
343
|
-
if (!String(aiSafeUiAudit.failureDefinition || '').includes('placeholder copy')) {
|
|
344
|
-
validationErrors.push('designIntent.aiSafeUiAudit.failureDefinition must reject test/demo/placeholder UI copy.');
|
|
345
|
-
}
|
|
346
|
-
if (!String(aiSafeUiAudit.interchangeabilityTest || '').includes('renamed')) {
|
|
347
|
-
validationErrors.push('designIntent.aiSafeUiAudit.interchangeabilityTest must include the rename/interchangeability test.');
|
|
348
|
-
}
|
|
349
|
-
if (!Array.isArray(aiSafeUiAudit.requiredProductSpecificSignals) || aiSafeUiAudit.requiredProductSpecificSignals.length < 3) {
|
|
350
|
-
validationErrors.push('designIntent.aiSafeUiAudit.requiredProductSpecificSignals must list at least three product-specific signals.');
|
|
351
|
-
}
|
|
352
|
-
if (!String(aiSafeUiAudit.paletteExplorationRule || '').trim()) {
|
|
353
|
-
validationErrors.push('designIntent.aiSafeUiAudit.paletteExplorationRule must be a non-empty string.');
|
|
354
|
-
}
|
|
355
|
-
if (!String(aiSafeUiAudit.backgroundPatternRule || '').trim()) {
|
|
356
|
-
validationErrors.push('designIntent.aiSafeUiAudit.backgroundPatternRule must be a non-empty string.');
|
|
357
|
-
}
|
|
358
|
-
if (!aiSafeUiAudit.aiColorAudit || typeof aiSafeUiAudit.aiColorAudit !== 'object') {
|
|
359
|
-
validationErrors.push('designIntent.aiSafeUiAudit.aiColorAudit must exist.');
|
|
360
|
-
} else {
|
|
361
|
-
if (aiSafeUiAudit.aiColorAudit.status !== 'agent-must-complete-before-ui-implementation') {
|
|
362
|
-
validationErrors.push('designIntent.aiSafeUiAudit.aiColorAudit.status must require completion before UI implementation.');
|
|
363
|
-
}
|
|
364
|
-
if (!String(aiSafeUiAudit.aiColorAudit.failureDefinition || '').includes('AI color')) {
|
|
365
|
-
validationErrors.push('designIntent.aiSafeUiAudit.aiColorAudit.failureDefinition must define AI color drift.');
|
|
366
|
-
}
|
|
367
|
-
if (!Array.isArray(aiSafeUiAudit.aiColorAudit.autopilotRisks) || aiSafeUiAudit.aiColorAudit.autopilotRisks.length < 4) {
|
|
368
|
-
validationErrors.push('designIntent.aiSafeUiAudit.aiColorAudit.autopilotRisks must list common autopilot palettes.');
|
|
369
|
-
}
|
|
370
|
-
if (!Array.isArray(aiSafeUiAudit.aiColorAudit.requiredEvidence) || aiSafeUiAudit.aiColorAudit.requiredEvidence.length < 3) {
|
|
371
|
-
validationErrors.push('designIntent.aiSafeUiAudit.aiColorAudit.requiredEvidence must list color evidence requirements.');
|
|
372
|
-
}
|
|
373
|
-
if (!String(aiSafeUiAudit.aiColorAudit.reviewQuestion || '').trim()) {
|
|
374
|
-
validationErrors.push('designIntent.aiSafeUiAudit.aiColorAudit.reviewQuestion must be a non-empty string.');
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
if (!aiSafeUiAudit.motionSpatialCourageAudit || typeof aiSafeUiAudit.motionSpatialCourageAudit !== 'object') {
|
|
378
|
-
validationErrors.push('designIntent.aiSafeUiAudit.motionSpatialCourageAudit must exist.');
|
|
379
|
-
} else {
|
|
380
|
-
if (aiSafeUiAudit.motionSpatialCourageAudit.status !== 'agent-must-complete-before-ui-implementation') {
|
|
381
|
-
validationErrors.push('designIntent.aiSafeUiAudit.motionSpatialCourageAudit.status must require completion before UI implementation.');
|
|
382
|
-
}
|
|
383
|
-
if (!String(aiSafeUiAudit.motionSpatialCourageAudit.defaultStance || '').includes('first-class options')) {
|
|
384
|
-
validationErrors.push('designIntent.aiSafeUiAudit.motionSpatialCourageAudit.defaultStance must treat motion and spatial UI as first-class options.');
|
|
385
|
-
}
|
|
386
|
-
if (!Array.isArray(aiSafeUiAudit.motionSpatialCourageAudit.requiredDecisionFields) || aiSafeUiAudit.motionSpatialCourageAudit.requiredDecisionFields.length < 3) {
|
|
387
|
-
validationErrors.push('designIntent.aiSafeUiAudit.motionSpatialCourageAudit.requiredDecisionFields must list required motion/spatial decisions.');
|
|
388
|
-
}
|
|
389
|
-
if (!String(aiSafeUiAudit.motionSpatialCourageAudit.rejectionRule || '').includes('product reason')) {
|
|
390
|
-
validationErrors.push('designIntent.aiSafeUiAudit.motionSpatialCourageAudit.rejectionRule must require a product reason before omitting spatial UI.');
|
|
391
|
-
}
|
|
392
|
-
if (!String(aiSafeUiAudit.motionSpatialCourageAudit.reviewQuestion || '').trim()) {
|
|
393
|
-
validationErrors.push('designIntent.aiSafeUiAudit.motionSpatialCourageAudit.reviewQuestion must be a non-empty string.');
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
if (!String(aiSafeUiAudit.reviewQuestion || '').trim()) {
|
|
397
|
-
validationErrors.push('designIntent.aiSafeUiAudit.reviewQuestion must be a non-empty string.');
|
|
398
|
-
}
|
|
399
|
-
if (aiSafeUiAudit.blockingByDefault !== true) {
|
|
400
|
-
validationErrors.push('designIntent.aiSafeUiAudit.blockingByDefault must equal true.');
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
if (!designIntentContract.productionContentPolicy || typeof designIntentContract.productionContentPolicy !== 'object') {
|
|
405
|
-
validationErrors.push('designIntent.productionContentPolicy must exist.');
|
|
406
|
-
} else {
|
|
407
|
-
const productionContentPolicy = designIntentContract.productionContentPolicy;
|
|
408
|
-
if (productionContentPolicy.status !== 'agent-must-complete-before-ui-implementation') {
|
|
409
|
-
validationErrors.push('designIntent.productionContentPolicy.status must require completion before UI implementation.');
|
|
410
|
-
}
|
|
411
|
-
if (!String(productionContentPolicy.userFacingCopyRule || '').includes('testing')) {
|
|
412
|
-
validationErrors.push('designIntent.productionContentPolicy.userFacingCopyRule must reject testing/demo/placeholder UI copy.');
|
|
413
|
-
}
|
|
414
|
-
if (!String(productionContentPolicy.terminalDependencyRule || '').includes('Terminal commands')) {
|
|
415
|
-
validationErrors.push('designIntent.productionContentPolicy.terminalDependencyRule must keep terminal commands out of core UI flows.');
|
|
416
|
-
}
|
|
417
|
-
if (!Array.isArray(productionContentPolicy.allowedExceptions) || productionContentPolicy.allowedExceptions.length < 3) {
|
|
418
|
-
validationErrors.push('designIntent.productionContentPolicy.allowedExceptions must list limited exceptions.');
|
|
419
|
-
}
|
|
420
|
-
if (productionContentPolicy.blockingByDefault !== true) {
|
|
421
|
-
validationErrors.push('designIntent.productionContentPolicy.blockingByDefault must equal true.');
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if (!designIntentContract.tokenSystem || typeof designIntentContract.tokenSystem !== 'object') {
|
|
426
|
-
validationErrors.push('designIntent.tokenSystem must exist.');
|
|
427
|
-
} else {
|
|
428
|
-
const taxonomyOrder = designIntentContract.tokenSystem.taxonomyOrder;
|
|
429
|
-
if (!Array.isArray(taxonomyOrder) || taxonomyOrder.join('|') !== 'primitive|semantic|component') {
|
|
430
|
-
validationErrors.push('designIntent.tokenSystem.taxonomyOrder must equal ["primitive","semantic","component"].');
|
|
431
|
-
}
|
|
432
|
-
if (designIntentContract.tokenSystem.primitiveColorSpace !== 'OKLCH') {
|
|
433
|
-
validationErrors.push('designIntent.tokenSystem.primitiveColorSpace must equal "OKLCH".');
|
|
434
|
-
}
|
|
435
|
-
if (designIntentContract.tokenSystem.requireSemanticAliases !== true) {
|
|
436
|
-
validationErrors.push('designIntent.tokenSystem.requireSemanticAliases must equal true.');
|
|
437
|
-
}
|
|
438
|
-
if (designIntentContract.tokenSystem.semanticAliasesMutableWithoutComponentRewrite !== true) {
|
|
439
|
-
validationErrors.push('designIntent.tokenSystem.semanticAliasesMutableWithoutComponentRewrite must equal true.');
|
|
440
|
-
}
|
|
441
|
-
if (designIntentContract.tokenSystem.componentTokensConsumeSemantic !== true) {
|
|
442
|
-
validationErrors.push('designIntent.tokenSystem.componentTokensConsumeSemantic must equal true.');
|
|
443
|
-
}
|
|
444
|
-
const tokenLockingPolicy = designIntentContract.tokenSystem.tokenLockingPolicy;
|
|
445
|
-
if (!tokenLockingPolicy || typeof tokenLockingPolicy !== 'object') {
|
|
446
|
-
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy must exist.');
|
|
447
|
-
} else {
|
|
448
|
-
if (tokenLockingPolicy.defaultLockState !== 'semantic-roles-locked-primitives-flexible') {
|
|
449
|
-
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.defaultLockState must preserve semantic roles while keeping primitives flexible.');
|
|
450
|
-
}
|
|
451
|
-
if (!Array.isArray(tokenLockingPolicy.flexibleByDefault) || tokenLockingPolicy.flexibleByDefault.length < 4) {
|
|
452
|
-
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.flexibleByDefault must list flexible primitive axes.');
|
|
453
|
-
}
|
|
454
|
-
if (!hasNonEmptyString(tokenLockingPolicy.promotionRule)) {
|
|
455
|
-
validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.promotionRule must be a non-empty string.');
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
const fallbackPolicy = designIntentContract.tokenSystem.fallbackPolicy;
|
|
459
|
-
if (!fallbackPolicy || typeof fallbackPolicy !== 'object') {
|
|
460
|
-
validationErrors.push('designIntent.tokenSystem.fallbackPolicy must exist.');
|
|
461
|
-
} else {
|
|
462
|
-
if (fallbackPolicy.forbidRawHexOutsidePrimitives !== true) {
|
|
463
|
-
validationErrors.push('designIntent.tokenSystem.fallbackPolicy.forbidRawHexOutsidePrimitives must equal true.');
|
|
464
|
-
}
|
|
465
|
-
if (fallbackPolicy.forbidRawSpacingOutsidePrimitives !== true) {
|
|
466
|
-
validationErrors.push('designIntent.tokenSystem.fallbackPolicy.forbidRawSpacingOutsidePrimitives must equal true.');
|
|
467
|
-
}
|
|
468
|
-
if (fallbackPolicy.requireDocumentedExceptionForLegacyBypass !== true) {
|
|
469
|
-
validationErrors.push('designIntent.tokenSystem.fallbackPolicy.requireDocumentedExceptionForLegacyBypass must equal true.');
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
const namingConstraints = designIntentContract.tokenSystem.namingConstraints;
|
|
473
|
-
if (!namingConstraints || typeof namingConstraints !== 'object') {
|
|
474
|
-
validationErrors.push('designIntent.tokenSystem.namingConstraints must exist.');
|
|
475
|
-
} else {
|
|
476
|
-
if (namingConstraints.forbidCurlyBracesInNames !== true) {
|
|
477
|
-
validationErrors.push('designIntent.tokenSystem.namingConstraints.forbidCurlyBracesInNames must equal true.');
|
|
478
|
-
}
|
|
479
|
-
if (namingConstraints.forbidDotsInNames !== true) {
|
|
480
|
-
validationErrors.push('designIntent.tokenSystem.namingConstraints.forbidDotsInNames must equal true.');
|
|
481
|
-
}
|
|
482
|
-
if (namingConstraints.forbidSquareBracketsInNames !== true) {
|
|
483
|
-
validationErrors.push('designIntent.tokenSystem.namingConstraints.forbidSquareBracketsInNames must equal true.');
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (!designIntentContract.colorTruth || typeof designIntentContract.colorTruth !== 'object') {
|
|
489
|
-
validationErrors.push('designIntent.colorTruth must exist.');
|
|
490
|
-
} else {
|
|
491
|
-
if (designIntentContract.colorTruth.format !== 'OKLCH') {
|
|
492
|
-
validationErrors.push('designIntent.colorTruth.format must equal "OKLCH".');
|
|
493
|
-
}
|
|
494
|
-
if (designIntentContract.colorTruth.allowHexDerivatives !== true) {
|
|
495
|
-
validationErrors.push('designIntent.colorTruth.allowHexDerivatives must equal true.');
|
|
496
|
-
}
|
|
497
|
-
if (!String(designIntentContract.colorTruth.intent || '').trim()) {
|
|
498
|
-
validationErrors.push('designIntent.colorTruth.intent must be a non-empty string.');
|
|
499
|
-
}
|
|
500
|
-
const paletteRoles = designIntentContract.colorTruth.paletteRoles;
|
|
501
|
-
if (!Array.isArray(paletteRoles) || paletteRoles.length < 1) {
|
|
502
|
-
validationErrors.push('designIntent.colorTruth.paletteRoles must define or request agent-defined semantic palette roles.');
|
|
503
|
-
}
|
|
504
|
-
if (designIntentContract.colorTruth.rolesMustBeAgentDefined !== true) {
|
|
505
|
-
validationErrors.push('designIntent.colorTruth.rolesMustBeAgentDefined must equal true.');
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
if (!designIntentContract.crossViewportAdaptation || typeof designIntentContract.crossViewportAdaptation !== 'object') {
|
|
510
|
-
validationErrors.push('designIntent.crossViewportAdaptation must exist.');
|
|
511
|
-
} else {
|
|
512
|
-
const mutationRules = designIntentContract.crossViewportAdaptation.mutationRules;
|
|
513
|
-
if (!mutationRules || typeof mutationRules !== 'object') {
|
|
514
|
-
validationErrors.push('designIntent.crossViewportAdaptation.mutationRules must exist.');
|
|
515
|
-
} else {
|
|
516
|
-
for (const viewportKey of ['mobile', 'tablet', 'desktop']) {
|
|
517
|
-
if (!String(mutationRules[viewportKey] || '').trim()) {
|
|
518
|
-
validationErrors.push(`designIntent.crossViewportAdaptation.mutationRules.${viewportKey} must be a non-empty string.`);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
if (!designIntentContract.motionSystem || typeof designIntentContract.motionSystem !== 'object') {
|
|
525
|
-
validationErrors.push('designIntent.motionSystem must exist.');
|
|
526
|
-
} else {
|
|
527
|
-
if (designIntentContract.motionSystem.allowMeaningfulMotion !== true) {
|
|
528
|
-
validationErrors.push('designIntent.motionSystem.allowMeaningfulMotion must equal true.');
|
|
529
|
-
}
|
|
530
|
-
if (!String(designIntentContract.motionSystem.purpose || '').trim()) {
|
|
531
|
-
validationErrors.push('designIntent.motionSystem.purpose must be a non-empty string.');
|
|
532
|
-
}
|
|
533
|
-
if (designIntentContract.motionSystem.respectReducedMotion !== true) {
|
|
534
|
-
validationErrors.push('designIntent.motionSystem.respectReducedMotion must equal true.');
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
if (!designIntentContract.componentMorphology || typeof designIntentContract.componentMorphology !== 'object') {
|
|
539
|
-
validationErrors.push('designIntent.componentMorphology must exist.');
|
|
540
|
-
} else {
|
|
541
|
-
if (designIntentContract.componentMorphology.requireStateBehaviorMatrix !== true) {
|
|
542
|
-
validationErrors.push('designIntent.componentMorphology.requireStateBehaviorMatrix must equal true.');
|
|
543
|
-
}
|
|
544
|
-
if (!Array.isArray(designIntentContract.componentMorphology.stateKeys) || designIntentContract.componentMorphology.stateKeys.length < 4) {
|
|
545
|
-
validationErrors.push('designIntent.componentMorphology.stateKeys must contain multiple interaction states.');
|
|
546
|
-
}
|
|
547
|
-
const viewportBehavior = designIntentContract.componentMorphology.viewportBehavior;
|
|
548
|
-
if (!viewportBehavior || typeof viewportBehavior !== 'object') {
|
|
549
|
-
validationErrors.push('designIntent.componentMorphology.viewportBehavior must exist.');
|
|
550
|
-
} else {
|
|
551
|
-
for (const viewportKey of ['mobile', 'tablet', 'desktop']) {
|
|
552
|
-
if (!String(viewportBehavior[viewportKey] || '').trim()) {
|
|
553
|
-
validationErrors.push(`designIntent.componentMorphology.viewportBehavior.${viewportKey} must be a non-empty string.`);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
if (!designIntentContract.accessibilityPolicy || typeof designIntentContract.accessibilityPolicy !== 'object') {
|
|
560
|
-
validationErrors.push('designIntent.accessibilityPolicy must exist.');
|
|
561
|
-
} else {
|
|
562
|
-
if (designIntentContract.accessibilityPolicy.hardComplianceFloor !== 'WCAG-2.2-AA') {
|
|
563
|
-
validationErrors.push('designIntent.accessibilityPolicy.hardComplianceFloor must equal "WCAG-2.2-AA".');
|
|
564
|
-
}
|
|
565
|
-
if (designIntentContract.accessibilityPolicy.advisoryContrastModel !== 'APCA') {
|
|
566
|
-
validationErrors.push('designIntent.accessibilityPolicy.advisoryContrastModel must equal "APCA".');
|
|
567
|
-
}
|
|
568
|
-
if (designIntentContract.accessibilityPolicy.failOnHardViolations !== true) {
|
|
569
|
-
validationErrors.push('designIntent.accessibilityPolicy.failOnHardViolations must equal true.');
|
|
570
|
-
}
|
|
571
|
-
if (designIntentContract.accessibilityPolicy.advisoryFindingsDoNotBlockByDefault !== true) {
|
|
572
|
-
validationErrors.push('designIntent.accessibilityPolicy.advisoryFindingsDoNotBlockByDefault must equal true.');
|
|
573
|
-
}
|
|
574
|
-
const hardRequirements = designIntentContract.accessibilityPolicy.hardRequirements;
|
|
575
|
-
if (!hardRequirements || typeof hardRequirements !== 'object') {
|
|
576
|
-
validationErrors.push('designIntent.accessibilityPolicy.hardRequirements must exist.');
|
|
577
|
-
} else {
|
|
578
|
-
for (const requirementKey of [
|
|
579
|
-
'textContrastMinimum',
|
|
580
|
-
'nonTextContrast',
|
|
581
|
-
'useOfColorOnlyProhibited',
|
|
582
|
-
'focusVisible',
|
|
583
|
-
'focusAppearance',
|
|
584
|
-
'targetSizeMinimum',
|
|
585
|
-
'keyboardAccess',
|
|
586
|
-
'reflowRequired',
|
|
587
|
-
'accessibleAuthenticationMinimum',
|
|
588
|
-
'statusMessagesAndDynamicStateAccess',
|
|
589
|
-
]) {
|
|
590
|
-
if (hardRequirements[requirementKey] !== true) {
|
|
591
|
-
validationErrors.push(`designIntent.accessibilityPolicy.hardRequirements.${requirementKey} must equal true.`);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
const advisoryChecks = designIntentContract.accessibilityPolicy.advisoryChecks;
|
|
596
|
-
if (!advisoryChecks || typeof advisoryChecks !== 'object') {
|
|
597
|
-
validationErrors.push('designIntent.accessibilityPolicy.advisoryChecks must exist.');
|
|
598
|
-
} else {
|
|
599
|
-
for (const advisoryKey of [
|
|
600
|
-
'perceptualContrastReview',
|
|
601
|
-
'darkModeContrastTuning',
|
|
602
|
-
'typographyReadabilityTuning',
|
|
603
|
-
]) {
|
|
604
|
-
if (advisoryChecks[advisoryKey] !== true) {
|
|
605
|
-
validationErrors.push(`designIntent.accessibilityPolicy.advisoryChecks.${advisoryKey} must equal true.`);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
if (!designIntentContract.contextHygiene || typeof designIntentContract.contextHygiene !== 'object') {
|
|
612
|
-
validationErrors.push('designIntent.contextHygiene must exist.');
|
|
613
|
-
} else {
|
|
614
|
-
if (designIntentContract.contextHygiene.continuityMode !== 'opt-in-only') {
|
|
615
|
-
validationErrors.push('designIntent.contextHygiene.continuityMode must equal "opt-in-only".');
|
|
616
|
-
}
|
|
617
|
-
if (designIntentContract.contextHygiene.repoEvidenceOverridesMemory !== true) {
|
|
618
|
-
validationErrors.push('designIntent.contextHygiene.repoEvidenceOverridesMemory must equal true.');
|
|
619
|
-
}
|
|
620
|
-
if (designIntentContract.contextHygiene.requireExplicitContinuityApproval !== true) {
|
|
621
|
-
validationErrors.push('designIntent.contextHygiene.requireExplicitContinuityApproval must equal true.');
|
|
622
|
-
}
|
|
623
|
-
if (designIntentContract.contextHygiene.forbidCarryoverWhenUnapproved !== true) {
|
|
624
|
-
validationErrors.push('designIntent.contextHygiene.forbidCarryoverWhenUnapproved must equal true.');
|
|
625
|
-
}
|
|
626
|
-
if (!Array.isArray(designIntentContract.contextHygiene.allowedSources) || designIntentContract.contextHygiene.allowedSources.length < 4) {
|
|
627
|
-
validationErrors.push('designIntent.contextHygiene.allowedSources must list the approved design evidence sources.');
|
|
628
|
-
}
|
|
629
|
-
if (!Array.isArray(designIntentContract.contextHygiene.taintedSources) || designIntentContract.contextHygiene.taintedSources.length < 3) {
|
|
630
|
-
validationErrors.push('designIntent.contextHygiene.taintedSources must list tainted carryover sources.');
|
|
631
|
-
}
|
|
632
|
-
if (!String(designIntentContract.contextHygiene.approvedExternalConstraintUsage || '').trim()) {
|
|
633
|
-
validationErrors.push('designIntent.contextHygiene.approvedExternalConstraintUsage must be a non-empty string.');
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
if (!designIntentContract.designExecutionPolicy || typeof designIntentContract.designExecutionPolicy !== 'object') {
|
|
638
|
-
validationErrors.push('designIntent.designExecutionPolicy must exist.');
|
|
639
|
-
} else {
|
|
640
|
-
if (designIntentContract.designExecutionPolicy.representationStrategy !== 'surface-plan-v1') {
|
|
641
|
-
validationErrors.push('designIntent.designExecutionPolicy.representationStrategy must equal "surface-plan-v1".');
|
|
642
|
-
}
|
|
643
|
-
for (const requiredFlagName of [
|
|
644
|
-
'requireSurfacePlan',
|
|
645
|
-
'requireComponentGraph',
|
|
646
|
-
'requireViewportMutationPlan',
|
|
647
|
-
'requireInteractionStateMatrix',
|
|
648
|
-
'requireContentPriorityMap',
|
|
649
|
-
'requireTaskFlowNarrative',
|
|
650
|
-
'requireSignatureMoveRationale',
|
|
651
|
-
'requireCreativeCommitmentGate',
|
|
652
|
-
'requireStructuredHandoff',
|
|
653
|
-
'requireRepoEvidenceAlignment',
|
|
654
|
-
'forbidScreenshotDependency',
|
|
655
|
-
'separateRequiredOutcomesFromCandidateMoves',
|
|
656
|
-
'forbidCandidateMovesAsLockedRequirements',
|
|
657
|
-
'forbidLibraryThemeAsVisualAuthority',
|
|
658
|
-
'forbidLiteralAnchorChromeWithoutProductFunction',
|
|
659
|
-
'requirePerSurfaceMutationOps',
|
|
660
|
-
'forbidUniformSiblingSurfaceTreatment',
|
|
661
|
-
'zeroBasedRedesignResetsPriorVisualsWhenRequested',
|
|
662
|
-
]) {
|
|
663
|
-
if (designIntentContract.designExecutionPolicy[requiredFlagName] !== true) {
|
|
664
|
-
validationErrors.push(`designIntent.designExecutionPolicy.${requiredFlagName} must equal true.`);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
if (designIntentContract.designExecutionPolicy.handoffFormatVersion !== 'ui-handoff-v1') {
|
|
668
|
-
validationErrors.push('designIntent.designExecutionPolicy.handoffFormatVersion must equal "ui-handoff-v1".');
|
|
669
|
-
}
|
|
670
|
-
if (
|
|
671
|
-
!Array.isArray(designIntentContract.designExecutionPolicy.semanticReviewFocus)
|
|
672
|
-
|| designIntentContract.designExecutionPolicy.semanticReviewFocus.length < 4
|
|
673
|
-
) {
|
|
674
|
-
validationErrors.push('designIntent.designExecutionPolicy.semanticReviewFocus must list the required review dimensions.');
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
if (!designIntentContract.designExecutionHandoff || typeof designIntentContract.designExecutionHandoff !== 'object') {
|
|
679
|
-
validationErrors.push('designIntent.designExecutionHandoff must exist.');
|
|
680
|
-
} else {
|
|
681
|
-
if (designIntentContract.designExecutionHandoff.version !== 'ui-handoff-v1') {
|
|
682
|
-
validationErrors.push('designIntent.designExecutionHandoff.version must equal "ui-handoff-v1".');
|
|
683
|
-
}
|
|
684
|
-
if (designIntentContract.designExecutionHandoff.seedMode !== 'structure-first-scaffold') {
|
|
685
|
-
validationErrors.push('designIntent.designExecutionHandoff.seedMode must equal "structure-first-scaffold".');
|
|
686
|
-
}
|
|
687
|
-
if (designIntentContract.designExecutionHandoff.requiresTaskSpecificRefinement !== true) {
|
|
688
|
-
validationErrors.push('designIntent.designExecutionHandoff.requiresTaskSpecificRefinement must equal true.');
|
|
689
|
-
}
|
|
690
|
-
if (!String(designIntentContract.designExecutionHandoff.primaryExperienceGoal || '').trim()) {
|
|
691
|
-
validationErrors.push('designIntent.designExecutionHandoff.primaryExperienceGoal must be a non-empty string.');
|
|
692
|
-
}
|
|
693
|
-
if (!Array.isArray(designIntentContract.designExecutionHandoff.surfacePlan) || designIntentContract.designExecutionHandoff.surfacePlan.length < 1) {
|
|
694
|
-
validationErrors.push('designIntent.designExecutionHandoff.surfacePlan must define at least one planned surface.');
|
|
695
|
-
}
|
|
696
|
-
const componentGraph = designIntentContract.designExecutionHandoff.componentGraph;
|
|
697
|
-
if (!componentGraph || typeof componentGraph !== 'object') {
|
|
698
|
-
validationErrors.push('designIntent.designExecutionHandoff.componentGraph must exist.');
|
|
699
|
-
} else {
|
|
700
|
-
if (!Array.isArray(componentGraph.nodes) || componentGraph.nodes.length < 2) {
|
|
701
|
-
validationErrors.push('designIntent.designExecutionHandoff.componentGraph.nodes must list the primary execution nodes.');
|
|
702
|
-
}
|
|
703
|
-
if (!Array.isArray(componentGraph.edges) || componentGraph.edges.length < 1) {
|
|
704
|
-
validationErrors.push('designIntent.designExecutionHandoff.componentGraph.edges must define relationships between UI nodes.');
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
const contentPriorityMap = designIntentContract.designExecutionHandoff.contentPriorityMap;
|
|
708
|
-
if (!contentPriorityMap || typeof contentPriorityMap !== 'object') {
|
|
709
|
-
validationErrors.push('designIntent.designExecutionHandoff.contentPriorityMap must exist.');
|
|
710
|
-
} else {
|
|
711
|
-
for (const priorityBucket of ['primary', 'secondary', 'deferred']) {
|
|
712
|
-
if (!Array.isArray(contentPriorityMap[priorityBucket]) || contentPriorityMap[priorityBucket].length < 1) {
|
|
713
|
-
validationErrors.push(`designIntent.designExecutionHandoff.contentPriorityMap.${priorityBucket} must contain at least one item.`);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
const viewportMutationPlan = designIntentContract.designExecutionHandoff.viewportMutationPlan;
|
|
718
|
-
if (!viewportMutationPlan || typeof viewportMutationPlan !== 'object') {
|
|
719
|
-
validationErrors.push('designIntent.designExecutionHandoff.viewportMutationPlan must exist.');
|
|
720
|
-
} else {
|
|
721
|
-
for (const viewportKey of ['mobile', 'tablet', 'desktop']) {
|
|
722
|
-
const viewportPlan = viewportMutationPlan[viewportKey];
|
|
723
|
-
if (!viewportPlan || typeof viewportPlan !== 'object') {
|
|
724
|
-
validationErrors.push(`designIntent.designExecutionHandoff.viewportMutationPlan.${viewportKey} must be an object.`);
|
|
725
|
-
continue;
|
|
726
|
-
}
|
|
727
|
-
if (!String(viewportPlan.primaryOperation || '').trim()) {
|
|
728
|
-
validationErrors.push(`designIntent.designExecutionHandoff.viewportMutationPlan.${viewportKey}.primaryOperation must be a non-empty string.`);
|
|
729
|
-
}
|
|
730
|
-
if (!Array.isArray(viewportPlan.requiredSurfaceActions) || viewportPlan.requiredSurfaceActions.length < 2) {
|
|
731
|
-
validationErrors.push(`designIntent.designExecutionHandoff.viewportMutationPlan.${viewportKey}.requiredSurfaceActions must contain at least two actions.`);
|
|
732
|
-
}
|
|
733
|
-
if (!Array.isArray(viewportPlan.forbiddenPatterns) || viewportPlan.forbiddenPatterns.length < 1) {
|
|
734
|
-
validationErrors.push(`designIntent.designExecutionHandoff.viewportMutationPlan.${viewportKey}.forbiddenPatterns must contain at least one anti-pattern.`);
|
|
735
|
-
}
|
|
736
|
-
if (!String(viewportPlan.rationale || '').trim()) {
|
|
737
|
-
validationErrors.push(`designIntent.designExecutionHandoff.viewportMutationPlan.${viewportKey}.rationale must be a non-empty string.`);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
if (!Array.isArray(designIntentContract.designExecutionHandoff.interactionStateMatrix) || designIntentContract.designExecutionHandoff.interactionStateMatrix.length < 1) {
|
|
742
|
-
validationErrors.push('designIntent.designExecutionHandoff.interactionStateMatrix must list key component state expectations.');
|
|
743
|
-
}
|
|
744
|
-
const expressionFlexibility = designIntentContract.designExecutionHandoff.expressionFlexibility;
|
|
745
|
-
if (!expressionFlexibility || typeof expressionFlexibility !== 'object') {
|
|
746
|
-
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility must exist.');
|
|
747
|
-
} else {
|
|
748
|
-
if (!Array.isArray(expressionFlexibility.lockedOutcomes) || expressionFlexibility.lockedOutcomes.length < 3) {
|
|
749
|
-
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.lockedOutcomes must list locked outcomes.');
|
|
750
|
-
}
|
|
751
|
-
if (!Array.isArray(expressionFlexibility.candidateSignatureMoves) || expressionFlexibility.candidateSignatureMoves.length < 1) {
|
|
752
|
-
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.candidateSignatureMoves must include at least one candidate move placeholder.');
|
|
753
|
-
}
|
|
754
|
-
if (!Array.isArray(expressionFlexibility.flexibleAxes) || expressionFlexibility.flexibleAxes.length < 4) {
|
|
755
|
-
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.flexibleAxes must list flexible implementation axes.');
|
|
756
|
-
}
|
|
757
|
-
if (!String(expressionFlexibility.lockingRule || '').includes('candidate')) {
|
|
758
|
-
validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.lockingRule must explain when candidate moves become required.');
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
if (!Array.isArray(designIntentContract.designExecutionHandoff.taskFlowNarrative) || designIntentContract.designExecutionHandoff.taskFlowNarrative.length < 2) {
|
|
762
|
-
validationErrors.push('designIntent.designExecutionHandoff.taskFlowNarrative must describe the key UI task flow in sequence.');
|
|
763
|
-
}
|
|
764
|
-
if (!String(designIntentContract.designExecutionHandoff.signatureMoveRationale || '').trim()) {
|
|
765
|
-
validationErrors.push('designIntent.designExecutionHandoff.signatureMoveRationale must explain the chosen authored move.');
|
|
766
|
-
}
|
|
767
|
-
const creativeCommitment = designIntentContract.designExecutionHandoff.creativeCommitment;
|
|
768
|
-
if (!creativeCommitment || typeof creativeCommitment !== 'object') {
|
|
769
|
-
validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment must exist.');
|
|
770
|
-
} else {
|
|
771
|
-
if (creativeCommitment.status !== 'agent-must-complete-before-ui-implementation') {
|
|
772
|
-
validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment.status must equal "agent-must-complete-before-ui-implementation".');
|
|
773
|
-
}
|
|
774
|
-
if (
|
|
775
|
-
!Array.isArray(creativeCommitment.requiredFields)
|
|
776
|
-
|| !creativeCommitment.requiredFields.includes('specificReferencePoint')
|
|
777
|
-
|| !creativeCommitment.requiredFields.includes('signatureMotion')
|
|
778
|
-
|| !creativeCommitment.requiredFields.includes('typographicDecision')
|
|
779
|
-
) {
|
|
780
|
-
validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment.requiredFields must include specificReferencePoint, signatureMotion, and typographicDecision.');
|
|
781
|
-
}
|
|
782
|
-
if (!hasNonEmptyString(creativeCommitment.failureMode)) {
|
|
783
|
-
validationErrors.push('designIntent.designExecutionHandoff.creativeCommitment.failureMode must be a non-empty string.');
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
const implementationGuardrails = designIntentContract.designExecutionHandoff.implementationGuardrails;
|
|
787
|
-
if (!implementationGuardrails || typeof implementationGuardrails !== 'object') {
|
|
788
|
-
validationErrors.push('designIntent.designExecutionHandoff.implementationGuardrails must exist.');
|
|
789
|
-
} else {
|
|
790
|
-
for (const requiredFlagName of [
|
|
791
|
-
'requireBuildFromHandoff',
|
|
792
|
-
'requireGapNotesBeforeFallback',
|
|
793
|
-
'forbidGenericLayoutFallbackWithoutReason',
|
|
794
|
-
'requireLockedVsFlexibleDecisionReview',
|
|
795
|
-
'forbidCandidateMoveHardcoding',
|
|
796
|
-
'forbidTestingDemoCopyInUi',
|
|
797
|
-
'forbidTerminalOnlyUserFlows',
|
|
798
|
-
]) {
|
|
799
|
-
if (implementationGuardrails[requiredFlagName] !== true) {
|
|
800
|
-
validationErrors.push(`designIntent.designExecutionHandoff.implementationGuardrails.${requiredFlagName} must equal true.`);
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
if (!designIntentContract.reviewRubric || typeof designIntentContract.reviewRubric !== 'object') {
|
|
807
|
-
validationErrors.push('designIntent.reviewRubric must exist.');
|
|
808
|
-
} else {
|
|
809
|
-
if (designIntentContract.reviewRubric.version !== 'ui-rubric-v1') {
|
|
810
|
-
validationErrors.push('designIntent.reviewRubric.version must equal "ui-rubric-v1".');
|
|
811
|
-
}
|
|
812
|
-
if (designIntentContract.reviewRubric.genericityAutoFail !== true) {
|
|
813
|
-
validationErrors.push('designIntent.reviewRubric.genericityAutoFail must equal true.');
|
|
814
|
-
}
|
|
815
|
-
if (!Array.isArray(designIntentContract.reviewRubric.dimensions) || designIntentContract.reviewRubric.dimensions.length < 5) {
|
|
816
|
-
validationErrors.push('designIntent.reviewRubric.dimensions must define the required rubric dimensions.');
|
|
817
|
-
} else {
|
|
818
|
-
for (const requiredRubricKey of [
|
|
819
|
-
'distinctiveness',
|
|
820
|
-
'contractFidelity',
|
|
821
|
-
'visualConsistency',
|
|
822
|
-
'heuristicUxQuality',
|
|
823
|
-
'motionDiscipline',
|
|
824
|
-
]) {
|
|
825
|
-
if (!designIntentContract.reviewRubric.dimensions.some((dimension) => dimension?.key === requiredRubricKey)) {
|
|
826
|
-
validationErrors.push(`designIntent.reviewRubric.dimensions is missing "${requiredRubricKey}".`);
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
if (!Array.isArray(designIntentContract.reviewRubric.genericitySignals) || designIntentContract.reviewRubric.genericitySignals.length < 3) {
|
|
831
|
-
validationErrors.push('designIntent.reviewRubric.genericitySignals must list common genericity drift signals.');
|
|
832
|
-
} else {
|
|
833
|
-
for (const requiredSignal of [
|
|
834
|
-
'ai-safe-ui-template-look',
|
|
835
|
-
'ai-color-default-palette-without-product-role-behavior',
|
|
836
|
-
'interchangeable-product-renaming-test-fails',
|
|
837
|
-
'decorative-grid-or-glow-wallpaper-without-product-function',
|
|
838
|
-
'decorative-line-or-calibration-wallpaper-without-product-function',
|
|
839
|
-
'measurement-or-calibration-marks-used-as-page-background',
|
|
840
|
-
'testing-demo-or-placeholder-copy-shipped-to-ui',
|
|
841
|
-
'terminal-only-user-flow-without-product-reason',
|
|
842
|
-
'motion-or-3d-omitted-from-fear-without-fit-analysis',
|
|
843
|
-
]) {
|
|
844
|
-
if (!designIntentContract.reviewRubric.genericitySignals.includes(requiredSignal)) {
|
|
845
|
-
validationErrors.push(`designIntent.reviewRubric.genericitySignals must include "${requiredSignal}".`);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
if (!Array.isArray(designIntentContract.reviewRubric.validBoldSignals) || designIntentContract.reviewRubric.validBoldSignals.length < 3) {
|
|
850
|
-
validationErrors.push('designIntent.reviewRubric.validBoldSignals must list legitimate authored signals.');
|
|
851
|
-
} else {
|
|
852
|
-
for (const requiredSignal of [
|
|
853
|
-
'three-at-a-glance-product-specific-signals',
|
|
854
|
-
'visually-exploratory-accessible-palette-derived-from-product',
|
|
855
|
-
'audacious-accessible-palette-with-product-role-behavior',
|
|
856
|
-
'motion-or-spatial-experience-derived-from-anchor',
|
|
857
|
-
]) {
|
|
858
|
-
if (!designIntentContract.reviewRubric.validBoldSignals.includes(requiredSignal)) {
|
|
859
|
-
validationErrors.push(`designIntent.reviewRubric.validBoldSignals must include "${requiredSignal}".`);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
if (!designIntentContract.reviewRubric.reportingRules || typeof designIntentContract.reviewRubric.reportingRules !== 'object') {
|
|
864
|
-
validationErrors.push('designIntent.reviewRubric.reportingRules must exist.');
|
|
865
|
-
} else {
|
|
866
|
-
for (const requiredFlagName of [
|
|
867
|
-
'mustExplainGenericity',
|
|
868
|
-
'mustSeparateTasteFromFailure',
|
|
869
|
-
'contractFidelityOverridesPersonalTaste',
|
|
870
|
-
]) {
|
|
871
|
-
if (designIntentContract.reviewRubric.reportingRules[requiredFlagName] !== true) {
|
|
872
|
-
validationErrors.push(`designIntent.reviewRubric.reportingRules.${requiredFlagName} must equal true.`);
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
if (!Array.isArray(designIntentContract.requiredDesignSections) || designIntentContract.requiredDesignSections.length !== DESIGN_REQUIRED_SECTIONS.length) {
|
|
879
|
-
validationErrors.push('designIntent.requiredDesignSections must match the required design contract sections.');
|
|
880
|
-
} else {
|
|
881
|
-
for (const requiredSectionName of DESIGN_REQUIRED_SECTIONS) {
|
|
882
|
-
if (!designIntentContract.requiredDesignSections.includes(requiredSectionName)) {
|
|
883
|
-
validationErrors.push(`designIntent.requiredDesignSections is missing "${requiredSectionName}".`);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
if (!Array.isArray(designIntentContract.forbiddenPatterns) || designIntentContract.forbiddenPatterns.length < 4) {
|
|
889
|
-
validationErrors.push('designIntent.forbiddenPatterns must list concrete anti-generic patterns.');
|
|
890
|
-
} else {
|
|
891
|
-
for (const requiredPattern of [
|
|
892
|
-
'ai-safe-ui-template-look',
|
|
893
|
-
'ai-color-default-palette-without-product-role-behavior',
|
|
894
|
-
'interchangeable-product-renaming-test-fails',
|
|
895
|
-
'decorative-grid-or-glow-wallpaper-without-product-function',
|
|
896
|
-
'decorative-line-or-calibration-wallpaper-without-product-function',
|
|
897
|
-
'measurement-or-calibration-marks-used-as-page-background',
|
|
898
|
-
'testing-demo-or-placeholder-copy-shipped-to-ui',
|
|
899
|
-
'terminal-only-user-flow-without-product-reason',
|
|
900
|
-
'motion-or-3d-omitted-from-fear-without-fit-analysis',
|
|
901
|
-
]) {
|
|
902
|
-
if (!designIntentContract.forbiddenPatterns.includes(requiredPattern)) {
|
|
903
|
-
validationErrors.push(`designIntent.forbiddenPatterns must include "${requiredPattern}".`);
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
}
|
|
52
|
+
validateModeAndProjectShape(designIntentContract, validationErrors);
|
|
53
|
+
validateExternalResearchIntake(designIntentContract, validationErrors);
|
|
54
|
+
validateDesignFlexibilityPolicy(designIntentContract, validationErrors);
|
|
55
|
+
validateConceptualAnchor(designIntentContract, validationErrors);
|
|
56
|
+
validateMathSystems(designIntentContract, validationErrors);
|
|
57
|
+
validateAiSafeUiAudit(designIntentContract, validationErrors);
|
|
58
|
+
validateProductionContentPolicy(designIntentContract, validationErrors);
|
|
59
|
+
validateTokenSystem(designIntentContract, validationErrors);
|
|
60
|
+
validateColorTruth(designIntentContract, validationErrors);
|
|
61
|
+
validateCrossViewportAdaptation(designIntentContract, validationErrors);
|
|
62
|
+
validateMotionSystem(designIntentContract, validationErrors);
|
|
63
|
+
validateComponentMorphology(designIntentContract, validationErrors);
|
|
64
|
+
validateAccessibilityPolicy(designIntentContract, validationErrors);
|
|
65
|
+
validateContextHygiene(designIntentContract, validationErrors);
|
|
66
|
+
validateDesignExecutionPolicy(designIntentContract, validationErrors);
|
|
67
|
+
validateDesignExecutionHandoff(designIntentContract, validationErrors);
|
|
68
|
+
validateReviewRubric(designIntentContract, validationErrors);
|
|
69
|
+
validateRequiredSectionsAndForbiddenPatterns(designIntentContract, validationErrors);
|
|
907
70
|
|
|
908
71
|
return validationErrors;
|
|
909
72
|
}
|