@reqvire-org/ads 0.3.15 → 0.3.17

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 (41) hide show
  1. package/README.md +3 -0
  2. package/dist/check.mjs +13 -8
  3. package/dist/evidence.mjs +18 -0
  4. package/dist/investigations.mjs +70 -0
  5. package/dist/mcp/context.mjs +1 -1
  6. package/dist/mcp/mutations.mjs +34 -17
  7. package/dist/mcp/preview-widget.bundle.js +12 -12
  8. package/dist/mcp/resource-loader.js +3 -3
  9. package/dist/mcp/server.mjs +30 -8
  10. package/dist/scenario-selectors.mjs +140 -0
  11. package/dist/selector-match.mjs +94 -0
  12. package/dist/showcase/client.bundle.js +18 -18
  13. package/dist/showcase/resource-reader.js +37 -0
  14. package/dist/skills/ads-break-ui/SKILL.md +3 -0
  15. package/dist/skills/ads-break-ui/references/evidence.md +73 -0
  16. package/dist/skills/ads-break-ui/references/guarded-editing.md +12 -0
  17. package/dist/skills/ads-break-ui/references/scenarios.md +32 -0
  18. package/dist/skills/ads-designer/SKILL.md +3 -0
  19. package/dist/skills/ads-designer/references/evidence.md +73 -0
  20. package/dist/skills/ads-designer/references/guarded-editing.md +12 -0
  21. package/dist/skills/ads-designer/references/scenarios.md +32 -0
  22. package/dist/skills/ads-import/SKILL.md +3 -0
  23. package/dist/skills/ads-import/references/evidence.md +73 -0
  24. package/dist/skills/ads-import/references/guarded-editing.md +12 -0
  25. package/dist/skills/ads-import/references/scenarios.md +32 -0
  26. package/dist/skills/ads-migrate/SKILL.md +3 -0
  27. package/dist/skills/ads-migrate/references/evidence.md +73 -0
  28. package/dist/skills/ads-migrate/references/guarded-editing.md +12 -0
  29. package/dist/skills/ads-migrate/references/scenarios.md +32 -0
  30. package/dist/skills/ads-motion/SKILL.md +3 -0
  31. package/dist/skills/ads-motion/references/evidence.md +73 -0
  32. package/dist/skills/ads-motion/references/guarded-editing.md +12 -0
  33. package/dist/skills/ads-motion/references/scenarios.md +32 -0
  34. package/dist/verification/browser.mjs +27 -8
  35. package/dist/verification/playwright-reporter.cjs +39 -1
  36. package/dist/verification.mjs +32 -9
  37. package/docs/ARCHITECTURE.md +29 -3
  38. package/docs/BEHAVIORS.md +35 -2
  39. package/docs/CHANGELOG.md +21 -0
  40. package/docs/MCP.md +13 -0
  41. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ const retryDelays = [200, 800];
2
+ const networkFailure = error => error?.name === "TypeError" && /^(Failed to fetch|fetch failed|Load failed|NetworkError when attempting to fetch resource\.)$/.test(error.message);
3
+
4
+ function pause(milliseconds, signal) {
5
+ return new Promise((resolve, reject) => {
6
+ signal?.throwIfAborted();
7
+ const finish = () => { signal?.removeEventListener("abort", abort); resolve(); };
8
+ const timer = setTimeout(finish, milliseconds);
9
+ const abort = () => { clearTimeout(timer); signal.removeEventListener("abort", abort); reject(signal.reason); };
10
+ signal?.addEventListener("abort", abort, { once: true });
11
+ });
12
+ }
13
+
14
+ /** Only resources/read is repeatable here; never wrap tool calls or assertions. */
15
+ export function resourceReader(read, { signal, onDiagnostic, wait = pause } = {}) {
16
+ return async input => {
17
+ for (let attempt = 1; ; attempt++) {
18
+ signal?.throwIfAborted();
19
+ try {
20
+ const response = await read(input);
21
+ signal?.throwIfAborted();
22
+ if (attempt > 1) onDiagnostic?.({ state: "recovered", uri: input.uri, attempt });
23
+ return response;
24
+ } catch (error) {
25
+ signal?.throwIfAborted();
26
+ if (!networkFailure(error)) throw error;
27
+ if (attempt > retryDelays.length) {
28
+ onDiagnostic?.({ state: "exhausted", uri: input.uri, attempt, message: error.message });
29
+ throw Object.assign(new Error(`MCP resource transport failed for ${input.uri} after ${attempt} attempts: ${error.message}. Inspect the host connection and browser network diagnostics; this resource-loading error does not establish a component assertion failure.`, { cause: error }), { code: "ADS_RESOURCE_TRANSPORT" });
30
+ }
31
+ const delayMs = retryDelays[attempt - 1];
32
+ onDiagnostic?.({ state: "retry", uri: input.uri, attempt, nextAttempt: attempt + 1, delayMs, message: error.message });
33
+ await wait(delayMs, signal);
34
+ }
35
+ }
36
+ };
37
+ }
@@ -52,6 +52,9 @@ For owner drafts, token-sample reconciliation, coupled transactions and local
52
52
  constant namespaces, 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
