@reqvire-org/ads 0.3.9 → 0.3.11

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.
@@ -1,8 +1,38 @@
1
- # Scenario render evidence and public class helpers
1
+ # Scenario rendering, token previews and public class helpers
2
2
 
3
3
  Use this reference for `scenario-render`, `scenario-coverage` or `showcase-class`
4
4
  diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
5
5
 
6
+ All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
7
+ link instead of inferring a section from an ID's directory: an owner-local token
8
+ scenario may live under `components/` or `patterns/`, with `kind: "tokens"`.
9
+ Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
10
+ `category` argument; both preview tools return canonical `?scenario=` links.
11
+
12
+ After an edit, check the build's `current`/`stale` fields and `sourceRevision`.
13
+ Source evidence is captured before compilation and checked against current project
14
+ inputs; an unchanged artifact or running watcher cannot establish freshness.
15
+ `ADS_PREVIEW_STALE_SOURCE` means the retained output awaits a current build.
16
+ Guarded writes explicitly invalidate the compiler, and content reconciliation
17
+ recovers missed atomic replacements. Do not touch source to force freshness;
18
+ inspect build diagnostics. Upgrade the project's compiler dependency together
19
+ with MCP when an older reporter lacks source evidence.
20
+
21
+ ## Owner-local token previews load their own definitions
22
+
23
+ Keep the registered token sheet imported by its runtime owner for product use.
24
+ A colocated `kind: "tokens"` scenario may render only the public review pattern
25
+ with its fixture samples. Discovery adds the registered owner sheet to the
26
+ generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
27
+ into the token preview independently of the runtime component. Custom builders
28
+ that replace this plugin must preserve these explicit stylesheet dependencies.
29
+ Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
30
+
31
+ Open the exact token scenario in a fresh App and verify resolved values and sample
32
+ effects in both themes. A successful ordinary component preview does not prove
33
+ the independently bundled token preview loads the same definitions. Shared
34
+ foundation styling still follows the project's mount/build integration.
35
+
6
36
  ## Public children can share their parent's scenario
7
37
 
8
38
  Declare the public parts actually demonstrated in `covers`, even when their
@@ -1,8 +1,38 @@
1
- # Scenario render evidence and public class helpers
1
+ # Scenario rendering, token previews and public class helpers
2
2
 
3
3
  Use this reference for `scenario-render`, `scenario-coverage` or `showcase-class`
4
4
  diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
5
5
 
6
+ All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
7
+ link instead of inferring a section from an ID's directory: an owner-local token
8
+ scenario may live under `components/` or `patterns/`, with `kind: "tokens"`.
9
+ Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
10
+ `category` argument; both preview tools return canonical `?scenario=` links.
11
+
12
+ After an edit, check the build's `current`/`stale` fields and `sourceRevision`.
13
+ Source evidence is captured before compilation and checked against current project
14
+ inputs; an unchanged artifact or running watcher cannot establish freshness.
15
+ `ADS_PREVIEW_STALE_SOURCE` means the retained output awaits a current build.
16
+ Guarded writes explicitly invalidate the compiler, and content reconciliation
17
+ recovers missed atomic replacements. Do not touch source to force freshness;
18
+ inspect build diagnostics. Upgrade the project's compiler dependency together
19
+ with MCP when an older reporter lacks source evidence.
20
+
21
+ ## Owner-local token previews load their own definitions
22
+
23
+ Keep the registered token sheet imported by its runtime owner for product use.
24
+ A colocated `kind: "tokens"` scenario may render only the public review pattern
25
+ with its fixture samples. Discovery adds the registered owner sheet to the
26
+ generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
27
+ into the token preview independently of the runtime component. Custom builders
28
+ that replace this plugin must preserve these explicit stylesheet dependencies.
29
+ Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
30
+
31
+ Open the exact token scenario in a fresh App and verify resolved values and sample
32
+ effects in both themes. A successful ordinary component preview does not prove
33
+ the independently bundled token preview loads the same definitions. Shared
34
+ foundation styling still follows the project's mount/build integration.
35
+
6
36
  ## Public children can share their parent's scenario
