@reqvire-org/ads 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/ADS.md CHANGED
@@ -169,6 +169,35 @@ custom styling in fixture files. The ADS frame pattern uses `--ux-*`. Foreign br
169
169
  CSS imports the approved token files in order; shared assignments belong in
170
170
  those token files, never in consumer styles or component state overrides.
171
171
 
172
+ Foundation roles are enforced by `foundation-role`, `foundation-selector` and
173
+ `foundation-import`, alongside the regular token checks. Shared definitions
174
+ belong on the document root or explicit root themes; ordinary declarations belong
175
+ in `base.css`, and font-face descriptors in optional `fonts.css`. The entry imports
176
+ canonical sheets; those sheets cannot import another styling layer. Component
177
+ classes, IDs, data/ARIA hooks, contextual selectors, keyframes and scoped UI rules
178
+ are rejected in the foundation, including nested functional selectors. Raw visual
179
+ values and undefined token references are checked in native defaults too; literal
180
+ font-face metadata keeps its separate asset role.
181
+
182
+ `base.css` has three closed roles:
183
+
184
+ - Document defaults: root/body typography, canvas colors and theme behavior,
185
+ global text selection and document scrollbars.
186
+ - Native resets: permitted normalization properties and values, such as zero
187
+ spacing, inherited control typography, list resets and responsive replaced media.
188
+ - Global accessibility: universal `:focus-visible` outline rules, and reduced-motion
189
+ overrides inside `@media (prefers-reduced-motion: reduce)`.
190
+
191
+ The `foundation-role` check validates every selector branch, property and value.
192
+ Native selectors are not a bypass: token-backed button backgrounds, flex/grid
193
+ layout, component-specific focus rules and hover/disabled skins are rejected.
194
+ Shared token definitions belong in value sheets, not `base.css`. No project token
195
+ names are embedded in this policy. A zero-specificity `:where()` wrapper does not
196
+ change ownership. Put component design and animation in Linaria owners, and
197
+ scenario layout variations in typed public review-pattern props. Browser review
198
+ still checks the effects and accessibility of permitted defaults.
199
+
200
+
172
201
  Store original branding and its usage, credits, and licenses in
173
202
  `assets/brand/`, and fonts in `assets/fonts/`. Configure generated icons and
