@reqvire-org/ads 0.3.5 → 0.3.6

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 (43) hide show
  1. package/README.md +5 -1
  2. package/dist/bootstrap-ds/ADS.md +9 -3
  3. package/dist/bootstrap-ds/README.md +10 -0
  4. package/dist/boundaries.mjs +3 -0
  5. package/dist/check.mjs +13 -0
  6. package/dist/config.mjs +6 -2
  7. package/dist/mcp/build-status.mjs +7 -4
  8. package/dist/mcp/context.mjs +2 -2
  9. package/dist/mcp/edit-preparation.mjs +111 -0
  10. package/dist/mcp/mutations.mjs +54 -38
  11. package/dist/mcp/preview-watch.mjs +10 -4
  12. package/dist/mcp/server.mjs +32 -22
  13. package/dist/mcp/text-diff.mjs +19 -0
  14. package/dist/preview-resources.mjs +45 -8
  15. package/dist/preview-scope.mjs +30 -0
  16. package/dist/scenarios-compiler.mjs +24 -17
  17. package/dist/scenarios.mjs +46 -4
  18. package/dist/scoped-tokens.mjs +57 -0
  19. package/dist/skills/ads-break-ui/SKILL.md +4 -2
  20. package/dist/skills/ads-break-ui/references/guarded-editing.md +44 -0
  21. package/dist/skills/ads-break-ui/references/verification.md +6 -0
  22. package/dist/skills/ads-designer/SKILL.md +4 -2
  23. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +9 -3
  24. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +10 -0
  25. package/dist/skills/ads-designer/references/guarded-editing.md +44 -0
  26. package/dist/skills/ads-import/SKILL.md +4 -2
  27. package/dist/skills/ads-import/references/guarded-editing.md +44 -0
  28. package/dist/skills/ads-import/references/tokens.md +4 -2
  29. package/dist/skills/ads-migrate/SKILL.md +4 -2
  30. package/dist/skills/ads-migrate/references/guarded-editing.md +44 -0
  31. package/dist/skills/ads-motion/SKILL.md +4 -2
  32. package/dist/skills/ads-motion/references/guarded-editing.md +44 -0
  33. package/dist/token-fixtures.mjs +30 -0
  34. package/dist/tokens.mjs +8 -2
  35. package/dist/units.mjs +15 -0
  36. package/dist/verification.mjs +1 -1
  37. package/docs/ADS.md +45 -2
  38. package/docs/ARCHITECTURE.md +21 -0
  39. package/docs/BEHAVIORS.md +11 -0
  40. package/docs/CHANGELOG.md +20 -0
  41. package/docs/GUIDE.md +8 -3
  42. package/docs/MCP.md +60 -5
  43. package/package.json +1 -1
package/docs/BEHAVIORS.md CHANGED
@@ -145,6 +145,17 @@ Write meaningful assertions for the registered guarantee. The helper waits for
145
145
  the current selected scenario inside the real sandboxed MCP App. It uses `load`
146
146
  and explicit readiness, not `networkidle`: MCP keeps event connections open.
147
147
 
148
+ Compare reference and candidate under equivalent framing. In a reported Chrome
149
+ comparison, `content-visibility` initially used placeholder geometry inside a
150
+ cross-origin App iframe for both ADS and the upstream reference; the same content
151
+ measured differently as a top-level page. This is an observed browser/layout
152
+ condition, not evidence of an ADS defect. App readiness does not imply that every
153
+ off-screen item has rendered. For geometry assertions, bring the relevant content
154
+ into view and wait for its measured layout to settle. Record the framing and
155
+ visibility state; test initial placeholder behavior separately when it matters to
156
+ the guarantee. Wait for focus and positioning readiness before normal keyboard
157
+ comparisons, and test rapid input separately rather than hiding it behind delays.
158
+
148
159
  `mode: "browser"` starts an isolated managed showcase on an automatic port. Test
149
160
  requests contain its scenario URLs, and cleanup closes its host/compiler tree.
150
161
  Mutation candidates use their own source, generated graph and server; a passing
package/docs/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.3.6
6
+
7
+ - Isolate managed resource-graph output by session; reuse verified compiled
8
+ snapshots across warm starts without letting standalone builds overwrite live
9
+ preview success records.
10
+ - Add component/pattern-owned token namespaces, closed definition-only sheets,
11
+ discovery, alias/ownership checks and real colocated token-preview coverage.
12
+ - Add owner draft/diff preparation and project-directed token sample reconciliation.
13
+ Keep all source writes behind guarded Git patches.
14
+ - Add bounded coupled-owner transactions, validating all guards, registered checks
15
+ and affected behavior checks against the final candidate before publication.
16
+ - Permit empty .gitkeep deletion alongside real new owner source. Retain hidden
17
+ file restrictions, render coverage and public scenario-control ownership.
18
+ - Document framed content-visibility geometry as a browser comparison condition,
19
+ with observable layout/focus readiness and separate rapid-input checks.
20
+
21
+ - Use MCP display titles throughout the diagnostic explorer, with annotation-title
22
+ and tool-name fallbacks. Publish configured App titles in tool metadata and keep
23
+ machine-readable names for protocol calls.
24
+
5
25
  ## 0.3.5
