@reqvire-org/ads 0.3.16 → 0.3.18
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 +3 -0
- package/dist/atomic-composition.mjs +1 -1
- package/dist/check.mjs +43 -11
- package/dist/evidence.mjs +18 -0
- package/dist/investigations.mjs +101 -0
- package/dist/linaria/preserve-values.cjs +21 -2
- package/dist/mcp/behavior-pages.mjs +36 -0
- package/dist/mcp/context.mjs +3 -1
- package/dist/mcp/execution-results.mjs +146 -0
- package/dist/mcp/mutations.mjs +34 -17
- package/dist/mcp/preview-widget.bundle.js +12 -12
- package/dist/mcp/resource-loader.js +3 -3
- package/dist/mcp/result-pages.mjs +87 -0
- package/dist/mcp/server.mjs +67 -30
- package/dist/property-registrations.mjs +39 -0
- package/dist/scenario-selectors.mjs +140 -0
- package/dist/scenario-trace.mjs +1 -1
- package/dist/scoped-tokens.mjs +6 -0
- package/dist/selector-match.mjs +94 -0
- package/dist/showcase/client.bundle.js +2 -2
- package/dist/skills/ads-break-ui/SKILL.md +8 -3
- package/dist/skills/ads-break-ui/references/atomic-styles.md +48 -0
- package/dist/skills/ads-break-ui/references/captures.md +6 -1
- package/dist/skills/ads-break-ui/references/evidence.md +120 -0
- package/dist/skills/ads-break-ui/references/guarded-editing.md +8 -5
- package/dist/skills/ads-break-ui/references/scenarios.md +32 -0
- package/dist/skills/ads-designer/SKILL.md +8 -3
- package/dist/skills/ads-designer/references/atomic-styles.md +48 -0
- package/dist/skills/ads-designer/references/captures.md +6 -1
- package/dist/skills/ads-designer/references/evidence.md +120 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +8 -5
- package/dist/skills/ads-designer/references/scenarios.md +32 -0
- package/dist/skills/ads-import/SKILL.md +8 -3
- package/dist/skills/ads-import/references/atomic-styles.md +48 -0
- package/dist/skills/ads-import/references/captures.md +6 -1
- package/dist/skills/ads-import/references/evidence.md +120 -0
- package/dist/skills/ads-import/references/guarded-editing.md +8 -5
- package/dist/skills/ads-import/references/scenarios.md +32 -0
- package/dist/skills/ads-migrate/SKILL.md +8 -3
- package/dist/skills/ads-migrate/references/atomic-styles.md +48 -0
- package/dist/skills/ads-migrate/references/captures.md +6 -1
- package/dist/skills/ads-migrate/references/evidence.md +120 -0
- package/dist/skills/ads-migrate/references/guarded-editing.md +8 -5
- package/dist/skills/ads-migrate/references/scenarios.md +32 -0
- package/dist/skills/ads-motion/SKILL.md +8 -3
- package/dist/skills/ads-motion/references/atomic-styles.md +48 -0
- package/dist/skills/ads-motion/references/captures.md +6 -1
- package/dist/skills/ads-motion/references/evidence.md +120 -0
- package/dist/skills/ads-motion/references/guarded-editing.md +8 -5
- package/dist/skills/ads-motion/references/scenarios.md +32 -0
- package/dist/verification/browser.mjs +22 -7
- package/dist/verification/playwright-reporter.cjs +23 -5
- package/dist/verification.mjs +31 -9
- package/docs/ADS.md +10 -0
- package/docs/ARCHITECTURE.md +47 -3
- package/docs/BEHAVIORS.md +30 -0
- package/docs/CHANGELOG.md +30 -0
- package/docs/MCP.md +66 -7
- package/package.json +2 -1
|
@@ -101,7 +101,12 @@ failed/cancelled capture does not replace existing image slots or apply source.
|
|
|
101
101
|
If a scenario/target is newly introduced, `current` is null with an explicit
|
|
102
102
|
`currentAbsent` explanation; only the real candidate image exists.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
The edit reply is a summary. Read `ads_results({resultId,section:"captures"})` for
|
|
105
|
+
the requested image resource URIs and `section:"diagnostics"` for relevant
|
|
106
|
+
messages; follow `nextCursor` when needed. Read image resources explicitly.
|
|
107
|
+
Standalone `ads_capture` continues returning its selected capture directly.
|
|
108
|
+
|
|
109
|
+
Review those images and diagnostics, fix the draft if necessary, then apply
|
|
105
110
|
with `dryRun:false`. Apply reruns all gates. An image is promoted only when the
|
|
106
111
|
accepted source revision matches the captured candidate; other proposals remain
|
|
107
112
|
stale. Images do not approve a patch or certify interaction/accessibility/parity.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Investigate the failing boundary
|
|
2
|
+
|
|
3
|
+
Use this reference after a rejected patch, failed check or preview loading error.
|
|
4
|
+
MCP serves it as `ads://guides/evidence`. Inspect the compact result first; fetch
|
|
5
|
+
only the failing check's bundle or relevant artifact, rather than repeating a suite.
|
|
6
|
+
|
|
7
|
+
## Read the result correctly
|
|
8
|
+
|
|
9
|
+
`failure.category` identifies a boundary, not an inferred root cause:
|
|
10
|
+
|
|
11
|
+
| Category | Established observation | Next inspection |
|
|
12
|
+
|----------|-------------------------|-----------------|
|
|
13
|
+
| `architecture` | A source/ownership/configuration gate rejected the candidate. | Exact rule, source location and `certainty`. An inconclusive ownership proof does not establish that a valid API is wrong. |
|
|
14
|
+
| `build` | A registered project pipeline step or compiled-resource integrity check failed. | Named command/phase, exit code, bounded output and build revision. A custom project script may contain several kinds of checks. |
|
|
15
|
+
| `transport` | An MCP/browser resource delivery boundary failed. | Resource URI, relevant failed startup requests and observed browser errors. Do not infer a network-interface or component cause without evidence. |
|
|
16
|
+
| `runner` | The harness, process, readiness or reporting boundary failed, or a test threw without assertion evidence. | Active/pending checks, timeout, failing step and artifacts. `certainty: "unclassified"` means ADS cannot establish the cause. |
|
|
17
|
+
| `assertion` | A reported assertion step or token binding check failed. | Expected behavior, source location, state and trace. This can still be a test defect; compare the intended contract before editing the component. |
|
|
18
|
+
|
|
19
|
+
A complete failed run can contain independent passing cases. Suite interruption,
|
|
20
|
+
missing/skipped cases, stale inputs and an unexplained process exit cannot certify
|
|
21
|
+
a pass. Keep the reported case outcome separate from whole-run acceptance.
|
|
22
|
+
|
|
23
|
+
## Retrieve only the evidence needed
|
|
24
|
+
|
|
25
|
+
`ads_verify`, `ads_apply_patch` and `ads_apply_transaction` reply with counts,
|
|
26
|
+
bounded acceptance, at most three failure previews and `resultId`, within 4096
|
|
27
|
+
UTF-8 JSON bytes. Full validation still decides acceptance. Do not repeat a suite
|
|
28
|
+
merely to recover its output, or restate the complete report in conversation.
|
|
29
|
+
|
|
30
|
+
Read a relevant saved section:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
ads_results({resultId: "<returned ID>", section: "outcomes", status: "not_passed"})
|
|
34
|
+
// Continue only when needed, with the same section and status:
|
|
35
|
+
ads_results({resultId: "<returned ID>", section: "outcomes", status: "not_passed", cursor: "<nextCursor>"})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Pages default to 10 rows, allow at most 20 and stay within 8192 JSON bytes. The
|
|
39
|
+
byte cap can return fewer rows; `nextCursor` is the continuation. Other sections
|
|
40
|
+
are `checks` (pipeline steps), `diagnostics`, `advisories`, `warnings`, `changes`,
|
|
41
|
+
`captures`, `acceptance`, `investigation` (mutation boundary) and `selection`.
|
|
42
|
+
A row marked `detailTruncated` is a preview. To read that exact record, pass its
|
|
43
|
+
`recordIndex`, the same result/section, and `offset`/`chars` (maximum 2000 UTF-16
|
|
44
|
+
characters); follow `nextOffset`. Do not combine ranges with a cursor/status filter.
|
|
45
|
+
Read only the relevant log range. Reading pages or ranges never executes checks.
|
|
46
|
+
|
|
47
|
+
`ads://project/results` lists the latest IDs. `ads://results/<resultId>` reads a
|
|
48
|
+
summary; matching query parameters read pages/ranges. Only the latest verification
|
|
49
|
+
and latest mutation snapshots are retained, independently, up to 8 MiB each.
|
|
50
|
+
A superseded ID fails explicitly. An oversized report retains only its summary
|
|
51
|
+
with a warning; disk failure retains details in server memory until shutdown.
|
|
52
|
+
Neither changes actual acceptance or applied state. These are logical JSON byte
|
|
53
|
+
budgets, not token estimates; compatibility text can duplicate structured JSON.
|
|
54
|
+
Saved outcomes describe completion-time evidence, not current source freshness;
|
|
55
|
+
compare their revisions with `ads_behaviors` before claiming a current pass.
|
|
56
|
+
|
|
57
|
+
`ads_behaviors` pages owner summaries, then an exact unit's `checks`, `guarantees`,
|
|
58
|
+
`subjects`, `demonstrations` or `profiles`. Use `nextCursor` and identical filters;
|
|
59
|
+
changes invalidate a discovery cursor. Read a truncated contract via its
|
|
60
|
+
`sourceFile` and bounded `ads_read_file`, rather than requesting everything.
|
|
61
|
+
|
|
62
|
+
## Get a compact investigation
|
|
63
|
+
|
|
64
|
+
Take an outcome's exact owner/check/run IDs from `ads_results`, then:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{ "unit": "components/Example", "check": "keyboard-navigation", "runId": "<outcome runId>" }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Send this to `ads_investigate`. It reads a summary within 4096 JSON bytes, without
|
|
71
|
+
running code. The run ID rejects evidence superseded by another execution.
|
|
72
|
+
`section: "details"`, `"requests"`, `"browserErrors"` or `"artifacts"` reads separate pages
|
|
73
|
+
(default 10/max 20 rows, at most 8192 JSON bytes); artifacts themselves require
|
|
74
|
+
explicit resource reads. Truncated investigation records also support
|
|
75
|
+
`recordIndex`/`offset`/`chars`; keep the exact `runId` to avoid mixing evidence.
|
|
76
|
+
Without a check, the tool pages available investigations.
|
|
77
|
+
`ads://project/investigations` lists available entries; the returned `resourceUri`
|
|
78
|
+
reads the same bundle. It records:
|
|
79
|
+
|
|
80
|
+
- Project versus isolated candidate, configured framework/profile and scenario.
|
|
81
|
+
- Exact input revision and the preview revision actually observed by the helper.
|
|
82
|
+
- `details.failingStep`, `details.source`, startup viewport and failure boundary.
|
|
83
|
+
- Counts for separately paged relevant requests, browser errors and artifacts.
|
|
84
|
+
- Available registered trace, screenshot or context artifact resource URIs.
|
|
85
|
+
- Explicit `acceptance.established` and `acceptance.unverified` scope.
|
|
86
|
+
|
|
87
|
+
Absent observations are `null` or empty; ADS does not invent a viewport, trace or
|
|
88
|
+
source line. Viewport evidence is labeled `preview-startup`; a test that resizes
|
|
89
|
+
later must collect its own failure-state evidence. Failed-request collection
|
|
90
|
+
covers managed startup, not a complete network trace. Bodies and headers are not
|
|
91
|
+
collected. Project-configured Playwright trace/screenshot policy controls which
|
|
92
|
+
artifacts exist; ADS does not turn on expensive recording or rerun a failed case.
|
|
93
|
+
Protocol runners may provide structured failure/step/location/artifact fields;
|
|
94
|
+
older reports remain valid and their unclassified errors stay explicit.
|
|
95
|
+
|
|
96
|
+
Only the latest bundle per registered check is exposed, including dry runs.
|
|
97
|
+
Another verification replaces it and removes old artifacts from resource access;
|
|
98
|
+
old runner output directories follow project cleanup policy. Artifact resources
|
|
99
|
+
are restricted to registered ordinary files under that run's output directory,
|
|
100
|
+
bounded to 20 MiB each and checked against their recorded digest on read.
|
|
101
|
+
Metadata is bounded to 2 MiB. Removed registrations are pruned on verification.
|
|
102
|
+
|
|
103
|
+
Candidate evidence never becomes passing live-source evidence. Compare the
|
|
104
|
+
recorded input revision with current `ads_behaviors` evidence; a bundle describes
|
|
105
|
+
its run, and does not claim current source merely because it remains available.
|
|
106
|
+
For a build/architecture rejection before behavior runs, inspect the mutation
|
|
107
|
+
saved `investigation` section via `ads_results`. Status retains the compact
|
|
108
|
+
execution summary and result ID, rather than embedding complete reports.
|
|
109
|
+
|
|
110
|
+
## Preserve the design while repairing the failure
|
|
111
|
+
|
|
112
|
+
Fix the owner of the demonstrated defect. Do not privatize a valid API, introduce
|
|
113
|
+
demo-only props, substitute a styled link, change the reference baseline or weaken
|
|
114
|
+
verification policy to pass a tooling limitation. Preserve the draft and report
|
|
115
|
+
the smallest source/browser reproduction when ownership remains unprovable.
|
|
116
|
+
|
|
117
|
+
`acceptance` states what that result established. Core checks establish source
|
|
118
|
+
guard acceptance; registered tests establish only their actual cases/profiles.
|
|
119
|
+
Neither establishes untested states, visual parity, an accessibility audit or
|
|
120
|
+
another MCP host's compatibility. Captures show an appearance, not a transition.
|
|
@@ -15,8 +15,10 @@ ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>",
|
|
|
15
15
|
|
|
16
16
|
The dry run validates the full candidate, including affected registered behavior
|
|
17
17
|
checks in an isolated project copy. Configured browser checks use that candidate's
|
|
18
|
-
managed preview, not the live showcase.
|
|
19
|
-
|
|
18
|
+
managed preview, not the live showcase. Read the summary, then page failing
|
|
19
|
+
`outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
|
|
20
|
+
`resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;
|
|
21
|
+
fix the draft and diff again. See [evidence.md](evidence.md) for page/range limits.
|
|
20
22
|
Keep behavior.json/specs with their owner and use registered checks; a scratchpad
|
|
21
23
|
run against live source cannot verify unapplied changes. After validation, apply
|
|
22
24
|
with `dryRun:false`; ADS revalidates before writing. Dry-run evidence is not saved
|
|
@@ -120,9 +122,10 @@ them through their actual public composition/customization path and list their r
|
|
|
120
122
|
render references in covers. Do not count internal production renders as public API
|
|
121
123
|
coverage. Behavioral APIs use exercises and registered guarantees instead.
|
|
122
124
|
Scenario controls still use public UI. A native link/button can supply semantics
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
through a public runtime slot that demonstrably clones its child with owned
|
|
126
|
+
props, or through matching runtime-owned selectors attached to the actual rendered
|
|
127
|
+
DOM. Source ownership must be proven; an `asChild` flag or a lookalike marker is
|
|
128
|
+
insufficient. Standalone controls and custom scenario styling remain rejected. See
|
|
126
129
|
[scenarios.md](scenarios.md) for evidence and limits. Preserve the intended
|
|
127
130
|
composition instead of substituting an unrelated styled control or adding a
|
|
128
131
|
demo-only component prop. Review framing belongs in public layout patterns.
|
|
@@ -101,6 +101,38 @@ do not export the helper solely for a test. Public/private ownership is a produc
|
|
|
101
101
|
decision, not a coverage workaround. Browser checks verify transitions but do not
|
|
102
102
|
replace the current static `covers` requirement; `exercises` does not waive it.
|
|
103
103
|
|
|
104
|
+
## Native semantics through runtime-owned selectors
|
|
105
|
+
|
|
106
|
+
An anchor or other native semantic element can also occupy a position styled by
|
|
107
|
+
public runtime UI, without cloning or an `asChild` API:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
// Runtime owner: the class is attached to Line's actual rendered span.
|
|
111
|
+
const line = css`:is(a, button) > & { color: var(--text-body); }`;
|
|
112
|
+
export function Line(props) { return <span className={line} {...props} />; }
|
|
113
|
+
|
|
114
|
+
// Scenario: semantics belong to the consumer, appearance to the runtime owner.
|
|
115
|
+
<a href={fixture.destination}><Line>{fixture.label}</Line></a>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
ADS traces the actual returned DOM, the attached Linaria template and matching
|
|
119
|
+
selector relationships. A public parent's `& > a` is evidence too. A tag-agnostic
|
|
120
|
+
parent selector such as `& > :has(> [data-part="line"])` must match a marker
|
|
121
|
+
declared by the actual runtime-owned child; a scenario-authored lookalike does not
|
|
122
|
+
qualify. No component names or marker spellings are reserved.
|
|
123
|
+
|
|
124
|
+
Unused styles, unrelated CSS, broad `& > *` selectors, negative selectors alone,
|
|
125
|
+
fabricated markers, unknown render alternatives and opaque class replacement
|
|
126
|
+
cannot grant permission. A selector cannot establish a scenario-built custom
|
|
127
|
+
widget's keyboard behavior. Inline styles and arbitrary classes remain rejected;
|
|
128
|
+
existing source-verified public class helpers keep their own contract.
|
|
129
|
+
|
|
130
|
+
Do not add a public link part or change the DOM to satisfy a cloning-only model.
|
|
131
|
+
Preserve semantic attributes and the intended public API. Unsupported source
|
|
132
|
+
grammar produces an inconclusive ownership diagnostic, not proof of a bad API.
|
|
133
|
+
Browser verification must establish the real focus treatment, hover/state
|
|
134
|
+
precedence, navigation and other promised behavior in the compiled App iframe.
|
|
135
|
+
|
|
104
136
|
## Native semantics through a public runtime slot
|
|
105
137
|
|
|
106
138
|
A native element can be the direct child of a public runtime component that
|
|
@@ -48,16 +48,21 @@ For owner drafts, token-sample reconciliation, coupled transactions and local
|
|
|
48
48
|
constant namespaces, read [guarded-editing.md](references/guarded-editing.md).
|
|
49
49
|
For on-demand current/candidate screenshots and visual dry-run review, read
|
|
50
50
|
[captures.md](references/captures.md).
|
|
51
|
+
For a rejected patch, failed check or loading error, read
|
|
52
|
+
[evidence and diagnosis](references/evidence.md); inspect the failing boundary
|
|
53
|
+
then page needed `ads_results` sections using the returned result ID. Inspect
|
|
54
|
+
one `ads_investigate({unit,check,runId})` summary before changing APIs or policy;
|
|
55
|
+
load request/error/artifact details only when relevant.
|
|
51
56
|
|
|
52
57
|
For parent/child `covers`, conditional-control review, reference comparisons,
|
|
53
|
-
public style-helper use, fragment
|
|
54
|
-
`showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
|
|
58
|
+
public style-helper use, native slot/selector composition, fragment navigation,
|
|
59
|
+
or `scenario-render` / `showcase-control` / `showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
|
|
55
60
|
examples explain API visibility, reference baselines and state-transition checks.
|
|
56
61
|
Traced parents can cover declared public children; verified public Linaria
|
|
57
62
|
helpers do not grant custom scenario CSS.
|
|
58
63
|
|
|
59
64
|
For atomic base/variant styling, helper/wrapper class composition, extracted
|
|
60
|
-
custom-property arithmetic, or an
|
|
65
|
+
custom-property arithmetic, typed `@property` registrations, or an
|
|
61
66
|
`atomic-composition-review` / `atomic-composition-limit` advisory, read
|
|
62
67
|
[atomic style composition](references/atomic-styles.md). The same guide is served
|
|
63
68
|
as `ads://guides/atomic-styles`. It explains shorthand/logical conflicts and
|
|
@@ -81,6 +81,54 @@ const treatment = css`
|
|
|
81
81
|
This is a distinct state, not two competing base atoms. Whether changing padding
|
|
82
82
|
on hover is desirable remains a product decision.
|
|
83
83
|
|
|
84
|
+
## Register typed custom properties without atomizing their descriptors
|
|
85
|
+
|
|
86
|
+
Use a literal `@property` in its component/pattern's Linaria template when the
|
|
87
|
+
browser needs a typed, interpolated runtime variable:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
const treatment = css`
|
|
91
|
+
@property --ds-example-progress {
|
|
92
|
+
syntax: "<number>";
|
|
93
|
+
inherits: false;
|
|
94
|
+
initial-value: 0;
|
|
95
|
+
}
|
|
96
|
+
opacity: var(--ds-example-progress);
|
|
97
|
+
`;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The identifier is illustrative; use a unique name owned by the real unit.
|
|
101
|
+
Registrations are document-global, even when authored beside one component.
|
|
102
|
+
Put them at template level or inside conditional at-rules, never element selectors.
|
|
103
|
+
Use the same ADS tag resolver described below in both product and preview builds;
|
|
104
|
+
it preserves each complete registration and its conditional context instead of
|
|
105
|
+
splitting syntax/inherits/initial-value into invalid atomic rules. This works for
|
|
106
|
+
atomic `css` and `styled`; the browser receives CSS without a registration runtime.
|
|
107
|
+
MCP delivers it inside the App document, not the outer showcase host.
|
|
108
|
+
|
|
109
|
+
`property-registration` validates descriptor shape, CSS syntax/initial-value and
|
|
110
|
+
ownership, and rejects conflicting schemas or registrations shared by unrelated
|
|
111
|
+
owners. Identical registrations from the same owner are permitted. Runtime
|
|
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`.
|
|
115
|
+
Neither `base.css` nor `fonts.css` becomes a registration escape hatch. Registration
|
|
116
|
+
alone does not define a token or satisfy its sample/fixture coverage.
|
|
117
|
+
|
|
118
|
+
Typed initial values must match their syntax and be computationally independent:
|
|
119
|
+
`0px` is valid metadata; `var(--space-4)`, `1rem` and `currentColor` are not.
|
|
120
|
+
The literal exemption applies only to registration descriptors. Keep design
|
|
121
|
+
assignments outside them token-backed; a technical fallback is not a place to
|
|
122
|
+
hide a component skin. Use literal static descriptors so guards can inspect them.
|
|
123
|
+
See the [W3C registration contract](https://www.w3.org/TR/css-properties-values-api-1/#at-property-rule).
|
|
124
|
+
|
|
125
|
+
Verify extracted CSS and actual interpolation, including after minification and
|
|
126
|
+
inside the MCP App. A declaration can parse while a browser ignores an invalid
|
|
127
|
+
registration. Keep required browser fallbacks and reduced-motion behavior; do not
|
|
128
|
+
replace a valid CSS implementation with script merely to evade extraction or a
|
|
129
|
+
guard limitation. These checks cover declarative registrations; arbitrary dynamic
|
|
130
|
+
`CSS.registerProperty()` calls are not an ownership proof.
|
|
131
|
+
|
|
84
132
|
## Preserve custom-property arithmetic during extraction
|
|
85
133
|
|
|
86
134
|
Custom properties can hold an unevaluated token stream that becomes arithmetic
|
|
@@ -101,7 +101,12 @@ failed/cancelled capture does not replace existing image slots or apply source.
|
|
|
101
101
|
If a scenario/target is newly introduced, `current` is null with an explicit
|
|
102
102
|
`currentAbsent` explanation; only the real candidate image exists.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
The edit reply is a summary. Read `ads_results({resultId,section:"captures"})` for
|
|
105
|
+
the requested image resource URIs and `section:"diagnostics"` for relevant
|
|
106
|
+
messages; follow `nextCursor` when needed. Read image resources explicitly.
|
|
107
|
+
Standalone `ads_capture` continues returning its selected capture directly.
|
|
108
|
+
|
|
109
|
+
Review those images and diagnostics, fix the draft if necessary, then apply
|
|
105
110
|
with `dryRun:false`. Apply reruns all gates. An image is promoted only when the
|
|
106
111
|
accepted source revision matches the captured candidate; other proposals remain
|
|
107
112
|
stale. Images do not approve a patch or certify interaction/accessibility/parity.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Investigate the failing boundary
|
|
2
|
+
|
|
3
|
+
Use this reference after a rejected patch, failed check or preview loading error.
|
|
4
|
+
MCP serves it as `ads://guides/evidence`. Inspect the compact result first; fetch
|
|
5
|
+
only the failing check's bundle or relevant artifact, rather than repeating a suite.
|
|
6
|
+
|
|
7
|
+
## Read the result correctly
|
|
8
|
+
|
|
9
|
+
`failure.category` identifies a boundary, not an inferred root cause:
|
|
10
|
+
|
|
11
|
+
| Category | Established observation | Next inspection |
|
|
12
|
+
|----------|-------------------------|-----------------|
|
|
13
|
+
| `architecture` | A source/ownership/configuration gate rejected the candidate. | Exact rule, source location and `certainty`. An inconclusive ownership proof does not establish that a valid API is wrong. |
|
|
14
|
+
| `build` | A registered project pipeline step or compiled-resource integrity check failed. | Named command/phase, exit code, bounded output and build revision. A custom project script may contain several kinds of checks. |
|
|
15
|
+
| `transport` | An MCP/browser resource delivery boundary failed. | Resource URI, relevant failed startup requests and observed browser errors. Do not infer a network-interface or component cause without evidence. |
|
|
16
|
+
| `runner` | The harness, process, readiness or reporting boundary failed, or a test threw without assertion evidence. | Active/pending checks, timeout, failing step and artifacts. `certainty: "unclassified"` means ADS cannot establish the cause. |
|
|
17
|
+
| `assertion` | A reported assertion step or token binding check failed. | Expected behavior, source location, state and trace. This can still be a test defect; compare the intended contract before editing the component. |
|
|
18
|
+
|
|
19
|
+
A complete failed run can contain independent passing cases. Suite interruption,
|
|
20
|
+
missing/skipped cases, stale inputs and an unexplained process exit cannot certify
|
|
21
|
+
a pass. Keep the reported case outcome separate from whole-run acceptance.
|
|
22
|
+
|
|
23
|
+
## Retrieve only the evidence needed
|
|
24
|
+
|
|
25
|
+
`ads_verify`, `ads_apply_patch` and `ads_apply_transaction` reply with counts,
|
|
26
|
+
bounded acceptance, at most three failure previews and `resultId`, within 4096
|
|
27
|
+
UTF-8 JSON bytes. Full validation still decides acceptance. Do not repeat a suite
|
|
28
|
+
merely to recover its output, or restate the complete report in conversation.
|
|
29
|
+
|
|
30
|
+
Read a relevant saved section:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
ads_results({resultId: "<returned ID>", section: "outcomes", status: "not_passed"})
|
|
34
|
+
// Continue only when needed, with the same section and status:
|
|
35
|
+
ads_results({resultId: "<returned ID>", section: "outcomes", status: "not_passed", cursor: "<nextCursor>"})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Pages default to 10 rows, allow at most 20 and stay within 8192 JSON bytes. The
|
|
39
|
+
byte cap can return fewer rows; `nextCursor` is the continuation. Other sections
|
|
40
|
+
are `checks` (pipeline steps), `diagnostics`, `advisories`, `warnings`, `changes`,
|
|
41
|
+
`captures`, `acceptance`, `investigation` (mutation boundary) and `selection`.
|
|
42
|
+
A row marked `detailTruncated` is a preview. To read that exact record, pass its
|
|
43
|
+
`recordIndex`, the same result/section, and `offset`/`chars` (maximum 2000 UTF-16
|
|
44
|
+
characters); follow `nextOffset`. Do not combine ranges with a cursor/status filter.
|
|
45
|
+
Read only the relevant log range. Reading pages or ranges never executes checks.
|
|
46
|
+
|
|
47
|
+
`ads://project/results` lists the latest IDs. `ads://results/<resultId>` reads a
|
|
48
|
+
summary; matching query parameters read pages/ranges. Only the latest verification
|
|
49
|
+
and latest mutation snapshots are retained, independently, up to 8 MiB each.
|
|
50
|
+
A superseded ID fails explicitly. An oversized report retains only its summary
|
|
51
|
+
with a warning; disk failure retains details in server memory until shutdown.
|
|
52
|
+
Neither changes actual acceptance or applied state. These are logical JSON byte
|
|
53
|
+
budgets, not token estimates; compatibility text can duplicate structured JSON.
|
|
54
|
+
Saved outcomes describe completion-time evidence, not current source freshness;
|
|
55
|
+
compare their revisions with `ads_behaviors` before claiming a current pass.
|
|
56
|
+
|
|
57
|
+
`ads_behaviors` pages owner summaries, then an exact unit's `checks`, `guarantees`,
|
|
58
|
+
`subjects`, `demonstrations` or `profiles`. Use `nextCursor` and identical filters;
|
|
59
|
+
changes invalidate a discovery cursor. Read a truncated contract via its
|
|
60
|
+
`sourceFile` and bounded `ads_read_file`, rather than requesting everything.
|
|
61
|
+
|
|
62
|
+
## Get a compact investigation
|
|
63
|
+
|
|
64
|
+
Take an outcome's exact owner/check/run IDs from `ads_results`, then:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{ "unit": "components/Example", "check": "keyboard-navigation", "runId": "<outcome runId>" }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Send this to `ads_investigate`. It reads a summary within 4096 JSON bytes, without
|
|
71
|
+
running code. The run ID rejects evidence superseded by another execution.
|
|
72
|
+
`section: "details"`, `"requests"`, `"browserErrors"` or `"artifacts"` reads separate pages
|
|
73
|
+
(default 10/max 20 rows, at most 8192 JSON bytes); artifacts themselves require
|
|
74
|
+
explicit resource reads. Truncated investigation records also support
|
|
75
|
+
`recordIndex`/`offset`/`chars`; keep the exact `runId` to avoid mixing evidence.
|
|
76
|
+
Without a check, the tool pages available investigations.
|
|
77
|
+
`ads://project/investigations` lists available entries; the returned `resourceUri`
|
|
78
|
+
reads the same bundle. It records:
|
|
79
|
+
|
|
80
|
+
- Project versus isolated candidate, configured framework/profile and scenario.
|
|
81
|
+
- Exact input revision and the preview revision actually observed by the helper.
|
|
82
|
+
- `details.failingStep`, `details.source`, startup viewport and failure boundary.
|
|
83
|
+
- Counts for separately paged relevant requests, browser errors and artifacts.
|
|
84
|
+
- Available registered trace, screenshot or context artifact resource URIs.
|
|
85
|
+
- Explicit `acceptance.established` and `acceptance.unverified` scope.
|
|
86
|
+
|
|
87
|
+
Absent observations are `null` or empty; ADS does not invent a viewport, trace or
|
|
88
|
+
source line. Viewport evidence is labeled `preview-startup`; a test that resizes
|
|
89
|
+
later must collect its own failure-state evidence. Failed-request collection
|
|
90
|
+
covers managed startup, not a complete network trace. Bodies and headers are not
|
|
91
|
+
collected. Project-configured Playwright trace/screenshot policy controls which
|
|
92
|
+
artifacts exist; ADS does not turn on expensive recording or rerun a failed case.
|
|
93
|
+
Protocol runners may provide structured failure/step/location/artifact fields;
|
|
94
|
+
older reports remain valid and their unclassified errors stay explicit.
|
|
95
|
+
|
|
96
|
+
Only the latest bundle per registered check is exposed, including dry runs.
|
|
97
|
+
Another verification replaces it and removes old artifacts from resource access;
|
|
98
|
+
old runner output directories follow project cleanup policy. Artifact resources
|
|
99
|
+
are restricted to registered ordinary files under that run's output directory,
|
|
100
|
+
bounded to 20 MiB each and checked against their recorded digest on read.
|
|
101
|
+
Metadata is bounded to 2 MiB. Removed registrations are pruned on verification.
|
|
102
|
+
|
|
103
|
+
Candidate evidence never becomes passing live-source evidence. Compare the
|
|
104
|
+
recorded input revision with current `ads_behaviors` evidence; a bundle describes
|
|
105
|
+
its run, and does not claim current source merely because it remains available.
|
|
106
|
+
For a build/architecture rejection before behavior runs, inspect the mutation
|
|
107
|
+
saved `investigation` section via `ads_results`. Status retains the compact
|
|
108
|
+
execution summary and result ID, rather than embedding complete reports.
|
|
109
|
+
|
|
110
|
+
## Preserve the design while repairing the failure
|
|
111
|
+
|
|
112
|
+
Fix the owner of the demonstrated defect. Do not privatize a valid API, introduce
|
|
113
|
+
demo-only props, substitute a styled link, change the reference baseline or weaken
|
|
114
|
+
verification policy to pass a tooling limitation. Preserve the draft and report
|
|
115
|
+
the smallest source/browser reproduction when ownership remains unprovable.
|
|
116
|
+
|
|
117
|
+
`acceptance` states what that result established. Core checks establish source
|
|
118
|
+
guard acceptance; registered tests establish only their actual cases/profiles.
|
|
119
|
+
Neither establishes untested states, visual parity, an accessibility audit or
|
|
120
|
+
another MCP host's compatibility. Captures show an appearance, not a transition.
|
|
@@ -15,8 +15,10 @@ ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>",
|
|
|
15
15
|
|
|
16
16
|
The dry run validates the full candidate, including affected registered behavior
|
|
17
17
|
checks in an isolated project copy. Configured browser checks use that candidate's
|
|
18
|
-
managed preview, not the live showcase.
|
|
19
|
-
|
|
18
|
+
managed preview, not the live showcase. Read the summary, then page failing
|
|
19
|
+
`outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
|
|
20
|
+
`resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;
|
|
21
|
+
fix the draft and diff again. See [evidence.md](evidence.md) for page/range limits.
|
|
20
22
|
Keep behavior.json/specs with their owner and use registered checks; a scratchpad
|
|
21
23
|
run against live source cannot verify unapplied changes. After validation, apply
|
|
22
24
|
with `dryRun:false`; ADS revalidates before writing. Dry-run evidence is not saved
|
|
@@ -120,9 +122,10 @@ them through their actual public composition/customization path and list their r
|
|
|
120
122
|
render references in covers. Do not count internal production renders as public API
|
|
121
123
|
coverage. Behavioral APIs use exercises and registered guarantees instead.
|
|
122
124
|
Scenario controls still use public UI. A native link/button can supply semantics
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
through a public runtime slot that demonstrably clones its child with owned
|
|
126
|
+
props, or through matching runtime-owned selectors attached to the actual rendered
|
|
127
|
+
DOM. Source ownership must be proven; an `asChild` flag or a lookalike marker is
|
|
128
|
+
insufficient. Standalone controls and custom scenario styling remain rejected. See
|
|
126
129
|
[scenarios.md](scenarios.md) for evidence and limits. Preserve the intended
|
|
127
130
|
composition instead of substituting an unrelated styled control or adding a
|
|
128
131
|
demo-only component prop. Review framing belongs in public layout patterns.
|
|
@@ -101,6 +101,38 @@ do not export the helper solely for a test. Public/private ownership is a produc
|
|
|
101
101
|
decision, not a coverage workaround. Browser checks verify transitions but do not
|
|
102
102
|
replace the current static `covers` requirement; `exercises` does not waive it.
|
|
103
103
|
|
|
104
|
+
## Native semantics through runtime-owned selectors
|
|
105
|
+
|
|
106
|
+
An anchor or other native semantic element can also occupy a position styled by
|
|
107
|
+
public runtime UI, without cloning or an `asChild` API:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
// Runtime owner: the class is attached to Line's actual rendered span.
|
|
111
|
+
const line = css`:is(a, button) > & { color: var(--text-body); }`;
|
|
112
|
+
export function Line(props) { return <span className={line} {...props} />; }
|
|
113
|
+
|
|
114
|
+
// Scenario: semantics belong to the consumer, appearance to the runtime owner.
|
|
115
|
+
<a href={fixture.destination}><Line>{fixture.label}</Line></a>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
ADS traces the actual returned DOM, the attached Linaria template and matching
|
|
119
|
+
selector relationships. A public parent's `& > a` is evidence too. A tag-agnostic
|
|
120
|
+
parent selector such as `& > :has(> [data-part="line"])` must match a marker
|
|
121
|
+
declared by the actual runtime-owned child; a scenario-authored lookalike does not
|
|
122
|
+
qualify. No component names or marker spellings are reserved.
|
|
123
|
+
|
|
124
|
+
Unused styles, unrelated CSS, broad `& > *` selectors, negative selectors alone,
|
|
125
|
+
fabricated markers, unknown render alternatives and opaque class replacement
|
|
126
|
+
cannot grant permission. A selector cannot establish a scenario-built custom
|
|
127
|
+
widget's keyboard behavior. Inline styles and arbitrary classes remain rejected;
|
|
128
|
+
existing source-verified public class helpers keep their own contract.
|
|
129
|
+
|
|
130
|
+
Do not add a public link part or change the DOM to satisfy a cloning-only model.
|
|
131
|
+
Preserve semantic attributes and the intended public API. Unsupported source
|
|
132
|
+
grammar produces an inconclusive ownership diagnostic, not proof of a bad API.
|
|
133
|
+
Browser verification must establish the real focus treatment, hover/state
|
|
134
|
+
precedence, navigation and other promised behavior in the compiled App iframe.
|
|
135
|
+
|
|
104
136
|
## Native semantics through a public runtime slot
|
|
105
137
|
|
|
106
138
|
A native element can be the direct child of a public runtime component that
|
|
@@ -49,17 +49,22 @@ For owner drafts, token-sample reconciliation, coupled transactions and local
|
|
|
49
49
|
constant namespaces, read [guarded-editing.md](references/guarded-editing.md).
|
|
50
50
|
For on-demand current/candidate screenshots and visual dry-run review, read
|
|
51
51
|
[captures.md](references/captures.md).
|
|
52
|
+
For a rejected patch, failed check or loading error, read
|
|
53
|
+
[evidence and diagnosis](references/evidence.md); inspect the failing boundary
|
|
54
|
+
then page needed `ads_results` sections using the returned result ID. Inspect
|
|
55
|
+
one `ads_investigate({unit,check,runId})` summary before changing APIs or policy;
|
|
56
|
+
load request/error/artifact details only when relevant.
|
|
52
57
|
|
|
53
58
|
|
|
54
59
|
For parent/child `covers`, conditional-control review, reference comparisons,
|
|
55
|
-
public style-helper use, fragment
|
|
56
|
-
`showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
|
|
60
|
+
public style-helper use, native slot/selector composition, fragment navigation,
|
|
61
|
+
or `scenario-render` / `showcase-control` / `showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
|
|
57
62
|
examples explain API visibility, reference baselines and state-transition checks.
|
|
58
63
|
Traced parents can cover declared public children; verified public Linaria
|
|
59
64
|
helpers do not grant custom scenario CSS.
|
|
60
65
|
|
|
61
66
|
For atomic base/variant styling, helper/wrapper class composition, extracted
|
|
62
|
-
custom-property arithmetic, or an
|
|
67
|
+
custom-property arithmetic, typed `@property` registrations, or an
|
|
63
68
|
`atomic-composition-review` / `atomic-composition-limit` advisory, read
|
|
64
69
|
[atomic style composition](references/atomic-styles.md). The same guide is served
|
|
65
70
|
as `ads://guides/atomic-styles`. It explains shorthand/logical conflicts and
|
|
@@ -81,6 +81,54 @@ const treatment = css`
|
|
|
81
81
|
This is a distinct state, not two competing base atoms. Whether changing padding
|
|
82
82
|
on hover is desirable remains a product decision.
|
|
83
83
|
|
|
84
|
+
## Register typed custom properties without atomizing their descriptors
|
|
85
|
+
|
|
86
|
+
Use a literal `@property` in its component/pattern's Linaria template when the
|
|
87
|
+
browser needs a typed, interpolated runtime variable:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
const treatment = css`
|
|
91
|
+
@property --ds-example-progress {
|
|
92
|
+
syntax: "<number>";
|
|
93
|
+
inherits: false;
|
|
94
|
+
initial-value: 0;
|
|
95
|
+
}
|
|
96
|
+
opacity: var(--ds-example-progress);
|
|
97
|
+
`;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The identifier is illustrative; use a unique name owned by the real unit.
|
|
101
|
+
Registrations are document-global, even when authored beside one component.
|
|
102
|
+
Put them at template level or inside conditional at-rules, never element selectors.
|
|
103
|
+
Use the same ADS tag resolver described below in both product and preview builds;
|
|
104
|
+
it preserves each complete registration and its conditional context instead of
|
|
105
|
+
splitting syntax/inherits/initial-value into invalid atomic rules. This works for
|
|
106
|
+
atomic `css` and `styled`; the browser receives CSS without a registration runtime.
|
|
107
|
+
MCP delivers it inside the App document, not the outer showcase host.
|
|
108
|
+
|
|
109
|
+
`property-registration` validates descriptor shape, CSS syntax/initial-value and
|
|
110
|
+
ownership, and rejects conflicting schemas or registrations shared by unrelated
|
|
111
|
+
owners. Identical registrations from the same owner are permitted. Runtime
|
|
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`.
|
|
115
|
+
Neither `base.css` nor `fonts.css` becomes a registration escape hatch. Registration
|
|
116
|
+
alone does not define a token or satisfy its sample/fixture coverage.
|
|
117
|
+
|
|
118
|
+
Typed initial values must match their syntax and be computationally independent:
|
|
119
|
+
`0px` is valid metadata; `var(--space-4)`, `1rem` and `currentColor` are not.
|
|
120
|
+
The literal exemption applies only to registration descriptors. Keep design
|
|
121
|
+
assignments outside them token-backed; a technical fallback is not a place to
|
|
122
|
+
hide a component skin. Use literal static descriptors so guards can inspect them.
|
|
123
|
+
See the [W3C registration contract](https://www.w3.org/TR/css-properties-values-api-1/#at-property-rule).
|
|
124
|
+
|
|
125
|
+
Verify extracted CSS and actual interpolation, including after minification and
|
|
126
|
+
inside the MCP App. A declaration can parse while a browser ignores an invalid
|
|
127
|
+
registration. Keep required browser fallbacks and reduced-motion behavior; do not
|
|
128
|
+
replace a valid CSS implementation with script merely to evade extraction or a
|
|
129
|
+
guard limitation. These checks cover declarative registrations; arbitrary dynamic
|
|
130
|
+
`CSS.registerProperty()` calls are not an ownership proof.
|
|
131
|
+
|
|
84
132
|
## Preserve custom-property arithmetic during extraction
|
|
85
133
|
|
|
86
134
|
Custom properties can hold an unevaluated token stream that becomes arithmetic
|
|
@@ -101,7 +101,12 @@ failed/cancelled capture does not replace existing image slots or apply source.
|
|
|
101
101
|
If a scenario/target is newly introduced, `current` is null with an explicit
|
|
102
102
|
`currentAbsent` explanation; only the real candidate image exists.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
The edit reply is a summary. Read `ads_results({resultId,section:"captures"})` for
|
|
105
|
+
the requested image resource URIs and `section:"diagnostics"` for relevant
|
|
106
|
+
messages; follow `nextCursor` when needed. Read image resources explicitly.
|
|
107
|
+
Standalone `ads_capture` continues returning its selected capture directly.
|
|
108
|
+
|
|
109
|
+
Review those images and diagnostics, fix the draft if necessary, then apply
|
|
105
110
|
with `dryRun:false`. Apply reruns all gates. An image is promoted only when the
|
|
106
111
|
accepted source revision matches the captured candidate; other proposals remain
|
|
107
112
|
stale. Images do not approve a patch or certify interaction/accessibility/parity.
|