+ For a rejected patch, failed check or loading error, read
56
+ [evidence and diagnosis](references/evidence.md); inspect the failing boundary
57
+ and `ads_investigate` bundle before changing APIs or verification policy.
55
58
 
56
59
 
57
60
  For parent/child `covers`, conditional-control review, reference comparisons,
@@ -0,0 +1,73 @@
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
+ ## Get a compact investigation
24
+
25
+ Discover exact owner/check IDs with `ads_behaviors`, then:
26
+
27
+ ```json
28
+ { "unit": "components/Example", "check": "keyboard-navigation" }
29
+ ```
30
+
31
+ Send this to `ads_investigate`. It reads the latest bundle without running code.
32
+ `ads://project/investigations` lists available entries; the returned `resourceUri`
33
+ reads the same bundle. It records:
34
+
35
+ - Project versus isolated candidate, configured framework/profile and scenario.
36
+ - Exact input revision and the preview revision actually observed by the helper.
37
+ - Failing step/source, observed startup viewport and relevant failed requests.
38
+ - Available registered trace, screenshot or context artifact resource URIs.
39
+ - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
+
41
+ Absent observations are `null` or empty; ADS does not invent a viewport, trace or
42
+ source line. Viewport evidence is labeled `preview-startup`; a test that resizes
43
+ later must collect its own failure-state evidence. Failed-request collection
44
+ covers managed startup, not a complete network trace. Bodies and headers are not
45
+ collected. Project-configured Playwright trace/screenshot policy controls which
46
+ artifacts exist; ADS does not turn on expensive recording or rerun a failed case.
47
+ Protocol runners may provide structured failure/step/location/artifact fields;
48
+ older reports remain valid and their unclassified errors stay explicit.
49
+
50
+ Only the latest bundle per registered check is exposed, including dry runs.
51
+ Another verification replaces it and removes old artifacts from resource access;
52
+ old runner output directories follow project cleanup policy. Artifact resources
53
+ are restricted to registered ordinary files under that run's output directory,
54
+ bounded to 20 MiB each and checked against their recorded digest on read.
55
+ Metadata is bounded to 2 MiB. Removed registrations are pruned on verification.
56
+
57
+ Candidate evidence never becomes passing live-source evidence. Compare the
58
+ recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
+ its run, and does not claim current source merely because it remains available.
60
+ For a build/architecture rejection before behavior runs, inspect the mutation
61
+ result's `investigation` (also retained in `ads_status.mutations.lastResult`).
62
+
63
+ ## Preserve the design while repairing the failure
64
+
65
+ Fix the owner of the demonstrated defect. Do not privatize a valid API, introduce
66
+ demo-only props, substitute a styled link, change the reference baseline or weaken
67
+ verification policy to pass a tooling limitation. Preserve the draft and report
68
+ the smallest source/browser reproduction when ownership remains unprovable.
69
+
70
+ `acceptance` states what that result established. Core checks establish source
71
+ guard acceptance; registered tests establish only their actual cases/profiles.
72
+ Neither establishes untested states, visual parity, an accessibility audit or
73
+ another MCP host's compatibility. Captures show an appearance, not a transition.
@@ -51,6 +51,18 @@ blanket sleeps. Fake clocks suit timer-only guarantees; keep real time for actua
51
51
  gesture/motion/layout guarantees. Project settings belong in guarded configuration
