@nac3/runtime 2.5.0-alpha.5 → 2.5.0

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/CHANGELOG.md CHANGED
@@ -1,887 +1,1017 @@
1
- # Changelog
2
-
3
- ## 2.5.0-alpha.5 -- 2026-05-25
4
-
5
- NAC3 v2.5.0-alpha.5 ships the remaining three assistive blocks of
6
- the v2.5 line: **Block B tree navigation**, **Block C asistive
7
- labels**, **Block D effect detection**. The full v2.5 surface is
8
- now GA: every SHIPPED RFC (V24-01/02/04/05 + V25-01/02/03/04) has
9
- runtime code + Layer 2 demo + Layer 3 Pilot LIVE evidence.
10
-
11
- ### Added
12
-
13
- - **`NAC.narrate(plugin, nac_id) -> string | null`** (RFC V25-03 /
14
- SPEC sec 17). Canonical human-readable label resolution. Priority:
15
- `aria-label > visible text > data-nac-label > nac_id`. Nested
16
- addressable children excluded from parent's visible-text. Whitespace
17
- values at any tier fall through.
18
- - **`NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }`**
19
- (RFC V25-02 / SPEC sec 16). Walks up from `document.activeElement`
20
- through addressable ancestors. Labels via narrate.
21
- - **`NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]`**
22
- (RFC V25-02). Enumerates IMMEDIATE addressable children of rootId
23
- (or the plugin root). Honours `data-nac-opens` and `data-nac-leaf`
24
- authoring attributes.
25
- - **`NAC.expect(plugin, statePath, value, opts?) -> Promise<value>`**
26
- (RFC V25-04 / SPEC sec 18). Polls `NAC.read()` until the comparator
27
- returns truthy or the deadline fires (default 5000ms timeout,
28
- 100ms poll). Rejects `NacError('timeout')` on deadline.
29
- - **`NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>`**
30
- (RFC V25-04). Snapshots state, awaits actionFn, snapshots again.
31
- JSON-stringify compare for the `changed` flag.
32
-
33
- ### Evidence (Layer 2 + Layer 3 LIVE)
34
-
35
- - V25-02 tree-nav: L2 18 PASS / L3 LIVE 4 PASS.
36
- - V25-03 narrate: L2 12 PASS / L3 LIVE 6 PASS.
37
- - V25-04 expect+diff: L2 17 PASS / L3 LIVE 7 PASS.
38
-
39
- Each demo + Pilot driver under `demos/` and `scripts/`, evidence in
40
- `evidence/v25-0{2,3,4}*/<date>/`. Total LIVE Claude cost: ~$0.04.
41
-
42
- ### Status of v2.5 line
43
-
44
- All 8 RFCs of the v2.5 line are now SHIPPED with full L2 + L3 LIVE
45
- evidence. Collabora pilot can now consume the full surface end-to-end.
46
-
47
- ---
48
-
49
- ## 2.5.0-alpha.4 -- 2026-05-25
50
-
51
- NAC3 v2.5.0-alpha.4 closes the V24-04 contract: every mutating
52
- verb now honours `expected_*` parameters, and `STRICT_VERSIONING`
53
- default flips from `false` to `true`. Adopters that do not opt in
54
- to OCC explicitly will get `version_required` and must either pass
55
- expected parameters or set `NAC.STRICT_VERSIONING = false` once
56
- at bootstrap.
57
-
58
- ### Added (V24-04 -- final dispatch hook)
59
-
60
- - **`tab(plugin, tab_key, opts?)`** -- third argument added. opts
61
- accepts `expected_plugin_version` / `expected_tree_version` /
62
- `expected_element_state_hash`. The single-arg ergonomic form
63
- (e.g., `tab('conduit.tab.feed__home')`) keeps working; when
64
- called as `tab(bareId, opts)` the runtime detects the object
65
- and re-binds. Both two-arg and single-arg paths run the OCC
66
- gate after element resolution + before the tab click.
67
- - **`tab_by_label(plugin, label, opts?)`** -- propagates opts
68
- through to `tab()`.
69
-
70
- ### Changed (V24-04 -- default flip)
71
-
72
- - **`NAC.STRICT_VERSIONING` defaults to `true`** in alpha.4.
73
- Rationale: every mutating verb (click / fill / select / invoke
74
- / tab / tab_by_label / click_by_verb via click) now honours the
75
- OCC gate, so the strict default is finally safe to flip.
76
- - Callers that do NOT pass `expected_*` parameters must set
77
- `NAC.STRICT_VERSIONING = false` at bootstrap if they want the
78
- pre-alpha.4 behaviour (silent dispatch ignoring OCC state).
79
- - Code reviewers should reject any new callsite that catches
80
- `version_required` without escalating to the user -- swallowing
81
- the error defeats the point of the contract.
82
-
83
- ### Breaking changes since alpha.3
84
-
85
- - ALL test files that exercised mutating verbs (`click`,
86
- `click_by_verb`, `fill`, `select`, `invoke`, `tab`,
87
- `tab_by_label`) without passing `expected_*` started failing
88
- on the STRICT default flip. Fix: opt out at the top of the test
89
- file with `NAC.STRICT_VERSIONING = false;` after the runtime
90
- loads. Applied across all internal tests as part of this
91
- commit; downstream adopters that have similar tests need the
92
- same one-line addition.
93
-
94
- ### Tests
95
-
96
- stage12-snapshot-versioning.mjs grows two assertions:
97
-
98
- - `tab() with stale expected_tree_version throws snapshot_stale`
99
- - `tab() under STRICT without expected_* throws version_required`
100
-
101
- Total suite: **384 PASS / 0 FAIL** across 14 stage suites.
102
-
103
- ### Pending for 2.5.0 stable promotion (alpha -> latest)
104
-
105
- Per `PROJECT.md` sec 3.1 (three-layer test bar, instituted
106
- 2026-05-25), `npm dist-tag add @nac3/runtime@2.5.0 latest`
107
- requires:
108
-
109
- - Layer 1 unit tests green (already 384/0). ✓
110
- - Layer 2 visual demos + Playwright + screenshots in
111
- `evidence/<feature>/<run-date>/` per RFC.
112
- - Layer 3 Pilot-driven high-complexity statements run against
113
- each demo, with reasoning trace + screenshots saved.
114
- - Pablo's explicit OK after reviewing Layer 2 + Layer 3
115
- evidence.
116
-
117
- Layer 2 + Layer 3 building scheduled next. V25-02 / V25-03 /
118
- V25-04 RFCs remain DRAFT; target subsequent 2.5.x patches.
119
-
120
- ---
121
-
122
- ## 2.5.0-alpha.3 -- 2026-05-23
123
-
124
- NAC3 v2.5.0-alpha.3 wires the V24-04 OCC dispatch hooks into the
125
- mutating verbs. The contract now has teeth: an agent that passes
126
- mismatched `expected_*` parameters gets `NacError('snapshot_stale',
127
- ...)` synchronously, BEFORE any side effect occurs. No partial
128
- mutations on stale state. No silent damage.
129
-
130
- ### Added (V24-04 -- dispatch enforcement)
131
-
132
- Every mutating verb that accepts `opts` now calls
133
- `_resolveVersionExpectations(opts, el)` after the element lookup +
134
- disabled / hidden / aria preflight checks, and BEFORE the side
135
- effect:
136
-
137
- - **`click(nac_id, opts?)`** -- after the v2.3 capability gate +
138
- v1.8 hidden gate + v1.9 aria preflight, before `el.click()`.
139
- - **`fill(nac_id, value, opts?)`** -- after the fillability preflight,
140
- before native-setter `el.value = ...`.
141
- - **`select(nac_id, option, opts?)`** -- after `_findElement`, before
142
- the select-option write.
143
- - **`invoke(action_id, payload, opts?)`** -- after `_findElement`,
144
- before the `nac:action:requested` dispatch.
145
-
146
- Verbs that inherit click/tab transitively are covered automatically:
147
-
148
- - **`click_by_verb(plugin, verb, opts?)`** -- resolves to a `nac_id`
149
- then dispatches `click(id, opts)`. The OCC gate runs inside the
150
- nested click. Caller passes `expected_*` in opts and they flow
151
- through.
152
- - **`tab_by_label(plugin, label, opts?)`** -- similarly delegates to
153
- `tab(...)`. But because `tab` itself does not yet accept `opts`
154
- (signature change pending alpha.4), `expected_*` passed to
155
- `tab_by_label` is currently dropped. This will close in alpha.4.
156
-
157
- ### Pending for 2.5.0-alpha.4
158
-
159
- - `tab(plugin, tab_key, opts?)` accepts opts + threads OCC gate.
160
- - `NAC.STRICT_VERSIONING` default flips from `false` to `true` once
161
- tab is covered (so all mutating verbs uniformly require
162
- `expected_*` under strict mode).
163
- - E2E demo `example-v25-snapshot-versioning.php` for the landing.
164
-
165
- ### Conditional-await pattern
166
-
167
- To avoid introducing a microtask boundary that would reorder
168
- side-effect-then-immediate-check call patterns (which several
169
- v23-editor tests rely on with synchronous `NAC.click_by_verb()`
170
- followed by an immediate DOM check), the OCC hook is conditional:
171
-
172
- - When opts has any `expected_*` key OR `NAC.STRICT_VERSIONING` is
173
- true: `await _resolveVersionExpectations(...)`. May throw
174
- `snapshot_stale` / `version_required` / `feature_not_supported`.
175
- - Otherwise: no await, no microtask. Existing behaviour preserved.
176
-
177
- This keeps backward compatibility intact for code that never opted
178
- into OCC, while making `expected_*`-aware callers see the contract.
179
-
180
- ### Tests
181
-
182
- stage12-snapshot-versioning.mjs gains 7 new assertions for the
183
- dispatch enforcement: stale plugin_version + stale tree_version
184
- both raise `snapshot_stale` with structured `reason` + `slug` +
185
- expected/current pairs; current plugin_version passes the gate and
186
- proceeds (then hits the timeout, NOT snapshot_stale); STRICT mode
187
- without expected_* throws `version_required`.
188
-
189
- Total suite: **384 PASS / 0 FAIL** across 14 stage suites.
190
-
191
- ---
192
-
193
- ## 2.5.0-alpha.2 -- 2026-05-23
194
-
195
- NAC3 v2.5.0-alpha.2 lands the V24-04 OCC foundation that was
196
- deferred from alpha.1. This is an additive release on top of
197
- alpha.1 -- everything that worked in alpha.1 still works.
198
-
199
- ### Added (V24-04 -- foundation SHIPPED)
200
-
201
- The snapshot versioning + optimistic concurrency framework from
202
- RFC V24-04 lands as a foundation layer:
203
-
204
- - `_tree_version` + `_plugin_versions` Map -- per-(slug, instance_id)
205
- monotonic version counters. Bumped on every structural mutation
206
- observed by the runtime MutationObserver + on every syncPlugin
207
- call.
208
- - `_resolvePluginScope(el)` walks ancestor [data-nac-plugin] roots
209
- with WeakMap caching to avoid O(depth) walks on every mutation.
210
- - `_bumpPluginVersion(slug, instance_id, trigger)` + `_bumpTreeVersion`
211
- atomic helpers: increment counter, push to `_version_history`
212
- (capped at 500), dispatch `nac:plugin:invalidated` +
213
- `nac:tree:invalidated` events.
214
- - Single document-rooted MutationObserver that filters mutations to
215
- data-nac-* attribute changes + addNodes/removeNodes that contain
216
- data-nac-* descendants. Pure value/text changes do NOT bump.
217
- - `element_state_hash` (128-bit SHA-256 truncated) over a canonical
218
- 5-key state (visible, disabled, value, text, custom). Sync impl
219
- + async crypto.subtle path when available. Byte-identical digests
220
- across paths.
221
- - `markHydrationComplete()` + 100ms fallback for SSR-then-hydrate
222
- scenarios. Tagged trigger='hydration_complete' on the resulting
223
- bump events.
224
- - `versionHistory(limit?)` devtools surface -- last N bumps, most
225
- recent first.
226
-
227
- ### Added (V24-04 -- describe() additions)
228
-
229
- - `describe()` output now carries `tree_version` at the root +
230
- `plugin_version` + `plugin_instance_id` per plugin entry +
231
- `element_state_hash` per element entry. All three are read-only
232
- observers; consuming them is opt-in.
233
-
234
- ### Added (V24-04 -- NAC.* surface)
235
-
236
- - `NAC.STRICT_VERSIONING` (default **false** in alpha.2; will flip to
237
- true in alpha.3 after one soak window). When true,
238
- every mutating API call without `expected_*` parameters throws
239
- `NacError('version_required', ...)`.
240
- - `NAC.eager_hashing` (default false) -- placeholder flag for future
241
- cache-the-hash-on-mutate optimization.
242
- - `NAC.conformance_tier` (default `'NAC-3-versioned'`). Runtimes that
243
- declare the legacy `'NAC-3'` tier explicitly reject `expected_*`
244
- parameters with `NacError('feature_not_supported', ...)`.
245
- - `NAC.markHydrationComplete()` -- explicit hydration ack.
246
- - `NAC.versionHistory(limit?)` -- devtools.
247
-
248
- ### V24-02 syncPlugin consolidation
249
-
250
- syncPlugin's version stamp now uses the V24-04 `_bumpPluginVersion`
251
- machinery instead of the alpha.1 per-call timestamp string. The
252
- return shape (`{replaced, slug, version}`) is unchanged, but the
253
- `version` value is now `v_<N>` instead of `v_<base36-ts>_<seq>`.
254
- Tests pass either format (just check the `v_` prefix and that
255
- versions differ across calls).
256
-
257
- ### Pending for 2.5.0-alpha.3
258
-
259
- - **Dispatch enforcement hooks.** `click` / `click_by_verb` / `tab` /
260
- `tab_by_label` / `fill` / `select` / `invoke` accept
261
- `expected_plugin_version` / `expected_tree_version` /
262
- `expected_element_state_hash` parameters and reject with
263
- `NacError('snapshot_stale', ...)` on mismatch via
264
- `_resolveVersionExpectations()` (the helper is already in this
265
- release; the hooks are not yet wired into the dispatch verbs).
266
- - **`STRICT_VERSIONING` default flip** from false to true. Gated on
267
- the dispatch hooks landing.
268
- - **V25-02/03/04 drafts** -- tree navigation, asistive labels,
269
- effect detection. Target subsequent 2.5.x patches.
270
-
271
- ### Tests
272
-
273
- `runtime/test/` adds stage12-snapshot-versioning.mjs (23 PASS):
274
- API surface, describe() additions, syncPlugin bump events, version
275
- history, markHydrationComplete idempotency, hydration trigger
276
- tagging.
277
-
278
- Suite total: **377 PASS / 0 FAIL** across 14 stage suites.
279
-
280
- ### Migration notes
281
-
282
- - Code consuming `describe()` output that did NOT expect
283
- `tree_version` / `plugin_version` / `element_state_hash` keys is
284
- unaffected: those keys are additive. Code that explicitly checked
285
- describe().plugins[i] for an enumerated key set might fail; the
286
- fix is to ignore unknown keys (forward-compatible default).
287
- - syncPlugin's `result.version` value format changed (see V24-02
288
- section above). Tests that asserted the exact alpha.1 format
289
- string would need to relax to a prefix-only check.
290
-
291
- ---
292
-
293
- ## 2.5.0-alpha.1 -- 2026-05-23
294
-
295
- NAC3 v2.5.0-alpha.1 is a **consolidation release**. Two parallel
296
- development lines that diverged during May 2026 are unified here.
297
- The yujinapp/nac-spec repository becomes the SOLE source of truth
298
- for NAC3 from this commit forward; the prior development copies
299
- under rpaforce-crm (`packages/nac/`, `yujin.app/nac-spec/`) are
300
- deleted in that monorepo's history.
301
-
302
- ### Lines unified
303
-
304
- - **Line A** (was on this repo, RFC track): V24-01 plugin slug
305
- uniqueness, V24-02 idempotent syncPlugin (was announced in
306
- 2.3.x changelog but never landed in code -- now implemented
307
- for the first time with full test coverage), V24-04 snapshot
308
- versioning + OCC (in flight, see "Pending" below), V24-05
309
- agent authority + sudo (was DRAFT, ships SHIPPED here).
310
- - **Line B** (was on rpaforce-crm, contract track): V25-01 plugin
311
- extension contract for canvas+API surfaces (Block A: 8 backends
312
- complete + tests).
313
-
314
- ### Added (V25-01 -- NEW)
315
-
316
- - `NAC.registerPlugin(slug, manifest)` declarative plugin
317
- registration for surfaces where verbs / state / events route
318
- through something other than direct DOM (postMessage to iframe,
319
- plugin SDK call, script bridge, DOM mirror, same-origin window,
320
- synthesised events).
321
- - `NAC.call(plugin, verb_path, args)` abstract verb dispatch.
322
- - `NAC.read(plugin, state_path)` abstract state read with declared
323
- fallback chain semantics.
324
- - `NAC.subscribe(plugin, event_path, cb) / unsubscribe(handle)`
325
- event subscription with backend routing.
326
- - 8 backend kinds in fixed vocabulary: `postmessage`,
327
- `postmessage-listen`, `sdk-call`, `script-bridge`, `dom-mirror`,
328
- `same-origin-window`, `synthetic-mutation`, `synthetic-poll`.
329
- - Declarative extractor mini-DSL (`text` / `value` / `present` /
330
- `attribute:NAME` / `classList.contains:CLASS` / dotted-path).
331
- - Provenance event family: `nac:plugin:invoked` / `:read` / `:event`
332
- with `{plugin, backend, request_id, source, trusted, duration_ms,
333
- ok, error}` payload.
334
-
335
- ### Added (V24-02 -- NEW IMPLEMENTATION)
336
-
337
- - `NAC.syncPlugin(manifest)` / `NAC.syncPlugin(slug, manifest)`
338
- -- idempotent registration. Replaces the manifest for a slug
339
- instead of appending; SPA hosts call this on remount without
340
- accumulating stale entries.
341
- - Returns `{ replaced: boolean, slug, version }`.
342
- - Emits `nac:plugin:invalidated` on REPLACE (not on first-add),
343
- detail `{plugin_slug, plugin_instance_id, from_version,
344
- to_version, trigger: 'syncPlugin'}`.
345
-
346
- ### Added (V24-05 -- NEW)
347
-
348
- - `NAC.set_confirm_handler(fn)` -- register async (req) => boolean.
349
- - `NAC.confirm_action(action_id, message, opts?)` -- Promise<boolean>.
350
- Sudo bypass: short-circuits true if elevation already granted
351
- for the requested scope (or higher).
352
- - `NAC.request_authority(scope, ttl_ms, opts?)` -- sudo-style
353
- time-bounded elevation. Scope rank: high > medium > low.
354
- - `NAC.has_authority(scope) -> bool`.
355
- - `NAC.revoke_authority(scope) -> void` (idempotent).
356
- - Provenance event family:
357
- `nac:authority:requested / :granted / :denied / :revoked / :expired`,
358
- `nac:action:confirmed / :rejected`.
359
- - SUPERSEDES the v1.9 confirm_action mechanism (removed: it was
360
- unused + had a strictly narrower contract).
361
-
362
- ### Added (V24-01 -- CONSOLIDATED + ENFORCED)
363
-
364
- - `NAC.HARD_DEDUP` flag (default true). Gates the synchronous
365
- throw in `NAC.register` + the boot-time pass.
366
- - `NAC.register` throws `NacError('duplicate_plugin_no_instance_id',
367
- ...)` synchronously when the DOM already contains multiple roots
368
- for the registered slug and any of them omits / duplicates
369
- `data-nac-plugin-id`.
370
- - Boot-time pass on `DOMContentLoaded` runs the same check across
371
- every `[data-nac-plugin]` root. On first violation: dispatches
372
- `nac:fatal` event + paints a fixed-position red banner
373
- (`#__nac_fatal_banner__`) + re-throws asynchronously so test
374
- harnesses + browsers catch it.
375
- - `validate_global()` extended with `plugin_instance_violations`
376
- array -- structured findings for CI gates.
377
- - Migration: `NAC.HARD_DEDUP = false` BEFORE any `register()`
378
- call opts out for one release window. Flag removed in v2.6.
379
-
380
- ### New: PROJECT.md at repo root
381
-
382
- PROJECT.md documents the post-migration topology, the RFC process
383
- states (Proposed / In implementation / Implemented / Alpha /
384
- Production), the doc-update invariant (every RFC transition
385
- touches SPEC + CHANGELOG + USER_MANUAL + TECHNICAL_DESIGN + demos
386
- list + benchmark numbers + Sumi KB), and the programming +
387
- architecture norms. Read it FIRST before any contribution.
388
-
389
- ### Tests
390
-
391
- `runtime/test/` suite now has 13 stages:
392
-
393
- smoke + v22 + v23-{invoke,shadow,capabilities,editor,interop}
394
- + stage2-disambiguation + stage7-strict-resolution + stage8-plugin-extension
395
- + stage9-sync-plugin + stage10-authority-sudo + stage11-plugin-id-dedup
396
-
397
- `npm test` exit code 0, 349 PASS / 0 FAIL.
398
-
399
- ### Pending for 2.5.0-alpha.2
400
-
401
- - V24-04 snapshot versioning + OCC -- in implementation, code in
402
- flight. Targets `NAC.STRICT_VERSIONING=true` by default, with
403
- `expected_plugin_version` / `expected_tree_version` enforcement
404
- on every mutating API. The `plugin_version` + `element_state_hash`
405
- fields will appear in `describe()` output.
406
- - V25-02 tree navigation (`context`, `tree`, `data-nac-opens`)
407
- -- DRAFT, target 2.5.x.
408
- - V25-03 asistive labels (`narrate`) -- DRAFT, target 2.5.x.
409
- - V25-04 effect detection (`expect`, `diff`) -- DRAFT, target 2.5.x.
410
-
411
- ### Migration notes
412
-
413
- - Code that ran fine under 2.4.0 (strict resolution + disambiguation)
414
- continues to work unchanged in 2.5; that contract is stable.
415
- - Code that called the pre-existing v1.9 `confirm_action` must
416
- migrate to V24-05 (`confirm_action` + `set_confirm_handler` +
417
- `request_authority`). The argument shape changed
418
- (`(action_id, opts)` -> `(action_id, message, opts)`). Audit
419
- callers; no automatic migration tool.
420
- - Code that registered the same plugin slug on multiple DOM roots
421
- WITHOUT `data-nac-plugin-id` now throws at register time. Either
422
- add the attribute, OR set `NAC.HARD_DEDUP=false` before
423
- registering for a one-release migration window.
424
-
425
- ---
426
-
427
- ## 2.4.0 -- 2026-05-21
428
-
429
- NAC3 v2.4.0 is a **behavior-of-contract change**: id / verb / qualifier
430
- resolution becomes strict. Backwards-compatible with code paths that
431
- already supplied unambiguous arguments, **NOT** backwards-compatible
432
- with code paths that depended on the previous lenient (`indexOf`)
433
- fallback to resolve to the first near-match.
434
-
435
- ### Why this changed (the principle, not a feature)
436
-
437
- The lenient resolution in 2.3.x violated the spec's 0-silent-damage
438
- invariant. Specifically, `click_by_verb(plugin, verb, { qualifier })`
439
- would, on a no-exact-suffix match, fall through to an `indexOf(qualifier)`
440
- substring search and resolve silently to whatever element happened to
441
- contain the qualifier string anywhere in its id. The H4 benchmark on the
442
- Conduit case study (2026-05-21) showed that **12 of 18 "model failures"
443
- on the canonical flows were actually silent runtime damage** — the
444
- agent emitted an invalid qualifier, the runtime sent it to the wrong
445
- element, the agent looped against the wrong page state. Strict
446
- resolution rescues those 12 (see `nac-spec/conduit/H4_STRICT_NAC_REPORT.md`).
447
-
448
- For an assistive-software use case (the principal driver of this
449
- project), a silent dispatch to the wrong element with no recovery path
450
- is a safety blocker. Strict resolution closes that gap.
451
-
452
- ### New error model — disambiguation contract
453
-
454
- When `click_by_verb` / `tab` / `tab_by_label` cannot resolve a request
455
- unambiguously, the runtime now:
456
-
457
- 1. Emits `nac:disambiguation_requested` on `document` with a
458
- structured detail payload (see below).
459
- 2. Throws `NacError` with `err.code` ∈ `{no_matching_instance,
460
- ambiguous_qualifier, ambiguous_tab, ambiguous_label}` AND
461
- `err.candidates: [{nac_id, label}, ...]` pre-validated against the
462
- live DOM.
463
-
464
- Detail / candidates payload:
465
- ```js
466
- {
467
- method: 'click_by_verb' | 'tab' | 'tab_by_label',
468
- plugin: string | null,
469
- query: { verb?, qualifier?, label?, id? },
470
- reason: 'no_matching_instance' | 'ambiguous_qualifier' | 'ambiguous_tab' |
471
- 'ambiguous_label' | 'ambiguous_label_exact' | 'ambiguous_label_fuzzy' |
472
- 'no_matching_label',
473
- candidates: [{ nac_id: string, label: string }, ...]
474
- }
475
- ```
476
-
477
- A reactive host (chat UI / voice agent / screen-reader) can listen
478
- on the event and present the options to the user as *"did you
479
- mean A or B?"*. A synchronous catcher can read `err.candidates`
480
- directly. An autonomous agent (Pilot, etc.) can inject the candidates
481
- into the next turn's prompt so the LLM picks from a DOM-validated
482
- list instead of re-guessing a qualifier.
483
-
484
- ### What changed in the resolvers
485
-
486
- - **`click_by_verb` with qualifier:** only exact-equality or anchored
487
- suffix (`id === qualifier || id.endsWith('__' + qualifier)`)
488
- resolves. Multiple matches → `ambiguous_qualifier`. Zero matches →
489
- `no_matching_instance`. **The `indexOf` substring fallback is
490
- removed.**
491
- - **`tab` single-arg form:** bare id resolves to exact match in DOM. If
492
- no exact, exactly one anchored-prefix instance
493
- (`id.startsWith(bare + '__')`) resolves; multiple → `ambiguous_tab`;
494
- zero → `no_matching_instance`.
495
- - **`tab_by_label`:** two-tier strict — exact label match first
496
- (errors if multiple), then substring match (errors if multiple).
497
- Fuzzy match preserved for voice/assistive use case; ambiguity
498
- caught.
499
-
500
- ### Verification
501
-
502
- - `packages/nac/test/stage2-disambiguation.mjs` — pre-existing
503
- tab_by_label cases still PASS (B1–B4).
504
- - `packages/nac/test/stage7-strict-resolution.mjs` (new) — 9/9
505
- invariants pass under JSDOM shim.
506
- - `nac3-bench/bench/scripts/stage7_strict_nac.mjs` (new) — 9/9
507
- invariants pass under Playwright against a live page.
508
- - `nac3-bench/bench/h4_results/h4_2026-05-21T19-01-19-040Z.json` —
509
- cheap-model benchmark with strict NAC: 48/54 = 89% (vs 36/54 = 67%
510
- under lenient).
511
-
512
- ### Migration guide
513
-
514
- If your code was passing fuzzy qualifiers and depending on the runtime
515
- to pick "something close", the upgrade requires you to:
516
- - Either supply the full `nac_id` directly (always unambiguous), OR
517
- - Pass the exact `__suffix` of the instance you want, OR
518
- - Listen for `nac:disambiguation_requested` / catch `NacError` with
519
- `err.candidates` and pick from the returned list.
520
-
521
- Most users won't be affected — the only callers that broke during the
522
- internal regression were the ones that were already broken silently in
523
- 2.3.x but happened to land on the wrong-but-related element instead of
524
- failing.
525
-
526
- ---
527
-
528
- ## 2.3.1 -- 2026-05-13 (stable, blank republish)
529
-
530
- Identical source to 2.3.0. The 2.3.0 tag had already been published to
531
- npm as a preview; 2.3.1 is the first installable stable version. No
532
- behavioural changes.
533
-
534
- ---
535
-
536
- ## 2.3.0 -- 2026-05-13 (stable)
537
-
538
- NAC3 v2.3.0 is the first stable release of the payload-bearing
539
- contract. Everything in 2.3.0-alpha.1 and 2.3.0-alpha.2 is rolled
540
- in; the alpha tags are deprecated. New in stable (beyond the alpha
541
- preview):
542
-
543
- ### New primitives
544
-
545
- - **`NAC.invoke(action_id, payload, opts?)`** -- payload-bearing
546
- action. Dispatches `nac:action:requested`, awaits the host's
547
- `nac:action:succeeded` / `:failed` with the same `request_id`.
548
- Default timeout 30 s. (Promoted from 2.3.0-alpha.1.)
549
- - **`NAC.utter(action_id, {text, lang?, voice?})`** -- ergonomic
550
- shortcut for `verb='utter'`. (Promoted from 2.3.0-alpha.1.)
551
- - **`NAC.bindTab(el, handler, ctx, opts?)`** -- tab companion to
552
- `bindAction`. Emits `nac:tab:activated` / `:activation_failed`
553
- for you. Sister of v2.2's `bindAction`.
554
- - **`NAC.edit_field(nac_id)`** -- field editor primitive promoted
555
- from preview to GA. Selection, replace, AI syntax correction,
556
- save/cancel verbs. Modal mounts the `nac_editor` plugin
557
- idempotently with all 10 locales.
558
-
559
- ### Shadow DOM resolution (F1 + F6)
560
-
561
- - **Open shadow DOM**: the runtime walks `el.shadowRoot`
562
- recursively up to depth 10. Any element with `data-nac-id`
563
- inside an open shadow root is now resolvable by `NAC.click`,
564
- `NAC.fill`, `NAC.invoke`, etc. with no glue code.
565
- - **Closed shadow DOM**: voluntary exposure contract. A
566
- component MAY expose a `nac3` getter on the host element
567
- implementing `query(selector)` (mandatory),
568
- `queryAll(selector)` (recommended), and `describe()` (optional).
569
- The runtime delegates to those methods.
570
- - **Error events** for closed shadow:
571
- - `nac:shadow_blocked` -- emitted once per host with
572
- `detail.reason` in `'exposure_threw'`, `'not_exposed'`.
573
- - `nac:shadow_protocol_violation` -- emitted when an exposed
574
- method returns a non-Element value.
575
- - All events use `composed: true` so they correctly cross shadow
576
- boundaries to document-level listeners.
577
-
578
- ### Auth-aware capabilities (F7)
579
-
580
- - Manifest entries MAY declare `requires_capability: 'verb_slug'`
581
- at the element level or per `action.verb`. Array values use
582
- OR semantics ("at least one cap matches passes").
583
- - `NAC.setCapabilities([...])`, `NAC.grantCapability(cap)`,
584
- `NAC.revokeCapability(cap)`, `NAC.userCapabilities()` manage
585
- the user's capability set.
586
- - `NAC.click` and `NAC.invoke` gate against the set before
587
- dispatch. Missing cap -> reject with `code='capability_required'`
588
- + emit `nac:command:rejected`.
589
-
590
- ### Strict validation default (F3)
591
-
592
- - `NAC.STRICT_VALIDATION` default flipped from `false` to **`true`**
593
- in v2.3 stable, per the v2.2 migration promise.
594
- `NAC.register` now throws `code='strict_validation'` on
595
- `manifest_role_unknown` / `tab_id_manifest_role_drift` /
596
- `manifest_dom_role_mismatch` findings.
597
- - Opt-out: set `NAC.STRICT_VALIDATION = false` BEFORE any
598
- `register()` call in your bootstrap. See
599
- `guides/MIGRATION_v2.2_to_v2.3.md` for the playbook.
600
-
601
- ### Hotfix carryover from alpha.2
602
-
603
- - `NAC.invoke` does NOT reject with `code='disabled'` on elements
604
- with `disabled` or `aria-disabled='true'`. `invoke` is a logical
605
- payload-bearing request, not a synthetic click. `NAC.click` still
606
- rejects on disabled (click semantics preserved). Pinned down by
607
- test v23-invoke.mjs T7/T8/T9 so the relaxation cannot silently
608
- regress.
609
-
610
- ### Test surface
611
-
612
- `npm test` now chains 7 suites (75+ assertions):
613
- smoke, v22, v23-invoke, v23-shadow, v23-capabilities, v23-editor,
614
- v23-interop. Plus 5 stage suites + live Playwright E2E
615
- (`atlas-pro-v23-utter-e2e.mjs` 16/16 GREEN against the deployed
616
- demo).
617
-
618
- ### Spec text
619
-
620
- SPEC.md updated:
621
- - Section 5.1.4 -- `NAC.invoke` + `NAC.utter` final wording.
622
- - Section 5.1.5 -- Shadow DOM resolution (open, cap 10).
623
- - Section 5.1.6 -- Closed shadow DOM exposure API (voluntary).
624
- - Section 5.1.7 -- Auth-aware capabilities.
625
- - Section 13 -- `edit_field` promoted from preview to GA.
626
-
627
- ### Reference adopters
628
-
629
- - Atlas Pro voice ad (`ads-demo/atlas-pro/`) -- production live,
630
- uses `NAC.utter` + payload schema.
631
- - React demo (`packages/nac-react-demo/`) -- adopts payload-bearing
632
- pattern for the chat-to-todos flow.
633
- - Angular demo (`packages/nac-angular-demo/`) -- mirror of React.
634
- - Web Component demos: `example-v23-shadow-open.html` and
635
- `example-v23-shadow-closed.html`.
636
-
637
- ## 2.3.0-alpha.2 -- 2026-05-13 (superseded by 2.3.0)
638
-
639
- Hotfix on top of 2.3.0-alpha.1:
640
-
641
- - `NAC.invoke` no longer rejects with `code='disabled'` when the
642
- target element has `disabled` or `aria-disabled='true'` set. The
643
- `disabled` HTML attribute is a click-event UX guard; `invoke` is
644
- a logical payload-bearing request, not a synthetic click. Hosts
645
- that need to refuse an invoke based on UI state should do it in
646
- their `nac:action:requested` listener and emit
647
- `nac:action:failed` with a meaningful code. This was hitting the
648
- Atlas Pro mic which gets `disabled = true` during /parse +
649
- /tts processing, blocking subsequent NAC.utter calls from
650
- external agents mid-conversation. Reproduced in the video-gen
651
- pipeline (every turn after the demo's first state-transition).
652
- - Bumped CLI version + smoke test assertions to match.
653
-
654
- ## 2.3.0-alpha.1 -- 2026-05-12
655
-
656
- ### New: payload-bearing actions via `NAC.invoke` + `NAC.utter`
657
-
658
- The NAC v2.2 contract was click-and-go: an agent triggers
659
- `NAC.click(id)` or `NAC.click_by_verb(plugin, verb)` and the host
660
- does whatever it does. That works for verb-and-state actions
661
- (`save`, `cancel`, `submit`, `delete`) but breaks down when the
662
- action needs **data** from the agent: `utter(text)`,
663
- `search(query)`, `send_message(body)`, `upload(file)`,
664
- `schedule(date)`. Hosts had no way to receive an agent's payload
665
- via a synthetic click.
666
-
667
- v2.3 adds the missing primitive:
668
-
669
- ```ts
670
- NAC.invoke(action_id, payload, opts?): Promise<{ok, request_id, ack}>
671
- NAC.utter(action_id, {text, lang?, voice?}): Promise<...>
672
- ```
673
-
674
- `NAC.invoke` dispatches a `nac:action:requested` CustomEvent on
675
- the host element (bubbles) with the agent's `payload` + a
676
- runtime-issued `request_id`. The host listens, processes, emits
677
- `nac:action:succeeded` (or `:failed`) echoing the same
678
- `request_id`. The runtime correlates and resolves the Promise.
679
-
680
- Default timeout 30 s (vs 5 s for click). On timeout the Promise
681
- rejects with `code='timeout'`.
682
-
683
- `NAC.utter(id, opts)` is the ergonomic shortcut for `verb='utter'`
684
- -- equivalent to `NAC.invoke(id, {verb:'utter', text, lang, voice})`.
685
-
686
- Manifest entries for payload-bearing actions can declare an
687
- informational `payload_schema`:
688
-
689
- ```js
690
- { id: 'atlas_pro_ad.mic', role: 'action',
691
- actions: [
692
- { verb: 'listen' },
693
- { verb: 'utter',
694
- payload_schema: {
695
- text: { type: 'string', required: true, max: 4000 },
696
- lang: { type: 'string', enum: ['en','es','pt','fr','it','de','ja','zh','hi','ar'] }
697
- }
698
- }
699
- ]
700
- }
701
- ```
702
-
703
- Click-style verbs (`NAC.click`, `NAC.click_by_verb`) continue to
704
- work unchanged. The new contract is purely additive; no demo
705
- behaviour regresses.
706
-
707
- #### First adopter
708
-
709
- Atlas Pro (`https://yujin.app/nac-spec/ads-demo/atlas-pro/`)
710
- declares both `listen` (click-only, existing) and `utter`
711
- (payload-bearing) on its `atlas_pro_ad.mic` action. The same
712
- `/ad-orchestrator/parse` + `/ad-orchestrator/tts` loop drives
713
- either path -- agents with their own STT call `listen`, agents
714
- with their own LM call `utter` with the recognised text.
715
-
716
- #### Test coverage
717
-
718
- - `test/v23-invoke.mjs` (new) -- 22 assertions covering happy
719
- path, ack echo, host-failed path, invalid args, not-found,
720
- custom timeout. PASS.
721
- - `test/v22.mjs` -- amended to accept v2.3.x in addition to
722
- v2.2.x. PASS.
723
- - `test/smoke.mjs` -- updated version assertions. PASS.
724
-
725
- #### Files touched
726
-
727
- - `yujin.app/nac-spec/js/nac.js` -- `invoke()` + `utter()` (~150
728
- LOC additive). Public API surface +2 functions. NAC.version
729
- bumped to '2.3.0-alpha.1', spec_version to '2.3'.
730
- - `yujin.app/nac-spec/SPEC.md` -- new section 5.1.4 + header
731
- version line.
732
- - `yujin.app/nac-spec/ads-demo/atlas-pro/index.html` -- manifest
733
- declares the `utter` verb + DOM listener routes into the demo's
734
- existing `handleUtterance(text)`.
735
- - `packages/nac/package.json`, `build.mjs`, `test/smoke.mjs` --
736
- version bumps + new test in `npm test`.
737
-
738
- #### Not yet wired
739
-
740
- - `STRICT_VALIDATION` enforcement of `payload_schema` (alpha:
741
- schema is informational).
742
- - A `NAC.search` / `NAC.upload` / `NAC.send_message` ergonomic
743
- shortcut sibling to `NAC.utter`. The generic `NAC.invoke` works
744
- today; concrete shortcuts can be added without re-spec.
745
-
746
- ## 2.2.1 -- 2026-05-12
747
-
748
- ### Bug fix: importable in Node / SSR / test contexts
749
-
750
- Pre-launch smoke test caught that `import '@nac3/runtime'` and
751
- `import '@nac3/runtime/chat-client'` crashed in Node.js with
752
- `ReferenceError: document is not defined`. The bundles had
753
- top-level `document.dispatchEvent` and `document.addEventListener`
754
- calls firing at module-evaluation time.
755
-
756
- Fix: wrap browser-only init in `typeof document !== 'undefined'`
757
- guards. In the browser the behaviour is unchanged (the events
758
- still fire on install + the confirm listener still attaches). In
759
- Node / SSR / Vitest / Jest the bundles now import as no-ops
760
- instead of crashing.
761
-
762
- Files patched (no API change):
763
- - `dist/nac.{mjs,cjs,browser.js}` -- guarded `nac:installed`
764
- dispatch + `_installA11yHintBridge()` call.
765
- - `dist/nac-chat-client.{mjs,cjs,browser.js}` -- guarded
766
- `nac:confirm:requested` listener attach.
767
- - `dist/nac-v2-extensions.*` -- unchanged (it already early-bails
768
- when the main runtime is not present).
769
-
770
- Verified: all three entry points (`@nac3/runtime`,
771
- `@nac3/runtime/extensions`, `@nac3/runtime/chat-client`) now
772
- import cleanly under Node 22 ESM + CommonJS `require`.
773
-
774
- ## 2.2.0 -- 2026-05-10
775
-
776
- Same-day v2.2 ships the constructor-strict validator + action-ack
777
- helper. Both items moved from the v2.2 roadmap into the runtime
778
- with no breaking changes (warning-only mode by default).
779
-
780
- ### V22-01 -- `NAC.register` strict validator
781
-
782
- `NAC.register(manifest)` now checks each manifest entry against
783
- three rules and emits `console.error` for findings:
784
-
785
- - `manifest_role_unknown` -- the entry's `role` is outside the
786
- canonical set (the 18 roles in SPEC sec 1).
787
- - `tab_id_manifest_role_drift` -- the entry's id matches `^tab\.`
788
- but its role is not `'tab'`. NAC.tab() and NAC.tab_by_label()
789
- query the canonical role only; a drift here makes the tab
790
- invisible to those resolvers (the bug class that broke
791
- example-v21-data-table.php on 2026-05-09).
792
- - `manifest_dom_role_mismatch` -- the corresponding DOM element
793
- is mounted, and its `data-nac-role` differs from the manifest's
794
- `role` value. Catches the case where an HTML author and a JS
795
- author drift apart on what role to use.
796
-
797
- A new flag `NAC.STRICT_VALIDATION` toggles findings between
798
- warning-only (default; ships in 2.2) and throwing (will be the
799
- v2.3 default; opt-in in 2.2 for adopters who want to gate CI).
800
-
801
- Migration window: v2.2 = console.error only, v2.3 = throw
802
- default, v3.0 = remove the flag.
803
-
804
- ### V22-02 -- `NAC.bindAction` helper
805
-
806
- New helper:
807
-
808
- ```js
809
- NAC.bindAction(buttonEl, function (ev) { /* side effect */ }, {
810
- plugin: 'invoice', action_id: 'invoice.save'
811
- });
812
- ```
813
-
814
- Bakes the `nac:action:succeeded` / `:failed` contract into the
815
- runtime so brownfield panels cannot forget to emit the ack event.
816
- Handles sync handlers + Promise-returning handlers; emits failure
817
- on throw + preserves normal error semantics; returns an unbinder
818
- function.
819
-
820
- Removes the foot-gun that produced the v20-panel timeout reports
821
- on 2026-05-09 (every voice command on example-v20-full.php
822
- replied "No pude ejecutar X: timeout" because the panel handlers
823
- did the work synchronously but never emitted the ack).
824
-
825
- ### Tests
826
-
827
- - `test/smoke.mjs` -- 36/36 PASS (artefact integrity + d.ts
828
- surface + CLI version + CLI lint over demos + package.json
829
- consistency, version asserts now check 2.2.0).
830
- - `test/v22.mjs` -- new. 14/14 PASS. 5 strict-validator cases
831
- (clean, unknown-role, tab-drift, DOM mismatch, strict-throws)
832
- + 5 bindAction cases (sync ack, throw -> failed event, Promise
833
- ack, unbinder, ctx validation) + NAC sanity checks.
834
-
835
- Run via: `npm test` (chains both suites).
836
-
837
- ### Known to-dos
838
-
839
- - Per-action signing (v3.0 candidate).
840
- - v2.3 will flip `STRICT_VALIDATION` default to true.
841
- - v2.3 will ship `NAC.bindTab(el, handler, ctx)` companion for
842
- tab-role widgets.
843
-
844
- ## 2.1.0 -- 2026-05-10
845
-
846
- First public release. Wraps the reference runtime that has been
847
- running in production at yujin.app since 2026-04 as the npm package
848
- `@nac3/runtime`.
849
-
850
- ### Spec
851
-
852
- - v2.1 with data-table primitive (collection / matrix /
853
- matrix-singletree subkinds; `dt_add_row` / `dt_edit_cell` /
854
- aggregates / transactional commit).
855
- - Brownfield migration story shipped (v2.0 extensions: scope tree,
856
- ephemeral capture, autoRegister, HMAC, isTrusted).
857
- - 18 canonical roles, 11 success-event families.
858
- - 10-locale i18n contract.
859
-
860
- ### Package
861
-
862
- - ESM + CJS + browser builds.
863
- - TypeScript declarations (permissive surface; v2.2 ships
864
- hand-authored full types).
865
- - CLI: `npx nac validate <dir>` does static lint of HTML/PHP.
866
- - Single source of truth: package built from
867
- `yujin.app/nac-spec/js/*.js`, no maintenance duplication.
868
-
869
- ### Demos
870
-
871
- - `example.php` -- v1.9 reference, 27 widgets.
872
- - `example-v20-full.php` -- brownfield migration of v1.9 to v2.0.
873
- - `example-v20-primitives-showcase.php` -- didactic showcase of
874
- the 8 v2.0 primitives.
875
- - `example-v21-data-table.php` -- live data-table demo wired to
876
- the Yujin chat backend.
877
-
878
- All demos hosted at yujin.app/nac-spec/.
879
-
880
- ### Known limitations
881
-
882
- - No per-action signing yet (only manifests). v3.0 candidate.
883
- - Constructor (`NAC.register`) is permissive on unknown roles; the
884
- v2.2 strict-validator landing fixes this.
885
- - CLI URL mode (`nac validate https://...`) requires Playwright;
886
- the package does not pull Playwright as a hard dep. Static-lint
887
- mode works without it.
1
+ # Changelog
2
+
3
+ ## 2.5.0 -- 2026-10-26
4
+
5
+ Stabilises the 2.5 line. First stable release of the 2.5 series: `latest`
6
+ points here, and the stability guarantees of SPEC section 10 and the
7
+ finding-code guarantees of section 12 begin at this version.
8
+
9
+ ### Fixed
10
+
11
+ - **`fill()` no longer throws on a host with a partial DOM, and the
12
+ fallback it always had is finally reachable** (audit N-44). `fill()`
13
+ writes an input value through the native property setter on
14
+ `HTMLInputElement.prototype` rather than with `el.value = v`, because
15
+ React tracks the original setter and a plain assignment is silently
16
+ reverted on the next render -- a controlled input never sees the
17
+ value. A fallback existed for a host without those constructors, and
18
+ it could never run: the guard tested the property DESCRIPTOR while
19
+ the expression producing it reached through
20
+ `window.HTMLInputElement.prototype`. On a partial DOM -- a test shim,
21
+ an SSR or headless context -- `fill()` threw
22
+ `TypeError: Cannot read properties of undefined (reading 'prototype')`
23
+ before any fallback could run, and that TypeError carries no `code`,
24
+ so a caller branching on the error contract got nothing usable.
25
+ The three call sites (`checked`, `SELECT.value`,
26
+ `INPUT`/`TEXTAREA.value`) now share one helper that checks the
27
+ constructor before the descriptor.
28
+ **No change in a browser:** the constructors always exist there, the
29
+ native setter is used exactly as before, and a Chromium lock
30
+ (`npm run test:fill-setter`) now proves it by spying on the
31
+ instance property the native setter bypasses.
32
+
33
+ - **The copy-paste install snippet on the project landing page
34
+ published an `integrity` hash that matched no released file** (audit
35
+ N-40). It carried the hash computed over CRLF bytes from a Windows
36
+ working tree; the fix that moved every real `<script>` tag onto the
37
+ LF hash never reached the snippet, because the snippet is
38
+ HTML-escaped and so was not a script tag. Anyone who copied it got a
39
+ browser that refused to execute the runtime, reported only as a
40
+ console line. Does not affect `npm install`; it affected the
41
+ documented CDN path. The snippet hash now has a single producer and
42
+ the gate refuses any `sha384` on the page that is not a published
43
+ hash.
44
+
45
+ - **`validate_global()` can see a manifest written the documented way**
46
+ (audit N-33). The id collector behind it read only the legacy manifest
47
+ groups (`actions`, `fields`, `tabs`, `kpis`, `charts`, keyed by
48
+ `nac_id`) and never the canonical `elements: [{ id }]` shape of SPEC
49
+ section 4 -- the shape every demo ships and the rest of the runtime
50
+ reads. Against a canonical manifest it reported `total_ids: 0`, listed
51
+ every declared element as an orphan, could not report a duplicate, an
52
+ unmounted id or a convention violation at all, and still answered
53
+ `ok: true`. Measured on this project's own landing page: 2 plugins,
54
+ 64 declared elements, `total_ids: 0`, 128 orphans. After the fix:
55
+ `total_ids: 64`, 64 orphans -- and those 64 are exactly the undeclared
56
+ ids a separate audit had counted by hand.
57
+ **Upgrade note:** a host that gates CI on `has_errors` may see its
58
+ first failure after upgrading. That is a true positive that was always
59
+ there, not a new rule. Both manifest shapes are read from now on.
60
+
61
+ ### Added
62
+
63
+ - **`nac validate <url>` loads the page and REPORTS A CONFORMANCE
64
+ LEVEL** (audit N-18, second half). Until now URL mode aborted with
65
+ exit 2 and a message about Playwright, and no mode of the CLI ever
66
+ printed a level -- while SPEC section 8 said, in those words, that
67
+ this command "reports the highest level a page reaches".
68
+
69
+ The validator loads the page in a real browser, waits for the manifest
70
+ registry to stop moving rather than for a fixed sleep, and reports
71
+ against the identifiers published in `levels.json`. It follows the
72
+ published rule: a level is asserted only when every machine-checkable
73
+ requirement of that level and of every lower level passes, and
74
+ anything no tool can decide is reported `unverified` -- never assumed.
75
+ Three verdicts, and the difference between the last two is the point:
76
+ `pass` measured and it holds, `fail` measured and it does not,
77
+ `unverified` **not measured**.
78
+
79
+ Every level it reports carries its coverage -- "asserted on N of M
80
+ requirements" -- and the words *this is a measurement, not a
81
+ certification*. Directory mode now says out loud that it cannot decide
82
+ a level, instead of printing a finding count a reader could mistake
83
+ for one.
84
+
85
+ - `--drive` clicks the advertised controls, which is what decides the
86
+ two behavioural requirements of level 1. Off by default: clicking
87
+ every control on somebody's production page is not a read-only
88
+ operation.
89
+ - `--json` emits the whole report. `--timeout`, `--drive-roles`,
90
+ `--drive-limit` for the rest.
91
+ - **Playwright is optional and is NOT a dependency of this package.**
92
+ It is resolved at call time; when it is missing the CLI exits 3 and
93
+ prints the two commands that install it. A runtime that pulled a
94
+ browser into every adopter's `node_modules` to offer a tool most of
95
+ them never run would be charging everyone for nobody.
96
+
97
+ The level definitions are NOT in the CLI. They are generated from
98
+ SPEC section 8 through the same module that produces
99
+ `api/v/<version>/levels.json`, and each requirement publishes the name
100
+ of the `decider` that judges it. The build refuses to emit a CLI whose
101
+ decider table disagrees with the contract in either direction.
102
+
103
+ - **The contract publishes the `conformance_tier` vocabulary**
104
+ (audit N-29). `contract.json` used to publish the field as
105
+ `type: "string"` and not its values, so a machine could see the field
106
+ and had no way to learn that `NAC-3-versioned` is not a level name.
107
+ It now publishes the three values with what each one requires, which
108
+ one this runtime declares, where they are defined, and the sentence
109
+ that separates the two taxonomies: a **tier** describes what the
110
+ runtime implements (RFC V24-04 section 6); a **level** describes what
111
+ the page declares and does (SPEC section 8). The values are extracted
112
+ from the RFC, never typed, and the build refuses any disagreement
113
+ between the RFC, the sidecar and the value the runtime declares.
114
+
115
+ - **Every `validate_global()` bucket carries `code` + `severity`**
116
+ (audit N-14, SPEC sec 10.1 + 12 promise 4). New codes:
117
+ `nac_id_duplicate_across_plugins` (error),
118
+ `nac_id_orphan_in_dom` (warn),
119
+ `nac_id_declared_not_mounted` (warn),
120
+ `nac_id_missing_plugin_prefix` (warn).
121
+ `plugin_instance_violations` already carried
122
+ `duplicate_plugin_no_instance_id`. Promise 4 of section 12 named this
123
+ validator while every bucket was uncoded, so it covered an empty set;
124
+ it covers a real one now. The codes are published with their severity
125
+ and a fix under `global_buckets` in `api/latest/findings.json`.
126
+
127
+ ### Changed
128
+
129
+ - **SPEC section 10.1 describes the shape the runtime actually returns**
130
+ (audit N-34): an object of named buckets, not the flat array of
131
+ findings the section had documented since before 1.0.
132
+
133
+ ## 2.5.0-alpha.5 -- 2026-05-25
134
+
135
+ NAC3 v2.5.0-alpha.5 ships the remaining three assistive blocks of
136
+ the v2.5 line: **Block B tree navigation**, **Block C assistive
137
+ labels**, **Block D effect detection**. The full v2.5 surface is
138
+ now GA: every SHIPPED RFC (V24-01/02/04/05 + V25-01/02/03/04) has
139
+ runtime code + Layer 2 demo + Layer 3 Pilot LIVE evidence.
140
+
141
+ ### Added
142
+
143
+ - **`NAC.narrate(plugin, nac_id) -> string | null`** (RFC V25-03 /
144
+ SPEC sec 17). Canonical human-readable label resolution. Priority:
145
+ `aria-label > visible text > data-nac-label > nac_id`. Nested
146
+ addressable children excluded from parent's visible-text. Whitespace
147
+ values at any tier fall through.
148
+ - **`NAC.context(plugin) -> { breadcrumb: [{nac_id, label}, ...] }`**
149
+ (RFC V25-02 / SPEC sec 16). Walks up from `document.activeElement`
150
+ through addressable ancestors. Labels via narrate.
151
+ - **`NAC.tree(plugin, rootId?) -> [{nac_id, label, opens?, leaf?}, ...]`**
152
+ (RFC V25-02). Enumerates IMMEDIATE addressable children of rootId
153
+ (or the plugin root). Honours `data-nac-opens` and `data-nac-leaf`
154
+ authoring attributes.
155
+ - **`NAC.expect(plugin, statePath, value, opts?) -> Promise<value>`**
156
+ (RFC V25-04 / SPEC sec 18). Polls `NAC.read()` until the comparator
157
+ returns truthy or the deadline fires (default 5000ms timeout,
158
+ 100ms poll). Rejects `NacError('timeout')` on deadline.
159
+ - **`NAC.diff(plugin, statePath, actionFn) -> Promise<{before, after, changed}>`**
160
+ (RFC V25-04). Snapshots state, awaits actionFn, snapshots again.
161
+ JSON-stringify compare for the `changed` flag.
162
+
163
+ ### Evidence (Layer 2 + Layer 3 LIVE)
164
+
165
+ - V25-02 tree-nav: L2 18 PASS / L3 LIVE 4 PASS.
166
+ - V25-03 narrate: L2 12 PASS / L3 LIVE 6 PASS.
167
+ - V25-04 expect+diff: L2 17 PASS / L3 LIVE 7 PASS.
168
+
169
+ Each demo + Pilot driver under `demos/` and `scripts/`, evidence in
170
+ `evidence/v25-0{2,3,4}*/<date>/`. Total LIVE Claude cost: ~$0.04.
171
+
172
+ ### Status of v2.5 line
173
+
174
+ All 8 RFCs of the v2.5 line are now SHIPPED with full L2 + L3 LIVE
175
+ evidence. Collabora pilot can now consume the full surface end-to-end.
176
+
177
+ ---
178
+
179
+ ## 2.5.0-alpha.4 -- 2026-05-25
180
+
181
+ NAC3 v2.5.0-alpha.4 closes the V24-04 contract: every mutating
182
+ verb now honours `expected_*` parameters, and `STRICT_VERSIONING`
183
+ default flips from `false` to `true`. Adopters that do not opt in
184
+ to OCC explicitly will get `version_required` and must either pass
185
+ expected parameters or set `NAC.STRICT_VERSIONING = false` once
186
+ at bootstrap.
187
+
188
+ ### Added (V24-04 -- final dispatch hook)
189
+
190
+ - **`tab(plugin, tab_key, opts?)`** -- third argument added. opts
191
+ accepts `expected_plugin_version` / `expected_tree_version` /
192
+ `expected_element_state_hash`. The single-arg ergonomic form
193
+ (e.g., `tab('conduit.tab.feed__home')`) keeps working; when
194
+ called as `tab(bareId, opts)` the runtime detects the object
195
+ and re-binds. Both two-arg and single-arg paths run the OCC
196
+ gate after element resolution + before the tab click.
197
+ - **`tab_by_label(plugin, label, opts?)`** -- propagates opts
198
+ through to `tab()`.
199
+
200
+ ### Changed (V24-04 -- default flip)
201
+
202
+ - **`NAC.STRICT_VERSIONING` defaults to `true`** in alpha.4.
203
+ Rationale: every mutating verb (click / fill / select / invoke
204
+ / tab / tab_by_label / click_by_verb via click) now honours the
205
+ OCC gate, so the strict default is finally safe to flip.
206
+ - Callers that do NOT pass `expected_*` parameters must set
207
+ `NAC.STRICT_VERSIONING = false` at bootstrap if they want the
208
+ pre-alpha.4 behaviour (silent dispatch ignoring OCC state).
209
+ - Code reviewers should reject any new callsite that catches
210
+ `version_required` without escalating to the user -- swallowing
211
+ the error defeats the point of the contract.
212
+
213
+ ### Breaking changes since alpha.3
214
+
215
+ - ALL test files that exercised mutating verbs (`click`,
216
+ `click_by_verb`, `fill`, `select`, `invoke`, `tab`,
217
+ `tab_by_label`) without passing `expected_*` started failing
218
+ on the STRICT default flip. Fix: opt out at the top of the test
219
+ file with `NAC.STRICT_VERSIONING = false;` after the runtime
220
+ loads. Applied across all internal tests as part of this
221
+ commit; downstream adopters that have similar tests need the
222
+ same one-line addition.
223
+
224
+ ### Tests
225
+
226
+ stage12-snapshot-versioning.mjs grows two assertions:
227
+
228
+ - `tab() with stale expected_tree_version throws snapshot_stale`
229
+ - `tab() under STRICT without expected_* throws version_required`
230
+
231
+ Total suite: **386 PASS / 0 FAIL** across 14 stage suites.
232
+
233
+ ### Pending for 2.5.0 stable promotion (alpha -> latest)
234
+
235
+ Per `PROJECT.md` sec 3.1 (three-layer test bar, instituted
236
+ 2026-05-25), `npm dist-tag add @nac3/runtime@2.5.0 latest`
237
+ requires:
238
+
239
+ - Layer 1 unit tests green (already 386/0). ✓
240
+ - Layer 2 visual demos + Playwright + screenshots in
241
+ `evidence/<feature>/<run-date>/` per RFC.
242
+ - Layer 3 Pilot-driven high-complexity statements run against
243
+ each demo, with reasoning trace + screenshots saved.
244
+ - Pablo's explicit OK after reviewing Layer 2 + Layer 3
245
+ evidence.
246
+
247
+ Layer 2 + Layer 3 building scheduled next. V25-02 / V25-03 /
248
+ V25-04 RFCs remain DRAFT; target subsequent 2.5.x patches.
249
+
250
+ ---
251
+
252
+ ## 2.5.0-alpha.3 -- 2026-05-23
253
+
254
+ NAC3 v2.5.0-alpha.3 wires the V24-04 OCC dispatch hooks into the
255
+ mutating verbs. The contract now has teeth: an agent that passes
256
+ mismatched `expected_*` parameters gets `NacError('snapshot_stale',
257
+ ...)` synchronously, BEFORE any side effect occurs. No partial
258
+ mutations on stale state. No silent damage.
259
+
260
+ ### Added (V24-04 -- dispatch enforcement)
261
+
262
+ Every mutating verb that accepts `opts` now calls
263
+ `_resolveVersionExpectations(opts, el)` after the element lookup +
264
+ disabled / hidden / aria preflight checks, and BEFORE the side
265
+ effect:
266
+
267
+ - **`click(nac_id, opts?)`** -- after the v2.3 capability gate +
268
+ v1.8 hidden gate + v1.9 aria preflight, before `el.click()`.
269
+ - **`fill(nac_id, value, opts?)`** -- after the fillability preflight,
270
+ before native-setter `el.value = ...`.
271
+ - **`select(nac_id, option, opts?)`** -- after `_findElement`, before
272
+ the select-option write.
273
+ - **`invoke(action_id, payload, opts?)`** -- after `_findElement`,
274
+ before the `nac:action:requested` dispatch.
275
+
276
+ Verbs that inherit click/tab transitively are covered automatically:
277
+
278
+ - **`click_by_verb(plugin, verb, opts?)`** -- resolves to a `nac_id`
279
+ then dispatches `click(id, opts)`. The OCC gate runs inside the
280
+ nested click. Caller passes `expected_*` in opts and they flow
281
+ through.
282
+ - **`tab_by_label(plugin, label, opts?)`** -- similarly delegates to
283
+ `tab(...)`. But because `tab` itself does not yet accept `opts`
284
+ (signature change pending alpha.4), `expected_*` passed to
285
+ `tab_by_label` is currently dropped. This will close in alpha.4.
286
+
287
+ ### Pending for 2.5.0-alpha.4
288
+
289
+ - `tab(plugin, tab_key, opts?)` accepts opts + threads OCC gate.
290
+ - `NAC.STRICT_VERSIONING` default flips from `false` to `true` once
291
+ tab is covered (so all mutating verbs uniformly require
292
+ `expected_*` under strict mode).
293
+ - E2E demo `example-v25-snapshot-versioning.php` for the landing.
294
+
295
+ ### Conditional-await pattern
296
+
297
+ To avoid introducing a microtask boundary that would reorder
298
+ side-effect-then-immediate-check call patterns (which several
299
+ v23-editor tests rely on with synchronous `NAC.click_by_verb()`
300
+ followed by an immediate DOM check), the OCC hook is conditional:
301
+
302
+ - When opts has any `expected_*` key OR `NAC.STRICT_VERSIONING` is
303
+ true: `await _resolveVersionExpectations(...)`. May throw
304
+ `snapshot_stale` / `version_required` / `feature_not_supported`.
305
+ - Otherwise: no await, no microtask. Existing behaviour preserved.
306
+
307
+ This keeps backward compatibility intact for code that never opted
308
+ into OCC, while making `expected_*`-aware callers see the contract.
309
+
310
+ ### Tests
311
+
312
+ stage12-snapshot-versioning.mjs gains 7 new assertions for the
313
+ dispatch enforcement: stale plugin_version + stale tree_version
314
+ both raise `snapshot_stale` with structured `reason` + `slug` +
315
+ expected/current pairs; current plugin_version passes the gate and
316
+ proceeds (then hits the timeout, NOT snapshot_stale); STRICT mode
317
+ without expected_* throws `version_required`.
318
+
319
+ Total suite: **386 PASS / 0 FAIL** across 14 stage suites.
320
+
321
+ ---
322
+
323
+ ## 2.5.0-alpha.2 -- 2026-05-23
324
+
325
+ NAC3 v2.5.0-alpha.2 lands the V24-04 OCC foundation that was
326
+ deferred from alpha.1. This is an additive release on top of
327
+ alpha.1 -- everything that worked in alpha.1 still works.
328
+
329
+ ### Added (V24-04 -- foundation SHIPPED)
330
+
331
+ The snapshot versioning + optimistic concurrency framework from
332
+ RFC V24-04 lands as a foundation layer:
333
+
334
+ - `_tree_version` + `_plugin_versions` Map -- per-(slug, instance_id)
335
+ monotonic version counters. Bumped on every structural mutation
336
+ observed by the runtime MutationObserver + on every syncPlugin
337
+ call.
338
+ - `_resolvePluginScope(el)` walks ancestor [data-nac-plugin] roots
339
+ with WeakMap caching to avoid O(depth) walks on every mutation.
340
+ - `_bumpPluginVersion(slug, instance_id, trigger)` + `_bumpTreeVersion`
341
+ atomic helpers: increment counter, push to `_version_history`
342
+ (capped at 500), dispatch `nac:plugin:invalidated` +
343
+ `nac:tree:invalidated` events.
344
+ - Single document-rooted MutationObserver that filters mutations to
345
+ data-nac-* attribute changes + addNodes/removeNodes that contain
346
+ data-nac-* descendants. Pure value/text changes do NOT bump.
347
+ - `element_state_hash` (128-bit SHA-256 truncated) over a canonical
348
+ 5-key state (visible, disabled, value, text, custom). Sync impl
349
+ + async crypto.subtle path when available. Byte-identical digests
350
+ across paths.
351
+ - `markHydrationComplete()` + 100ms fallback for SSR-then-hydrate
352
+ scenarios. Tagged trigger='hydration_complete' on the resulting
353
+ bump events.
354
+ - `versionHistory(limit?)` devtools surface -- last N bumps, most
355
+ recent first.
356
+
357
+ ### Added (V24-04 -- describe() additions)
358
+
359
+ - `describe()` output now carries `tree_version` at the root +
360
+ `plugin_version` + `plugin_instance_id` per plugin entry +
361
+ `element_state_hash` per element entry. All three are read-only
362
+ observers; consuming them is opt-in.
363
+
364
+ ### Added (V24-04 -- NAC.* surface)
365
+
366
+ - `NAC.STRICT_VERSIONING` (default **false** in alpha.2; will flip to
367
+ true in alpha.3 after one soak window). When true,
368
+ every mutating API call without `expected_*` parameters throws
369
+ `NacError('version_required', ...)`.
370
+ - `NAC.eager_hashing` (default false) -- placeholder flag for future
371
+ cache-the-hash-on-mutate optimization.
372
+ - `NAC.conformance_tier` (default `'NAC-3-versioned'`). Runtimes that
373
+ declare the legacy `'NAC-3'` tier explicitly reject `expected_*`
374
+ parameters with `NacError('feature_not_supported', ...)`.
375
+ - `NAC.markHydrationComplete()` -- explicit hydration ack.
376
+ - `NAC.versionHistory(limit?)` -- devtools.
377
+
378
+ ### V24-02 syncPlugin consolidation
379
+
380
+ syncPlugin's version stamp now uses the V24-04 `_bumpPluginVersion`
381
+ machinery instead of the alpha.1 per-call timestamp string. The
382
+ return shape (`{replaced, slug, version}`) is unchanged, but the
383
+ `version` value is now `v_<N>` instead of `v_<base36-ts>_<seq>`.
384
+ Tests pass either format (just check the `v_` prefix and that
385
+ versions differ across calls).
386
+
387
+ ### Pending for 2.5.0-alpha.3
388
+
389
+ - **Dispatch enforcement hooks.** `click` / `click_by_verb` / `tab` /
390
+ `tab_by_label` / `fill` / `select` / `invoke` accept
391
+ `expected_plugin_version` / `expected_tree_version` /
392
+ `expected_element_state_hash` parameters and reject with
393
+ `NacError('snapshot_stale', ...)` on mismatch via
394
+ `_resolveVersionExpectations()` (the helper is already in this
395
+ release; the hooks are not yet wired into the dispatch verbs).
396
+ - **`STRICT_VERSIONING` default flip** from false to true. Gated on
397
+ the dispatch hooks landing.
398
+ - **V25-02/03/04 drafts** -- tree navigation, assistive labels,
399
+ effect detection. Target subsequent 2.5.x patches.
400
+
401
+ ### Tests
402
+
403
+ `runtime/test/` adds stage12-snapshot-versioning.mjs (23 PASS):
404
+ API surface, describe() additions, syncPlugin bump events, version
405
+ history, markHydrationComplete idempotency, hydration trigger
406
+ tagging.
407
+
408
+ Suite total: **377 PASS / 0 FAIL** across 14 stage suites.
409
+
410
+ ### Migration notes
411
+
412
+ - Code consuming `describe()` output that did NOT expect
413
+ `tree_version` / `plugin_version` / `element_state_hash` keys is
414
+ unaffected: those keys are additive. Code that explicitly checked
415
+ describe().plugins[i] for an enumerated key set might fail; the
416
+ fix is to ignore unknown keys (forward-compatible default).
417
+ - syncPlugin's `result.version` value format changed (see V24-02
418
+ section above). Tests that asserted the exact alpha.1 format
419
+ string would need to relax to a prefix-only check.
420
+
421
+ ---
422
+
423
+ ## 2.5.0-alpha.1 -- 2026-05-23
424
+
425
+ NAC3 v2.5.0-alpha.1 is a **consolidation release**. Two parallel
426
+ development lines that diverged during May 2026 are unified here.
427
+ The yujinapp/nac-spec repository becomes the SOLE source of truth
428
+ for NAC3 from this commit forward; the prior development copies
429
+ under rpaforce-crm (`packages/nac/`, `yujin.app/nac-spec/`) are
430
+ deleted in that monorepo's history.
431
+
432
+ ### Lines unified
433
+
434
+ - **Line A** (was on this repo, RFC track): V24-01 plugin slug
435
+ uniqueness, V24-02 idempotent syncPlugin (was announced in
436
+ 2.3.x changelog but never landed in code -- now implemented
437
+ for the first time with full test coverage), V24-04 snapshot
438
+ versioning + OCC (in flight, see "Pending" below), V24-05
439
+ agent authority + sudo (was DRAFT, ships SHIPPED here).
440
+ - **Line B** (was on rpaforce-crm, contract track): V25-01 plugin
441
+ extension contract for canvas+API surfaces (Block A: 8 backends
442
+ complete + tests).
443
+
444
+ ### Added (V25-01 -- NEW)
445
+
446
+ - `NAC.registerPlugin(slug, manifest)` declarative plugin
447
+ registration for surfaces where verbs / state / events route
448
+ through something other than direct DOM (postMessage to iframe,
449
+ plugin SDK call, script bridge, DOM mirror, same-origin window,
450
+ synthesised events).
451
+ - `NAC.call(plugin, verb_path, args)` abstract verb dispatch.
452
+ - `NAC.read(plugin, state_path)` abstract state read with declared
453
+ fallback chain semantics.
454
+ - `NAC.subscribe(plugin, event_path, cb) / unsubscribe(handle)`
455
+ event subscription with backend routing.
456
+ - 8 backend kinds in fixed vocabulary: `postmessage`,
457
+ `postmessage-listen`, `sdk-call`, `script-bridge`, `dom-mirror`,
458
+ `same-origin-window`, `synthetic-mutation`, `synthetic-poll`.
459
+ - Declarative extractor mini-DSL (`text` / `value` / `present` /
460
+ `attribute:NAME` / `classList.contains:CLASS` / dotted-path).
461
+ - Provenance event family: `nac:plugin:invoked` / `:read` / `:event`
462
+ with `{plugin, backend, request_id, source, trusted, duration_ms,
463
+ ok, error}` payload.
464
+
465
+ ### Added (V24-02 -- NEW IMPLEMENTATION)
466
+
467
+ - `NAC.syncPlugin(manifest)` / `NAC.syncPlugin(slug, manifest)`
468
+ -- idempotent registration. Replaces the manifest for a slug
469
+ instead of appending; SPA hosts call this on remount without
470
+ accumulating stale entries.
471
+ - Returns `{ replaced: boolean, slug, version }`.
472
+ - Emits `nac:plugin:invalidated` on REPLACE (not on first-add),
473
+ detail `{plugin_slug, plugin_instance_id, from_version,
474
+ to_version, trigger: 'syncPlugin'}`.
475
+
476
+ ### Added (V24-05 -- NEW)
477
+
478
+ - `NAC.set_confirm_handler(fn)` -- register async (req) => boolean.
479
+ - `NAC.confirm_action(action_id, message, opts?)` -- Promise<boolean>.
480
+ Sudo bypass: short-circuits true if elevation already granted
481
+ for the requested scope (or higher).
482
+ - `NAC.request_authority(scope, ttl_ms, opts?)` -- sudo-style
483
+ time-bounded elevation. Scope rank: high > medium > low.
484
+ - `NAC.has_authority(scope) -> bool`.
485
+ - `NAC.revoke_authority(scope) -> void` (idempotent).
486
+ - Provenance event family:
487
+ `nac:authority:requested / :granted / :denied / :revoked / :expired`,
488
+ `nac:action:confirmed / :rejected`.
489
+ - SUPERSEDES the v1.9 confirm_action mechanism (removed: it was
490
+ unused + had a strictly narrower contract).
491
+
492
+ ### Added (V24-01 -- CONSOLIDATED + ENFORCED)
493
+
494
+ - `NAC.HARD_DEDUP` flag (default true). Gates the synchronous
495
+ throw in `NAC.register` + the boot-time pass.
496
+ - `NAC.register` throws `NacError('duplicate_plugin_no_instance_id',
497
+ ...)` synchronously when the DOM already contains multiple roots
498
+ for the registered slug and any of them omits / duplicates
499
+ `data-nac-plugin-id`.
500
+ - Boot-time pass on `DOMContentLoaded` runs the same check across
501
+ every `[data-nac-plugin]` root. On first violation: dispatches
502
+ `nac:fatal` event + paints a fixed-position red banner
503
+ (`#__nac_fatal_banner__`) + re-throws asynchronously so test
504
+ harnesses + browsers catch it.
505
+ - `validate_global()` extended with `plugin_instance_violations`
506
+ array -- structured findings for CI gates.
507
+ - Migration: `NAC.HARD_DEDUP = false` BEFORE any `register()`
508
+ call opts out for one release window. Flag removed in v2.6.
509
+
510
+ ### New: PROJECT.md at repo root
511
+
512
+ PROJECT.md documents the post-migration topology, the RFC process
513
+ states (Proposed / In implementation / Implemented / Alpha /
514
+ Production), the doc-update invariant (every RFC transition
515
+ touches SPEC + CHANGELOG + USER_MANUAL + TECHNICAL_DESIGN + demos
516
+ list + benchmark numbers + Sumi KB), and the programming +
517
+ architecture norms. Read it FIRST before any contribution.
518
+
519
+ ### Tests
520
+
521
+ `runtime/test/` suite now has 13 stages:
522
+
523
+ smoke + v22 + v23-{invoke,shadow,capabilities,editor,interop}
524
+ + stage2-disambiguation + stage7-strict-resolution + stage8-plugin-extension
525
+ + stage9-sync-plugin + stage10-authority-sudo + stage11-plugin-id-dedup
526
+
527
+ `npm test` exit code 0, 349 PASS / 0 FAIL.
528
+
529
+ ### Pending for 2.5.0-alpha.2
530
+
531
+ - V24-04 snapshot versioning + OCC -- in implementation, code in
532
+ flight. Targets `NAC.STRICT_VERSIONING=true` by default, with
533
+ `expected_plugin_version` / `expected_tree_version` enforcement
534
+ on every mutating API. The `plugin_version` + `element_state_hash`
535
+ fields will appear in `describe()` output.
536
+ - V25-02 tree navigation (`context`, `tree`, `data-nac-opens`)
537
+ -- DRAFT, target 2.5.x.
538
+ - V25-03 assistive labels (`narrate`) -- DRAFT, target 2.5.x.
539
+ - V25-04 effect detection (`expect`, `diff`) -- DRAFT, target 2.5.x.
540
+
541
+ ### Migration notes
542
+
543
+ - Code that ran fine under 2.4.0 (strict resolution + disambiguation)
544
+ continues to work unchanged in 2.5; that contract is stable.
545
+ - Code that called the pre-existing v1.9 `confirm_action` must
546
+ migrate to V24-05 (`confirm_action` + `set_confirm_handler` +
547
+ `request_authority`). The argument shape changed
548
+ (`(action_id, opts)` -> `(action_id, message, opts)`). Audit
549
+ callers; no automatic migration tool.
550
+ - Code that registered the same plugin slug on multiple DOM roots
551
+ WITHOUT `data-nac-plugin-id` now throws at register time. Either
552
+ add the attribute, OR set `NAC.HARD_DEDUP=false` before
553
+ registering for a one-release migration window.
554
+
555
+ ---
556
+
557
+ ## 2.4.0 -- 2026-05-21
558
+
559
+ NAC3 v2.4.0 is a **behavior-of-contract change**: id / verb / qualifier
560
+ resolution becomes strict. Backwards-compatible with code paths that
561
+ already supplied unambiguous arguments, **NOT** backwards-compatible
562
+ with code paths that depended on the previous lenient (`indexOf`)
563
+ fallback to resolve to the first near-match.
564
+
565
+ ### Why this changed (the principle, not a feature)
566
+
567
+ The lenient resolution in 2.3.x violated the spec's 0-silent-damage
568
+ invariant. Specifically, `click_by_verb(plugin, verb, { qualifier })`
569
+ would, on a no-exact-suffix match, fall through to an `indexOf(qualifier)`
570
+ substring search and resolve silently to whatever element happened to
571
+ contain the qualifier string anywhere in its id. The H4 benchmark on the
572
+ Conduit case study (2026-05-21) showed that **12 of 18 "model failures"
573
+ on the canonical flows were actually silent runtime damage** — the
574
+ agent emitted an invalid qualifier, the runtime sent it to the wrong
575
+ element, the agent looped against the wrong page state. Strict
576
+ resolution rescues those 12 (see `nac-spec/conduit/H4_STRICT_NAC_REPORT.md`).
577
+
578
+ For an assistive-software use case (the principal driver of this
579
+ project), a silent dispatch to the wrong element with no recovery path
580
+ is a safety blocker. Strict resolution closes that gap.
581
+
582
+ ### New error model — disambiguation contract
583
+
584
+ When `click_by_verb` / `tab` / `tab_by_label` cannot resolve a request
585
+ unambiguously, the runtime now:
586
+
587
+ 1. Emits `nac:disambiguation_requested` on `document` with a
588
+ structured detail payload (see below).
589
+ 2. Throws `NacError` with `err.code` ∈ `{no_matching_instance,
590
+ ambiguous_qualifier, ambiguous_tab, ambiguous_label}` AND
591
+ `err.candidates: [{nac_id, label}, ...]` pre-validated against the
592
+ live DOM.
593
+
594
+ Detail / candidates payload:
595
+ ```js
596
+ {
597
+ method: 'click_by_verb' | 'tab' | 'tab_by_label',
598
+ plugin: string | null,
599
+ query: { verb?, qualifier?, label?, id? },
600
+ reason: 'no_matching_instance' | 'ambiguous_qualifier' | 'ambiguous_tab' |
601
+ 'ambiguous_label' | 'ambiguous_label_exact' | 'ambiguous_label_fuzzy' |
602
+ 'no_matching_label',
603
+ candidates: [{ nac_id: string, label: string }, ...]
604
+ }
605
+ ```
606
+
607
+ A reactive host (chat UI / voice agent / screen-reader) can listen
608
+ on the event and present the options to the user as *"did you
609
+ mean A or B?"*. A synchronous catcher can read `err.candidates`
610
+ directly. An autonomous agent (Pilot, etc.) can inject the candidates
611
+ into the next turn's prompt so the LLM picks from a DOM-validated
612
+ list instead of re-guessing a qualifier.
613
+
614
+ ### What changed in the resolvers
615
+
616
+ - **`click_by_verb` with qualifier:** only exact-equality or anchored
617
+ suffix (`id === qualifier || id.endsWith('__' + qualifier)`)
618
+ resolves. Multiple matches → `ambiguous_qualifier`. Zero matches →
619
+ `no_matching_instance`. **The `indexOf` substring fallback is
620
+ removed.**
621
+ - **`tab` single-arg form:** bare id resolves to exact match in DOM. If
622
+ no exact, exactly one anchored-prefix instance
623
+ (`id.startsWith(bare + '__')`) resolves; multiple → `ambiguous_tab`;
624
+ zero → `no_matching_instance`.
625
+ - **`tab_by_label`:** two-tier strict — exact label match first
626
+ (errors if multiple), then substring match (errors if multiple).
627
+ Fuzzy match preserved for voice/assistive use case; ambiguity
628
+ caught.
629
+
630
+ ### Verification
631
+
632
+ - `packages/nac/test/stage2-disambiguation.mjs` — pre-existing
633
+ tab_by_label cases still PASS (B1–B4).
634
+ - `packages/nac/test/stage7-strict-resolution.mjs` (new) — 9/9
635
+ invariants pass under JSDOM shim.
636
+ - `nac3-bench/bench/scripts/stage7_strict_nac.mjs` (new) — 9/9
637
+ invariants pass under Playwright against a live page.
638
+ - `nac3-bench/bench/h4_results/h4_2026-05-21T19-01-19-040Z.json` —
639
+ cheap-model benchmark with strict NAC: 48/54 = 89% (vs 36/54 = 67%
640
+ under lenient).
641
+
642
+ ### Migration guide
643
+
644
+ If your code was passing fuzzy qualifiers and depending on the runtime
645
+ to pick "something close", the upgrade requires you to:
646
+ - Either supply the full `nac_id` directly (always unambiguous), OR
647
+ - Pass the exact `__suffix` of the instance you want, OR
648
+ - Listen for `nac:disambiguation_requested` / catch `NacError` with
649
+ `err.candidates` and pick from the returned list.
650
+
651
+ Most users won't be affected — the only callers that broke during the
652
+ internal regression were the ones that were already broken silently in
653
+ 2.3.x but happened to land on the wrong-but-related element instead of
654
+ failing.
655
+
656
+ ---
657
+
658
+ ## 2.3.1 -- 2026-05-13 (stable, blank republish)
659
+
660
+ Identical source to 2.3.0. The 2.3.0 tag had already been published to
661
+ npm as a preview; 2.3.1 is the first installable stable version. No
662
+ behavioural changes.
663
+
664
+ ---
665
+
666
+ ## 2.3.0 -- 2026-05-13 (stable)
667
+
668
+ NAC3 v2.3.0 is the first stable release of the payload-bearing
669
+ contract. Everything in 2.3.0-alpha.1 and 2.3.0-alpha.2 is rolled
670
+ in; the alpha tags are deprecated. New in stable (beyond the alpha
671
+ preview):
672
+
673
+ ### New primitives
674
+
675
+ - **`NAC.invoke(action_id, payload, opts?)`** -- payload-bearing
676
+ action. Dispatches `nac:action:requested`, awaits the host's
677
+ `nac:action:succeeded` / `:failed` with the same `request_id`.
678
+ Default timeout 30 s. (Promoted from 2.3.0-alpha.1.)
679
+ - **`NAC.utter(action_id, {text, lang?, voice?})`** -- ergonomic
680
+ shortcut for `verb='utter'`. (Promoted from 2.3.0-alpha.1.)
681
+ - **`NAC.bindTab(el, handler, ctx, opts?)`** -- tab companion to
682
+ `bindAction`. Emits `nac:tab:activated` / `:activation_failed`
683
+ for you. Sister of v2.2's `bindAction`.
684
+ - **`NAC.edit_field(nac_id)`** -- field editor primitive promoted
685
+ from preview to GA. Selection, replace, AI syntax correction,
686
+ save/cancel verbs. Modal mounts the `nac_editor` plugin
687
+ idempotently with all 10 locales.
688
+
689
+ ### Shadow DOM resolution (F1 + F6)
690
+
691
+ - **Open shadow DOM**: the runtime walks `el.shadowRoot`
692
+ recursively up to depth 10. Any element with `data-nac-id`
693
+ inside an open shadow root is now resolvable by `NAC.click`,
694
+ `NAC.fill`, `NAC.invoke`, etc. with no glue code.
695
+ - **Closed shadow DOM**: voluntary exposure contract. A
696
+ component MAY expose a `nac3` getter on the host element
697
+ implementing `query(selector)` (mandatory),
698
+ `queryAll(selector)` (recommended), and `describe()` (optional).
699
+ The runtime delegates to those methods.
700
+ - **Error events** for closed shadow:
701
+ - `nac:shadow_blocked` -- emitted once per host with
702
+ `detail.reason` in `'exposure_threw'`, `'not_exposed'`.
703
+ - `nac:shadow_protocol_violation` -- emitted when an exposed
704
+ method returns a non-Element value.
705
+ - All events use `composed: true` so they correctly cross shadow
706
+ boundaries to document-level listeners.
707
+
708
+ ### Auth-aware capabilities (F7)
709
+
710
+ - Manifest entries MAY declare `requires_capability: 'verb_slug'`
711
+ at the element level or per `action.verb`. Array values use
712
+ OR semantics ("at least one cap matches passes").
713
+ - `NAC.setCapabilities([...])`, `NAC.grantCapability(cap)`,
714
+ `NAC.revokeCapability(cap)`, `NAC.userCapabilities()` manage
715
+ the user's capability set.
716
+ - `NAC.click` and `NAC.invoke` gate against the set before
717
+ dispatch. Missing cap -> reject with `code='capability_required'`
718
+ + emit `nac:command:rejected`.
719
+
720
+ ### Strict validation default (F3)
721
+
722
+ - `NAC.STRICT_VALIDATION` default flipped from `false` to **`true`**
723
+ in v2.3 stable, per the v2.2 migration promise.
724
+ `NAC.register` now throws `code='strict_validation'` on
725
+ `manifest_role_unknown` / `tab_id_manifest_role_drift` /
726
+ `manifest_dom_role_mismatch` findings.
727
+ - Opt-out: set `NAC.STRICT_VALIDATION = false` BEFORE any
728
+ `register()` call in your bootstrap. See
729
+ `guides/MIGRATION_v2.2_to_v2.3.md` for the playbook.
730
+
731
+ ### Hotfix carryover from alpha.2
732
+
733
+ - `NAC.invoke` does NOT reject with `code='disabled'` on elements
734
+ with `disabled` or `aria-disabled='true'`. `invoke` is a logical
735
+ payload-bearing request, not a synthetic click. `NAC.click` still
736
+ rejects on disabled (click semantics preserved). Pinned down by
737
+ test v23-invoke.mjs T7/T8/T9 so the relaxation cannot silently
738
+ regress.
739
+
740
+ ### Test surface
741
+
742
+ `npm test` now chains 7 suites (75+ assertions):
743
+ smoke, v22, v23-invoke, v23-shadow, v23-capabilities, v23-editor,
744
+ v23-interop. Plus 5 stage suites + live Playwright E2E
745
+ (`atlas-pro-v23-utter-e2e.mjs` 16/16 GREEN against the deployed
746
+ demo).
747
+
748
+ ### Spec text
749
+
750
+ SPEC.md updated:
751
+ - Section 5.1.4 -- `NAC.invoke` + `NAC.utter` final wording.
752
+ - Section 5.1.5 -- Shadow DOM resolution (open, cap 10).
753
+ - Section 5.1.6 -- Closed shadow DOM exposure API (voluntary).
754
+ - Section 5.1.7 -- Auth-aware capabilities.
755
+ - Section 13 -- `edit_field` promoted from preview to GA.
756
+
757
+ ### Reference adopters
758
+
759
+ - Atlas Pro voice ad (`ads-demo/atlas-pro/`) -- production live,
760
+ uses `NAC.utter` + payload schema.
761
+ - React demo (`packages/nac-react-demo/`) -- adopts payload-bearing
762
+ pattern for the chat-to-todos flow.
763
+ - Angular demo (`packages/nac-angular-demo/`) -- mirror of React.
764
+ - Web Component demos: `example-v23-shadow-open.html` and
765
+ `example-v23-shadow-closed.html`.
766
+
767
+ ## 2.3.0-alpha.2 -- 2026-05-13 (superseded by 2.3.0)
768
+
769
+ Hotfix on top of 2.3.0-alpha.1:
770
+
771
+ - `NAC.invoke` no longer rejects with `code='disabled'` when the
772
+ target element has `disabled` or `aria-disabled='true'` set. The
773
+ `disabled` HTML attribute is a click-event UX guard; `invoke` is
774
+ a logical payload-bearing request, not a synthetic click. Hosts
775
+ that need to refuse an invoke based on UI state should do it in
776
+ their `nac:action:requested` listener and emit
777
+ `nac:action:failed` with a meaningful code. This was hitting the
778
+ Atlas Pro mic which gets `disabled = true` during /parse +
779
+ /tts processing, blocking subsequent NAC.utter calls from
780
+ external agents mid-conversation. Reproduced in the video-gen
781
+ pipeline (every turn after the demo's first state-transition).
782
+ - Bumped CLI version + smoke test assertions to match.
783
+
784
+ ## 2.3.0-alpha.1 -- 2026-05-12
785
+
786
+ ### New: payload-bearing actions via `NAC.invoke` + `NAC.utter`
787
+
788
+ The NAC v2.2 contract was click-and-go: an agent triggers
789
+ `NAC.click(id)` or `NAC.click_by_verb(plugin, verb)` and the host
790
+ does whatever it does. That works for verb-and-state actions
791
+ (`save`, `cancel`, `submit`, `delete`) but breaks down when the
792
+ action needs **data** from the agent: `utter(text)`,
793
+ `search(query)`, `send_message(body)`, `upload(file)`,
794
+ `schedule(date)`. Hosts had no way to receive an agent's payload
795
+ via a synthetic click.
796
+
797
+ v2.3 adds the missing primitive:
798
+
799
+ ```ts
800
+ NAC.invoke(action_id, payload, opts?): Promise<{ok, request_id, ack}>
801
+ NAC.utter(action_id, {text, lang?, voice?}): Promise<...>
802
+ ```
803
+
804
+ `NAC.invoke` dispatches a `nac:action:requested` CustomEvent on
805
+ the host element (bubbles) with the agent's `payload` + a
806
+ runtime-issued `request_id`. The host listens, processes, emits
807
+ `nac:action:succeeded` (or `:failed`) echoing the same
808
+ `request_id`. The runtime correlates and resolves the Promise.
809
+
810
+ Default timeout 30 s (vs 5 s for click). On timeout the Promise
811
+ rejects with `code='timeout'`.
812
+
813
+ `NAC.utter(id, opts)` is the ergonomic shortcut for `verb='utter'`
814
+ -- equivalent to `NAC.invoke(id, {verb:'utter', text, lang, voice})`.
815
+
816
+ Manifest entries for payload-bearing actions can declare an
817
+ informational `payload_schema`:
818
+
819
+ ```js
820
+ { id: 'atlas_pro_ad.mic', role: 'action',
821
+ actions: [
822
+ { verb: 'listen' },
823
+ { verb: 'utter',
824
+ payload_schema: {
825
+ text: { type: 'string', required: true, max: 4000 },
826
+ lang: { type: 'string', enum: ['en','es','pt','fr','it','de','ja','zh','hi','ar'] }
827
+ }
828
+ }
829
+ ]
830
+ }
831
+ ```
832
+
833
+ Click-style verbs (`NAC.click`, `NAC.click_by_verb`) continue to
834
+ work unchanged. The new contract is purely additive; no demo
835
+ behaviour regresses.
836
+
837
+ #### First adopter
838
+
839
+ Atlas Pro (`https://yujin.app/nac-spec/ads-demo/atlas-pro/`)
840
+ declares both `listen` (click-only, existing) and `utter`
841
+ (payload-bearing) on its `atlas_pro_ad.mic` action. The same
842
+ `/ad-orchestrator/parse` + `/ad-orchestrator/tts` loop drives
843
+ either path -- agents with their own STT call `listen`, agents
844
+ with their own LM call `utter` with the recognised text.
845
+
846
+ #### Test coverage
847
+
848
+ - `test/v23-invoke.mjs` (new) -- 22 assertions covering happy
849
+ path, ack echo, host-failed path, invalid args, not-found,
850
+ custom timeout. PASS.
851
+ - `test/v22.mjs` -- amended to accept v2.3.x in addition to
852
+ v2.2.x. PASS.
853
+ - `test/smoke.mjs` -- updated version assertions. PASS.
854
+
855
+ #### Files touched
856
+
857
+ - `yujin.app/nac-spec/js/nac.js` -- `invoke()` + `utter()` (~150
858
+ LOC additive). Public API surface +2 functions. NAC.version
859
+ bumped to '2.3.0-alpha.1', spec_version to '2.3'.
860
+ - `yujin.app/nac-spec/SPEC.md` -- new section 5.1.4 + header
861
+ version line.
862
+ - `yujin.app/nac-spec/ads-demo/atlas-pro/index.html` -- manifest
863
+ declares the `utter` verb + DOM listener routes into the demo's
864
+ existing `handleUtterance(text)`.
865
+ - `packages/nac/package.json`, `build.mjs`, `test/smoke.mjs` --
866
+ version bumps + new test in `npm test`.
867
+
868
+ #### Not yet wired
869
+
870
+ - `STRICT_VALIDATION` enforcement of `payload_schema` (alpha:
871
+ schema is informational).
872
+ - A `NAC.search` / `NAC.upload` / `NAC.send_message` ergonomic
873
+ shortcut sibling to `NAC.utter`. The generic `NAC.invoke` works
874
+ today; concrete shortcuts can be added without re-spec.
875
+
876
+ ## 2.2.1 -- 2026-05-12
877
+
878
+ ### Bug fix: importable in Node / SSR / test contexts
879
+
880
+ Pre-launch smoke test caught that `import '@nac3/runtime'` and
881
+ `import '@nac3/runtime/chat-client'` crashed in Node.js with
882
+ `ReferenceError: document is not defined`. The bundles had
883
+ top-level `document.dispatchEvent` and `document.addEventListener`
884
+ calls firing at module-evaluation time.
885
+
886
+ Fix: wrap browser-only init in `typeof document !== 'undefined'`
887
+ guards. In the browser the behaviour is unchanged (the events
888
+ still fire on install + the confirm listener still attaches). In
889
+ Node / SSR / Vitest / Jest the bundles now import as no-ops
890
+ instead of crashing.
891
+
892
+ Files patched (no API change):
893
+ - `dist/nac.{mjs,cjs,browser.js}` -- guarded `nac:installed`
894
+ dispatch + `_installA11yHintBridge()` call.
895
+ - `dist/nac-chat-client.{mjs,cjs,browser.js}` -- guarded
896
+ `nac:confirm:requested` listener attach.
897
+ - `dist/nac-v2-extensions.*` -- unchanged (it already early-bails
898
+ when the main runtime is not present).
899
+
900
+ Verified: all three entry points (`@nac3/runtime`,
901
+ `@nac3/runtime/extensions`, `@nac3/runtime/chat-client`) now
902
+ import cleanly under Node 22 ESM + CommonJS `require`.
903
+
904
+ ## 2.2.0 -- 2026-05-10
905
+
906
+ Same-day v2.2 ships the constructor-strict validator + action-ack
907
+ helper. Both items moved from the v2.2 roadmap into the runtime
908
+ with no breaking changes (warning-only mode by default).
909
+
910
+ ### V22-01 -- `NAC.register` strict validator
911
+
912
+ `NAC.register(manifest)` now checks each manifest entry against
913
+ three rules and emits `console.error` for findings:
914
+
915
+ - `manifest_role_unknown` -- the entry's `role` is outside the
916
+ canonical set (the 18 roles in SPEC sec 1).
917
+ - `tab_id_manifest_role_drift` -- the entry's id matches `^tab\.`
918
+ but its role is not `'tab'`. NAC.tab() and NAC.tab_by_label()
919
+ query the canonical role only; a drift here makes the tab
920
+ invisible to those resolvers (the bug class that broke
921
+ example-v21-data-table.php on 2026-05-09).
922
+ - `manifest_dom_role_mismatch` -- the corresponding DOM element
923
+ is mounted, and its `data-nac-role` differs from the manifest's
924
+ `role` value. Catches the case where an HTML author and a JS
925
+ author drift apart on what role to use.
926
+
927
+ A new flag `NAC.STRICT_VALIDATION` toggles findings between
928
+ warning-only (default; ships in 2.2) and throwing (will be the
929
+ v2.3 default; opt-in in 2.2 for adopters who want to gate CI).
930
+
931
+ Migration window: v2.2 = console.error only, v2.3 = throw
932
+ default, v3.0 = remove the flag.
933
+
934
+ ### V22-02 -- `NAC.bindAction` helper
935
+
936
+ New helper:
937
+
938
+ ```js
939
+ NAC.bindAction(buttonEl, function (ev) { /* side effect */ }, {
940
+ plugin: 'invoice', action_id: 'invoice.save'
941
+ });
942
+ ```
943
+
944
+ Bakes the `nac:action:succeeded` / `:failed` contract into the
945
+ runtime so brownfield panels cannot forget to emit the ack event.
946
+ Handles sync handlers + Promise-returning handlers; emits failure
947
+ on throw + preserves normal error semantics; returns an unbinder
948
+ function.
949
+
950
+ Removes the foot-gun that produced the v20-panel timeout reports
951
+ on 2026-05-09 (every voice command on example-v20-full.php
952
+ replied "No pude ejecutar X: timeout" because the panel handlers
953
+ did the work synchronously but never emitted the ack).
954
+
955
+ ### Tests
956
+
957
+ - `test/smoke.mjs` -- 36/36 PASS (artefact integrity + d.ts
958
+ surface + CLI version + CLI lint over demos + package.json
959
+ consistency, version asserts now check 2.2.0).
960
+ - `test/v22.mjs` -- new. 14/14 PASS. 5 strict-validator cases
961
+ (clean, unknown-role, tab-drift, DOM mismatch, strict-throws)
962
+ + 5 bindAction cases (sync ack, throw -> failed event, Promise
963
+ ack, unbinder, ctx validation) + NAC sanity checks.
964
+
965
+ Run via: `npm test` (chains both suites).
966
+
967
+ ### Known to-dos
968
+
969
+ - Per-action signing (v3.0 candidate).
970
+ - v2.3 will flip `STRICT_VALIDATION` default to true.
971
+ - v2.3 will ship `NAC.bindTab(el, handler, ctx)` companion for
972
+ tab-role widgets.
973
+
974
+ ## 2.1.0 -- 2026-05-10
975
+
976
+ First public release. Wraps the reference runtime that has been
977
+ running in production at yujin.app since 2026-04 as the npm package
978
+ `@nac3/runtime`.
979
+
980
+ ### Spec
981
+
982
+ - v2.1 with data-table primitive (collection / matrix /
983
+ matrix-singletree subkinds; `dt_add_row` / `dt_edit_cell` /
984
+ aggregates / transactional commit).
985
+ - Brownfield migration story shipped (v2.0 extensions: scope tree,
986
+ ephemeral capture, autoRegister, HMAC, isTrusted).
987
+ - 18 canonical roles, 11 success-event families.
988
+ - 10-locale i18n contract.
989
+
990
+ ### Package
991
+
992
+ - ESM + CJS + browser builds.
993
+ - TypeScript declarations (permissive surface; v2.2 ships
994
+ hand-authored full types).
995
+ - CLI: `npx nac validate <dir>` does static lint of HTML/PHP.
996
+ - Single source of truth: package built from
997
+ `yujin.app/nac-spec/js/*.js`, no maintenance duplication.
998
+
999
+ ### Demos
1000
+
1001
+ - `example.php` -- v1.9 reference, 27 widgets.
1002
+ - `example-v20-full.php` -- brownfield migration of v1.9 to v2.0.
1003
+ - `example-v20-primitives-showcase.php` -- didactic showcase of
1004
+ the 8 v2.0 primitives.
1005
+ - `example-v21-data-table.php` -- live data-table demo wired to
1006
+ the Yujin chat backend.
1007
+
1008
+ All demos hosted at yujin.app/nac-spec/.
1009
+
1010
+ ### Known limitations
1011
+
1012
+ - No per-action signing yet (only manifests). v3.0 candidate.
1013
+ - Constructor (`NAC.register`) is permissive on unknown roles; the
1014
+ v2.2 strict-validator landing fixes this.
1015
+ - CLI URL mode (`nac validate https://...`) requires Playwright;
1016
+ the package does not pull Playwright as a hard dep. Static-lint
1017
+ mode works without it.