6
26
 
7
27
  - Bound preview-watch test teardown, publish selection requests atomically and
package/docs/GUIDE.md CHANGED
@@ -364,7 +364,11 @@ for edits made by other tools.
364
364
  categories, undefined aliases, alias cycles, and individual theme/media
365
365
  overrides. Project-specific values and additional definitions within ADS's fixed
366
366
  naming contract are allowed. The contract's `naming` section lists the fixed
367
- shared families and names; projects cannot configure alternative prefixes.
367
+ shared families and names; projects cannot rename those shared semantics.
368
+ Component/pattern constants can use an explicit unique owner-local namespace and
369
+ definition-only stylesheet, with the same real-token preview completeness rules.
370
+ See [owner-local tokens](ADS.md#owner-local-tokens). Unregistered foreign names
371
+ remain rejected.
368
372
  `--ds-*`, `--ux-*`, and `--showcase-*` variables remain owned by their layers,
369
373
  including when a file is inside `tokens/`. Shared token assignments outside
370
374
  `tokens/` fail. Source styles also check shared references for undeclared names.
@@ -498,8 +502,9 @@ in owned component/pattern styles, with tokens supplying visual values.
498
502
 
499
503
  ADS has fixed token names and ownership namespaces. Change values in the existing
500
504
  token files; `--accent`, `--font-sans`, `--radius-md`, and the other shared roles
501
- keep their meanings across projects. Foreign prefixes such as `--nuv-*` or
502
- `--brand-*` fail. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
505
+ keep their meanings across projects. Foreign shared prefixes such as `--nuv-*` or
506
+ `--brand-*` fail; a registered owner-local constant namespace is separate from
507
+ the shared branding vocabulary. Components own `--ds-*`, patterns own `--ux-*`, and the showcase
503
508
  reserves `--showcase-*` for showcase boundaries. Fixture files still define no
504
509
  custom styling; the frame pattern uses `--ux-*`. Branding never assigns
505
510
  component state variables.
package/docs/MCP.md CHANGED
@@ -171,6 +171,9 @@ The server supplies agent guidance through its instructions, tool descriptions,
171
171
  | `ads_verify` | Execute an owner's registered checks and record revision-bound evidence |
172
172
  | `ads_show_<id>` | Optional explicitly configured grouped App |
173
173
  | `ads_units` | Discover edit owners and the files belonging to one unit |
174
+ | `ads_prepare_patch` | Prepare a local draft of one owner, then generate its Git patch |
175
+ | `ads_prepare_token_samples` | Reconcile real-token fixture samples using explicit project bindings |
176
+ | `ads_apply_transaction` | Validate and apply coupled owner patches as one final candidate |
174
177
  | `ads_read_file` | Read bounded source ranges, with owning unit and full-file digest |
175
178
  | `ads_apply_patch` | Opt-in Git unified diff for one ADS unit, with dry-run validation |
176
179
 
@@ -220,8 +223,9 @@ npx -y @reqvire-org/ads mcp --mutations
220
223
  ```
221
224
 
222
225
  `ads_status.mutations` reports the mode, checks, limits and latest result. Editing
223
- is disabled by default. The editing tool accepts **one Git unified diff for one
224
- ADS unit**, not replacement file bodies or a caller-selected batch of owners.
226
+ is disabled by default. The default editing tool accepts **one Git unified diff
227
+ for one ADS unit**. Replacement file bodies are not mutation inputs. Genuinely
228
+ coupled changes use the bounded owner transaction described below.
225
229
 
226
230
  Find the owner with `ads_units({ "query": "Button" })`, then request its file
227
231
  manifest with `ads_units({ "unit": "components/core/Button" })`. IDs derive from
@@ -231,6 +235,8 @@ composition owns its scenario and mock inputs. Imported components and patterns
231
235
  remain separate owners. `tokens` is one foundation unit covering token definitions,
232
236
  themes and token scenarios/fixtures, whose coverage spans shared source files.
233
237
  Preview IDs remain separate: several token previews belong to `tokens`.
238
+ Unit-local token definitions and their previews stay in their component/pattern
239
+ owner; see [owner tokens](ADS.md#owner-local-tokens).
234
240
 
235
241
  The `tokens` manifest also returns `companionFiles` with the configured foundation
236
242
  entry path. When creating or deleting a canonical token foundation file, include
@@ -256,6 +262,8 @@ name) or colocated fixture keeps ownership stable without `Scenario.tsx`.
256
262
  A redundant standalone scenario can be removed when other registered scenarios
257
263
  still declare and actually render its public exports. Coverage requirements remain
258
264
  in force; there is no metadata waiver for uncovered UI.
265
+ An empty `.gitkeep` may be deleted alongside new source in the selected owner
266
+ beneath that marker. Other hidden files and nonempty markers remain blocked.
259
267
 
260
268
  The same discovery covers the rest of the project ADS:
261
269
 
@@ -310,6 +318,47 @@ not an edit to live ADS source. Binary `ads_read_file` results return the digest
310
318
  byte count without encoded content. Git verifies the original binary blob and
311
319
  reconstructs the result inside the validation copy.
312
320
 
321
+ For local editing without a second Git mirror, call
322
+ `ads_prepare_patch({unit, action:"create"})`. It returns a draft ID and a local
323
+ directory containing only the owner and declared companions. Edit that directory
324
+ using the client's local file tools, then call
325
+ `ads_prepare_patch({unit, action:"diff", draft})`. It checks source/baseline
326
+ freshness and owner paths and returns a `patchFile`; it changes no live source.
327
+ Apply the result through `ads_apply_patch`, which runs the normal candidate gates.
328
+ Use `action:"discard"` to remove the draft. Remote clients can continue sending
329
+ inline Git diffs. Drafts are local conveniences, not an alternative mutation API.
330
+
331
+ `ads_prepare_token_samples({id, bindings?})` reconciles the selected token
332
+ scenario's consumed literal sample array. Existing bindings and other fixture
333
+ fields are preserved; undeclared samples are removed. New bindings explicitly
334
+ name a real `token`, CSS `property` and `probe`. Missing mappings are reported as
335
+ `unresolved`; ADS never guesses a property or renderer from the token name.
336
+ The result is an owner patch file for guarded application. This preparation does
337
+ not establish rendered effects or waive token coverage.
338
+
339
+ For a coupled rename or upgrade, call `ads_apply_transaction`:
340
+
341
+ ```json
342
+ {
343
+ "patches": [
344
+ { "unit": "tokens", "patchFile": ".ds/patches/tokens.patch" },
345
+ { "unit": "components/Button", "patchFile": ".ds/patches/button.patch" }
346
+ ],
347
+ "dryRun": true
348
+ }
349
+ ```
350
+
351
+ It accepts 2–8 distinct owners, at most 32 distinct files and 16 MiB of combined
352
+ Git diff text. Each patch obeys its own ownership/companion rules. Patches apply
353
+ in order inside one candidate; shared-entry hunks in a later patch must match
354
+ the earlier candidate's content. Core checks, registered Oxlint, project commands
355
+ and all affected behavior checks run against the final candidate. No intermediate
356
+ candidate is published. Dry runs, failures, conflicts and cancellation write no
357
+ source; a publication failure rolls back prior writes. This coordinates owned
358
+ source migrations, not dependency installation or arbitrary application files.
359
+ Install changed dependencies before verification; candidates use the project's
360
+ installed `node_modules`.
361
+
313
362
  Resolve ownership diagnostics by preserving the required capability in its proper
314
363
  layer. Demo-only sizing, borders and framing belong in a public review/layout
315
364
  pattern; a component API addition needs a runtime use case. Measured imperative
@@ -326,8 +375,8 @@ a new directory owner, or change unrelated public-entry statements. Shared
326
375
  public-entry changes are limited to re-exports from the selected unit. Alongside
327
376
  its real re-export, a patch can remove an obsolete `export {};` placeholder;
328
377
  it cannot add one or change unrelated statements. Init generates no empty-export
329
- placeholder. Report unsupported coupled changes rather than bypassing a rejected
330
- mutation with direct source writes.
378
+ placeholder. For coupled owners use the bounded transaction; a rejection still
379
+ requires correcting its owner/policy, never a direct-write bypass.
331
380
 
332
381
  Set `dryRun` to `false` to apply. ADS reconstructs complete candidate files locally
333
382
  and validates a temporary project copy with core guards and registered Oxlint
@@ -557,7 +606,13 @@ wrappers require their own launcher and are not shell-executed by ADS.
557
606
  Both build output streams go to stderr, keeping stdout exclusively for MCP.
558
607
  Opening an App waits up to 30 seconds for validated current output. A matching
559
608
  success cache is republished in the new watcher session without recompilation;
560
- merely finding an older HTML file is insufficient. A timeout leaves the watcher running: inspect the
609
+ merely finding an older HTML file is insufficient. Managed resource graphs and
610
+ HTML descriptors use private session output; standalone build commands retain
611
+ the configured output. One cannot overwrite the other's success record. The
612
+ compiler caches at most six verified graph snapshots under `.ds/preview-graphs/`
613
+ and cleans its session output on ordinary shutdown. These are generated files;
614
+ do not track or use them as source. Legacy self-contained HTML builders retain
615
+ their existing publication contract. A timeout leaves the watcher running: inspect the
561
616
  logs and invoke the preview again. `ads_status` distinguishes watcher process
562
617
  state from reported build state. Token inspection and other ordinary tools
563
618
  remain available after a build failure. Invalid scenario metadata at startup and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
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": {