52
52
  changes; ADS does not silently raise budgets or override the worker count.
53
53
 
54
+ If a check cannot load its MCP preview, preserve the draft and inspect the exact
55
+ resource URI and failed browser requests before changing component code. The ADS
56
+ showcase retries a fetch transport failure on `resources/read` at most twice
57
+ (200/800 ms backoff); recovered startup reads remain visible in
58
+ `startupDiagnostics`. It never retries tool calls, assertions or complete checks,
59
+ and persistent failures still block application. HTTP/protocol/content errors,
60
+ integrity failures and cancellation do not retry. External hosts own their
61
+ transport behavior. Chrome's `ERR_NETWORK_CHANGED` does not prove an ADS restart
62
+ or identify Docker/VPN churn: correlate failure timestamps with live interface
63
+ events, Chrome network logs and server availability. Do not weaken checks or
64
+ rewrite a valid API to hide infrastructure failures.
65
+
54
66
  Named barrel imports can narrow affected checks when the project accurately
55
67
  declares package `sideEffects`; retain CSS/global effects in that policy. Missing
56
68
  or unsupported policies and dynamic/wildcard dependencies stay conservative.
@@ -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
@@ -84,6 +84,9 @@ For owner drafts, token-sample reconciliation, coupled transactions and local
84
84
  constant namespaces, read [guarded-editing.md](references/guarded-editing.md).
85
85
  For on-demand current/candidate screenshots and visual dry-run review, read
86
86
  [captures.md](references/captures.md).
87
+ For a rejected patch, failed check or loading error, read
88
+ [evidence and diagnosis](references/evidence.md); inspect the failing boundary
89
+ and `ads_investigate` bundle before changing APIs or verification policy.
87
90
 
88
91
  For parent/child `covers`, conditional-control review, reference comparisons,
89
92
  public style-helper use, fragment-link navigation, or `scenario-render` /
@@ -0,0 +1,73 @@
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
+ ## Get a compact investigation
24
+
25
+ Discover exact owner/check IDs with `ads_behaviors`, then:
26
+
27
+ ```json
28
+ { "unit": "components/Example", "check": "keyboard-navigation" }
29
+ ```
30
+
31
+ Send this to `ads_investigate`. It reads the latest bundle without running code.
32
+ `ads://project/investigations` lists available entries; the returned `resourceUri`
33
+ reads the same bundle. It records:
34
+
35
+ - Project versus isolated candidate, configured framework/profile and scenario.
36
+ - Exact input revision and the preview revision actually observed by the helper.
37
+ - Failing step/source, observed startup viewport and relevant failed requests.
38
+ - Available registered trace, screenshot or context artifact resource URIs.
39
+ - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
+
41
+ Absent observations are `null` or empty; ADS does not invent a viewport, trace or
42
+ source line. Viewport evidence is labeled `preview-startup`; a test that resizes
43
+ later must collect its own failure-state evidence. Failed-request collection
44
+ covers managed startup, not a complete network trace. Bodies and headers are not
45
+ collected. Project-configured Playwright trace/screenshot policy controls which
46
+ artifacts exist; ADS does not turn on expensive recording or rerun a failed case.
47
+ Protocol runners may provide structured failure/step/location/artifact fields;
48
+ older reports remain valid and their unclassified errors stay explicit.
49
+
50
+ Only the latest bundle per registered check is exposed, including dry runs.
51
+ Another verification replaces it and removes old artifacts from resource access;
52
+ old runner output directories follow project cleanup policy. Artifact resources
53
+ are restricted to registered ordinary files under that run's output directory,
54
+ bounded to 20 MiB each and checked against their recorded digest on read.
55
+ Metadata is bounded to 2 MiB. Removed registrations are pruned on verification.
56
+
57
+ Candidate evidence never becomes passing live-source evidence. Compare the
58
+ recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
+ its run, and does not claim current source merely because it remains available.
60
+ For a build/architecture rejection before behavior runs, inspect the mutation
61
+ result's `investigation` (also retained in `ads_status.mutations.lastResult`).
62
+
63
+ ## Preserve the design while repairing the failure
64
+
65
+ Fix the owner of the demonstrated defect. Do not privatize a valid API, introduce
66
+ demo-only props, substitute a styled link, change the reference baseline or weaken
67
+ verification policy to pass a tooling limitation. Preserve the draft and report
68
+ the smallest source/browser reproduction when ownership remains unprovable.
69
+
70
+ `acceptance` states what that result established. Core checks establish source
71
+ guard acceptance; registered tests establish only their actual cases/profiles.
72
+ Neither establishes untested states, visual parity, an accessibility audit or
73
+ another MCP host's compatibility. Captures show an appearance, not a transition.
@@ -51,6 +51,18 @@ blanket sleeps. Fake clocks suit timer-only guarantees; keep real time for actua
51
51
  gesture/motion/layout guarantees. Project settings belong in guarded configuration
