@reqvire-org/ads 0.3.17 → 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.
Files changed (44) hide show
  1. package/dist/atomic-composition.mjs +1 -1
  2. package/dist/check.mjs +30 -3
  3. package/dist/investigations.mjs +34 -3
  4. package/dist/linaria/preserve-values.cjs +21 -2
  5. package/dist/mcp/behavior-pages.mjs +36 -0
  6. package/dist/mcp/context.mjs +3 -1
  7. package/dist/mcp/execution-results.mjs +146 -0
  8. package/dist/mcp/mutations.mjs +3 -3
  9. package/dist/mcp/result-pages.mjs +87 -0
  10. package/dist/mcp/server.mjs +43 -28
  11. package/dist/property-registrations.mjs +39 -0
  12. package/dist/scenario-trace.mjs +1 -1
  13. package/dist/scoped-tokens.mjs +6 -0
  14. package/dist/skills/ads-break-ui/SKILL.md +6 -4
  15. package/dist/skills/ads-break-ui/references/atomic-styles.md +48 -0
  16. package/dist/skills/ads-break-ui/references/captures.md +6 -1
  17. package/dist/skills/ads-break-ui/references/evidence.md +52 -5
  18. package/dist/skills/ads-break-ui/references/guarded-editing.md +8 -5
  19. package/dist/skills/ads-designer/SKILL.md +6 -4
  20. package/dist/skills/ads-designer/references/atomic-styles.md +48 -0
  21. package/dist/skills/ads-designer/references/captures.md +6 -1
  22. package/dist/skills/ads-designer/references/evidence.md +52 -5
  23. package/dist/skills/ads-designer/references/guarded-editing.md +8 -5
  24. package/dist/skills/ads-import/SKILL.md +6 -4
  25. package/dist/skills/ads-import/references/atomic-styles.md +48 -0
  26. package/dist/skills/ads-import/references/captures.md +6 -1
  27. package/dist/skills/ads-import/references/evidence.md +52 -5
  28. package/dist/skills/ads-import/references/guarded-editing.md +8 -5
  29. package/dist/skills/ads-migrate/SKILL.md +6 -4
  30. package/dist/skills/ads-migrate/references/atomic-styles.md +48 -0
  31. package/dist/skills/ads-migrate/references/captures.md +6 -1
  32. package/dist/skills/ads-migrate/references/evidence.md +52 -5
  33. package/dist/skills/ads-migrate/references/guarded-editing.md +8 -5
  34. package/dist/skills/ads-motion/SKILL.md +6 -4
  35. package/dist/skills/ads-motion/references/atomic-styles.md +48 -0
  36. package/dist/skills/ads-motion/references/captures.md +6 -1
  37. package/dist/skills/ads-motion/references/evidence.md +52 -5
  38. package/dist/skills/ads-motion/references/guarded-editing.md +8 -5
  39. package/docs/ADS.md +10 -0
  40. package/docs/ARCHITECTURE.md +27 -0
  41. package/docs/BEHAVIORS.md +14 -2
  42. package/docs/CHANGELOG.md +17 -0
  43. package/docs/MCP.md +60 -14
  44. 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
- Review the returned images and diagnostics, fix the draft if necessary, then apply
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.
@@ -20,21 +20,67 @@ A complete failed run can contain independent passing cases. Suite interruption,
20
20
  missing/skipped cases, stale inputs and an unexplained process exit cannot certify
21
21
  a pass. Keep the reported case outcome separate from whole-run acceptance.
22
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
+
23
62
  ## Get a compact investigation
24
63
 
25
- Discover exact owner/check IDs with `ads_behaviors`, then:
64
+ Take an outcome's exact owner/check/run IDs from `ads_results`, then:
26
65
 
27
66
  ```json
28
- { "unit": "components/Example", "check": "keyboard-navigation" }
67
+ { "unit": "components/Example", "check": "keyboard-navigation", "runId": "<outcome runId>" }
29
68
  ```
30
69
 
31
- Send this to `ads_investigate`. It reads the latest bundle without running code.
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.
32
77
  `ads://project/investigations` lists available entries; the returned `resourceUri`
33
78
  reads the same bundle. It records:
34
79
 
35
80
  - Project versus isolated candidate, configured framework/profile and scenario.
36
81
  - Exact input revision and the preview revision actually observed by the helper.
37
- - Failing step/source, observed startup viewport and relevant failed requests.
82
+ - `details.failingStep`, `details.source`, startup viewport and failure boundary.
83
+ - Counts for separately paged relevant requests, browser errors and artifacts.
38
84
  - Available registered trace, screenshot or context artifact resource URIs.
39
85
  - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
86
 
@@ -58,7 +104,8 @@ Candidate evidence never becomes passing live-source evidence. Compare the
58
104
  recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
