@reqvire-org/ads 0.3.24 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/behaviors.mjs +6 -4
- package/dist/bootstrap-ds/ADS.md +28 -30
- package/dist/bootstrap-ds/README.md +6 -6
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/boundaries.mjs +0 -3
- package/dist/check.mjs +15 -22
- package/dist/config.mjs +3 -7
- package/dist/contract-migration.mjs +3 -3
- package/dist/contracts.d.mts +2 -3
- package/dist/declarative-flow.mjs +144 -0
- package/dist/design-values.mjs +81 -0
- package/dist/evidence.mjs +1 -1
- package/dist/mcp/catalog.mjs +4 -2
- package/dist/mcp/context.mjs +3 -3
- package/dist/mcp/prompts.mjs +4 -4
- package/dist/mcp/reports.mjs +101 -0
- package/dist/mcp/server.mjs +38 -3
- package/dist/paint-contracts.mjs +4 -5
- package/dist/preview-resources.mjs +1 -2
- package/dist/runtime-contracts.mjs +26 -37
- package/dist/scenario-trace.mjs +47 -18
- package/dist/scenarios.mjs +15 -15
- package/dist/skills/README.md +7 -3
- package/dist/skills/ads-break-ui/SKILL.md +24 -13
- package/dist/skills/ads-break-ui/references/atomic-styles.md +9 -2
- package/dist/skills/ads-break-ui/references/behaviors.md +393 -0
- package/dist/skills/ads-break-ui/references/captures.md +1 -1
- package/dist/skills/ads-break-ui/references/contracts.md +61 -40
- package/dist/skills/ads-break-ui/references/design-data.md +91 -0
- package/dist/skills/ads-break-ui/references/evidence.md +4 -0
- package/dist/skills/ads-break-ui/references/guarded-editing.md +7 -11
- package/dist/skills/ads-break-ui/references/reporting.md +101 -0
- package/dist/skills/ads-break-ui/references/scenarios.md +9 -15
- package/dist/skills/ads-designer/SKILL.md +26 -15
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +28 -30
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +6 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/skills/ads-designer/references/atomic-styles.md +9 -2
- package/dist/skills/ads-designer/references/behaviors.md +393 -0
- package/dist/skills/ads-designer/references/captures.md +1 -1
- package/dist/skills/ads-designer/references/contracts.md +61 -40
- package/dist/skills/ads-designer/references/design-craft.md +1 -1
- package/dist/skills/ads-designer/references/design-data.md +91 -0
- package/dist/skills/ads-designer/references/evidence.md +4 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +7 -11
- package/dist/skills/ads-designer/references/mobile.md +1 -1
- package/dist/skills/ads-designer/references/reporting.md +101 -0
- package/dist/skills/ads-designer/references/scenarios.md +9 -15
- package/dist/skills/ads-import/SKILL.md +29 -17
- package/dist/skills/ads-import/references/atomic-styles.md +9 -2
- package/dist/skills/ads-import/references/behaviors.md +393 -0
- package/dist/skills/ads-import/references/branding.md +1 -1
- package/dist/skills/ads-import/references/captures.md +1 -1
- package/dist/skills/ads-import/references/contracts.md +61 -40
- package/dist/skills/ads-import/references/design-data.md +91 -0
- package/dist/skills/ads-import/references/evidence.md +4 -0
- package/dist/skills/ads-import/references/guarded-editing.md +7 -11
- package/dist/skills/ads-import/references/implementation.md +3 -2
- package/dist/skills/ads-import/references/reporting.md +101 -0
- package/dist/skills/ads-import/references/scenarios.md +9 -15
- package/dist/skills/ads-import/references/tokens.md +11 -9
- package/dist/skills/ads-motion/SKILL.md +23 -12
- package/dist/skills/ads-motion/references/atomic-styles.md +9 -2
- package/dist/skills/ads-motion/references/behaviors.md +393 -0
- package/dist/skills/ads-motion/references/captures.md +1 -1
- package/dist/skills/ads-motion/references/contracts.md +61 -40
- package/dist/skills/ads-motion/references/design-data.md +91 -0
- package/dist/skills/ads-motion/references/evidence.md +4 -0
- package/dist/skills/ads-motion/references/guarded-editing.md +7 -11
- package/dist/skills/ads-motion/references/reporting.md +101 -0
- package/dist/skills/ads-motion/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/SKILL.md +59 -31
- package/dist/skills/ads-port/agents/openai.yaml +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/atomic-styles.md +9 -2
- package/dist/skills/ads-port/references/behaviors.md +393 -0
- package/dist/skills/{ads-migrate → ads-port}/references/captures.md +1 -1
- package/dist/skills/{ads-migrate → ads-port}/references/contracts.md +61 -40
- package/dist/skills/ads-port/references/design-data.md +91 -0
- package/dist/skills/{ads-migrate → ads-port}/references/evidence.md +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/guarded-editing.md +7 -11
- package/dist/skills/{ads-migrate → ads-port}/references/lint-and-docs.md +5 -0
- package/dist/skills/{ads-migrate → ads-port}/references/native-implementation.md +49 -15
- package/dist/skills/ads-port/references/reporting.md +101 -0
- package/dist/skills/{ads-migrate → ads-port}/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/references/testing.md +11 -1
- package/dist/source-values.mjs +3 -3
- package/dist/tokens.mjs +5 -8
- package/dist/unit-contracts.mjs +24 -12
- package/docs/ADS.md +42 -73
- package/docs/ARCHITECTURE.md +54 -20
- package/docs/BEHAVIORS.md +46 -36
- package/docs/CHANGELOG.md +34 -0
- package/docs/CONTRACTS.md +67 -39
- package/docs/GUIDE.md +21 -13
- package/docs/MCP.md +67 -11
- package/package.json +1 -1
- package/dist/scoped-tokens.mjs +0 -68
- package/dist/skills/ads-migrate/agents/openai.yaml +0 -4
- /package/dist/skills/{ads-migrate → ads-port}/references/cli.md +0 -0
- /package/dist/skills/{ads-migrate → ads-port}/references/layers.md +0 -0
- /package/dist/skills/{ads-migrate → ads-port}/references/review.md +0 -0
|
@@ -38,8 +38,7 @@ export function previewEntriesPlugin(entries, mountEntry) {
|
|
|
38
38
|
load(id) {
|
|
39
39
|
const entry = ids.get(id.slice(1));
|
|
40
40
|
if (!entry) return;
|
|
41
|
-
|
|
42
|
-
return `import { mountScenario } from ${JSON.stringify(mountEntry)};${styles}import Scenario from ${JSON.stringify(path.resolve(entry.root, entry.file))};export const mount = container => mountScenario(Scenario,container);`;
|
|
41
|
+
return `import { mountScenario } from ${JSON.stringify(mountEntry)};import Scenario from ${JSON.stringify(path.resolve(entry.root, entry.file))};export const mount = container => mountScenario(Scenario,container);`;
|
|
43
42
|
},
|
|
44
43
|
};
|
|
45
44
|
}
|
|
@@ -5,15 +5,21 @@ import { isDevelopmentFile, isReviewFile } from "./config.mjs";
|
|
|
5
5
|
import { inspectUnitContracts, implementationIdentity, implementationNode } from "./unit-contracts.mjs";
|
|
6
6
|
import { tokenContract } from "./token-policy.mjs";
|
|
7
7
|
import { uiOperation } from "./ui-framework.mjs";
|
|
8
|
+
import { createChildFlow } from "./declarative-flow.mjs";
|
|
8
9
|
import { unwrap, createSourceValues, reference } from "./source-values.mjs";
|
|
9
10
|
|
|
10
11
|
function fn(node) { return node && ts.isVariableDeclaration(node) ? unwrap(node.initializer) : node; }
|
|
11
12
|
function all(node, predicate) { const result=[];function visit(item){if(predicate(item))result.push(item);ts.forEachChild(item,visit);}if(node)visit(node);return result; }
|
|
12
13
|
|
|
13
14
|
export function inspectRuntimeContracts(options, program) {
|
|
15
|
+
// Contract discovery already owns a fully resolved program. Reuse it for
|
|
16
|
+
// typed array selections; the lightweight source guard program has no libs.
|
|
17
|
+
const declarations=inspectUnitContracts(options);
|
|
18
|
+
program=declarations.program??program;
|
|
14
19
|
if(options.runtimeContracts?.program===program)return options.runtimeContracts;
|
|
15
|
-
const checker=program.getTypeChecker()
|
|
20
|
+
const checker=program.getTypeChecker();
|
|
16
21
|
const result={program,diagnostics:[],bindings:[],parts:[],allowedStyles:new Set(),allowedStyleTypes:new Set()};
|
|
22
|
+
const partProofs=new Map();
|
|
17
23
|
options.runtimeContracts=result;
|
|
18
24
|
const key=node=>`${node.getSourceFile().fileName}:${node.pos}`;
|
|
19
25
|
const values=createSourceValues(program,options,{strict:true});
|
|
@@ -36,39 +42,14 @@ export function inspectRuntimeContracts(options, program) {
|
|
|
36
42
|
}
|
|
37
43
|
for(const contract of declarations.contracts) {
|
|
38
44
|
for(const part of contract.declarativeParts??[]) {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
seen=new Set([...seen,expression]);
|
|
44
|
-
const merge=sets=>new Set(sets.flatMap(set=>[...set]));
|
|
45
|
-
if(ts.isPropertyAccessExpression(expression)&&expression.name.text==="children") {
|
|
46
|
-
if(canonical(expression.expression)===consumer?.parameters?.[0])return new Set(["children-input"]);
|
|
47
|
-
if(ts.isPropertyAccessExpression(expression.expression)&&expression.expression.name.text==="props"&&childOrigins(expression.expression.expression,seen).size)return new Set([key(expression)]);
|
|
48
|
-
}
|
|
49
|
-
const declaration=canonical(expression);
|
|
50
|
-
if(declaration&&ts.isBindingElement(declaration)&&ts.isObjectBindingPattern(declaration.parent)&&declaration.parent.parent===consumer?.parameters?.[0]&&(declaration.propertyName??declaration.name).getText()==="children")return new Set(["children-input"]);
|
|
51
|
-
if(declaration&&ts.isVariableDeclaration(declaration)) {
|
|
52
|
-
if(declaration.initializer)return childOrigins(declaration.initializer,seen);
|
|
53
|
-
if(ts.isVariableDeclarationList(declaration.parent)&&ts.isForOfStatement(declaration.parent.parent)&&childOrigins(declaration.parent.parent.expression,seen).size)return new Set([key(declaration)]);
|
|
54
|
-
}
|
|
55
|
-
if(declaration&&ts.isParameter(declaration)) {
|
|
56
|
-
const callback=declaration.parent,index=callback.parameters.indexOf(declaration),origins=[];
|
|
57
|
-
for(const call of calls) {
|
|
58
|
-
if(fn(canonical(call.expression))===callback&&call.arguments[index])origins.push(childOrigins(call.arguments[index],seen));
|
|
59
|
-
const operation=uiOperation(call.expression,checker);
|
|
60
|
-
const childrenCall=["Children.map","Children.forEach"].includes(operation)&&call.arguments[1]&&(call.arguments[1]===callback||fn(canonical(call.arguments[1]))===callback);
|
|
61
|
-
const arrayCall=ts.isPropertyAccessExpression(call.expression)&&["map","forEach","flatMap"].includes(call.expression.name.text)&&call.arguments[0]&&(call.arguments[0]===callback||fn(canonical(call.arguments[0]))===callback);
|
|
62
|
-
if(index===0&&(childrenCall&&childOrigins(call.arguments[0],seen).size||arrayCall&&childOrigins(call.expression.expression,seen).size))origins.push(new Set([key(declaration)]));
|
|
63
|
-
}
|
|
64
|
-
return merge(origins);
|
|
65
|
-
}
|
|
66
|
-
if(ts.isCallExpression(expression)) {
|
|
67
|
-
if(["Children.toArray","toChildArray"].includes(uiOperation(expression.expression,checker)))return childOrigins(expression.arguments[0],seen);
|
|
68
|
-
if(ts.isPropertyAccessExpression(expression.expression)&&["filter","slice"].includes(expression.expression.name.text))return childOrigins(expression.expression.expression,seen);
|
|
69
|
-
}
|
|
70
|
-
return new Set();
|
|
45
|
+
const proofId=`${part.api.identity}@${part.consumer.identity}`;
|
|
46
|
+
if(partProofs.has(proofId)) {
|
|
47
|
+
if(partProofs.get(proofId))result.parts.push({...part,unit:contract.unit,file:contract.file});
|
|
48
|
+
continue;
|
|
71
49
|
}
|
|
50
|
+
const consumer=fn(implementationNode(program,part.consumer,options.root));
|
|
51
|
+
const bodies=[...new Set(localCalls(consumer))],calls=[...new Set(bodies.flatMap(body=>all(body,ts.isCallExpression)))];
|
|
52
|
+
const childOrigins=createChildFlow({consumer,calls,bodies,canonical,key,checker});
|
|
72
53
|
const propOrigins=new Set(bodies.flatMap(body=>all(body,ts.isPropertyAccessExpression).filter(node=>node.name.text==="props").flatMap(node=>[...childOrigins(node.expression)])));
|
|
73
54
|
const readsProps=expression=>[...childOrigins(expression)].some(origin=>propOrigins.has(origin));
|
|
74
55
|
let consumed=false;
|
|
@@ -88,13 +69,15 @@ export function inspectRuntimeContracts(options, program) {
|
|
|
88
69
|
}
|
|
89
70
|
}
|
|
90
71
|
}
|
|
72
|
+
partProofs.set(proofId,!!consumer&&consumed);
|
|
91
73
|
if(!consumer||!consumed)report(contract,`${part.apiName}: cannot establish that ${part.consumer.symbol} identifies this declarative child from its children input by resolved symbol and reads that same child's props. A registration, decoy object, import or unused reference is not consumption.`,"declarative-consumer");
|
|
92
74
|
else result.parts.push({...part,unit:contract.unit,file:contract.file});
|
|
93
75
|
}
|
|
94
76
|
for(const [name,binding]of Object.entries(contract.bindings??{})) {
|
|
95
77
|
const producer=fn(implementationNode(program,binding.producer,options.root));
|
|
96
78
|
const [prefix,suffix]=binding.variable.split("${key}");
|
|
97
|
-
|
|
79
|
+
const valuePaths=typeof binding.valueFrom==="string"?[binding.valueFrom]:binding.valueFrom;
|
|
80
|
+
if(valuePaths.some(field=>!(contract.paintInputs??[]).some(input=>input.api.identity===binding.input.api.identity&&input.property===`${binding.input.property}.*.${field}`))) {report(contract,`${name}: register every valueFrom config-entry path as a constrained paint input. A producer does not authorize untyped config colours.`,"binding-input");continue;}
|
|
98
81
|
if([...tokenContract.naming.prefixes,"--ds-","--ux-","--showcase-"].some(value=>value.startsWith(prefix)||prefix.startsWith(value))||[...tokenContract.naming.names,...Object.keys(tokenContract.tokens)].some(value=>value.startsWith(prefix)&&value.endsWith(suffix))) {
|
|
99
82
|
report(contract,`${name}: runtime family ${binding.variable} overlaps the shared token vocabulary. Use a nonconflicting private runtime family; registration cannot grant shared-token overrides.`,"binding-collision");continue;
|
|
100
83
|
}
|
|
@@ -122,8 +105,14 @@ export function inspectRuntimeContracts(options, program) {
|
|
|
122
105
|
function pairMatches(template,value,keySymbol,valueSymbol) {
|
|
123
106
|
template=unwrap(template);value=unwrap(value);
|
|
124
107
|
if(!template||!ts.isTemplateExpression(template)||template.templateSpans.length!==1||template.head.text!==prefix||template.templateSpans[0].literal.text!==suffix||checker.getSymbolAtLocation(template.templateSpans[0].expression)!==keySymbol)return false;
|
|
125
|
-
|
|
126
|
-
|
|
108
|
+
function entryValue(expression) {
|
|
109
|
+
expression=unwrap(expression);const fields=[];while(expression&&ts.isPropertyAccessExpression(expression)){fields.unshift(expression.name.text);expression=unwrap(expression.expression);}
|
|
110
|
+
return expression&&checker.getSymbolAtLocation(expression)===valueSymbol&&valuePaths.includes(fields.join("."));
|
|
111
|
+
}
|
|
112
|
+
if(entryValue(value))return true;
|
|
113
|
+
return ts.isTemplateExpression(value)&&value.head.text==="light-dark("&&value.templateSpans.length===2
|
|
114
|
+
&&/^\s*,\s*$/.test(value.templateSpans[0].literal.text)&&value.templateSpans[1].literal.text===")"
|
|
115
|
+
&&value.templateSpans.every(span=>entryValue(span.expression));
|
|
127
116
|
}
|
|
128
117
|
function proveMap(body,seen=new Set()) {
|
|
129
118
|
if(!body?.parameters?.[0]||!ts.isIdentifier(body.parameters[0].name)||seen.has(body)||seen.size>8)return null;
|
|
@@ -163,7 +152,7 @@ export function inspectRuntimeContracts(options, program) {
|
|
|
163
152
|
return mapSymbol&&!escapes&&checker.getSymbolAtLocation(returned)===mapSymbol?[body]:null;
|
|
164
153
|
}
|
|
165
154
|
const proof=proveMap(producer);
|
|
166
|
-
if(!proof){report(contract,`${name}: producer must return only the declared config-entry paint map. Use Object.entries with a loop or Object.fromEntries/map, guard keys with /^[A-Za-z0-9_-]+$/ before writing (throw or continue), and the exact computed family. Owner-local helper returns are supported; escaped maps, extra writes and unknown returns grant no permission.`,"binding-producer");continue;}
|
|
155
|
+
if(!proof){report(contract,`${name}: producer must return only the declared config-entry paint map. Declare every source path in valueFrom (one path or an array), with matching paintInputs; theme pairs may use an exact light-dark() template over two declared paths. Use Object.entries with a loop or Object.fromEntries/map, guard keys with /^[A-Za-z0-9_-]+$/ before writing (throw or continue), and the exact computed family. Owner-local helper returns are supported; escaped maps, extra writes and unknown returns grant no permission.`,"binding-producer");continue;}
|
|
167
156
|
const scope=fn(implementationNode(program,binding.scope.api,options.root));
|
|
168
157
|
let attached=false;
|
|
169
158
|
const returnedElements=new Set();
|
package/dist/scenario-trace.mjs
CHANGED
|
@@ -27,10 +27,12 @@ export function createScenarioTrace(program, options) {
|
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
29
|
const isCx = expression => linaria(expression, "cx");
|
|
30
|
-
const { state, next, at, resolve, get, arrays, returns, props } = createSourceValues(program, options, { preserveCall: expression => isCx(expression) || uiOperation(expression, checker) === "createElement", strict: true });
|
|
30
|
+
const { state, next, at, resolve, get, arrays, returns, props } = createSourceValues(program, options, { preserveCall: expression => isCx(expression) || uiOperation(expression, checker) === "createElement" || ts.isPropertyAccessExpression(expression)&&["map","flatMap"].includes(expression.name.text), strict: true });
|
|
31
31
|
const publicNodes = new Map(), helpers = new Map(), inventory = inspectUnits(options);
|
|
32
32
|
const parts = inspectRuntimeContracts(options, program).parts.map(part => ({ ...part,
|
|
33
|
+
edge: `${part.api.identity}>${part.parent.identity}@${part.consumer.identity}`,
|
|
33
34
|
apiNode: resolve(reference(implementationNode(program, part.api, options.root)?.name), state()).node,
|
|
35
|
+
parentNode: resolve(reference(implementationNode(program, part.parent, options.root)?.name), state()).node,
|
|
34
36
|
consumerNode: resolve(reference(implementationNode(program, part.consumer, options.root)?.name), state()).node,
|
|
35
37
|
}));
|
|
36
38
|
const locationKey = value => JSON.stringify([value.file, value.line, value.column]);
|
|
@@ -66,19 +68,35 @@ export function createScenarioTrace(program, options) {
|
|
|
66
68
|
return null;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
function traceRenders(site, { entry = false } = {}) {
|
|
71
|
+
function traceRenders(site, { entry = false, exercise = false } = {}) {
|
|
70
72
|
const limits = new Set();
|
|
71
|
-
|
|
73
|
+
const alternatives=exercise?combine:common;
|
|
74
|
+
const initial={...state(),...(exercise?{maxDepth:128,maxSteps:16000}:{})};
|
|
75
|
+
function mapped(value,context,visit) {
|
|
76
|
+
const call=value.node;
|
|
77
|
+
if(!call||!ts.isCallExpression(call)||!ts.isPropertyAccessExpression(call.expression)||!["map","flatMap"].includes(call.expression.name.text))return null;
|
|
78
|
+
const items=arrays(reference(call.expression.expression,value.env,value.via),next(context));
|
|
79
|
+
if(!items?.length)return new Set();
|
|
80
|
+
const callback=resolve(reference(call.arguments[0],value.env,value.via),next(context));
|
|
81
|
+
if(callback.kind!=="node"||!isFunction(callback.node))return new Set();
|
|
82
|
+
return combine(items.slice(0,maxBranches).map((item,index)=>combine(returns(callback,[item,{kind:"literal",value:index}],next(context)).map(output=>visit(output,next(context))))));
|
|
83
|
+
}
|
|
84
|
+
function childParts(input, context, parent = null) {
|
|
72
85
|
const value = resolve(input, next(context));
|
|
73
|
-
if (value.kind === "union") return
|
|
74
|
-
if (value.kind === "array") return combine(value.values.map(item => childParts(item, next(context))));
|
|
86
|
+
if (value.kind === "union") return alternatives(value.values.slice(0, maxBranches).map(item => childParts(item, next(context),parent)));
|
|
87
|
+
if (value.kind === "array") return combine(value.values.map(item => childParts(item, next(context),parent)));
|
|
75
88
|
if (value.kind !== "node") return new Set();
|
|
76
|
-
|
|
77
|
-
if
|
|
89
|
+
const mappedChildren=mapped(value,context,(output,context)=>childParts(output,context,parent));
|
|
90
|
+
if(mappedChildren)return mappedChildren;
|
|
91
|
+
if (ts.isJsxExpression(value.node)) return childParts(reference(value.node.expression, value.env, value.via), next(context),parent);
|
|
92
|
+
if (ts.isJsxFragment(value.node)) return combine(value.node.children.map(item => childParts(reference(item, value.env, value.via), next(context),parent)));
|
|
78
93
|
const view = element(value.node, value.env, value.via);
|
|
79
94
|
if (!view) return new Set();
|
|
80
95
|
const target = resolve(view.tag, next(context));
|
|
81
|
-
|
|
96
|
+
if(["provider","context"].includes(target.kind))return childParts(get(view.attributes,"children",next(context)),next(context),parent);
|
|
97
|
+
const matched=parts.filter(part=>part.apiNode&&part.apiNode===target.node);
|
|
98
|
+
const edges=matched.filter(part=>parent?part.parentNode===parent:!parts.some(other=>other.apiNode===part.parentNode)).map(part=>part.edge);
|
|
99
|
+
return new Set([...edges,...(matched.length?childParts(get(view.attributes,"children",next(context)),next(context),target.node):[])]);
|
|
82
100
|
}
|
|
83
101
|
function render(input, context) {
|
|
84
102
|
const value = resolve(input, next(context));
|
|
@@ -86,10 +104,11 @@ export function createScenarioTrace(program, options) {
|
|
|
86
104
|
if (value.kind === "unknown") { if (value.reason) limits.add(value.reason); return new Set(); }
|
|
87
105
|
if (value.kind === "union") {
|
|
88
106
|
if (value.values.length > maxBranches) { limits.add("Scenario render tracing reached its alternative limit."); return new Set(); }
|
|
89
|
-
return
|
|
107
|
+
return alternatives(value.values.map(item => render(item, next(context))));
|
|
90
108
|
}
|
|
91
109
|
if (value.kind === "array") return combine(value.values.map(item => render(item, next(context))));
|
|
92
110
|
if (value.kind !== "node") return new Set();
|
|
111
|
+
if(exercise){const mappedChildren=mapped(value,context,render);if(mappedChildren)return mappedChildren;}
|
|
93
112
|
const { node, env, via } = value;
|
|
94
113
|
if (ts.isJsxExpression(node)) return render(reference(node.expression, env, via), next(context));
|
|
95
114
|
if (ts.isJsxFragment(node)) return combine(node.children.map(child => render(reference(child, env, via), next(context))));
|
|
@@ -100,21 +119,31 @@ export function createScenarioTrace(program, options) {
|
|
|
100
119
|
function component(input) {
|
|
101
120
|
const target = resolve(input, next(context));
|
|
102
121
|
if (["provider", "context"].includes(target.kind)) return render(get(view.attributes, "children", next(context)), next(context));
|
|
103
|
-
if (target.kind === "union") return target.values.length <= maxBranches ?
|
|
122
|
+
if (target.kind === "union") return target.values.length <= maxBranches ? alternatives(target.values.map(component)) : new Set();
|
|
104
123
|
if (target.kind !== "node") return new Set();
|
|
105
124
|
const names = new Set(publicNodes.get(target.node) ?? []);
|
|
106
|
-
|
|
125
|
+
const children=parts.some(part=>target.node===part.consumerNode)?childParts(get(view.attributes,"children",next(context)),next(context)):new Set();
|
|
126
|
+
for (const part of parts) if (target.node === part.consumerNode && children.has(part.edge)) names.add(`@consumed:${part.edge}`);
|
|
107
127
|
if (isFunction(target.node) && (entry || !isDevelopmentFile(target.node.getSourceFile().fileName, options) || isReviewFile(target.node.getSourceFile().fileName, options))) {
|
|
108
|
-
const
|
|
109
|
-
|
|
128
|
+
const sites=context.componentSites??new Set();
|
|
129
|
+
if(sites.has(node))limits.add("Recursive component source site could not be fully traced.");
|
|
130
|
+
else {
|
|
131
|
+
const nested={...next(context),componentSites:new Set([...sites,node])};
|
|
132
|
+
const outputs = returns(target, [view.attributes], nested, "component");
|
|
133
|
+
for (const name of render(union(outputs), nested)) names.add(name);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for(let pass=0;pass<parts.length;pass++) {
|
|
137
|
+
const count=names.size;
|
|
138
|
+
for (const part of parts) if ((names.has(part.parentName)||names.has(`@exercised:${part.parentName}`)) && names.has(`@consumed:${part.edge}`)) names.add(`@exercised:${part.apiName}`);
|
|
139
|
+
if(names.size===count)break;
|
|
110
140
|
}
|
|
111
|
-
for (const part of parts) if (names.has(part.parentName) && names.has(`@consumed:${part.apiName}`)) names.add(`@exercised:${part.apiName}`);
|
|
112
141
|
return names;
|
|
113
142
|
}
|
|
114
143
|
return component(view.tag);
|
|
115
144
|
}
|
|
116
|
-
const target=entry&&resolve(reference(site),
|
|
117
|
-
const evidence = target?.kind==="node"&&isFunction(target.node) ? render(union(returns(target,[{kind:"object",layers:[]}],
|
|
145
|
+
const target=entry&&resolve(reference(site),initial);
|
|
146
|
+
const evidence = target?.kind==="node"&&isFunction(target.node) ? render(union(returns(target,[{kind:"object",layers:[]}],initial,"component")),initial) : render(reference(site), initial);
|
|
118
147
|
return { rendered: new Set([...evidence].filter(name => !name.startsWith("@"))), declarative: new Set([...evidence].filter(name => name.startsWith("@exercised:")).map(name => name.slice(11))), limits: [...limits].slice(0, 3) };
|
|
119
148
|
}
|
|
120
149
|
|
|
@@ -167,11 +196,11 @@ export function createScenarioTrace(program, options) {
|
|
|
167
196
|
if (!ok && !reasons.size) reasons.add("Each nonempty return path needs owned Linaria styles; stable hooks alone are not styling evidence.");
|
|
168
197
|
return { present: !property || value.kind !== "unknown", ok, reasons: [...reasons].slice(0, 3) };
|
|
169
198
|
}
|
|
170
|
-
function traceEntry(source) {
|
|
199
|
+
function traceEntry(source, {exercise=false}={}) {
|
|
171
200
|
const module=checker.getSymbolAtLocation(source),symbol=module&&checker.getExportsOfModule(module).find(symbol=>symbol.name==="default");
|
|
172
201
|
const resolved=symbol?.flags&ts.SymbolFlags.Alias?checker.getAliasedSymbol(symbol):symbol;
|
|
173
202
|
const declaration=resolved?.valueDeclaration;
|
|
174
|
-
return traceRenders(declaration&&(ts.isExportAssignment(declaration)?declaration.expression:declaration.name??declaration),{entry:true});
|
|
203
|
+
return traceRenders(declaration&&(ts.isExportAssignment(declaration)?declaration.expression:declaration.name??declaration),{entry:true,exercise});
|
|
175
204
|
}
|
|
176
205
|
return { traceRenders, traceEntry, classValue };
|
|
177
206
|
}
|
package/dist/scenarios.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { projectCompilerOptions } from "./boundaries.mjs";
|
|
|
8
8
|
import { inspectTokens } from "./tokens.mjs";
|
|
9
9
|
import { isSharedToken } from "./token-policy.mjs";
|
|
10
10
|
import { validTokenSamples } from "./token-samples.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { inspectUnits } from "./units.mjs";
|
|
12
12
|
import { createScenarioTrace } from "./scenario-trace.mjs";
|
|
13
13
|
import { inspectRuntimeContracts } from "./runtime-contracts.mjs";
|
|
14
14
|
import { inspectUnitContracts } from "./unit-contracts.mjs";
|
|
@@ -51,7 +51,7 @@ export function inspectScenarios(options, suppliedProgram) {
|
|
|
51
51
|
const behaviorApis = new Map(publicApi(program, options).filter(item => !item.renderable && item.behavioral).map(item => [item.name, item]));
|
|
52
52
|
const tokenInventory = inspectTokens(root, options);
|
|
53
53
|
const tokenNames = new Set(tokenInventory.tokens.map(token => token.name));
|
|
54
|
-
const
|
|
54
|
+
const units = inspectUnits(options);
|
|
55
55
|
const scenarios = [];
|
|
56
56
|
const diagnostics = [...inspectUnitContracts(options).diagnostics,...inspectRuntimeContracts(options,program).diagnostics,...inspectPaintContracts(options).diagnostics];
|
|
57
57
|
const ids = new Set();
|
|
@@ -76,7 +76,7 @@ export function inspectScenarios(options, suppliedProgram) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
if(metadata?.id!==undefined) {
|
|
79
|
-
const owner=
|
|
79
|
+
const owner=units.owner(relative);
|
|
80
80
|
if(typeof metadata.id!=="string"||metadata.id.length>256||!/^[\w-]+(?:[/.][\w-]+)*$/.test(metadata.id)||!owner||!(metadata.id===owner||metadata.id.startsWith(owner+"/")||metadata.id.startsWith(owner+".")))report(file,"Scenario id must be a safe stable identity inside this owner; it cannot capture another layer/owner.",metadataExpression,{entry:"id"});
|
|
81
81
|
else id=metadata.id;
|
|
82
82
|
}
|
|
@@ -84,8 +84,8 @@ export function inspectScenarios(options, suppliedProgram) {
|
|
|
84
84
|
if (ids.has(id)) { report(file, `Duplicate scenario id ${id}. Use one entrypoint per identity.`); continue; }
|
|
85
85
|
ids.add(id);
|
|
86
86
|
if (metadata?.kind !== undefined) {
|
|
87
|
-
const owner =
|
|
88
|
-
if (metadata.kind !== "tokens" ||
|
|
87
|
+
const owner = units.owner(relative);
|
|
88
|
+
if (metadata.kind !== "tokens" || owner !== "tokens") report(file, "Token previews belong in the shared Data token directory. Components and patterns map shared tokens; they do not own independent token catalogues.",entryNode("kind"),{entry:"kind"});
|
|
89
89
|
else kind = "tokens";
|
|
90
90
|
}
|
|
91
91
|
if (!entry) report(file, "Export a default independently mountable scenario entrypoint.");
|
|
@@ -117,7 +117,7 @@ export function inspectScenarios(options, suppliedProgram) {
|
|
|
117
117
|
return index !== undefined && property && ts.isArrayLiteralExpression(property.initializer) ? property.initializer.elements[index] : property?.initializer ?? metadataExpression;
|
|
118
118
|
}
|
|
119
119
|
if (!metadata) {
|
|
120
|
-
report(file, "Scenario metadata is not statically readable. Render coverage is not established until this prerequisite is repaired.", metadataExpression, {coverage:"not-established",owner:
|
|
120
|
+
report(file, "Scenario metadata is not statically readable. Render coverage is not established until this prerequisite is repaired.", metadataExpression, {coverage:"not-established",owner:units.owner(relative)});
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
123
|
for(const field of Object.keys(metadata))if(!["id","title","kind","covers","exercises","tokens","samples","captureTargets"].includes(field))report(file,`Unknown scenario field ${field}.`,entryNode(field),{entry:field});
|
|
@@ -126,7 +126,7 @@ export function inspectScenarios(options, suppliedProgram) {
|
|
|
126
126
|
metadata.title=id;
|
|
127
127
|
}
|
|
128
128
|
if(!Array.isArray(metadata.covers)||!metadata.covers.length) {
|
|
129
|
-
report(file,"Scenario covers must be a nonempty static array naming rendered public UI. Coverage is not established until repaired.",entryNode("covers"),{entry:"covers",coverage:"not-established",owner:
|
|
129
|
+
report(file,"Scenario covers must be a nonempty static array naming rendered public UI. Coverage is not established until repaired.",entryNode("covers"),{entry:"covers",coverage:"not-established",owner:units.owner(relative)});
|
|
130
130
|
metadata.covers=[];
|
|
131
131
|
}
|
|
132
132
|
if(Object.hasOwn(metadata,"tokens")&&(!Array.isArray(metadata.tokens)||metadata.tokens.some(name=>typeof name!=="string"||!name.startsWith("--")))) {
|
|
@@ -163,16 +163,16 @@ export function inspectScenarios(options, suppliedProgram) {
|
|
|
163
163
|
const tokens = [...new Set([...(metadata.tokens ?? []), ...(metadata.samples ?? []).map(sample => sample.token)])];
|
|
164
164
|
for (const name of tokens) if (!tokenNames.has(name)) diagnostics.push({ file: path.relative(root, file).replaceAll("\\", "/"), rule: "token-scenario-reference", line: 1, column: 1, message: `Scenario references undeclared token ${name}. Use a real token from its defining owner.` });
|
|
165
165
|
if (kind === "tokens") {
|
|
166
|
-
const owner =
|
|
167
|
-
for (const name of tokens) if (tokenInventory.tokens.find(token => token.name === name)?.owner !== owner) report(file, `Token ${name} needs a preview beside its defining owner.
|
|
166
|
+
const owner = units.owner(relative);
|
|
167
|
+
for (const name of tokens) if (tokenInventory.tokens.find(token => token.name === name)?.owner !== owner) report(file, `Token ${name} needs a preview beside its defining owner. All design tokens and their previews belong under the configured shared token directory.`);
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
const reachable = new Set(metadata.covers);
|
|
171
171
|
function findBindings(node) { if(ts.isJsxElement(node)||ts.isJsxSelfClosingElement(node))for(const name of bindingTrace.traceRenders(node).rendered)reachable.add(name);ts.forEachChild(node,findBindings); }
|
|
172
172
|
if(bindingTrace) findBindings(source);
|
|
173
173
|
const paintBindings = inspectRuntimeContracts(options,program).bindings.filter(binding=>reachable.has(binding.scope.apiName)).map(binding=>({owner:binding.unit,name:binding.name,scope:binding.scope.selector,prefix:binding.prefix,suffix:binding.suffix,tokens:tokenInventory.tokens.filter(token=>!token.owner||token.owner==="tokens"||token.owner===binding.unit).map(token=>token.name)}));
|
|
174
174
|
const paintAudit=contractDeclarations.some(contract=>contract.paintInputs?.some(input=>reachable.has(input.apiName)));
|
|
175
|
-
scenarios.push({ id, kind, title: metadata.title, ...(fixture ? { fixture: path.relative(root, fixture).replaceAll("\\", "/") } : {}), covers: [...new Set(metadata.covers)], ...(captureTargets ? { captureTargets } : {}), ...(Object.hasOwn(metadata, "exercises") ? { exercises: [...new Set(exercises)] } : {}), tokens, ...(metadata.samples ? { samples: metadata.samples } : {}), ...(
|
|
175
|
+
scenarios.push({ id, kind, title: metadata.title, ...(fixture ? { fixture: path.relative(root, fixture).replaceAll("\\", "/") } : {}), covers: [...new Set(metadata.covers)], ...(captureTargets ? { captureTargets } : {}), ...(Object.hasOwn(metadata, "exercises") ? { exercises: [...new Set(exercises)] } : {}), tokens, ...(metadata.samples ? { samples: metadata.samples } : {}), ...(paintBindings.length?{paintBindings}:{}), ...(paintAudit?{paintAudit:true}:{}), file: path.relative(root, file).replaceAll("\\", "/"), artifact: path.relative(root, scenarioArtifact(root, id)).replaceAll("\\", "/") });
|
|
176
176
|
}
|
|
177
177
|
return { scenarios: scenarios.sort((a, b) => a.id.localeCompare(b.id)), diagnostics };
|
|
178
178
|
}
|
|
@@ -282,7 +282,7 @@ export function inspectScenarioCoverage(options, program, report, advise = () =>
|
|
|
282
282
|
ts.forEachChild(node, child => visit(child, reached && (ts.isExportAssignment(node) || ts.isVariableDeclaration(node))));
|
|
283
283
|
}
|
|
284
284
|
for (const node of source.statements) if (ts.isExportAssignment(node) || node.modifiers?.some(item => item.kind === ts.SyntaxKind.DefaultKeyword)) visit(node, true);
|
|
285
|
-
if(parts.some(part=>scenario.exercises?.includes(part.apiName)))for(const name of trace.traceEntry(source).declarative)declarative.add(name);
|
|
285
|
+
if(parts.some(part=>scenario.exercises?.includes(part.apiName)))for(const name of trace.traceEntry(source,{exercise:true}).declarative)declarative.add(name);
|
|
286
286
|
for (const name of scenario.covers) {
|
|
287
287
|
if (!rendered.has(name)) report(source.fileName, "scenario-render", `${name} is declared in covers but has no reachable public render reference. Render it directly or through a traced parent with fixture props/defaults selecting that child. Imports, unused JSX and unknown conditional paths do not establish coverage.${renderLimits.size ? ` Source tracing could not establish: ${[...renderLimits].slice(0, 2).join(" ")}` : ""} Review the real scenario in a browser; do not hide a valid public part just to avoid coverage. See ads://guides/scenarios.`);
|
|
288
288
|
else covered.add(name);
|
|
@@ -300,7 +300,7 @@ export function inspectScenarioCoverage(options, program, report, advise = () =>
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
const blockedOwners=new Set(registry.diagnostics.filter(item=>item.coverage==="not-established").map(item=>item.owner));
|
|
303
|
-
for (const item of ui.filter((item) => item.renderable && !covered.has(item.name) && !blockedOwners.has(
|
|
303
|
+
for (const item of ui.filter((item) => item.renderable && !covered.has(item.name) && !blockedOwners.has(inspectUnits(options).owner(inspectUnits(options).relative(path.relative(options.root,item.file)))))) report(item.file, "scenario-coverage", `Public UI ${item.name} needs a colocated, registered scenario render reference. Related parts may share a scenario.`);
|
|
304
304
|
for (const token of tokenInventory.tokens.filter(token => !coveredTokens.has(token.name))) {
|
|
305
305
|
const definition = token.definitions[0];
|
|
306
306
|
report(path.join(options.root, definition.file), "token-scenario-coverage", `Token ${token.name} needs a registered scenario with a reachable token fixture reference.`, definition.line, definition.column);
|
|
@@ -335,9 +335,9 @@ export function tokenSampleSource(options, scenario) {
|
|
|
335
335
|
const array = property && resolve(property.initializer);
|
|
336
336
|
if (array && ts.isArrayLiteralExpression(array)) {
|
|
337
337
|
const source = array.getSourceFile();
|
|
338
|
-
const
|
|
338
|
+
const units = inspectUnits(options), owner = units.owner(units.relative(scenario.file));
|
|
339
339
|
const relative = path.relative(options.root, source.fileName).replaceAll("\\", "/");
|
|
340
|
-
if (!isDevelopmentFile(source.fileName, options) ||
|
|
340
|
+
if (!isDevelopmentFile(source.fileName, options) || units.owner(units.relative(relative)) !== owner) throw new Error("The consumed samples array must live in this scenario's own development fixture.");
|
|
341
341
|
return {file:relative, content:source.text, start:array.getStart(source), end:array.end};
|
|
342
342
|
}
|
|
343
343
|
}
|
package/dist/skills/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Install the skills you need with `npx skills`:
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
npx skills add reqvire-org/ads --skill ads-designer --skill ads-import --skill ads-
|
|
6
|
+
npx skills add reqvire-org/ads --skill ads-designer --skill ads-import --skill ads-port --skill ads-break-ui --skill ads-motion
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
For local development, install from this checkout:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npx skills add ./skills --skill ads-designer --skill ads-import --skill ads-
|
|
12
|
+
npx skills add ./skills --skill ads-designer --skill ads-import --skill ads-port --skill ads-break-ui --skill ads-motion
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Each skill includes its own instructions and references. `ads-designer` also
|
|
@@ -36,13 +36,17 @@ the browser, and provides a running URL or exact command for review. See the
|
|
|
36
36
|
|-------|-----|---------|
|
|
37
37
|
| [ads-designer](ads-designer/SKILL.md) | Bootstrap or build UI using the local ADS, with craft/mobile guidance | `$ads-designer build a settings page using this project's ADS` |
|
|
38
38
|
| [ads-import](ads-import/SKILL.md) | Import selected external ADS source, brand artwork, or compatible source token values | `$ads-import /path/to/source-repo component Toast` |
|
|
39
|
-
| [ads-
|
|
39
|
+
| [ads-port](ads-port/SKILL.md) | Port library capabilities into a coherent ADS using shared tokens and primitives | `$ads-port https://github.com/emilkowalski/sonner` |
|
|
40
40
|
| [ads-break-ui](ads-break-ui/SKILL.md) | Stress-test real components/patterns; optionally fix demonstrated failures | `$ads-break-ui AppShell +fix` |
|
|
41
41
|
| [ads-motion](ads-motion/SKILL.md) | Implement, review, audit, or profile motion | `$ads-motion review Toast` |
|
|
42
42
|
|
|
43
43
|
For token values, use `$ads-import /path/to/source-repo tokens`; for original
|
|
44
44
|
artwork and its guidance, use `$ads-import /path/to/source-repo brand`. ADS token
|
|
45
45
|
names and ownership prefixes are fixed; imports conform to that architecture.
|
|
46
|
+
Shared Data is the only design-value catalogue. Existing project font, text and
|
|
47
|
+
spacing roles take precedence over divergent upstream constants. Each skill
|
|
48
|
+
includes `references/design-data.md` for source rules and duplication review;
|
|
49
|
+
demo framing lives in development-only `review/`.
|
|
46
50
|
For motion, the
|
|
47
51
|
request selects the mode, for example `build`, `audit`, or `performance`.
|
|
48
52
|
Review/audit requests report findings; a fix request authorizes implementation.
|
|
@@ -49,7 +49,7 @@ ADS gates. For binary/large assets, generate `git diff --binary --full-index` in
|
|
|
49
49
|
stay out of model context. Binary changes require Git. When editing is disabled,
|
|
50
50
|
use the client's normal source-editing tools.
|
|
51
51
|
For owner drafts, token-sample reconciliation, coupled transactions and local
|
|
52
|
-
|
|
52
|
+
shared Data ownership, read [guarded-editing.md](references/guarded-editing.md).
|
|
53
53
|
For on-demand current/candidate screenshots and visual dry-run review, read
|
|
54
54
|
[captures.md](references/captures.md).
|
|
55
55
|
For a rejected patch, failed check or loading error, read
|
|
@@ -93,11 +93,11 @@ pattern; reusable controllers use discovered `controllers/<Name>` units. Use the
|
|
|
93
93
|
project's configured framework and declared dependencies, or plain TypeScript,
|
|
94
94
|
browser APIs and local helpers. MCP hosts supply no ad hoc runtime APIs. The
|
|
95
95
|
framework setting selects compilation/mounting; controller checks also validate
|
|
96
|
-
imports. For controller/behavior work, read
|
|
97
|
-
|
|
96
|
+
imports. For controller/behavior work, read
|
|
97
|
+
[behaviors.md](references/behaviors.md), also served as `ads://guides/behaviors`. Discover registered guarantees
|
|
98
98
|
with `ads_behaviors`; use `ads_verify` for selected real checks. Optional
|
|
99
99
|
`exercises` links public behavioral APIs to scenarios; keep `covers` for rendered
|
|
100
|
-
UI. Registration and demonstration are not passing evidence.
|
|
100
|
+
UI. Registration and demonstration are not passing evidence. `<Owner>.ads.contract.ts`,
|
|
101
101
|
scenarios, fixtures and checks stay out of production exports/imports. Verify
|
|
102
102
|
current results, including lifecycle setup/cleanup/setup and the actual browser
|
|
103
103
|
profile when promised. React StrictMode needs a development harness; wrapping a
|
|
@@ -154,7 +154,7 @@ failure is reproducible.
|
|
|
154
154
|
|
|
155
155
|
Scenarios own sample data and example selection. Missing reusable UI belongs in the
|
|
156
156
|
ADS implementation and public exports, not in a scenario-only control. The tool supplies the neutral client shell; reusable scenario review layouts
|
|
157
|
-
are
|
|
157
|
+
are exported through the separate development-only review entry.
|
|
158
158
|
Showcase/scenario files define no CSS, custom classes, or widget markup. Change
|
|
159
159
|
the owning ADS frame pattern when a necessary layout is missing. Run shared ADS/project guards for its build and the app
|
|
160
160
|
build, then give a full running URL or exact run command for human review.
|
|
@@ -179,26 +179,27 @@ The host shows errors and marks retained output as stale. Other hosts may need a
|
|
|
179
179
|
explicit preview-tool invocation. Compilation remains project-owned and required
|
|
180
180
|
for TSX/Linaria; it is automatic, not eliminated.
|
|
181
181
|
|
|
182
|
-
Reusable review layouts belong in
|
|
182
|
+
Reusable review layouts belong in development-only `review/`, exported through
|
|
183
|
+
the separate review entry, while scenario
|
|
183
184
|
files define no CSS, custom classes or widget replicas. Keep real presentation in
|
|
184
185
|
its component/pattern owner. The tooling shell's CSS is outside that project
|
|
185
186
|
contract. Legacy custom showcase pages may be retained during migration; new
|
|
186
187
|
projects require no TokensPage/ComponentsPage/PatternsPage/CompositionPage files.
|
|
187
188
|
|
|
188
|
-
Colocate
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
Colocate `<Owner>.ads.scenario.tsx` and `<Owner>.ads.fixture.ts` with tokens and
|
|
190
|
+
each component/pattern. Put larger entries under `composition/<Name>/` with their
|
|
191
|
+
own marked scenario and fixture. Export a default
|
|
191
192
|
zero-input mountable view and literal metadata, for example
|
|
192
193
|
`export const scenario = { title: "Button states", covers: ["Button"] };`.
|
|
193
194
|
Import the real UI from the public ADS alias. Keep fixture inputs, simulated
|
|
194
195
|
services and initial state/callback adapters beside the scenario. Empty fixtures
|
|
195
196
|
are valid for an entry with no inputs. Extra development helpers use a
|
|
196
|
-
|
|
197
|
+
`<Owner>.ads.helpers.ts` file, so guards
|
|
197
198
|
recognize their role even beside runtime code. Never require a page, router or store to
|
|
198
199
|
initialize the entry. Several contextual public parts may share one scenario.
|
|
199
200
|
|
|
200
|
-
IDs derive from ADS-relative filenames: both `components/core/Button/
|
|
201
|
-
and `components/core/Button.scenario.tsx` identify `components/core/Button`.
|
|
201
|
+
IDs derive from ADS-relative filenames: both `components/core/Button/Button.ads.scenario.tsx`
|
|
202
|
+
and `components/core/Button.ads.scenario.tsx` identify `components/core/Button`.
|
|
202
203
|
Use one form, no duplicate IDs or hand-maintained registry. Renames change IDs.
|
|
203
204
|
The showcase and external hosts mount the same discovered entry. The Vite
|
|
204
205
|
adapter uses `previewEntriesPlugin` and `createPreviewResources` with
|
|
@@ -357,5 +358,15 @@ Source credits and retained MIT terms: [README.md](README.md) and
|
|
|
357
358
|
[LICENSE.upstream](LICENSE.upstream).
|
|
358
359
|
|
|
359
360
|
For static owner contracts, `.ads.` development roles, typed paint/binding APIs,
|
|
360
|
-
declarative
|
|
361
|
+
declarative parent graphs, constrained theme bindings, private visual subject roles,
|
|
362
|
+
shared Data ownership and guarded migration, read
|
|
361
363
|
[contracts.md](references/contracts.md) when the task touches those contracts.
|
|
364
|
+
|
|
365
|
+
For a suspected ADS defect or missing capability after targeted investigation, read
|
|
366
|
+
[reporting.md](references/reporting.md). Record actionable observations with
|
|
367
|
+
`ads_report_bug` or `ads_request_feature`; preserve valid APIs and rejected drafts.
|
|
368
|
+
|
|
369
|
+
For Data/UX/Skin boundaries, shared token reuse and private-value diagnostics, read
|
|
370
|
+
[design-data.md](references/design-data.md). Components own mappings and mechanics,
|
|
371
|
+
not independent token catalogues. Existing project font, text and spacing roles
|
|
372
|
+
take precedence over divergent upstream constants during adaptation.
|
|
@@ -110,8 +110,7 @@ MCP delivers it inside the App document, not the outer showcase host.
|
|
|
110
110
|
ownership, and rejects conflicting schemas or registrations shared by unrelated
|
|
111
111
|
owners. Identical registrations from the same owner are permitted. Runtime
|
|
112
112
|
`--ds-*` / `--ux-*` variables stay with their runtime owner. A shared token's
|
|
113
|
-
registration belongs beside its actual definition in a foundation value sheet
|
|
114
|
-
a namespaced owner token's registration belongs in its registered `tokens.css`.
|
|
113
|
+
registration belongs beside its actual definition in a foundation value sheet.
|
|
115
114
|
Neither `base.css` nor `fonts.css` becomes a registration escape hatch. Registration
|
|
116
115
|
alone does not define a token or satisfy its sample/fixture coverage.
|
|
117
116
|
|
|
@@ -258,6 +257,14 @@ contract; an overlap warning remains a review signal.
|
|
|
258
257
|
with `severity: "warning"`. CLI checks still exit successfully when there are no
|
|
259
258
|
errors; MCP checks and mutations preserve the warning and its guidance URI.
|
|
260
259
|
|
|
260
|
+
An unchanged advisory baseline is not evidence that the affected styles are
|
|
261
|
+
correct. Triage warnings that reach an edited owner or its shared helpers against
|
|
262
|
+
the actual DOM classes and computed styles in a compiled scenario. Interaction
|
|
263
|
+
checks may pass without measuring padding, alignment or sizing. When an intended
|
|
264
|
+
layout is known, add a focused rendered assertion for that contract; when keeping
|
|
265
|
+
an overlap, state why it is intentional and which states/directions were checked.
|
|
266
|
+
Keep unresolved paths and unsupported writing modes explicit in the evidence.
|
|
267
|
+
|
|
261
268
|
The source review examines atomic Linaria templates and statically traceable
|
|
262
269
|
`cx` arguments, including aliases, local imports/re-exports, local helper returns,
|
|
263
270
|
arguments/defaults, nested composition, conditional expressions and variant-object
|