redweb 0.12.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 +166 -9
  2. package/README.md +177 -523
  3. package/bin/redweb.js +11 -20
  4. package/client.d.ts +7 -2
  5. package/config/tsconfig.json +14 -14
  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 -21
  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 +8 -7
  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 +88 -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 -30
  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 -87
  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
package/bin/redweb.js CHANGED
@@ -1,20 +1,11 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const path = require('path');
5
- const ProjectInitializer = require('../src/cli/ProjectInitializer');
6
- const { version } = require('../package.json');
7
-
8
- const [command, target = '.', ...extra] = process.argv.slice(2);
9
-
10
- if (command === 'init' && extra.length === 0) {
11
- const result = new ProjectInitializer(version).initialize(path.resolve(process.cwd(), target));
12
- console.log(`Redweb project ready in ${result.root}`);
13
- if (result.created.length) console.log(`Created: ${result.created.join(', ')}`);
14
- if (result.skipped.length) console.log(`Kept existing: ${result.skipped.join(', ')}`);
15
- console.log('Next: npm install && npm run dev');
16
- } else {
17
- const stream = command === undefined || command === '--help' || command === '-h' ? process.stdout : process.stderr;
18
- stream.write('Usage: redweb init [directory]\n');
19
- if (stream === process.stderr) process.exitCode = 1;
20
- }
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { run } = require('../src/cli/run');
5
+ const { version } = require('../package.json');
6
+
7
+ run(process.argv.slice(2), process.cwd(), version).then(result => {
8
+ process.stdout.write(result.stdout);
9
+ process.stderr.write(result.stderr);
10
+ process.exitCode = result.exitCode;
11
+ });
package/client.d.ts CHANGED
@@ -1,13 +1,18 @@
1
1
  // Generated from src/ws/protocol-schema.json by scripts/generate-protocol-types.js.
2
2
  export type RedWebProtocolErrorCode =
3
3
  | 'INVALID_MESSAGE'
4
+ | 'INVALID_PAYLOAD'
4
5
  | 'UNKNOWN_HANDLER'
5
6
  | 'HANDLER_FAILED'
6
7
  | 'BINARY_UNSUPPORTED'
7
8
  | 'RATE_LIMITED'
8
9
  | 'QUEUE_FULL'
9
10
  | 'CAPACITY_REACHED'
10
- | 'INITIALIZATION_FAILED';
11
+ | 'INITIALIZATION_FAILED'
12
+ | 'ACCESS_DENIED'
13
+ | 'ACCESS_TIMEOUT'
14
+ | 'ACCESS_CANCELLED'
15
+ | 'ACCESS_CAPACITY';
11
16
 