174
203
  asset mounts as described in the [branding guide](GUIDE.md#branding).
@@ -191,6 +191,29 @@ and the UI rendered inside Apps belong to the project. This keeps the tool usefu
191
191
  with an empty ADS while making every implementation addressable once its scenario
192
192
  exists.
193
193
 
194
+ ### The foundation has a narrow styling role
195
+
196
+ Shared token sheets define values on the document root and its themes. The
197
+ import-only entry loads them in canonical order. `fonts.css` declares font faces;
198
+ `base.css` establishes shared native defaults and normalization. Components and
199
+ patterns own their layout, skin, states and animations in Linaria.
200
+
201
+ `base.css` has a closed contract with three roles: root/body typography, canvas
202
+ colors and theme behavior; limited native normalization; and global accessibility
203
+ through focus indicators and reduced-motion rules. Selector, property and value
204
+ checks reject component skins and layout even when they use native selectors and
205
+ valid tokens. A `button` background or `body` grid belongs to a Linaria owner.
206
+ Document defaults also cover shared text selection and document scrollbars;
207
+ local control/scroll-container styling stays with its owner.
208
+
209
+ Foundation CSS passes the ordinary token-reference and visual-value checks too.
210
+ Parsed selectors reject component hooks, local shared-token overrides and
211
+ contextual selectors, including hooks concealed in `:where()` or `:is()`. The
212
+ policy describes CSS roles and normalization keywords, with no project classes,
213
+ token catalogue or sample templates. Lower specificity cannot bypass ownership.
214
+ Static gates establish this source contract; browser review still checks its
215
+ actual effects and accessibility.
216
+
194
217
  ### A preview scenario is the unit of review
195
218
 
196
219
  A component export alone may need inputs, parent context, local state or callbacks
@@ -201,8 +224,9 @@ page or initializing the application's router, store or services first.
201
224
  Scenarios and their fixtures live beside the tokens, component or pattern they exercise.
202
225
  Token scenarios choose real token names and sample inputs; a project-owned
203
226
  review pattern applies the foundation variables. The tool contains no project
204
- token list, sample templates or assumed visual identity. A minimal foundation
205
- scenario can inspect values before a project has any components.
227
+ token list, sample templates or assumed visual identity. Even an initial token
228
+ scenario uses a public project-owned review pattern to apply its declared samples;
229
+ a definitions-only inspector does not establish preview coverage.
206
230
  Larger scenarios live under `composition/`. They use the same public screen
207
231
  patterns as production: application adapters supply live data and effects;
208
232
  scenario adapters supply fixture data, local state and simulated services.
@@ -222,7 +246,12 @@ After source changes, validation and compilation must both succeed before a new
222
246
  graph becomes current. MCP announces build/resource updates. The built-in client
223
247
  refreshes discovery and sends the current selection to the existing App, whose
224
248
  loader mounts the new module graph. Failed builds retain the previous view with
225
- visible stale diagnostics. Compilation remains necessary for TSX and Linaria;
249
+ visible stale diagnostics. Invalid scenario metadata at startup and later source
250
+ failures stay in the watcher's recoverable diagnostic path. Fixing source triggers validation again.
251
+ If the compiler process exits, the next preview request starts one fresh child;
252
+ MCP inspection remains available. Each child generation has its own status report,
253
+ so independent MCP clients do not overwrite each other's build state.
254
+ Compilation remains necessary for TSX and Linaria;
226
255
  there is one preview pipeline with automatic updates.
227
256
 
228
257
  Scenario entries, adapters and fixtures are development source even when
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2
4
+
5
+ - Enforce foundation CSS roles, parsed selector boundaries, root-only shared token
6
+ assignments, token references and visual values. Keep native defaults in
7
+ `base.css`, definitions in value sheets and font-face metadata in `fonts.css`;
8
+ reject hidden owner styling, extra imports and animation/scoping escapes.
9
+ Close `base.css` to document defaults, limited normalization and global
10
+ accessibility; native selectors and valid tokens cannot hide component skins
11
+ or layout. Move the demo link hover styling into its TextLink owner.
12
+ - Keep scenario discovery and build failures recoverable in the watcher, including
13
+ invalid metadata at startup. Reattach replaced source-directory watches.
14
+ - Retry exited builders on the next preview request without reconnecting MCP;
15
+ reload changed compiler code through a fresh child and preserve inspection.
16
+ Isolate status reports per child session across concurrent MCP clients.
17
+ - Align the starter, example foundation and skills with the enforced boundaries.
18
+
3
19
  ## 0.3.1
4
20
 
5
21
  - Stop generating redundant empty public exports. Allow an owning unit's public
package/docs/GUIDE.md CHANGED
@@ -302,7 +302,7 @@ For iterative development, use the linking workflow above. From the repository r
302
302
  npm install
303
303
  npm run build
304
304
  npm run pack:tool
305
- ads_tool_package="$PWD/output/npm/reqvire-org-ads-0.3.1.tgz"
305
+ ads_tool_package="$PWD/output/npm/reqvire-org-ads-0.3.2.tgz"
306
306
  ```
307
307
 
308
308
  Then change into an existing test project containing `package.json`:
@@ -497,6 +497,14 @@ import-only: fonts (when present), colors, typography, spacing, elevation, base.
497
497
  Fixed artwork colors and geometry are permitted inside SVG assets; they do not
498
498
  permit raw visual values in component or pattern styles.
499
499
 
500
+ Foundation sheets are checked source. Keep root token definitions in value sheets,
501
+ font faces in `fonts.css`, and closed-role defaults in `base.css` (document
502
+ typography/canvas/theme, limited native resets, global focus/reduced motion).
503
+ Owner hooks, contextual UI selectors, keyframes, extra CSS imports, raw visual
504
+ values and missing token references fail checks there too. Move component-specific
505
+ repairs into their Linaria owner; see the [foundation contract](ADS.md#shared-token-contract).
506
+
507
+
500
508
  Select one SVG master with an ADS-relative path:
501
509
 
502
510
  ```json
package/docs/MCP.md CHANGED
@@ -498,11 +498,17 @@ success cache is republished in the new watcher session without recompilation;
498
498
  merely finding an older HTML file is insufficient. A timeout leaves the watcher running: inspect the
499
499
  logs and invoke the preview again. `ads_status` distinguishes watcher process
500
500
  state from reported build state. Token inspection and other ordinary tools
501
- remain available after a build failure. An exited watcher needs reconnection;
502
- an active watcher can recover on the next successful rebuild. Changes to
503
- `previewWatch`, the compiler adapter or ADS tooling require reconnection to load
504
- new process code. The shared scheduler rejects publication if its loaded adapter
505
- files change; normal component, fixture and style edits remain automatic.
501
+ remain available after a build failure. Invalid scenario metadata at startup and
502
+ later source/validation failures remain reported while the compiler watches for
503
+ repairs. A successful edit recovers without reconnecting MCP. If the child process
504
+ exits, fix the builder and invoke the preview again: concurrent requests share one
505
+ fresh child and session. ADS does not run an unattended crash/restart loop.
506
+
507
+ Changes to loaded compiler code or dependencies produce `ADS_PREVIEW_RESTART`;
508
+ the next preview invocation restarts only the builder and validates current inputs.
509
+ Managed configuration changes replace the compiler through the same supervisor.
510
+ Updating ADS server code itself still requires reconnecting the MCP client to load
511
+ the new package. Normal component, fixture and style edits remain automatic.
506
512
 
507
513
  ADS stops the managed watcher and its compiler subprocesses when stdin closes or
508
514
  it receives SIGINT/SIGTERM. The project must keep its watcher in the foreground,
@@ -529,7 +535,10 @@ No ADS package release or skill reinstall is needed for project component change
529
535
  ### When code or styles break
530
536
 
531
537
  A preview publisher reports `building`, `ready` or `error` to
532
- `.ds/build-status.json`. `ads_status.build` and the `ads://project/build` resource
538
+ `.ds/build-status.json` for standalone builds. A managed compiler receives its own
539
+ `.ds/build-status-<session>.json` through `ADS_MCP_BUILD_STATUS`; publishers must
540
+ honor that path and `ADS_MCP_BUILD_SESSION`. Independent MCP clients therefore do
541
+ not clobber each other's reports. `ads_status.build` and the `ads://project/build` resource
533
542
  expose those states, each preview's build revision, last successful revision,
534
543
  availability, freshness and diagnostics. Diagnostic positions are one-based.
535
544
  Tool summaries include the first three diagnostics per preview, capped at 1,000
@@ -553,7 +562,9 @@ failed build even when older output remains on disk. The reusable bootstrap and
553
562
  retained immutable assets stay readable so an existing App can report freshness;
554
563
  readability alone does not establish a current preview. After a successful rebuild the same
555
564
  tool works again without restarting MCP. If the watcher itself exits, its
556
- failure is reported and the client must reconnect after fixing the command.
565
+ failure is reported; after fixing the command, invoke the preview again to start
566
+ a fresh builder. Partial or empty scenario discovery also exposes project-level
567
+ diagnostics through `ads://project/build`.
557
568
 
558
569
  Already-mounted Apps show rebuilding, failure or a newer available revision
559
570
  when the host permits server resource reads. They check build status every two
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
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": {
@@ -51,6 +51,7 @@
51
51
  "dependencies": {
52
52
  "@modelcontextprotocol/server": "2.3.1",
53
53
  "postcss": "^8.5.30",
54
+ "postcss-selector-parser": "^7.1.6",
54
55
  "postcss-value-parser": "^4.2.0",
55
56
  "sharp": "^0.35.5",
56
57
  "typescript": "^5.9.3",