redweb 0.11.0 → 0.13.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.
Files changed (167) hide show
  1. package/CHANGELOG.md +163 -0
  2. package/README.md +176 -508
  3. package/bin/redweb.js +11 -0
  4. package/client.d.ts +7 -2
  5. package/config/tsconfig.json +14 -0
  6. package/contract.d.ts +45 -0
  7. package/contract.js +5 -0
  8. package/docs/ACTION_INPUT_VERIFICATION.md +96 -0
  9. package/docs/ADMISSION_TIMEOUT_VERIFICATION.md +69 -0
  10. package/docs/AGENT_ACCESS.md +35 -0
  11. package/docs/AGENT_EVALUATION.md +58 -0
  12. package/docs/AGENT_READY_ACCEPTANCE.md +763 -0
  13. package/docs/APPLICATION_RECORDER_VERIFICATION.md +50 -0
  14. package/docs/BENCHMARK_VERIFICATION.md +307 -0
  15. package/docs/BROWSER_OWNER_VERIFICATION.md +191 -0
  16. package/docs/CLI.md +116 -0
  17. package/docs/CLIENT_DEVELOPMENT.md +152 -0
  18. package/docs/CLIENT_POLISH_VERIFICATION.md +282 -0
  19. package/docs/COVERAGE_COUNTER_VALIDATION.md +109 -0
  20. package/docs/COVERAGE_SCOPE_AUDIT.md +1183 -0
  21. package/docs/DEVELOPMENT.md +79 -0
  22. package/docs/DIAGNOSTIC_COMPATIBILITY.md +76 -0
  23. package/docs/DOCUMENTATION.md +37 -0
  24. package/docs/FEEDBACK_COMMAND_VERIFICATION.md +228 -0
  25. package/docs/GETTING_STARTED.md +58 -0
  26. package/docs/JSX_PERFORMANCE_VERIFICATION.md +59 -0
  27. package/docs/LIVE_HTML.md +169 -8
  28. package/docs/LIVE_HTML_LOAD_VERIFICATION.md +98 -0
  29. package/docs/MIGRATION.md +28 -0
  30. package/docs/MULTIPLAYER_OPERATIONS.md +26 -4
  31. package/docs/ORIGINAL_RECOVERY_VERIFICATION.md +100 -0
  32. package/docs/PACKAGED_EXAMPLE_VERIFICATION.md +126 -0
  33. package/docs/POLISH_RELEASE_CHECKPOINT.md +91 -0
  34. package/docs/PROCESS_CLEANUP_OBSERVATION.md +61 -0
  35. package/docs/PROCESS_REAPING_VERIFICATION.md +30 -0
  36. package/docs/PRODUCTION_READINESS.md +11 -2
  37. package/docs/RECOVERY_CLIENT_HEAP.md +201 -0
  38. package/docs/RECOVERY_CODE_ATTRIBUTION.md +174 -0
  39. package/docs/RECOVERY_CODE_CENSUS.md +158 -0
  40. package/docs/RECOVERY_COMPARISON.md +103 -0
  41. package/docs/RECOVERY_DEOPTIMIZATION.md +169 -0
  42. package/docs/RECOVERY_FOLLOWUP_SPIKE.md +147 -0
  43. package/docs/RECOVERY_INVESTIGATION.md +229 -0
  44. package/docs/RECOVERY_RUNTIME_CONTROLS.md +181 -0
  45. package/docs/RELEASE_TRUST.md +58 -0
  46. package/docs/ROOM_AUTHORIZATION.md +49 -0
  47. package/docs/RUNTIME_DIAGNOSTICS.md +78 -0
  48. package/docs/SERVER_RECOVERY_CANDIDATE.md +185 -0
  49. package/docs/SOAK_ROTATION_OBSERVATION.md +160 -0
  50. package/docs/SOAK_VERIFICATION.md +154 -0
  51. package/docs/SOCKET_CONTRACTS.md +39 -0
  52. package/docs/SPLIT_RECOVERY_COVERAGE.md +83 -0
  53. package/docs/SPLIT_RECOVERY_ERROR_HANDLING.md +67 -0
  54. package/docs/STARTER_COORDINATOR_VERIFICATION.md +112 -0
  55. package/docs/STARTER_LIFECYCLE_VERIFICATION.md +75 -0
  56. package/docs/STARTER_REPORT_RETENTION.md +73 -0
  57. package/docs/VERIFICATION_EVIDENCE.md +2 -0
  58. package/docs/generated.json +2154 -0
  59. package/docs/guides/chatroom.md +27 -0
  60. package/docs/guides/http-websocket.md +28 -0
  61. package/docs/guides/jsx-without-react.md +26 -0
  62. package/docs/guides/realtime-dashboard.md +29 -0
  63. package/docs/guides/typed-websockets.md +26 -0
  64. package/docs/reference.json +1207 -0
  65. package/docs/snippets/room-access.tsx +51 -0
  66. package/docs/topics.json +21 -0
  67. package/examples/live-html/chatroom.js +207 -268
  68. package/examples/live-html/chatroom.tsx +167 -0
  69. package/examples/live-html/jsx-page.js +1 -1
  70. package/examples/live-html/jsx-page.tsx +1 -1
  71. package/examples/live-html/tsconfig.json +3 -8
  72. package/index.d.ts +170 -45
  73. package/index.js +2 -0
  74. package/jsx-dev-runtime.js +2 -2
  75. package/jsx-runtime.d.ts +7 -2
  76. package/package.json +94 -7
  77. package/recipes/add/artifact.test.cjs +57 -0
  78. package/recipes/add/live.tsx +18 -0
  79. package/recipes/add/socket-route.ts +24 -0
  80. package/recipes/chat/README.md +22 -0
  81. package/recipes/chat/app.test.cjs +105 -0
  82. package/recipes/chat/app.tsx +9 -0
  83. package/recipes/dashboard/README.md +43 -0
  84. package/recipes/dashboard/admin.ts +21 -0
  85. package/recipes/dashboard/app.css +16 -0
  86. package/recipes/dashboard/app.test.cjs +450 -0
  87. package/recipes/dashboard/app.tsx +86 -0
  88. package/recipes/dashboard/auth.ts +80 -0
  89. package/recipes/dashboard/cards.tsx +102 -0
  90. package/recipes/dashboard/rate-window.test.cjs +17 -0
  91. package/recipes/dashboard/store.ts +120 -0
  92. package/recipes/http-ws/README.md +11 -0
  93. package/recipes/http-ws/app.test.cjs +92 -0
  94. package/recipes/http-ws/app.tsx +36 -0
  95. package/recipes/realtime/README.md +8 -0
  96. package/recipes/realtime/app.test.cjs +15 -0
  97. package/recipes/realtime/app.tsx +28 -0
  98. package/recipes/shared/README.md +40 -0
  99. package/recipes/shared/app.css +8 -0
  100. package/recipes/shared/copy-assets.cjs +8 -0
  101. package/recipes/shared/network.cjs +59 -0
  102. package/recipes/shared/run-app.test.cjs +158 -0
  103. package/recipes/shared/run-app.ts +50 -0
  104. package/recipes/site/README.md +4 -0
  105. package/recipes/site/app.test.cjs +19 -0
  106. package/recipes/site/app.tsx +25 -0
  107. package/recipes/socket/README.md +39 -0
  108. package/recipes/socket/app.test.cjs +85 -0
  109. package/recipes/socket/app.tsx +30 -0
  110. package/recipes/socket/contract.ts +12 -0
  111. package/recipes/socket/handlers.ts +40 -0
  112. package/src/OwnedServerLifecycle.js +66 -0
  113. package/src/access/AccessPolicy.js +37 -0
  114. package/src/access/AuthenticationFailure.js +13 -0
  115. package/src/access/RequestFailure.js +33 -0
  116. package/src/access/failure-codes.json +25 -0
  117. package/src/async/BoundedOperation.js +62 -0
  118. package/src/cli/ActionReferences.js +193 -0
  119. package/src/cli/AdditionLayout.js +140 -0
  120. package/src/cli/FilePlan.js +94 -0
  121. package/src/cli/ProjectAddition.js +60 -0
  122. package/src/cli/ProjectConfig.js +26 -0
  123. package/src/cli/ProjectDoctor.js +112 -0
  124. package/src/cli/ProjectInitializer.js +20 -0
  125. package/src/cli/SourceInspector.js +207 -0
  126. package/src/cli/StaticSource.js +192 -0
  127. package/src/cli/arguments.js +62 -0
  128. package/src/cli/formatCommand.js +10 -0
  129. package/src/cli/run.js +57 -0
  130. package/src/cli/templates.js +86 -0
  131. package/src/context/RequestSnapshot.js +41 -0
  132. package/src/dataProperty.js +11 -0
  133. package/src/development/DevelopmentPageManager.js +48 -0
  134. package/src/development/Inspection.js +104 -0
  135. package/src/development/ObservedRenderer.js +42 -0
  136. package/src/development/description.js +35 -0
  137. package/src/development/loopbackRequest.js +27 -0
  138. package/src/development/refreshBrowser.js +96 -0
  139. package/src/development/refreshStyles.js +9 -0
  140. package/src/development/settings.js +17 -0
  141. package/src/docs/Documentation.js +182 -0
  142. package/src/htmx/ActionDefinition.js +44 -0
  143. package/src/htmx/Jsx.js +24 -8
  144. package/src/htmx/LiveHtmlServer.js +41 -19
  145. package/src/htmx/LivePage.js +63 -13
  146. package/src/htmx/PageIdentity.js +32 -0
  147. package/src/htmx/PageLifetime.js +37 -0
  148. package/src/htmx/PageManager.js +203 -74
  149. package/src/htmx/ReactiveRenderer.js +241 -0
  150. package/src/htmx/StaticExporter.js +1 -1
  151. package/src/htmx/TemplateRenderer.js +13 -7
  152. package/src/htmx/browserRuntime.js +2 -93
  153. package/src/htmx/metadata.js +19 -7
  154. package/src/validation/ActionInputError.js +12 -0
  155. package/src/validation/SchemaValidator.js +38 -0
  156. package/src/ws/AdmissionPolicy.js +24 -23
  157. package/src/ws/BaseSocketServer.js +53 -38
  158. package/src/ws/ContractValidationError.js +12 -0
  159. package/src/ws/HeartbeatMonitor.js +19 -7
  160. package/src/ws/ProtocolPolicy.js +1 -1
  161. package/src/ws/RoomAccess.js +82 -0
  162. package/src/ws/RoomRegistry.js +56 -6
  163. package/src/ws/RouteRuntime.js +56 -10
  164. package/src/ws/SocketContract.js +112 -0
  165. package/src/ws/SocketRoute.js +18 -0
  166. package/src/ws/protocol-schema.json +6 -1
  167. package/examples/live-html/chatroom.ts +0 -217