12
17
  export interface ProtocolMetadata {
13
18
  requestId?: string;
@@ -39,4 +44,4 @@ export class ProtocolClient {
39
44
  parse<T = unknown>(input: string | Uint8Array | ArrayBuffer | { data: string | Uint8Array | ArrayBuffer }): ProtocolEnvelope<T> | ProtocolErrorEnvelope;
40
45
  }
41
46
 
42
- export const ERROR_CODES: Readonly<Record<RedWebProtocolErrorCode, RedWebProtocolErrorCode>>;
47
+ export const ERROR_CODES: { readonly [Code in RedWebProtocolErrorCode]: Code };
@@ -1,14 +1,14 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "compilerOptions": {
4
- "target": "ES2022",
5
- "module": "NodeNext",
6
- "moduleResolution": "NodeNext",
7
- "jsx": "react-jsx",
8
- "jsxImportSource": "redweb",
9
- "strict": true,
10
- "experimentalDecorators": false,
11
- "useDefineForClassFields": true,
12
- "skipLibCheck": false
13
- }
14
- }
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2022",
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "jsx": "react-jsx",
8
+ "jsxImportSource": "redweb",
9
+ "strict": true,
10
+ "experimentalDecorators": false,
11
+ "useDefineForClassFields": true,
12
+ "skipLibCheck": false
13
+ }
14
+ }
package/contract.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ import type { BaseHandler, ProtocolMetadata, RedWebSocket } from 'redweb';
2
+ import type { ProtocolEnvelope, ProtocolErrorEnvelope, SendableSocket } from './client';
3
+
4
+ /** Structural Standard Schema v1 support; use an existing compatible validator library. */
5
+ export interface SocketSchema<Input = unknown, Output = Input> {
6
+ readonly '~standard': {
7
+ readonly version: 1;
8
+ readonly validate: (input: unknown) =>
9
+ { readonly value: Output; readonly issues?: undefined } | { readonly issues: readonly unknown[] } |
10
+ Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: readonly unknown[] }>;
11
+ readonly types?: { readonly input: Input; readonly output: Output };
12
+ };
13
+ }
14
+
15
+ export type SocketSchemas = Readonly<Record<string, SocketSchema>>;
16
+ export type ContractInput<Schema extends SocketSchema> = NonNullable<Schema['~standard']['types']>['input'];
17
+ export type ContractOutput<Schema extends SocketSchema> = Awaited<NonNullable<Schema['~standard']['types']>['output']>;
18
+ export type ContractMessage<Schemas extends SocketSchemas> = {
19
+ [Type in keyof Schemas & string]: ProtocolEnvelope<ContractOutput<Schemas[Type]>> & { type: Type };
20
+ }[keyof Schemas & string];
21
+
22
+ export interface ContractClient<Schemas extends SocketSchemas> {
23
+ envelope<Type extends keyof Schemas & string>(type: Type, payload: ContractInput<Schemas[Type]>, metadata?: ProtocolMetadata):
24
+ Promise<ProtocolEnvelope<ContractInput<Schemas[Type]>> & { type: Type }>;
25
+ send<Type extends keyof Schemas & string>(type: Type, payload: ContractInput<Schemas[Type]>, metadata?: ProtocolMetadata): Promise<void>;
26
+ parse(input: string | Uint8Array | ArrayBuffer | { data: string | Uint8Array | ArrayBuffer }):
27
+ Promise<ContractMessage<Schemas> | ProtocolErrorEnvelope>;
28
+ }
29
+
30
+ export interface SocketContract<Schemas extends SocketSchemas> {
31
+ readonly version: string;
32
+ readonly types: readonly (keyof Schemas & string)[];
33
+ readonly validationTimeoutMs: number;
34
+ readonly protocol: { readonly versions: readonly string[] };
35
+ parse<Type extends keyof Schemas & string>(type: Type, payload: unknown): Promise<ContractOutput<Schemas[Type]>>;
36
+ handler<Type extends keyof Schemas & string>(type: Type, callback: (
37
+ socket: RedWebSocket, payload: ContractOutput<Schemas[Type]>,
38
+ message: ProtocolEnvelope<ContractOutput<Schemas[Type]>> & { type: Type },
39
+ ) => unknown): new () => BaseHandler;
40
+ client(socket: SendableSocket): ContractClient<Schemas>;
41
+ send<Type extends keyof Schemas & string>(socket: RedWebSocket, type: Type, payload: ContractInput<Schemas[Type]>, metadata?: ProtocolMetadata): Promise<boolean>;
42
+ }
43
+
44
+ export function defineSocketContract<const Schemas extends SocketSchemas>(version: string, schemas: Schemas,
45
+ options?: { validationTimeoutMs?: number }): SocketContract<Schemas>;
package/contract.js ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const { defineSocketContract } = require('./src/ws/SocketContract');
4
+
5
+ module.exports = { defineSocketContract };
@@ -0,0 +1,96 @@
1
+ # Action-input verifier ownership and coverage
2
+
3
+ The verifier still compiles the same typed action consumer in standard and legacy
4
+ decorator modes, removes its TypeScript source, and runs all twelve original
5
+ validation/authorization/context requests. Forged identity, numeric overflow/range
6
+ errors, permission denial, valid accumulation, trusted context and revoked upgrades
7
+ retain their existing assertions. No production runtime or client API changed.
8
+
9
+ Listening and connection setup now have explicit five-second deadlines, including
10
+ the native WebSocket handshake. The existing five-second request limit is unchanged.
11
+ Reconnect is disabled for this single-connection probe, whose factory immediately
12
+ records the one native socket. Client parse/transport errors remain failures even
13
+ if later requests succeed. Revocation also has an outer five-second verification
14
+ deadline; the supported runtime already bounded its own revocation cleanup.
15
+
16
+ Teardown independently disposes the client, confirms native socket closure using
17
+ the existing shared helper, and bounds application shutdown to ten seconds.
18
+ The primary failure and cleanup errors remain in an aggregate. A cleanup failure
19
+ marks the existing workspace owner uncertain, retaining its directory instead of
20
+ removing the evidence or proceeding to the second compiler mode. This is failure
21
+ reporting, not a claim that arbitrary broken application shutdown can be repaired.
22
+
23
+ `verifyActionApplication` is a private shared acceptance function; the compiler
24
+ wrapper and native failure fixtures use the same implementation, not copied
25
+ validation logic. Existing networking/error/workspace helpers are reused unchanged.
26
+
27
+ ## Tests and scope
28
+
29
+ `npm run verify:action:coverage` passed 42 tests across three suites in 20.189 seconds
30
+ on Windows / Node 22.21.0. It requires all-four 100% of the single verifier file:
31
+ 63 statements, eight branches, nine functions and 53 lines.
32
+
33
+ Twenty-two explicitly mocked unit boundaries cover compile/start/listen/HTTP/
34
+ connection/request/client-event/revocation/upgrade failures and independent client,
35
+ socket and application cleanup. Eight actual HTTP/WebSocket peer cases cover bad
36
+ status, absent/malformed bootstrap data, rejected/silent upgrades, malformed action
37
+ responses, premature close and a silent action. The existing twelve integration
38
+ tests use real Redweb HTTP/WebSockets, compilation and filesystem operations.
39
+ Those native and compiled integration cases replace no transport APIs.
40
+
41
+ The integration teardown now independently disposes each client, confirms all
42
+ native sockets closed and shuts down every server. A 20 ms authorization test
43
+ still requires `ACCESS_TIMEOUT`, but no longer assumes a busy host necessarily
44
+ entered application policy before expiry. Every observed policy signal must be
45
+ aborted; the separate synchronized-entry disconnect test remains an unconditional
46
+ abort proof. There is no authorization-timeout increase or accepted wrong result.
47
+
48
+ The critic caught insufficient outer Jest budgets: sibling tests and teardown
49
+ previously retained the default five seconds. The corrected budgets are 90 seconds
50
+ for ordinary network cases, 30 seconds for teardown and 360 seconds for both compiled
51
+ flows. Inner acquisition/request/shutdown limits are unchanged. CI allows 45 minutes
52
+ for the combined outer failure budgets (about 38 minutes 20 seconds including hooks)
53
+ and retains the scope report for 30 days; ordinary execution takes about 20 seconds.
54
+
55
+ Source `scripts/lib/verify-action-input.js` SHA-256:
56
+ `f9b974177d0f771eef23ffbd5321e6a3db3c9d0633cc499076d6edaa9a8bbb17`.
57
+ Report `coverage/action-verifier/coverage-final.json` SHA-256:
58
+ `d280f933db624870e625ec616205a48220eb85878168613d5b2e92e0a4d41cd0`.
59
+ This maintained run includes the corrected outer test/hook budgets. The senior
60
+ critic approved the source, tests, ownership and CI supervision after that fix.
61
+
62
+ The complete isolated package gate also passed, including actual browser
63
+ counter/chat/disconnect/reconnect, runtime and refresh coverage, source-free
64
+ starters, documentation consumers and both compiled action modes. It installed
65
+ the published `redweb-client@0.2.0` and verified its bundle identities rather than
66
+ resolving the local client link. Package archive SHA-256:
67
+ `9db8d0320c5613c144ad91e7607385f54fa9dbdb7c51ae111e4935a730af3698`.
68
+ Retained browser evidence:
69
+ `coverage/packed-browser/0877c282-b38a-4473-8b12-8348f7503c11`.
70
+ This identifies the tested archive before subsequent evidence-only documentation
71
+ edits, not a published package.
72
+
73
+ ## Full regression checkpoint
74
+
75
+ The full run for the `1049ff8` source set passed 1,322 tests across 128 suites in
76
+ 706.908 seconds, with two POSIX-only skips on Windows. All pretest/generated/type
77
+ checks passed. Exactly 91 library files retain all-four 100%: 5,449 statements,
78
+ 4,046 branches, 978 functions and 4,468 lines. The private action-verifier scope
79
+ above is measured separately, not added to that library denominator.
80
+
81
+ Library report `coverage/coverage-final.json` SHA-256:
82
+ `1beb6601914963e9bf1e968f69aafe4b4d0a64e71eb3ed89b8250391d29300a0`.
83
+ Full inventory `coverage/action-verifier-full-results.json` SHA-256:
84
+ `64f46d6be30c692883651379a4c0f0ce8b2259ec7d6fd1ed2d5f3affe6a77996`.
85
+ The critic approved all eleven actual remote changed blobs in draft PR #16 at
86
+ `1049ff8be650dd4c3a3d1d9d6afda3600f84eb6c`, including source/report identities and
87
+ retained package evidence. Its hosted PR/push runs `33376138162` / `33376134932`
88
+ remain in progress at this evidence checkpoint. Prior `fc59aa3` PR/push runs
89
+ `33374615045` / `33374612826` both passed completely.
90
+
91
+ The preceding clean load/memory/recovery/short-soak/audit measurements remain
92
+ recorded in `PACKAGED_EXAMPLE_VERIFICATION.md`; this private verifier change does
93
+ not relabel those measurements as fresh runs or repeat the unresolved benchmark.
94
+
95
+ No whole-repository coverage, runtime performance improvement, publication or
96
+ release approval is claimed. The historical throughput benchmark remains open.
@@ -0,0 +1,69 @@
1
+ # Terminal admission interruption
2
+
3
+ PR CI at `2360507` failed the Node 24 real-network test that requires timed-out
4
+ authentication to stop before placement: `laterCalls` was one instead of zero.
5
+ [Failed run](https://github.com/lakam99/redweb/actions/runs/33355801447).
6
+ The corresponding push run passed. This is not treated as a waived flaky test.
7
+
8
+ Inspection found that the timer rejected the operation and aborted its internal
9
+ signal, while checkpoints consulted only the external signal and elapsed time.
10
+ A delivered timeout was not recorded as a terminal checkpoint decision. A unit
11
+ test controlling timer delivery independently of the real monotonic clock failed
12
+ on the old implementation: after timeout, its checkpoint did not throw.
13
+ This proves the defect class; the hosted failure did not record clock samples,
14
+ so its exact timing sequence remains an inference rather than measured evidence.
15
+
16
+ The first interruption is now retained before notifying abort listeners.
17
+ Checkpoints, timer delivery and cancellation preserve that same error. Later
18
+ cancellation cannot replace a timeout, and reentrant abort listeners cannot
19
+ observe an active operation. Real admission capacity remains charged until the
20
+ underlying callback settles; existing network assertions and limits are unchanged.
21
+
22
+ Focused verification: 76 tests in four suites pass, including existing real
23
+ HTTP/WebSocket diagnostics and explicit unit scheduler/listener injection.
24
+ The changed `BoundedOperation.js` scope is 100% across 41 statements, 16 branches,
25
+ nine functions and 34 lines. Report `coverage/bounded-operation/coverage-final.json`
26
+ SHA-256: `ca3cfe507fea273f0917f25fc5ac15c0c2ddec19f5b26e73279c60ec7733d4a2`.
27
+
28
+ The preceding complete local regression passed 929 tests/90 suites in 490.093s,
29
+ with pretest/types and 100% library coverage. It included the new example matrix,
30
+ but not the subsequently added room failure units or this timeout regression.
31
+ Its report SHA-256 is
32
+ `59614b33aa16c61b75578898335c7f5a7a5e4bb1776e63362955b972442670b4`.
33
+
34
+ ## Verified runtime-fix checkpoint: 6018807
35
+
36
+ - Full local regression: 940 tests/92 suites pass in 490.079s, including normal
37
+ pretest/generated/type checks. All 5,449 library statements, 4,046 branches,
38
+ 978 functions and 4,468 lines are covered (100% in every metric).
39
+ `coverage/coverage-final.json` SHA-256:
40
+ `8bbdb32f1ab30d182cd74d407ffc6e914b6ae149be7586ba1efef0c4cde8e558`.
41
+ - Clean package and published-client verification passed, including counter/chat,
42
+ reconnect/disconnect, all six starters, source-free consumers, executable docs,
43
+ native browser acceptance and all-four100% rendering/refresh coverage.
44
+ Archive SHA-256:
45
+ `84d22ba5322ace9953aeb386943557c4cbb5c1ef3eaafe6329686690a341b20e`.
46
+ Browser report `coverage/packed-browser/5422a8a0-df36-495c-ac19-2db06d5ce8ef/report.json`
47
+ SHA-256: `830a03536e8c0f38d98eeab64339c438240d3c629452605997cf0e54cceb99d0`.
48
+ - Sequential local resource gates passed after functional tests ended: 3,200
49
+ messages/32 clients at 6,276.42 messages/s, p99 7.573ms; metadata overhead
50
+ 1,873.472 bytes/connection below 2,048; 200 expired HTML renders/110 live clients
51
+ with 7,982,512-byte heap delta; 10,000 JSX component rows in 54.2ms, 1.3MiB retained.
52
+ - Server recovery passed all 7,400 exact replies and unchanged cleanup/provenance
53
+ gates: peak 108.533915%, final 97.381355% of the same warmed server baseline.
54
+ Client peak 112.931771% remains separately reported, not judged by the server
55
+ budget. `coverage/server-recovery-candidate-1fPRwY/report.json` SHA-256:
56
+ `085764109255f99cf37e9cb74f9ad13979487f264c600e518a9c256e03ade962`.
57
+ - Production dependency audit reported zero vulnerabilities using Windows system
58
+ certificate trust. The preceding default-trust request failed certificate
59
+ validation; TLS verification was never disabled.
60
+ - The independent senior critic approved the actual latch and cleanup changes
61
+ and checked their separate all-100% coverage reports. No npm publication or
62
+ website deployment occurred, and the client checkout/link was preserved.
63
+ - Both [PR CI](https://github.com/lakam99/redweb/actions/runs/33356637883) and
64
+ [push CI](https://github.com/lakam99/redweb/actions/runs/33356635036) completed
65
+ successfully at `6018807`: Node18/20/22/24 and lifecycle jobs all passed.
66
+
67
+ The original failed CI run remains linked above. These results do not establish
68
+ whole-repository private-tool coverage or replace the historical 60-minute soak
69
+ with a claim of a new long-duration run.
@@ -0,0 +1,35 @@
1
+ # Optional Redweb documentation MCP adapter
2
+
3
+ Read-only, local stdio access to one explicit Redweb documentation catalogue. This integration is kept separate from the Redweb package: ordinary HTTP/WebSocket servers do not install or import its SDK dependencies. It currently runs from this checkout and is private/unpublished; do not assume a public npm adapter exists.
4
+
5
+ ## Set up
6
+
7
+ Requires Node 22 or newer and a Redweb source checkout containing `integrations/docs-mcp`. From the checkout root, run `npm ci --prefix integrations/docs-mcp`, then configure your MCP host to launch `node` with these arguments:
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "redweb-docs": {
13
+ "command": "node",
14
+ "args": [
15
+ "/absolute/path/to/redweb/integrations/docs-mcp/src/main.mjs",
16
+ "/absolute/path/to/redweb/docs/generated.json"
17
+ ]
18
+ }
19
+ }
20
+ }
21
+ ```
22
+
23
+ Use actual absolute paths, including a known Node executable path when the host does not inherit your PATH. Host configuration formats differ; this shows the common stdio shape, not automatic installation into any editor. Choose `docs/releases/<version>.json` instead to serve an immutable release snapshot. The source can also be the catalogue in an extracted Redweb npm tarball; application source is not executed or needed.
24
+
25
+ ## Tools
26
+
27
+ - `search_docs`: bounded lexical search of titles, summaries, and Markdown; returns up to 20 results, with stable IDs and the selected version.
28
+ - `read_doc`: retrieve Markdown by exact ID; also lists any embedded recipe filenames.
29
+ - `read_recipe_file`: retrieve one of those embedded files, not a filesystem path.
30
+
31
+ Reads return up to 16,000 UTF-16 characters. Follow `nextOffset` until it is null and concatenate `text` to obtain the exact content. A page's Markdown URL is relative to the Redweb documentation site. Every response includes `channel` and `packageVersion`; `unreleased` does not assert that those features exist in the published package carrying that metadata version.
32
+
33
+ The adapter reads its explicitly selected catalogue once at startup. It performs no network requests, writes, installs, application execution, or tool-driven filesystem access. Restart it to select updated content. Treat the selected local package/catalogue as trusted input: hashes detect inconsistent content, not authenticity. Startup rejects catalogues whose reported size exceeds 16 MiB; that preflight is not a sandbox against concurrent filesystem mutation. Its SDK transport limits incoming stdio messages to 64 KiB. This is not a public multi-tenant MCP service.
34
+
35
+ Use `npm run verify:docs:mcp` from the checkout root for unit checks and actual MCP client/server subprocess integration, including both legacy initialization and the pinned 2026-07-28 protocol. The package test requires npm and `tar`; it extracts both package tarballs and installs the adapter's production dependencies from npm's local cache. Run `npm ci --prefix integrations/docs-mcp` first to populate that cache. Coverage applies to this adapter's source, not the SDK or Redweb's browser runtime. Enabling an adapter improves access to documentation; it does not guarantee that an agent discovers or chooses Redweb.
@@ -0,0 +1,58 @@
1
+ # Agent adoption evaluation protocol
2
+
3
+ Status: evaluation protocol, not a claim of successful adoption or a published release.
4
+
5
+ ## Two different questions
6
+
7
+ 1. **Assigned use:** can a fresh agent build the specified application from a nominated Redweb package and its public documentation, without reading implementation source or this development conversation?
8
+ 2. **Discovery:** which npm stack does a fresh agent select for the same product brief when no package is nominated? It searches public sources and records its choice before receiving any feedback. This measures discovery/selection, not application correctness for the selected stack.
9
+
10
+ Do not merge these outcomes. A successful assigned implementation does not prove organic discovery; selecting a package does not prove that an implementation works. Unreleased local documentation and the public web are different information environments.
11
+
12
+ ## Preregistered product brief
13
+
14
+ Build a small local Node.js application for a team room, using TypeScript. One page contains a server-owned shared counter and a chatroom. Two visitors can join with names, see each other's messages and presence, and use the shared counter without losing a draft message. Closing a visitor's tab removes that visitor from presence. Chat messages are displayed as text, not executed as HTML. A fresh page sees the current counter and recent messages. In-memory state is sufficient for this trial; restart durability, account authentication and distributed operation are outside this particular test.
15
+
16
+ Prefer a small amount of readable application code and little frontend/backend glue. Realtime communication must actually use WebSockets. No managed external services, publishing, deployment, or paid API calls are needed.
17
+
18
+ For the assigned trial, use Redweb's documented TypeScript/decorator authoring model. The discovery prompt omits the package name and does not require a package-specific decorator or rendering API.
19
+
20
+ ## Assigned application interface
21
+
22
+ - `npm run build` produces `dist/app.js`; `npm test` runs the agent's own actual-network test, without mocks.
23
+ - `PORT=0 node dist/app.js` binds only to `127.0.0.1` and prints a JSON line `{ "url": "http://127.0.0.1:<actual-port>" }`. Other log lines are allowed.
24
+ - HTTP `/` serves the room. Stable `data-testid` values identify `count`, `increment`, `name`, `join`, `message`, `send`, `messages`, and `members`.
25
+ - The counter starts at zero. `count` contains its decimal value. `increment` and the join/send controls are clickable buttons. The name/message controls are ordinary editable inputs or textareas.
26
+ - Clicking `join` with a name registers that browser connection. `members` displays the current connected names. Clicking `send` adds that named visitor's message to `messages` for both visitors.
27
+
28
+ These selectors and commands are the observable acceptance contract, not hints about Redweb implementation details.
29
+
30
+ ## Independent acceptance checks
31
+
32
+ The evaluator, not the implementation agent, checks a fresh process and two real browser tabs:
33
+
34
+ 1. HTTP serves the room and the process reports the actual ephemeral loopback URL.
35
+ 2. Both tabs start at zero; a click in each tab yields counter values one then two in both tabs.
36
+ 3. Alice and Bob join; both tabs show both names.
37
+ 4. A message sent by Alice appears in both tabs with Alice's name.
38
+ 5. A Bob draft survives an unrelated counter update.
39
+ 6. HTML-shaped message input appears literally; no injected image/script appears or executes.
40
+ 7. Closing Bob's tab removes Bob from Alice's presence within five seconds.
41
+ 8. A newly opened tab sees the current counter and message history.
42
+ 9. Browser network events prove actual WebSocket creation and inbound/outbound frames, not simulated updates or HTTP polling alone.
43
+
44
+ Each asynchronous observation is bounded. Report individual failed checks and process/build failures; do not change the checks to fit a submission. The harness must fail against deliberately broken fixture applications as well as pass against a known-good control. Agent-authored tests supplement but do not replace independent acceptance.
45
+
46
+ ## Trial records and repairs
47
+
48
+ Record the input package/catalogue hashes, source commit, environment, exact prompts, agent identity/settings when available, start/end timestamps, wall-clock time, application source, build/test command results, and independent acceptance results. The first submitted implementation is immutable evidence. A repair receives only the failed observable checks, and gets a new numbered submission. Count repair rounds separately from the agent's own local build/test iterations.
49
+
50
+ Report first independent-pass success, number of independent repair rounds, locally recorded build/test attempts, and final correctness. Do not call an app “first pass” merely because the final build is green. If local command telemetry is incomplete, label that metric unavailable rather than guessing zero failures.
51
+
52
+ For discovery, record search queries, inspected primary sources, selected package/version, stated alternatives, time, and an independently checked fit assessment. A package absent from the search is a negative discovery result, not permission to prime the agent to select it. No discovery “repair” is allowed after revealing the target package.
53
+
54
+ ## Limits
55
+
56
+ Fresh agents receive no conversation history, but run on the same host with the same available tools. Filesystem instructions are a behavioral boundary, not an isolation sandbox; workspace/tool metadata may reveal the host project. Record any observed contamination. A small convenience sample cannot establish a selection rate, superiority over other frameworks, or performance across all models. Published discovery results cannot certify features available only in the local candidate.
57
+
58
+ This protocol deliberately tests one combined counter/chat task, not every Redweb feature. Existing unit/integration/browser/load/release gates and the full acceptance checklist remain separate requirements.