52
52
  changes; ADS does not silently raise budgets or override the worker count.
53
53
 
54
+ If a check cannot load its MCP preview, preserve the draft and inspect the exact
55
+ resource URI and failed browser requests before changing component code. The ADS
56
+ showcase retries a fetch transport failure on `resources/read` at most twice
57
+ (200/800 ms backoff); recovered startup reads remain visible in
58
+ `startupDiagnostics`. It never retries tool calls, assertions or complete checks,
59
+ and persistent failures still block application. HTTP/protocol/content errors,
60
+ integrity failures and cancellation do not retry. External hosts own their
61
+ transport behavior. Chrome's `ERR_NETWORK_CHANGED` does not prove an ADS restart
62
+ or identify Docker/VPN churn: correlate failure timestamps with live interface
63
+ events, Chrome network logs and server availability. Do not weaken checks or
64
+ rewrite a valid API to hide infrastructure failures.
65
+
54
66
  Named barrel imports can narrow affected checks when the project accurately
55
67
  declares package `sideEffects`; retain CSS/global effects in that policy. Missing
56
68
  or unsupported policies and dynamic/wildcard dependencies stay conservative.
@@ -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,6 +48,9 @@ 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
+ and `ads_investigate` bundle before changing APIs or verification policy.
51
54
 
52
55
  For parent/child `covers`, conditional-control review, reference comparisons,
53
56
  public style-helper use, fragment-link navigation, or `scenario-render` /