105
  its run, and does not claim current source merely because it remains available.
60
106
  For a build/architecture rejection before behavior runs, inspect the mutation
61
- result's `investigation` (also retained in `ads_status.mutations.lastResult`).
107
+ saved `investigation` section via `ads_results`. Status retains the compact
108
+ execution summary and result ID, rather than embedding complete reports.
62
109
 
63
110
  ## Preserve the design while repairing the failure
64
111
 
@@ -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. Inspect the returned `behavior` failures
19
- or the registered behavior-check results in `checks`, fix the draft and diff again.
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
- as the single direct child of a public runtime slot when source tracing proves
124
- that owner clones the child with its props. An `asChild` flag alone is insufficient;
125
- standalone native controls and custom scenario styling remain rejected. See
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.
@@ -50,17 +50,19 @@ For on-demand current/candidate screenshots and visual dry-run review, read
50
50
  [captures.md](references/captures.md).
51
51
  For a rejected patch, failed check or loading error, read
52
52
  [evidence and diagnosis](references/evidence.md); inspect the failing boundary
53
- and `ads_investigate` bundle before changing APIs or verification policy.
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.
54
56
 
55
57
  For parent/child `covers`, conditional-control review, reference comparisons,
56
- public style-helper use, fragment-link navigation, or `scenario-render` /
57
- `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
58
60
  examples explain API visibility, reference baselines and state-transition checks.
59
61
  Traced parents can cover declared public children; verified public Linaria
60
62
  helpers do not grant custom scenario CSS.
61
63
 
62
64
  For atomic base/variant styling, helper/wrapper class composition, extracted
63
- custom-property arithmetic, or an
65
+ custom-property arithmetic, typed `@property` registrations, or an
64
66
  `atomic-composition-review` / `atomic-composition-limit` advisory, read
65
67
  [atomic style composition](references/atomic-styles.md). The same guide is served
66
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
- Review the returned images and diagnostics, fix the draft if necessary, then apply
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.
@@ -20,21 +20,67 @@ A complete failed run can contain independent passing cases. Suite interruption,
20
20
  missing/skipped cases, stale inputs and an unexplained process exit cannot certify
21
21
  a pass. Keep the reported case outcome separate from whole-run acceptance.
22
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
+
23
62
  ## Get a compact investigation
24
63
 
25
- Discover exact owner/check IDs with `ads_behaviors`, then:
64
+ Take an outcome's exact owner/check/run IDs from `ads_results`, then:
26
65
 
27
66
  ```json
28
- { "unit": "components/Example", "check": "keyboard-navigation" }
67
+ { "unit": "components/Example", "check": "keyboard-navigation", "runId": "<outcome runId>" }
29
68
  ```
30
69
 
31
- Send this to `ads_investigate`. It reads the latest bundle without running code.
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.
32
77
  `ads://project/investigations` lists available entries; the returned `resourceUri`
33
78
  reads the same bundle. It records:
34
79
 
35
80
  - Project versus isolated candidate, configured framework/profile and scenario.
36
81
  - Exact input revision and the preview revision actually observed by the helper.
37
- - Failing step/source, observed startup viewport and relevant failed requests.
82
+ - `details.failingStep`, `details.source`, startup viewport and failure boundary.
83
+ - Counts for separately paged relevant requests, browser errors and artifacts.
38
84
  - Available registered trace, screenshot or context artifact resource URIs.
39
85
  - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
86
 
@@ -58,7 +104,8 @@ Candidate evidence never becomes passing live-source evidence. Compare the
58
104
  recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
105
  its run, and does not claim current source merely because it remains available.
60
106
  For a build/architecture rejection before behavior runs, inspect the mutation
61
- result's `investigation` (also retained in `ads_status.mutations.lastResult`).
107
+ saved `investigation` section via `ads_results`. Status retains the compact
108
+ execution summary and result ID, rather than embedding complete reports.
62
109
 
63
110
  ## Preserve the design while repairing the failure
64
111
 
@@ -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. Inspect the returned `behavior` failures
19
- or the registered behavior-check results in `checks`, fix the draft and diff again.
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
- as the single direct child of a public runtime slot when source tracing proves
124
- that owner clones the child with its props. An `asChild` flag alone is insufficient;
125
- standalone native controls and custom scenario styling remain rejected. See
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.
@@ -51,18 +51,20 @@ For on-demand current/candidate screenshots and visual dry-run review, read
51
51
  [captures.md](references/captures.md).
52
52
  For a rejected patch, failed check or loading error, read
53
53
  [evidence and diagnosis](references/evidence.md); inspect the failing boundary
54
- and `ads_investigate` bundle before changing APIs or verification policy.
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.
55
57
 