@@ -0,0 +1,109 @@
1
+ # Exact coverage-counter validation
2
+
3
+ Independent review found that the browser collector checked source maps but not
4
+ the associated execution counters. A local reproduction supplied the unchanged
5
+ maps with every counter set to `0.5`: the old collector accepted the payload and
6
+ reported all-four 100%. Two regression tests failed before the correction.
7
+ This demonstrates a report-validation defect, not a runtime defect or evidence
8
+ that any saved native-browser report was corrupt.
9
+
10
+ ## One shared validator
11
+
12
+ `assertCoverageFile` extracts the existing authored-coverage rules into a small,
13
+ pure private helper. Both `ApplicationCoverage` and `BrowserCoverage` now require
14
+ the exact file path, source maps, counter keys and branch arity, with nonnegative
15
+ safe-integer counts. Validation precedes merging; a malformed later application
16
+ module cannot partially commit an earlier valid module. The helper imports only
17
+ Node's assertion module, not TypeScript or browser/runtime dependencies.
18
+
19
+ The isolated browser harness copies this helper unchanged, increasing its input
20
+ inventory from 24 to 25 files. Existing generator/addition/example verification
21
+ fingerprints include the extracted dependency. No application/runtime API,
22
+ workload threshold, frozen helper or evaluation file changed.
23
+
24
+ ## Maintained checks
25
+
26
+ The collector portion of `npm run verify:browser:coverage` passes 27 tests across
27
+ three suites in 4.370 seconds. Exactly three private files are all-four 100%:
28
+ 70 statements, 10 branches, 10 functions and 68 lines. Cases include explicit
29
+ malformed-report units, real VM executions of instrumented JavaScript/TypeScript,
30
+ multi-module no-partial-merge checks, package-harness compatibility, real child
31
+ process reports, and a Windows exclusive-file-lock cleanup failure. They do not
32
+ replace native browser acceptance.
33
+
34
+ Five tiny preload-test commands now have explicit five-second limits instead of
35
+ inheriting 120 seconds each. The test's outer limit is 45 seconds to accommodate
36
+ the commands and managed cleanup. CI allows ten minutes for the expanded combined
37
+ collector/browser command (formerly five), with unchanged native operation limits,
38
+ and retains collector/runtime/refresh reports for 30 days on success or failure.
39
+ This is test supervision, not a relaxed product performance limit.
40
+
41
+ | Exact source | SHA-256 |
42
+ | --- | --- |
43
+ | `scripts/lib/assertCoverageFile.js` | `a3af85e92bfc3f6f83ea18301db1e31dab75f930b3c9045ff7a2dbc50f65b5ba` |
44
+ | `scripts/lib/ApplicationCoverage.js` | `cf83c4c35baefa74ba431e5b0198ebfeba78f19f49c5eeac746205d6b2b12ae5` |
45
+ | `scripts/lib/BrowserCoverage.js` | `73afb4961fbda1ac0f077dddef197b6d36d386304299d69f115ce61d131f6aa2` |
46
+ | `scripts/lib/PackedBrowserHarness.js` | `0eb57075c391dbd32fd931c6647cdc1dbeb014cfbaf6df0afe631c7b790b24ce` |
47
+
48
+ `coverage/browser-collector/coverage-final.json` SHA-256:
49
+ `49f1230bf03006d0e8e49083e46ac33ca126a43a76b407717e6f1f1aa32d7132`.
50
+
51
+ ## Native acceptance and limits
52
+
53
+ The complete ordinary/instrumented runtime and refresh browser gates pass with
54
+ matching case inventories. Runtime remains all-four 100% over 426 statements,
55
+ 262 branches, 64 functions and 351 lines; refresh remains all-four 100% over
56
+ 82 statements, 44 branches, 12 functions and 71 lines. Real HTTP/WebSocket
57
+ actions, selection updates, history restoration, outage/recovery and draft guards
58
+ remain covered. Environment: Windows, Node 22.21.0, Chrome 152.0.7977.64.
59
+
60
+ | Native report | Run | SHA-256 |
61
+ | --- | --- | --- |
62
+ | `coverage/browser-runtime/report.json` | `01b23ee2-aeda-4594-a5a0-3e11f1005c97` | `2b20f3e87cb5c22f870d90a53879611247ff37582558a22cf7f55ca253d42b39` |
63
+ | `coverage/browser-refresh/report.json` | `d8f370d3-cf33-4b1a-b99d-3c45d3b8dae7` | `fdabcbf7de78568582f3bb2afd61aa8d443d8b4b05caaf8c71f43b527b4ce90f` |
64
+
65
+ The linked-client gate also passes 77 tests per mode, five worker reports and
66
+ native browser acceptance with 791 statements, 521 branches, 125 functions and
67
+ 659 lines all 100%. Run `09c44903-39bb-4741-8e24-60b511dc7245` is retained under
68
+ `coverage/client-source/`. Its ordinary source-built bundles equal the linked
69
+ production build. This does not relabel the Node-only V8 diagnostic as passing.
70
+
71
+ The client `summary.json` SHA-256 is
72
+ `302c162b655540152c5a1d4c5c562f768065c40431bf87852d5ba439d35b2348`;
73
+ `coverage.json` SHA-256 is
74
+ `8673e236f675d741cb0f55d4f4bf630f2e2a50c2f2f76f856622558491ac8009`.
75
+
76
+ The complete isolated-package gate then exited successfully. It verified registry
77
+ `redweb-client@0.2.0` and all four matching bundle identities, installed counter/chat,
78
+ dependency isolation, generated additions, authenticated dashboard, browser runtime
79
+ and refresh, all source-free starters, executable docs, compiled actions/rooms and
80
+ static export. No runtime modules were replaced; TLS verification remained enabled.
81
+
82
+ Tested Redweb archive SHA-256:
83
+ `d66bf453c60bec4bef6a0ea728637131bd014fc8e4e57d6bcc02bafd680c1cf0`.
84
+ This archive predates subsequent evidence-only README/documentation edits.
85
+ The retained report is
86
+ `coverage/packed-browser/d6c4db4d-fc0b-415c-b989-2241255e5e88/report.json`, SHA-256
87
+ `465bdf7c5f6f63dd34ba603bb408b18bf63e3c2ffbb7c39a5379deb04546e0d4`.
88
+ It records the three browser phases passing, 208 package files and 25 unchanged
89
+ harness inputs, with harness SHA-256
90
+ `1a999d87da59cd90e4bbea37e1324c3ab1e7b94fc1932d945c2878ff127651c7`.
91
+
92
+ The senior critic approved all 17 actual remote blobs at `659f638`, including the
93
+ shared validator, test supervision, attribution wording and evidence identities.
94
+ Pretest/generated/type checks and four documentation units pass.
95
+
96
+ The full regression for `9c29a6e` then passed 1,459 tests/138 suites in 770.875
97
+ seconds, with two POSIX-only skips. It includes the three new validator cases.
98
+ The unchanged 91-file library scope remains all-four 100%: 5,449 statements,
99
+ 4,046 branches, 978 functions and 4,468 lines.
100
+
101
+ | Full regression evidence | SHA-256 |
102
+ | --- | --- |
103
+ | `coverage/counter-validation-full-results.json` | `0ae3268e1b911fbfe4b766210172a404fbd77e146d7f0ab435ce6e8ce9b807a8` |
104
+ | `coverage/coverage-final.json` | `e3eff8cc021eb82fd323867a079c983c72abb5fe07f83255b302850684dda29e` |
105
+
106
+ Both preceding `f96ba79` and `367e104` hosted workflows passed completely.
107
+ Both `659f638` and `9c29a6e` hosted workflows also passed completely.
108
+ No npm publication, deployment, benchmark waiver, new long soak or whole-repository
109
+ 100% claim is made.