wenay-react2 1.0.49 → 1.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +14 -14
  2. package/doc/EXAMPLE_USAGE.md +48 -0
  3. package/doc/PROJECT_FUNCTIONALITY.md +13 -2
  4. package/doc/PROJECT_RULES.md +27 -27
  5. package/doc/WENAY_REACT2_RENAMES.md +170 -170
  6. package/doc/changes/v1.0.41.md +35 -35
  7. package/doc/changes/v1.0.42.md +26 -26
  8. package/doc/changes/v1.0.43.md +10 -10
  9. package/doc/changes/v1.0.44.md +14 -14
  10. package/doc/changes/v1.0.45.md +8 -8
  11. package/doc/changes/v1.0.46.md +11 -11
  12. package/doc/changes/v1.0.47.md +9 -9
  13. package/doc/changes/v1.0.48.md +8 -8
  14. package/doc/changes/v1.0.49.md +7 -7
  15. package/doc/changes/v1.0.50.md +7 -0
  16. package/doc/changes/v1.0.51.md +10 -0
  17. package/doc/examples/README.md +1 -1
  18. package/doc/examples/conference-client.html +34 -34
  19. package/doc/examples/conference-client.ts +212 -212
  20. package/doc/examples/conference-server.mjs +150 -150
  21. package/doc/examples/peer-call-media.tsx +7 -7
  22. package/doc/examples/stand.tsx +5 -5
  23. package/doc/native.md +37 -37
  24. package/doc/progress/README.md +13 -13
  25. package/doc/progress/architecture-fix-queue.md +74 -74
  26. package/doc/progress/column-state-present-gate.md +28 -28
  27. package/doc/progress/common2-adoption-1.0.73.md +28 -28
  28. package/doc/progress/common2-adoption-1.0.74.md +24 -24
  29. package/doc/progress/common2-adoption-1.0.75.md +120 -0
  30. package/doc/progress/hook-controller-opportunities.md +363 -363
  31. package/doc/progress/hook-extraction-audit.md +195 -195
  32. package/doc/progress/public-surface-normalization.md +351 -351
  33. package/doc/progress/qa-stand-walkthrough-2026-07-12.md +62 -62
  34. package/doc/progress/stand-as-examples-audit.md +20 -20
  35. package/doc/progress/style-system-normalization.md +121 -121
  36. package/doc/target/README.md +32 -32
  37. package/doc/target/my.md +11 -3
  38. package/doc/wenay-react2-rare.md +11 -7
  39. package/doc/wenay-react2.md +2 -2
  40. package/lib/common/src/grid/agGrid4/core.js +7 -2
  41. package/lib/common/src/hooks/useReplay.js +13 -2
  42. package/lib/common/src/logs/logs.d.ts +4 -1
  43. package/lib/common/src/logs/logs.js +19 -11
  44. package/lib/common/testUseReact/replayVideo.d.ts +5 -0
  45. package/lib/common/testUseReact/replayVideo.js +98 -1
  46. package/lib/style/menuRight.css +19 -19
  47. package/lib/style/style.css +23 -23
  48. package/lib/style/tokens.css +184 -184
  49. package/package.json +54 -54
  50. package/doc/changes/v1.0.35.md +0 -26
  51. package/doc/changes/v1.0.37.md +0 -13
  52. package/doc/changes/v1.0.38.md +0 -48
  53. package/doc/changes/v1.0.39.md +0 -35
  54. package/doc/changes/v1.0.40.md +0 -15