56
58
 
57
59
  For parent/child `covers`, conditional-control review, reference comparisons,
58
- public style-helper use, fragment-link navigation, or `scenario-render` /
59
- `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
60
62
  examples explain API visibility, reference baselines and state-transition checks.
61
63
  Traced parents can cover declared public children; verified public Linaria
62
64
  helpers do not grant custom scenario CSS.
63
65
 
64
66
  For atomic base/variant styling, helper/wrapper class composition, extracted
65
- custom-property arithmetic, or an
67
+ custom-property arithmetic, typed `@property` registrations, or an
66
68
  `atomic-composition-review` / `atomic-composition-limit` advisory, read
67
69
  [atomic style composition](references/atomic-styles.md). The same guide is served
68
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
- Review the returned images and diagnostics, fix the draft if necessary, then apply
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.
@@ -20,21 +20,67 @@ A complete failed run can contain independent passing cases. Suite interruption,
20
20
  missing/skipped cases, stale inputs and an unexplained process exit cannot certify
21
21
  a pass. Keep the reported case outcome separate from whole-run acceptance.
22
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
+
23
62
  ## Get a compact investigation
24
63
 
25
- Discover exact owner/check IDs with `ads_behaviors`, then:
64
+ Take an outcome's exact owner/check/run IDs from `ads_results`, then:
26
65
 
27
66
  ```json
28
- { "unit": "components/Example", "check": "keyboard-navigation" }
67
+ { "unit": "components/Example", "check": "keyboard-navigation", "runId": "<outcome runId>" }
29
68
  ```
30
69
 
31
- Send this to `ads_investigate`. It reads the latest bundle without running code.
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.
32
77
  `ads://project/investigations` lists available entries; the returned `resourceUri`
33
78
  reads the same bundle. It records:
34
79
 
35
80
  - Project versus isolated candidate, configured framework/profile and scenario.
36
81
  - Exact input revision and the preview revision actually observed by the helper.
37
- - Failing step/source, observed startup viewport and relevant failed requests.
82
+ - `details.failingStep`, `details.source`, startup viewport and failure boundary.
83
+ - Counts for separately paged relevant requests, browser errors and artifacts.
38
84
  - Available registered trace, screenshot or context artifact resource URIs.
39
85
  - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
86
 
@@ -58,7 +104,8 @@ Candidate evidence never becomes passing live-source evidence. Compare the
58
104
  recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
105
  its run, and does not claim current source merely because it remains available.
60
106
  For a build/architecture rejection before behavior runs, inspect the mutation
61
- result's `investigation` (also retained in `ads_status.mutations.lastResult`).
107
+ saved `investigation` section via `ads_results`. Status retains the compact
108
+ execution summary and result ID, rather than embedding complete reports.
62
109
 
63
110
  ## Preserve the design while repairing the failure
64
111
 
@@ -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. Inspect the returned `behavior` failures
19
- or the registered behavior-check results in `checks`, fix the draft and diff again.
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
- as the single direct child of a public runtime slot when source tracing proves
124
- that owner clones the child with its props. An `asChild` flag alone is insufficient;
125
- standalone native controls and custom scenario styling remain rejected. See
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.
@@ -71,18 +71,20 @@ For on-demand current/candidate screenshots and visual dry-run review, read
71
71
  [captures.md](references/captures.md).
72
72
  For a rejected patch, failed check or loading error, read
73
73
  [evidence and diagnosis](references/evidence.md); inspect the failing boundary
74
- and `ads_investigate` bundle before changing APIs or verification policy.
74
+ then page needed `ads_results` sections using the returned result ID. Inspect
75
+ one `ads_investigate({unit,check,runId})` summary before changing APIs or policy;
76
+ load request/error/artifact details only when relevant.
75
77
 
76
78
 
77
79
  For parent/child `covers`, conditional-control review, reference comparisons,
78
- public style-helper use, fragment-link navigation, or `scenario-render` /
79
- `showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
80
+ public style-helper use, native slot/selector composition, fragment navigation,
81
+ or `scenario-render` / `showcase-control` / `showcase-class` findings, read [scenario contracts](references/scenarios.md). Its verification
80
82
  examples explain API visibility, reference baselines and state-transition checks.
81
83
  Traced parents can cover declared public children; verified public Linaria
82
84
  helpers do not grant custom scenario CSS.
83
85
 
84
86
  For atomic base/variant styling, helper/wrapper class composition, extracted
85
- custom-property arithmetic, or an
87
+ custom-property arithmetic, typed `@property` registrations, or an
86
88
  `atomic-composition-review` / `atomic-composition-limit` advisory, read
87
89
  [atomic style composition](references/atomic-styles.md). The same guide is served
88
90
  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