@nac3/runtime 2.5.0-alpha.1 → 2.5.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.5.0-alpha.2 -- 2026-05-23
4
+
5
+ NAC3 v2.5.0-alpha.2 lands the V24-04 OCC foundation that was
6
+ deferred from alpha.1. This is an additive release on top of
7
+ alpha.1 -- everything that worked in alpha.1 still works.
8
+
9
+ ### Added (V24-04 -- foundation SHIPPED)
10
+
11
+ The snapshot versioning + optimistic concurrency framework from
12
+ RFC V24-04 lands as a foundation layer:
13
+
14
+ - `_tree_version` + `_plugin_versions` Map -- per-(slug, instance_id)
15
+ monotonic version counters. Bumped on every structural mutation
16
+ observed by the runtime MutationObserver + on every syncPlugin
17
+ call.
18
+ - `_resolvePluginScope(el)` walks ancestor [data-nac-plugin] roots
19
+ with WeakMap caching to avoid O(depth) walks on every mutation.
20
+ - `_bumpPluginVersion(slug, instance_id, trigger)` + `_bumpTreeVersion`
21
+ atomic helpers: increment counter, push to `_version_history`
22
+ (capped at 500), dispatch `nac:plugin:invalidated` +
23
+ `nac:tree:invalidated` events.
24
+ - Single document-rooted MutationObserver that filters mutations to
25
+ data-nac-* attribute changes + addNodes/removeNodes that contain
26
+ data-nac-* descendants. Pure value/text changes do NOT bump.
27
+ - `element_state_hash` (128-bit SHA-256 truncated) over a canonical
28
+ 5-key state (visible, disabled, value, text, custom). Sync impl
29
+ + async crypto.subtle path when available. Byte-identical digests
30
+ across paths.
31
+ - `markHydrationComplete()` + 100ms fallback for SSR-then-hydrate
32
+ scenarios. Tagged trigger='hydration_complete' on the resulting
33
+ bump events.
34
+ - `versionHistory(limit?)` devtools surface -- last N bumps, most
35
+ recent first.
36
+
37
+ ### Added (V24-04 -- describe() additions)
38
+
39
+ - `describe()` output now carries `tree_version` at the root +
40
+ `plugin_version` + `plugin_instance_id` per plugin entry +
41
+ `element_state_hash` per element entry. All three are read-only
42
+ observers; consuming them is opt-in.
43
+
44
+ ### Added (V24-04 -- NAC.* surface)
45
+
46
+ - `NAC.STRICT_VERSIONING` (default **false** in alpha.2; will flip to
47
+ true in alpha.3 after one soak window). When true,
48
+ every mutating API call without `expected_*` parameters throws
49
+ `NacError('version_required', ...)`.
50
+ - `NAC.eager_hashing` (default false) -- placeholder flag for future
51
+ cache-the-hash-on-mutate optimization.
52
+ - `NAC.conformance_tier` (default `'NAC-3-versioned'`). Runtimes that
53
+ declare the legacy `'NAC-3'` tier explicitly reject `expected_*`
54
+ parameters with `NacError('feature_not_supported', ...)`.
55
+ - `NAC.markHydrationComplete()` -- explicit hydration ack.
56
+ - `NAC.versionHistory(limit?)` -- devtools.
57
+
58
+ ### V24-02 syncPlugin consolidation
59
+
60
+ syncPlugin's version stamp now uses the V24-04 `_bumpPluginVersion`
61
+ machinery instead of the alpha.1 per-call timestamp string. The
62
+ return shape (`{replaced, slug, version}`) is unchanged, but the
63
+ `version` value is now `v_<N>` instead of `v_<base36-ts>_<seq>`.
64
+ Tests pass either format (just check the `v_` prefix and that
65
+ versions differ across calls).
66
+
67
+ ### Pending for 2.5.0-alpha.3
68
+
69
+ - **Dispatch enforcement hooks.** `click` / `click_by_verb` / `tab` /
70
+ `tab_by_label` / `fill` / `select` / `invoke` accept
71
+ `expected_plugin_version` / `expected_tree_version` /
72
+ `expected_element_state_hash` parameters and reject with
73
+ `NacError('snapshot_stale', ...)` on mismatch via
74
+ `_resolveVersionExpectations()` (the helper is already in this
75
+ release; the hooks are not yet wired into the dispatch verbs).
76
+ - **`STRICT_VERSIONING` default flip** from false to true. Gated on
77
+ the dispatch hooks landing.
78
+ - **V25-02/03/04 drafts** -- tree navigation, asistive labels,
79
+ effect detection. Target subsequent 2.5.x patches.
80
+
81
+ ### Tests
82
+
83
+ `runtime/test/` adds stage12-snapshot-versioning.mjs (23 PASS):
84
+ API surface, describe() additions, syncPlugin bump events, version
85
+ history, markHydrationComplete idempotency, hydration trigger
86
+ tagging.
87
+
88
+ Suite total: **377 PASS / 0 FAIL** across 14 stage suites.
89
+
90
+ ### Migration notes
91
+
92
+ - Code consuming `describe()` output that did NOT expect
93
+ `tree_version` / `plugin_version` / `element_state_hash` keys is
94
+ unaffected: those keys are additive. Code that explicitly checked
95
+ describe().plugins[i] for an enumerated key set might fail; the
96
+ fix is to ignore unknown keys (forward-compatible default).
97
+ - syncPlugin's `result.version` value format changed (see V24-02
98
+ section above). Tests that asserted the exact alpha.1 format
99
+ string would need to relax to a prefix-only check.
100
+
101
+ ---
102
+
3
103
  ## 2.5.0-alpha.1 -- 2026-05-23
4
104
 
5
105
  NAC3 v2.5.0-alpha.1 is a **consolidation release**. Two parallel
package/SPEC.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # NAC3 -- Native Agent Contract
2
2
 
3
- **Version:** 2.5.0-alpha.1 (consolidation alpha: Block A canvas+API + V24-01/02/05 RFCs alongside v2.4 strict resolution)
4
- **Status:** v2.5.0-alpha.1 alpha -- consolidates parallel dev lines, V24-04 OCC still in implementation for alpha.2
3
+ **Version:** 2.5.0-alpha.2 (alpha.1 + V24-04 OCC foundation: tree_version + plugin_version + element_state_hash + markHydrationComplete + versionHistory)
4
+ **Status:** v2.5.0-alpha.2 alpha -- V24-04 foundation SHIPPED, dispatch enforcement hooks pending for alpha.3
5
5
  **License:** Apache-2.0
6
6
  **Editor:** Yujin (yujin.app)
7
7