7
37
 
8
38
  Declare the public parts actually demonstrated in `covers`, even when their
@@ -1,8 +1,38 @@
1
- # Scenario render evidence and public class helpers
1
+ # Scenario rendering, token previews and public class helpers
2
2
 
3
3
  Use this reference for `scenario-render`, `scenario-coverage` or `showcase-class`
4
4
  diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
5
5
 
6
+ All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
7
+ link instead of inferring a section from an ID's directory: an owner-local token
8
+ scenario may live under `components/` or `patterns/`, with `kind: "tokens"`.
9
+ Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
10
+ `category` argument; both preview tools return canonical `?scenario=` links.
11
+
12
+ After an edit, check the build's `current`/`stale` fields and `sourceRevision`.
13
+ Source evidence is captured before compilation and checked against current project
14
+ inputs; an unchanged artifact or running watcher cannot establish freshness.
15
+ `ADS_PREVIEW_STALE_SOURCE` means the retained output awaits a current build.
16
+ Guarded writes explicitly invalidate the compiler, and content reconciliation
17
+ recovers missed atomic replacements. Do not touch source to force freshness;
18
+ inspect build diagnostics. Upgrade the project's compiler dependency together
19
+ with MCP when an older reporter lacks source evidence.
20
+
21
+ ## Owner-local token previews load their own definitions
22
+
23
+ Keep the registered token sheet imported by its runtime owner for product use.
24
+ A colocated `kind: "tokens"` scenario may render only the public review pattern
25
+ with its fixture samples. Discovery adds the registered owner sheet to the
26
+ generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
27
+ into the token preview independently of the runtime component. Custom builders
28
+ that replace this plugin must preserve these explicit stylesheet dependencies.
29
+ Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
30
+
31
+ Open the exact token scenario in a fresh App and verify resolved values and sample
32
+ effects in both themes. A successful ordinary component preview does not prove
33
+ the independently bundled token preview loads the same definitions. Shared
34
+ foundation styling still follows the project's mount/build integration.
35
+
6
36
  ## Public children can share their parent's scenario
7
37
 
8
38
  Declare the public parts actually demonstrated in `covers`, even when their
@@ -1,8 +1,38 @@
1
- # Scenario render evidence and public class helpers
1
+ # Scenario rendering, token previews and public class helpers
2
2
 
3
3
  Use this reference for `scenario-render`, `scenario-coverage` or `showcase-class`
4
4
  diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
5
5
 
6
+ All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
7
+ link instead of inferring a section from an ID's directory: an owner-local token
8
+ scenario may live under `components/` or `patterns/`, with `kind: "tokens"`.
9
+ Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
10
+ `category` argument; both preview tools return canonical `?scenario=` links.
11
+
12
+ After an edit, check the build's `current`/`stale` fields and `sourceRevision`.
13
+ Source evidence is captured before compilation and checked against current project
14
+ inputs; an unchanged artifact or running watcher cannot establish freshness.
15
+ `ADS_PREVIEW_STALE_SOURCE` means the retained output awaits a current build.
16
+ Guarded writes explicitly invalidate the compiler, and content reconciliation
17
+ recovers missed atomic replacements. Do not touch source to force freshness;
18
+ inspect build diagnostics. Upgrade the project's compiler dependency together
19
+ with MCP when an older reporter lacks source evidence.
20
+
21
+ ## Owner-local token previews load their own definitions
22
+
23
+ Keep the registered token sheet imported by its runtime owner for product use.
24
+ A colocated `kind: "tokens"` scenario may render only the public review pattern
25
+ with its fixture samples. Discovery adds the registered owner sheet to the
26
+ generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
27
+ into the token preview independently of the runtime component. Custom builders
28
+ that replace this plugin must preserve these explicit stylesheet dependencies.
29
+ Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
30
+
31
+ Open the exact token scenario in a fresh App and verify resolved values and sample
32
+ effects in both themes. A successful ordinary component preview does not prove
33
+ the independently bundled token preview loads the same definitions. Shared
34
+ foundation styling still follows the project's mount/build integration.
35
+
6
36
  ## Public children can share their parent's scenario