@@ -1,30 +1,30 @@
1
- # wenay-common2 1.0.73 adoption — progress
2
-
3
- ## Update
4
-
5
- - Previous dependency: 1.0.70.
6
- - npm latest verified: 1.0.73.
7
- - Updated dependency and lockfile to 1.0.73.
8
- - Compatibility: `tsc -p tsconfig.qa-check.json --noEmit` and full Jest 21 suites / 68 tests pass.
9
-
10
- ## Architecture decision
11
-
12
- | common2 capability | wenay-react2 decision | Reason |
13
- | --- | --- | --- |
14
- | Peer gap repair / `resync()` (1.0.71) | Core-only protocol; future `usePeer` may expose status and explicit `resync` | React must not own journal or repair state. |
15
- | Hidden-tab Media capture (1.0.72) | Adopt core defaults, no adapter | Browser worker/ImageCapture implementation belongs below React. |
16
- | `Media.attachVideoCanvas` / audio player / publish pipe (1.0.73) | Recipe and QA consumer first; thin ref-lifecycle hooks only if repeated | Frame decode/playback must bypass React renders. |
17
-
18
- ## Follow-up
19
-
20
- - Keep the existing `useMediaSource`, `usePeer` and WebRTC recipe items in target.
21
- - Add a real Media/Peer QA consumer before introducing any new hook.
22
- - No raw route-coordinator hook: Peer mirrors already survive route changes.
23
- ## Implementation batch
24
-
25
- - Added `useMediaSource`: React owns source start/stop/device lifecycle only; frames remain on the common2 Listen path.
26
- - Added `usePeer`: React exposes an SDK peer's mirrored store, low-frequency route state and explicit controls; it owns no repair or transport state.
27
- - QA cards 38/39/40 cover camera canvas viewer, microphone player and an in-process Peer host/mirror/resync scenario.
28
- - Verification: qa-check TypeScript, Jest 22 suites / 71 tests, package build, diff-check and live stand HTTP 200.
1
+ # wenay-common2 1.0.73 adoption — progress
2
+
3
+ ## Update
4
+
5
+ - Previous dependency: 1.0.70.
6
+ - npm latest verified: 1.0.73.
7
+ - Updated dependency and lockfile to 1.0.73.
8
+ - Compatibility: `tsc -p tsconfig.qa-check.json --noEmit` and full Jest 21 suites / 68 tests pass.
9
+
10
+ ## Architecture decision
11
+
12
+ | common2 capability | wenay-react2 decision | Reason |
13
+ | --- | --- | --- |
14
+ | Peer gap repair / `resync()` (1.0.71) | Core-only protocol; future `usePeer` may expose status and explicit `resync` | React must not own journal or repair state. |
15
+ | Hidden-tab Media capture (1.0.72) | Adopt core defaults, no adapter | Browser worker/ImageCapture implementation belongs below React. |
16
+ | `Media.attachVideoCanvas` / audio player / publish pipe (1.0.73) | Recipe and QA consumer first; thin ref-lifecycle hooks only if repeated | Frame decode/playback must bypass React renders. |
17
+
18
+ ## Follow-up
19
+
20
+ - Keep the existing `useMediaSource`, `usePeer` and WebRTC recipe items in target.
21
+ - Add a real Media/Peer QA consumer before introducing any new hook.
22
+ - No raw route-coordinator hook: Peer mirrors already survive route changes.
23
+ ## Implementation batch
24
+
25
+ - Added `useMediaSource`: React owns source start/stop/device lifecycle only; frames remain on the common2 Listen path.
26
+ - Added `usePeer`: React exposes an SDK peer's mirrored store, low-frequency route state and explicit controls; it owns no repair or transport state.
27
+ - QA cards 38/39/40 cover camera canvas viewer, microphone player and an in-process Peer host/mirror/resync scenario.
28
+ - Verification: qa-check TypeScript, Jest 22 suites / 71 tests, package build, diff-check and live stand HTTP 200.
29
29
  - Manual Verify: run cards 38, 39, 40 together with existing replay cards 23 and 34 before release.
30
30
  - Manual verification completed by the user on the stand; release candidate is 1.0.45.