@@ -0,0 +1,73 @@
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
+ ## Get a compact investigation
24
+
25
+ Discover exact owner/check IDs with `ads_behaviors`, then:
26
+
27
+ ```json
28
+ { "unit": "components/Example", "check": "keyboard-navigation" }
29
+ ```
30
+
31
+ Send this to `ads_investigate`. It reads the latest bundle without running code.
32
+ `ads://project/investigations` lists available entries; the returned `resourceUri`
33
+ reads the same bundle. It records:
34
+
35
+ - Project versus isolated candidate, configured framework/profile and scenario.
36
+ - Exact input revision and the preview revision actually observed by the helper.
37
+ - Failing step/source, observed startup viewport and relevant failed requests.
38
+ - Available registered trace, screenshot or context artifact resource URIs.
39
+ - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
+
41
+ Absent observations are `null` or empty; ADS does not invent a viewport, trace or
42
+ source line. Viewport evidence is labeled `preview-startup`; a test that resizes
43
+ later must collect its own failure-state evidence. Failed-request collection
44
+ covers managed startup, not a complete network trace. Bodies and headers are not
45
+ collected. Project-configured Playwright trace/screenshot policy controls which
46
+ artifacts exist; ADS does not turn on expensive recording or rerun a failed case.
47
+ Protocol runners may provide structured failure/step/location/artifact fields;
48
+ older reports remain valid and their unclassified errors stay explicit.
49
+
50
+ Only the latest bundle per registered check is exposed, including dry runs.
51
+ Another verification replaces it and removes old artifacts from resource access;
52
+ old runner output directories follow project cleanup policy. Artifact resources
53
+ are restricted to registered ordinary files under that run's output directory,
54
+ bounded to 20 MiB each and checked against their recorded digest on read.
55
+ Metadata is bounded to 2 MiB. Removed registrations are pruned on verification.
56
+
57
+ Candidate evidence never becomes passing live-source evidence. Compare the
58
+ recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
+ its run, and does not claim current source merely because it remains available.
60
+ For a build/architecture rejection before behavior runs, inspect the mutation
61
+ result's `investigation` (also retained in `ads_status.mutations.lastResult`).
62
+
63
+ ## Preserve the design while repairing the failure
64
+
65
+ Fix the owner of the demonstrated defect. Do not privatize a valid API, introduce
66
+ demo-only props, substitute a styled link, change the reference baseline or weaken
67
+ verification policy to pass a tooling limitation. Preserve the draft and report
68
+ the smallest source/browser reproduction when ownership remains unprovable.
69
+
70
+ `acceptance` states what that result established. Core checks establish source
71
+ guard acceptance; registered tests establish only their actual cases/profiles.
72
+ Neither establishes untested states, visual parity, an accessibility audit or
73
+ another MCP host's compatibility. Captures show an appearance, not a transition.
@@ -51,6 +51,18 @@ blanket sleeps. Fake clocks suit timer-only guarantees; keep real time for actua
51
51
  gesture/motion/layout guarantees. Project settings belong in guarded configuration
52
52
  changes; ADS does not silently raise budgets or override the worker count.
53
53
 
54
+ If a check cannot load its MCP preview, preserve the draft and inspect the exact
55
+ resource URI and failed browser requests before changing component code. The ADS
56
+ showcase retries a fetch transport failure on `resources/read` at most twice
57
+ (200/800 ms backoff); recovered startup reads remain visible in
58
+ `startupDiagnostics`. It never retries tool calls, assertions or complete checks,
59
+ and persistent failures still block application. HTTP/protocol/content errors,
60
+ integrity failures and cancellation do not retry. External hosts own their
61
+ transport behavior. Chrome's `ERR_NETWORK_CHANGED` does not prove an ADS restart
62
+ or identify Docker/VPN churn: correlate failure timestamps with live interface
63
+ events, Chrome network logs and server availability. Do not weaken checks or
64
+ rewrite a valid API to hide infrastructure failures.
65
+
54
66
  Named barrel imports can narrow affected checks when the project accurately
55
67
  declares package `sideEffects`; retain CSS/global effects in that policy. Missing
56
68
  or unsupported policies and dynamic/wildcard dependencies stay conservative.
@@ -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,6 +49,9 @@ 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
+ and `ads_investigate` bundle before changing APIs or verification policy.
52
55
 
53
56
 
54
57
  For parent/child `covers`, conditional-control review, reference comparisons,
@@ -0,0 +1,73 @@
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
+ ## Get a compact investigation
24
+
25
+ Discover exact owner/check IDs with `ads_behaviors`, then:
26
+
27
+ ```json
28
+ { "unit": "components/Example", "check": "keyboard-navigation" }
29
+ ```
30
+
31
+ Send this to `ads_investigate`. It reads the latest bundle without running code.
32
+ `ads://project/investigations` lists available entries; the returned `resourceUri`
33
+ reads the same bundle. It records:
34
+
35
+ - Project versus isolated candidate, configured framework/profile and scenario.
36
+ - Exact input revision and the preview revision actually observed by the helper.
37
+ - Failing step/source, observed startup viewport and relevant failed requests.
38
+ - Available registered trace, screenshot or context artifact resource URIs.
39
+ - Explicit `acceptance.established` and `acceptance.unverified` scope.
40
+
41
+ Absent observations are `null` or empty; ADS does not invent a viewport, trace or
42
+ source line. Viewport evidence is labeled `preview-startup`; a test that resizes
43
+ later must collect its own failure-state evidence. Failed-request collection
44
+ covers managed startup, not a complete network trace. Bodies and headers are not
45
+ collected. Project-configured Playwright trace/screenshot policy controls which
46
+ artifacts exist; ADS does not turn on expensive recording or rerun a failed case.
47
+ Protocol runners may provide structured failure/step/location/artifact fields;
48
+ older reports remain valid and their unclassified errors stay explicit.
49
+
50
+ Only the latest bundle per registered check is exposed, including dry runs.
51
+ Another verification replaces it and removes old artifacts from resource access;
52
+ old runner output directories follow project cleanup policy. Artifact resources
53
+ are restricted to registered ordinary files under that run's output directory,
54
+ bounded to 20 MiB each and checked against their recorded digest on read.
55
+ Metadata is bounded to 2 MiB. Removed registrations are pruned on verification.
56
+
57
+ Candidate evidence never becomes passing live-source evidence. Compare the
58
+ recorded input revision with current `ads_behaviors` evidence; a bundle describes
59
+ its run, and does not claim current source merely because it remains available.
60
+ For a build/architecture rejection before behavior runs, inspect the mutation
61
+ result's `investigation` (also retained in `ads_status.mutations.lastResult`).
62
+
63
+ ## Preserve the design while repairing the failure
64
+
65
+ Fix the owner of the demonstrated defect. Do not privatize a valid API, introduce
66
+ demo-only props, substitute a styled link, change the reference baseline or weaken
67
+ verification policy to pass a tooling limitation. Preserve the draft and report
68
+ the smallest source/browser reproduction when ownership remains unprovable.
69
+
70
+ `acceptance` states what that result established. Core checks establish source
71
+ guard acceptance; registered tests establish only their actual cases/profiles.
72
+ Neither establishes untested states, visual parity, an accessibility audit or
73
+ another MCP host's compatibility. Captures show an appearance, not a transition.
@@ -51,6 +51,18 @@ blanket sleeps. Fake clocks suit timer-only guarantees; keep real time for actua
51
51
  gesture/motion/layout guarantees. Project settings belong in guarded configuration
52
52
  changes; ADS does not silently raise budgets or override the worker count.
53
53
 
54
+ If a check cannot load its MCP preview, preserve the draft and inspect the exact
55
+ resource URI and failed browser requests before changing component code. The ADS
56
+ showcase retries a fetch transport failure on `resources/read` at most twice
57
+ (200/800 ms backoff); recovered startup reads remain visible in
58
+ `startupDiagnostics`. It never retries tool calls, assertions or complete checks,
59
+ and persistent failures still block application. HTTP/protocol/content errors,
60
+ integrity failures and cancellation do not retry. External hosts own their
61
+ transport behavior. Chrome's `ERR_NETWORK_CHANGED` does not prove an ADS restart
62
+ or identify Docker/VPN churn: correlate failure timestamps with live interface
63
+ events, Chrome network logs and server availability. Do not weaken checks or
64
+ rewrite a valid API to hide infrastructure failures.
65
+
54
66
  Named barrel imports can narrow affected checks when the project accurately
55
67
  declares package `sideEffects`; retain CSS/global effects in that policy. Missing
56
68
  or unsupported policies and dynamic/wildcard dependencies stay conservative.
@@ -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
@@ -69,6 +69,9 @@ For owner drafts, token-sample reconciliation, coupled transactions and local
69
69
  constant namespaces, read [guarded-editing.md](references/guarded-editing.md).
70
70
  For on-demand current/candidate screenshots and visual dry-run review, read
71
71
  [captures.md](references/captures.md).
72
+ For a rejected patch, failed check or loading error, read
73
+ [evidence and diagnosis](references/evidence.md); inspect the failing boundary
74
+ and `ads_investigate` bundle before changing APIs or verification policy.
72
75
 
73
76
 
74
77
  For parent/child `covers`, conditional-control review, reference comparisons,