7
37
 
8
38
  Declare the public parts actually demonstrated in `covers`, even when their
@@ -1,8 +1,38 @@
1
- # Scenario render evidence and public class helpers
1
+ # Scenario rendering, token previews and public class helpers
2
2
 
3
3
  Use this reference for `scenario-render`, `scenario-coverage` or `showcase-class`
4
4
  diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
5
5
 
6
+ All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
7
+ link instead of inferring a section from an ID's directory: an owner-local token
8
+ scenario may live under `components/` or `patterns/`, with `kind: "tokens"`.
9
+ Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
10
+ `category` argument; both preview tools return canonical `?scenario=` links.
11
+
12
+ After an edit, check the build's `current`/`stale` fields and `sourceRevision`.
13
+ Source evidence is captured before compilation and checked against current project
14
+ inputs; an unchanged artifact or running watcher cannot establish freshness.
15
+ `ADS_PREVIEW_STALE_SOURCE` means the retained output awaits a current build.
16
+ Guarded writes explicitly invalidate the compiler, and content reconciliation
17
+ recovers missed atomic replacements. Do not touch source to force freshness;
18
+ inspect build diagnostics. Upgrade the project's compiler dependency together
19
+ with MCP when an older reporter lacks source evidence.
20
+
21
+ ## Owner-local token previews load their own definitions
22
+
23
+ Keep the registered token sheet imported by its runtime owner for product use.
24
+ A colocated `kind: "tokens"` scenario may render only the public review pattern
25
+ with its fixture samples. Discovery adds the registered owner sheet to the
26
+ generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
27
+ into the token preview independently of the runtime component. Custom builders
28
+ that replace this plugin must preserve these explicit stylesheet dependencies.
29
+ Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
30
+
31
+ Open the exact token scenario in a fresh App and verify resolved values and sample
32
+ effects in both themes. A successful ordinary component preview does not prove
33
+ the independently bundled token preview loads the same definitions. Shared
34
+ foundation styling still follows the project's mount/build integration.
35
+
6
36
  ## Public children can share their parent's scenario
7
37
 
8
38
  Declare the public parts actually demonstrated in `covers`, even when their