@@ -1,24 +1,24 @@
1
- # wenay-common2 1.0.74 — adoption assessment
2
-
3
- ## Upgrade
4
-
5
- - Updated the workspace lockfile from `wenay-common2` 1.0.73 to 1.0.74.
6
- - Compatibility: qa-check TypeScript, full Jest (20 suites / 67 tests), package build and diff-check pass.
7
-
8
- ## Architecture decision
9
-
10
- - `Peer.createCallManager` is a new application interaction lifecycle, not an extension of the mirrored-store `usePeer` adapter.
11
- - React may bind call state and controls; common2 retains signaling envelopes, call-id ordering, busy/glare handling, timeouts and offline verdicts.
12
- - Presence belongs to the host protocol (`list()` plus edge-triggered `changes`), not polling or a second React-owned store.
13
- - `createMediaRelay` remains relay-first and server-authorized through `watchOf` / `canWatch`; a call UI attaches viewers only while active. React must not make ACL decisions.
14
-
15
- ## Planned validation batch
16
-
17
- Presence edges; ring/accept/active; media keyframe; hangup/decline/offline/busy; ACL revoke of an already-open viewer.
18
- ## Implementation batch — 1.0.46
19
-
20
- - Added `usePeerCalls(manager)`: a thin binding for ring/active state and explicit `call`; the app owns `manager.close()`.
21
- - Added `usePeerPresence(presence)`: subscribe-first snapshot plus online/offline edge projection.
22
- - QA cards 41–44 verify an in-process call lifecycle, presence disconnect/reconnect and media relay ACL revocation on an open viewer.
23
- - Automated verification: qa-check TypeScript, real in-process hook tests, full Jest and package build.
24
- - Manual Verify pending: QA card 43 — grant camera access, confirm canvas receives frames; revoke ACL and confirm viewer frame count freezes while source remains live; grant again and confirm it resumes. QA card 44 — grant microphone access, confirm audio player receives frames/plays; revoke and grant ACL with the same expectation.
1
+ # wenay-common2 1.0.74 — adoption assessment
2
+
3
+ ## Upgrade
4
+
5
+ - Updated the workspace lockfile from `wenay-common2` 1.0.73 to 1.0.74.
6
+ - Compatibility: qa-check TypeScript, full Jest (20 suites / 67 tests), package build and diff-check pass.
7
+
8
+ ## Architecture decision
9
+
10
+ - `Peer.createCallManager` is a new application interaction lifecycle, not an extension of the mirrored-store `usePeer` adapter.
11
+ - React may bind call state and controls; common2 retains signaling envelopes, call-id ordering, busy/glare handling, timeouts and offline verdicts.
12
+ - Presence belongs to the host protocol (`list()` plus edge-triggered `changes`), not polling or a second React-owned store.
13
+ - `createMediaRelay` remains relay-first and server-authorized through `watchOf` / `canWatch`; a call UI attaches viewers only while active. React must not make ACL decisions.
14
+
15
+ ## Planned validation batch
16
+
17
+ Presence edges; ring/accept/active; media keyframe; hangup/decline/offline/busy; ACL revoke of an already-open viewer.
18
+ ## Implementation batch — 1.0.46
19
+
20
+ - Added `usePeerCalls(manager)`: a thin binding for ring/active state and explicit `call`; the app owns `manager.close()`.
21
+ - Added `usePeerPresence(presence)`: subscribe-first snapshot plus online/offline edge projection.
22
+ - QA cards 41–44 verify an in-process call lifecycle, presence disconnect/reconnect and media relay ACL revocation on an open viewer.
23
+ - Automated verification: qa-check TypeScript, real in-process hook tests, full Jest and package build.
24
+ - Manual Verify pending: QA card 43 — grant camera access, confirm canvas receives frames; revoke ACL and confirm viewer frame count freezes while source remains live; grant again and confirm it resumes. QA card 44 — grant microphone access, confirm audio player receives frames/plays; revoke and grant ACL with the same expectation.
@@ -0,0 +1,120 @@
1
+ # wenay-common2 1.0.75 — adoption audit (ultracode, 2026-07-13)
2
+
3
+ Аудит рабочей копии после бампа 1.0.74 → 1.0.75 (RPC/Replay reconnect contract): 4 параллельных аудитора
4
+ (новая карточка 47 / хуки useReplay / старые стенды / тест+доки), каждая находка прошла адверсариальную
5
+ верификацию отдельным агентом по реальному коду `node_modules/wenay-common2`. Итог: 26 подтверждено, 0 ложных.
6
+
7
+ ## Что уже сделано в рабочей копии (некоммичено)
8
+
9
+ - Бамп `wenay-common2` до `^1.0.75`, фикс `useReplaySubscribe` (флаг `failed`: `off.ready` в 1.0.75 резолвится
10
+ даже при терминальном `onError`, гонка ready=true закрыта), карточка 47 `ReplayRpcReconnectDemo`,
11
+ Socket.IO QA-эндпоинт `/__qa/replay-rpc` в vite.config.ts, тест `__test/useReplayRpcReconnect.test.tsx`, доки.
12
+ - Проверено сейчас: tsc qa-check чистый; jest 26 suites / 91 tests зелёные (reconnect-suite 4/4).
13
+
14
+ ## Подтверждено корректным (менять не надо)
15
+
16
+ - Ядро карточки 47: `hub.setToken(null)` — легитимный первичный connect (первый вызов не рвёт поколение);
17
+ `io({reconnection: false})` + ручные `socket.disconnect()/connect()` — настоящий транзиентный reconnect
18
+ для хаба; `connectListen/disconnectListen` без утечек под StrictMode; серверная обвязка в vite.config
19
+ (SocketTmpl-адаптер, `replay: 'auto'`, `line.count()`, один io на httpServer) корректна.
20
+ - Старые стенды НЕ содержат устаревших restart/remount-обходов: remount-via-since (карточка 23),
21
+ remount client (33), restart (24) — легитимные API-паттерны и при 1.0.75 (авто-восстановление покрывает
22
+ только transient reconnect живой подписки). Single-slot `onConnect/onDisconnect` нигде не используется.
23
+ - Хуки не сбрасывают состояние при транзиентном reconnect (эффекты завязаны на identity remote — она
24
+ в 1.0.75 стабильна); stale-логика контракту не противоречит; useReplayHistory не затронут.
25
+ - Карточка 25 — эталон, не затрагивалась.
26
+
27
+ ## Баги (код хуков)
28
+
29
+ 1. **`useStoreReplaySync` без `failed`-фикса** (`src/common/src/hooks/useReplay.ts:389`; наследуют
30
+ `useStoreReplayMirror`/`useStoreReplayEach`, карточки 24/33). `off.ready` у `syncStoreReplay` РЕЗОЛВИТСЯ
31
+ при терминальном `onError` (settleReady внутри closeSubscription) → `ready=true` на мёртвой подписке.
32
+ Фикс: `failed`-флаг + `if (!alive || failed) return` в `ready.then` **и** `setReady(false)` в `onError`
33
+ (иначе ошибка после уже наступившего ready оставляет true). На in-proc карточках 24/33 почти
34
+ не воспроизводится (keyframe всегда есть), но хуки публичные и принимают RPC-remote.
35
+ 2. **Route-хуки после post-ready смерти линии оставляют `ready=true`** (`useReplay.ts:268` —
36
+ `useReplayRouteSubscribe`, `:464` — `useStoreReplayRouteSync`): `onError` делает только `setError`,
37
+ React-состояние `ready=true`/`phase=='ready'` при `active()==false`. Геттер `active()` снаружи честен
38
+ (subRef), рассинхронизировано именно React-state. Поведение библиотеки не ново (с 1.0.67).
39
+
40
+ ## Карточка 47 — недоделки QA-стенда
41
+
42
+ 3. **Индикатор «stable remote» тавтологичен** (`replayVideo.tsx:444`): сравниваются два присваивания
43
+ одного объекта при первом setToken; `hub.facade.qaReplay.func.events` после reconnect не перечитывается —
44
+ главная новая гарантия 1.0.75 (identity прокси через reconnect) карточкой НЕ проверяется.
45
+ Фикс: в `connectListen` перечитывать `func.events` и сравнивать с `firstRemote`.
46
+ 4. **«mount consumer» после unmount необратимо ломает PASS** (`replayVideo.tsx:479`): фиксированный
47
+ `since: 0` + заглушка `onSeq: () => {}` → повторный маунт заливает всю историю в append-only метрики
48
+ (duplicates>0, ordered=false, reset нет). Фикс: remount-via-since (паттерн карточки 23 и doc-комментария
49
+ useReplay.ts:24-25) либо сброс metrics при mount.
50
+ 5. **do-текст «wait until it is green» невыполним** (`qa.tsx:1667` + `replayVideo.tsx:469` «wait for
51
+ delivery»): авто-refresh нет, снапшот обновляется только по кликам/connect-событиям. Фикс: текст
52
+ «press refresh metrics until green» либо периодический refresh.
53
+ 6. minor: счётчик errors append-only и смешивает три источника (офлайн-отказы обычных RPC из `run()` —
54
+ контрактное поведение 1.0.75, терминальный onError подписки, провал setToken) — случайный клик
55
+ start/stop/burst офлайн навсегда красит карточку; нужен reset или разделение источников
56
+ (`replayVideo.tsx:462`).
57
+ 7. minor: офлайн-ветка `refresh()` обнуляет серверные числа (`produced 0 · seq N/-1`) вместо last-known
58
+ со stale-пометкой; требование `listeners == 1` ломается вторым открытым табом QA-борда — нигде
59
+ не оговорено (`replayVideo.tsx:419`).
60
+ 8. minor: `vite.config.ts:213` — close-хук не делает `clearInterval(qaReplayTimer)`: при рестарте конфига
61
+ запущенный продюсер утекает (вечный 50мс-тик + удержание осиротевшей линии на каждое поколение).
62
+ 9. minor: qaReplay — sacred-линия (нет current/keyframe) с history 20000: после >20000 событий свежий
63
+ маунт с since:0 получает терминальный onError; рестарт dev-сервера при живом клиенте → seq>head →
64
+ терминальная ошибка после reconnect. Оба поведения контрактно правильные, но note карточки 47
65
+ их не оговаривает — QA увидит необъяснимый красный (`vite.config.ts:10`).
66
+
67
+ ## Гэпы адаптации хуков
68
+
69
+ 10. **`useReplayFrame`** (`useReplay.ts:691`): любая ошибка pull терминальна (clearInterval до ручного
70
+ `restart()`) — транзиентный блип останавливает опрос навсегда, хотя identity remote теперь стабильна
71
+ и есть `connectListen`/lifecycle для re-arm. Не различает sacred eviction и transient disconnect.
72
+ JSDoc подаёт как by-design — позиция 1.0.74-эпохи.
73
+ 11. **`useStoreMirror`** (`useObserveStore.ts:263`): неудачный `sync()` при disconnect терминален,
74
+ reconnect-ресинка нет. Хук намеренно транспорт-агностичен — минимум: задокументировать внешний
75
+ паттерн `hub.connectListen(() => controller.sync())` и/или опциональный параметр.
76
+ 12. doc: JSDoc хуков не фиксирует контракт 1.0.75 — терминальность `onError` и то, что transport
77
+ reconnect common2 восстанавливает сам (шапка useReplay.ts:15-36 неполна аддитивно; `onError` на :52
78
+ и `error` на :81 вовсе без JSDoc).
79
+ 13. minor: мёртвые rejection-ветки `off.ready.then(..., e => ...)` в `useReplaySubscribe` (:162) и
80
+ `useStoreReplaySync` (:395) — ready в 1.0.75 никогда не реджектится (у route-хуков ветка рабочая).
81
+
82
+ ## Гэпы теста `__test/useReplayRpcReconnect.test.tsx`
83
+
84
+ Тест честный (реальный Socket.IO, без моков), но не покрывает на уровне React-обёртки:
85
+ 14. hard teardown: живая подписка → `dispose()`/`setToken()` → подписка не воскресает через effect (:72);
86
+ 15. стабильная identity прокси: `expect(clients.replay.func.ticks).toBe(remote)` после reconnect —
87
+ сейчас проверяется только физический сокет; assert нужен внутри fixture.reconnect, где clients
88
+ в замыкании (:50);
89
+ 16. eviction внутри офлайн-дыры: доставка до seq N → disconnect → эмит сверх маленького history →
90
+ reconnect → терминальная ошибка (ready true→false), без ложного продолжения (:225 покрывает только
91
+ initial subscribe);
92
+ 17. «unsubscribing offline prevents resurrection»: disconnect → unmount → reconnect → consumers==0 (:158);
93
+ 18. multi-consumer dedup recovery (два хука на одном remote → serverConsumers()==1, оба точны после
94
+ reconnect) и 2-3 повторных reconnect-поколения (:117).
95
+
96
+ ## Доки
97
+
98
+ 19. Шапка `replayVideo.tsx:3` «Everything is in-proc» устарела — карточка 47 в этом же файле на реальном
99
+ Socket.IO (docstring самой карточки корректен; поправить только охват шапки: in-proc — карточки 40-46).
100
+ 20. `doc/wenay-react2-rare.md:558` — осиротевшая строка `**Identity matrix**` без содержимого (обрубок).
101
+ 21. `doc/changes/v1.0.50.md:5` — Changed замалчивает фикс `useReplaySubscribe` (критично), карточку 47 и
102
+ QA-эндпоинт (упомянуты лишь косвенно в Verification).
103
+ 22. Карточка 47 не добавлена в списки live-примеров (`doc/wenay-react2.md:481` «cards 23…26»,
104
+ `doc/wenay-react2-rare.md:577`).
105
+ 23. `doc/EXAMPLE_USAGE.md:819` — retention журнала ошибочно приписан policy `queue` (retention задаёт
106
+ продюсер `replayListen({history})`; `queue` — только «wire-подписка ничего не пропускает при лаге»).
107
+ 24. minor: лишняя вторая пустая строка после `## Replay Feed Into A Grid` (`doc/EXAMPLE_USAGE.md:834`).
108
+ 25. gap стенда: терминальный sacred-onError + восстановление явным `restart(since)` не демонстрируется
109
+ ни одной интерактивной карточкой (автотест покрывает только терминальность на initial subscribe);
110
+ все линии стендов имеют keyframe/history с запасом (`replayVideo.tsx:32`).
111
+
112
+ ## Порядок работ (предложение)
113
+
114
+ 1. Баги хуков (№1-2) — фикс + симметричные тесты (по образцу eviction-теста 4).
115
+ 2. Карточка 47 до честного PASS (№3-9: stable remote, mount consumer, do-текст; minor — по ходу).
116
+ 3. Тестовые гэпы (№14-18) — один batch в reconnect-suite.
117
+ 4. Доки (№19-24) одним доко-проходом; №10-12 (useReplayFrame re-arm, mirror resync, JSDoc) — отдельный
118
+ осознанный pass, №25 (sacred-карточка) — опционально после него.
119
+
120
+ Verify каждого шага: tsc qa-check, jest, build, стенд 3010 (карточки 23/24/33/47).