@@ -170,7 +170,11 @@ export function createVerificationController(root) {
170
170
  if (profile.mode === "browser" && group.some(check => check.scenario)) {
171
171
  const { startAdsMcp } = await import("./mcp/server.mjs");
172
172
  host ??= await startAdsMcp(root, { stdio: false, showcase: true });
173
- for (const check of group.filter(check => check.scenario)) { const url = new URL(host.url); url.searchParams.set("scenario", check.scenario); scenarios[check.scenario] = url.href; }
173
+ for (const check of group.filter(check => check.scenario)) {
174
+ const url = new URL(host.url);
175
+ url.searchParams.set("scenario", check.scenario);
176
+ scenarios[check.scenario] = url.href;
177
+ }
174
178
  }
175
179
  const requestContext = { schemaVersion: 1, runId, projectRoot: root, framework: options.config.framework, profile: profileName, mode: profile.mode ?? "unit", checks: group.map(({ contract: _contract, ...check }) => check), scenarios };
176
180
  writeFileSync(request, JSON.stringify(requestContext));
package/docs/ADS.md CHANGED
@@ -209,6 +209,11 @@ Measured runtime variables retain their existing exact `styleWrites` boundary.
209
209
 
210
210
  A colocated scenario sets `kind:"tokens"` and declares real fixture `samples`
211
211
  consumed by a public review pattern. Its ID still derives from its source path.
212
+ Discovery attaches its owner's registered definition sheet as `stylesheets` on
213
+ the generated scenario record; `previewEntriesPlugin` imports it directly into
214
+ that preview's module graph. CSS-only package side effects can then tree-shake
215
+ the runtime component without dropping the token definitions. Keep the runtime
216
+ CSS import for product use; the token scenario need not import or render its owner.
212
217
  Every local token needs this real sample coverage, just like shared tokens.
213
218
  Definitions, metadata, fixture and token scenario belong to the same edit unit.
214
219
  Manifests/fixtures are development inputs; production includes the runtime's
@@ -288,7 +288,10 @@ Reassembling a second screen from shared primitives still allows design drift.
288
288
  The server discovers one path-derived scenario registry. The showcase's four
289
289
  sections—Tokens, Components, Patterns and Composition—browse that same registry
290
290
  through MCP results. They do not initialize the entry or define
291
- its UI. The host supplies theme and available space; the public implementation
291
+ its UI. Every preview uses `?scenario=<id>`; discovered `kind` selects its section,
292
+ including token scenarios colocated with component/pattern owners. Existing
293
+ `?category=` links remain compatibility aliases. The host supplies theme and
294
+ available space; the public implementation
292
295
  supplies presentation. Several related public parts may share a scenario with
293
296
  their required parent. Every declared token and every public renderable component
294
297
  and pattern needs addressable coverage. Token references must exist in the real
@@ -304,8 +307,12 @@ The skill-local [scenario guide](../skills/ads-designer/references/scenarios.md)
304
307
  explains evidence, limits and diagnostics.
305
308
 
306
309
  After source changes, validation and compilation must both succeed before a new
307
- graph becomes current. MCP announces build/resource updates. The built-in client
308
- refreshes discovery and sends the current selection to the existing App, whose
310
+ graph becomes current. MCP announces build/resource updates.
311
+ Build success records the project input digest captured before compilation;
312
+ status reads independently verify that digest and the output bytes. Guarded
313
+ publication invalidates the compiler explicitly. Content reconciliation recovers
314
+ missed atomic file replacements, so OS watch delivery cannot establish freshness.
315
+ The built-in client refreshes discovery and sends the current selection to the existing App, whose
309
316
  loader mounts the new module graph. Failed builds retain the previous view with
310
317
  visible stale diagnostics. Invalid scenario metadata at startup and later source
311
318
  failures stay in the watcher's recoverable diagnostic path. Fixing source triggers validation again.
@@ -434,6 +441,8 @@ verification, and the browser check does not judge design quality.
434
441
  An optional owner-local token namespace keeps component/pattern constants beside
435
442
  their consumer. Its definition-only stylesheet contains root/theme custom
436
443
  properties and is imported by the runtime owner; UI styling remains in Linaria.
444
+ Independent owner-token preview entries also import the registered definition
445
+ sheet directly, so tree-shaking an unused runtime owner cannot remove their values.
437
446
  Namespaces, aliases, ownership and actual colocated sample coverage are checked.
438
447
  The shared foundation remains the cross-owner vocabulary. See the
439
448
  [owner-token contract](ADS.md#owner-local-tokens).
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.11
4
+
5
+ - Bind preview success to project input content as well as artifact bytes. Source
6
+ edits immediately mark older output stale, including edits missed by OS watches
7
+ and changes made during a build; reject reports without source evidence.
8
+ - Recover missed atomic replacements with one-second input reconciliation and
9
+ explicitly invalidate the live compiler after accepted single/coupled edits.
10
+ Retain the same process and verify repeated replacements with generic fixtures.
11
+ - Use canonical `?scenario=<id>` links for every preview kind and select the
12
+ showcase section from discovered metadata. Preserve legacy `?category=` links
13
+ as aliases, unify MCP preview and browser-check links, and cover all kinds,
14
+ owner-local tokens, navigation and reloads in a real sandboxed-App regression.
15
+
16
+ ## 0.3.10
17
+
18
+ - Attach registered owner-local token sheets to independently compiled token
19
+ previews, preserving definitions under CSS-only package side effects without
20
+ retaining runtime owners or loading peer sheets. Verify resource closure in
21
+ React/Preact and rendered samples in a sandboxed App in both themes.
22
+ - Route managed browser checks for owner-local token scenarios through the
23
+ discovered token category, independent of their component/pattern file paths.
24
+
3
25
  ## 0.3.9
4
26
 
5
27
  - Credit explicitly declared public child renders reached through parents,
package/docs/MCP.md CHANGED
@@ -15,6 +15,14 @@ The agent keeps its stdio connection; the browser connects to `/mcp` on the same
15
15
  runtime using HTTP and the current modern protocol. Both share the configured
16
16
  preview watcher and artifacts. Stdout remains exclusively JSON-RPC.
17
17
 
18
+ Every registered preview uses `?scenario=<discovered-id>`, including token
19
+ previews colocated under components or patterns. The client selects its section
20
+ from the scenario's discovered `kind`, never from the ID's path prefix. Existing
21
+ `?category=<id>` links remain accepted and normalize to `?scenario=`; an explicit
22
+ `scenario` parameter takes precedence when both are present. `ads_show_tokens`
23
+ keeps its `category` tool argument and returns the same canonical showcase link
24
+ as `ads_show_scenario` for that ID.
25
+
18
26
  For browser-only work, run `ads showcase` inside the project. It starts the same
19
27
  runtime without stdio. `--port 4185` selects a port; otherwise the OS chooses an
20
28
  available one. For a stable address, add `"--port", "4191"` to the server's `args`
@@ -560,6 +568,10 @@ framework compilation and Linaria extraction. The starter's
560
568
  - Its `buildGraph(entries, options, track)` adapter runs one multi-entry Vite build
561
569
  with `previewEntriesPlugin()` and `createPreviewResources()` from
562
570
  `@reqvire-org/ads/scenarios/vite`.
571
+ Generated owner-token entries include `stylesheets` derived from the registered
572
+ owner manifest. Pass the entries intact: the plugin imports those definition
573
+ sheets even when the runtime owner is tree-shaken. A replacement entry plugin
574
+ must preserve these dependencies without importing unrelated owners.
563
575
  - Keep `preserveEntrySignatures: "strict"`, `cssCodeSplit: true`,
564
576
  `assetsInlineLimit: 0`, `modulePreload: false`, and `write: false`. Include the
565
577
  supplied dependency-tracking plugin and the project's Linaria/framework plugins.
@@ -697,7 +709,18 @@ Tool summaries include the first three diagnostics per preview, capped at 1,000
697
709
  characters each, with counts and truncation flags; the build resource retains
698
710
  the complete bounded report.
699
711
  A watcher session separates revisions across restarts, and an artifact digest
700
- checks that the served output matches the reported successful build.
712
+ checks that the served output matches the reported successful build. Each build
713
+ captures a `sourceRevision` before compilation. Status reads compare that content
714
+ digest with current project inputs; unchanged output cannot remain current after
715
+ source changes. Such previews retain their last successful revision and output,
716
+ but report `current: false`, `stale: true` and `ADS_PREVIEW_STALE_SOURCE` while
717
+ awaiting the current build. Changes during compilation also invalidate success.
718
+
719
+ Guarded single-owner edits and transactions explicitly invalidate the managed
720
+ compiler after publication. Filesystem events provide fast updates; one-second
721
+ input reconciliation recovers missed atomic replacements without touching source
722
+ or restarting MCP. Keep the project compiler's ADS dependency and the MCP package
723
+ updated together: older reports without source evidence cannot establish freshness.
701
724
 
702
725
  On each status transition MCP sends `notifications/resources/updated` to build
703
726
  resource subscribers. Legacy connections use `resources/subscribe`; modern
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {