react-native-roku 0.0.0-stage → 0.2.0-preview.3

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 (200) hide show
  1. package/CHANGELOG.md +328 -0
  2. package/CONTRIBUTING.md +34 -0
  3. package/LICENSE +21 -0
  4. package/NOTICE.md +10 -0
  5. package/README.md +66 -2
  6. package/bin/react-native-roku.mjs +91 -0
  7. package/build/assets.cjs +311 -0
  8. package/build/assets.d.cts +50 -0
  9. package/build/compatibility.d.mts +40 -0
  10. package/build/compatibility.mjs +272 -0
  11. package/build/dev.d.mts +34 -0
  12. package/build/dev.mjs +297 -0
  13. package/build/devWorkspace.d.mts +11 -0
  14. package/build/devWorkspace.mjs +86 -0
  15. package/build/device.d.mts +47 -0
  16. package/build/device.mjs +310 -0
  17. package/build/environment.d.mts +29 -0
  18. package/build/environment.mjs +144 -0
  19. package/build/esbuild.d.mts +5 -0
  20. package/build/esbuild.mjs +118 -0
  21. package/build/fontVariants.d.mts +27 -0
  22. package/build/fontVariants.mjs +424 -0
  23. package/build/frontend.d.mts +52 -0
  24. package/build/frontend.mjs +75 -0
  25. package/build/identity.mjs +45 -0
  26. package/build/index.d.mts +22 -0
  27. package/build/index.mjs +87 -0
  28. package/build/intl.mjs +121 -0
  29. package/build/metro.cjs +38 -0
  30. package/build/metro.d.cts +37 -0
  31. package/build/metroFrontend.mjs +222 -0
  32. package/build/metroMetadata.mjs +119 -0
  33. package/build/metroModules.mjs +397 -0
  34. package/build/metroRefresh.d.mts +64 -0
  35. package/build/metroRefresh.mjs +346 -0
  36. package/build/metroTransformer.cjs +146 -0
  37. package/build/nativeTextMemo.mjs +296 -0
  38. package/build/nativewind.d.mts +9 -0
  39. package/build/nativewind.mjs +92 -0
  40. package/build/project.d.mts +111 -0
  41. package/build/project.mjs +615 -0
  42. package/build/reactCompiler.mjs +113 -0
  43. package/build/reactProfile.cjs +35 -0
  44. package/build/refreshRuntime.mjs +187 -0
  45. package/build/refreshSourceMap.mjs +53 -0
  46. package/build/release.mjs +99 -0
  47. package/build/resolution.d.mts +3 -0
  48. package/build/resolution.mjs +25 -0
  49. package/build/surfaces.d.mts +1 -0
  50. package/build/surfaces.mjs +42 -0
  51. package/build/testing/node.d.mts +29 -0
  52. package/build/testing/node.mjs +106 -0
  53. package/build/yoga.d.mts +8 -0
  54. package/build/yoga.mjs +186 -0
  55. package/compatibility/public-api.json +327 -0
  56. package/compatibility/registry.json +2258 -0
  57. package/config/release.json +15 -0
  58. package/config/toolchain.json +34 -0
  59. package/docs/compatibility.md +813 -0
  60. package/docs/getting-started.md +460 -0
  61. package/docs/maintenance.md +368 -0
  62. package/docs/qualification.md +241 -0
  63. package/docs/standalone-testing.md +56 -0
  64. package/examples/hello-roku/README.md +35 -0
  65. package/examples/hello-roku/package.template.json +31 -0
  66. package/examples/hello-roku/pnpm-workspace.yaml +11 -0
  67. package/examples/hello-roku/roku.config.json +22 -0
  68. package/examples/hello-roku/src/App.tsx +54 -0
  69. package/examples/hello-roku/src/Catalog.tsx +200 -0
  70. package/examples/hello-roku/src/assets.d.ts +16 -0
  71. package/examples/hello-roku/src/catalog-cover.png +0 -0
  72. package/examples/hello-roku/tsconfig.json +1 -0
  73. package/examples/hello-roku/tsconfig.react.json +1 -0
  74. package/native/components/RNRAppControl.brs +215 -0
  75. package/native/components/RNRAppControl.xml +13 -0
  76. package/native/components/RNRDeviceFacts.brs +19 -0
  77. package/native/components/RNRDeviceFacts.xml +9 -0
  78. package/native/components/RNRDeviceFactsTask.brs +74 -0
  79. package/native/components/RNRDeviceFactsTask.xml +9 -0
  80. package/native/components/RNRTextRaster.brs +15 -0
  81. package/native/components/RNRTextRaster.xml +9 -0
  82. package/native/components/RNRTextRasterTask.brs +77 -0
  83. package/native/components/RNRTextRasterTask.xml +9 -0
  84. package/native/manifest.json +7 -0
  85. package/package.json +183 -3
  86. package/src/animation/clock.ts +10 -0
  87. package/src/animation/derivedValue.ts +163 -0
  88. package/src/animation/legacyAnimated.ts +255 -0
  89. package/src/animation/reanimated.ts +243 -0
  90. package/src/animation/sharedValue.ts +285 -0
  91. package/src/animation/worklets.ts +23 -0
  92. package/src/application/AppRegistry.ts +31 -0
  93. package/src/application/mountApplication.ts +136 -0
  94. package/src/graphics/BitmapLayer.tsx +68 -0
  95. package/src/graphics/RoundedBorder.tsx +116 -0
  96. package/src/graphics/TextRasterCache.ts +259 -0
  97. package/src/graphics/gradient.ts +37 -0
  98. package/src/graphics/inlineRaster.ts +85 -0
  99. package/src/graphics/png.ts +77 -0
  100. package/src/graphics/rasterPixels.ts +89 -0
  101. package/src/graphics/surfaces.ts +105 -0
  102. package/src/graphics/textRaster.types.ts +60 -0
  103. package/src/graphics/textRasterGeometry.ts +116 -0
  104. package/src/host/host.types.ts +57 -0
  105. package/src/index.ts +22 -0
  106. package/src/interop/nativewind.ts +2 -0
  107. package/src/layout/FontResources.ts +252 -0
  108. package/src/layout/affine.ts +89 -0
  109. package/src/layout/flexLayout.ts +398 -0
  110. package/src/layout/fontFaces.d.mts +19 -0
  111. package/src/layout/fontFaces.mjs +85 -0
  112. package/src/layout/fontVariants.d.mts +2 -0
  113. package/src/layout/fontVariants.mjs +8 -0
  114. package/src/layout/inlineParagraph.ts +158 -0
  115. package/src/layout/inlineText.ts +68 -0
  116. package/src/layout/layoutReuse.ts +117 -0
  117. package/src/layout/nativeNodeFields.ts +179 -0
  118. package/src/layout/preparedFields.ts +78 -0
  119. package/src/layout/textLayout.ts +138 -0
  120. package/src/layout/transform.ts +113 -0
  121. package/src/media/SceneGraphAudio.ts +161 -0
  122. package/src/media/SceneGraphVideo.ts +167 -0
  123. package/src/media/audioSession.ts +84 -0
  124. package/src/media/index.ts +2 -0
  125. package/src/media/videoErrorDetails.ts +40 -0
  126. package/src/media/videoSession.ts +136 -0
  127. package/src/navigation/RouterStore.ts +244 -0
  128. package/src/navigation/expoRouter.ts +115 -0
  129. package/src/react-native/NativeInput.ts +494 -0
  130. package/src/react-native/NativeSystemState.ts +95 -0
  131. package/src/react-native/accessibility.ts +265 -0
  132. package/src/react-native/activityIndicator.ts +72 -0
  133. package/src/react-native/compilerPressable.ts +26 -0
  134. package/src/react-native/createNativeRoot.ts +2126 -0
  135. package/src/react-native/directionalFocus.ts +55 -0
  136. package/src/react-native/environment.ts +275 -0
  137. package/src/react-native/flatList.ts +1001 -0
  138. package/src/react-native/flatListViewability.ts +231 -0
  139. package/src/react-native/focusEvents.ts +85 -0
  140. package/src/react-native/image.ts +247 -0
  141. package/src/react-native/index.ts +54 -0
  142. package/src/react-native/interactionManager.ts +76 -0
  143. package/src/react-native/keyboard.ts +60 -0
  144. package/src/react-native/linearGradient.ts +94 -0
  145. package/src/react-native/modal.tsx +148 -0
  146. package/src/react-native/nativeHostContext.ts +80 -0
  147. package/src/react-native/nativeModules.ts +86 -0
  148. package/src/react-native/nativeRoot.types.ts +22 -0
  149. package/src/react-native/nativeViewHandle.ts +191 -0
  150. package/src/react-native/nativewindPressable.ts +38 -0
  151. package/src/react-native/panResponder.ts +73 -0
  152. package/src/react-native/primitives.ts +685 -0
  153. package/src/react-native/safeArea.ts +76 -0
  154. package/src/react-native/scrollView.ts +289 -0
  155. package/src/react-native/styleInterop.ts +8 -0
  156. package/src/react-native/styleSheet.ts +54 -0
  157. package/src/react-native/textInput.ts +334 -0
  158. package/src/react-native/unsupported.ts +25 -0
  159. package/src/renderer/SceneRoot.ts +1006 -0
  160. package/src/scene/SdkDeviceFacts.ts +151 -0
  161. package/src/scene/SdkDeviceServices.ts +72 -0
  162. package/src/scene/SdkSceneGraph.ts +124 -0
  163. package/src/scene/SdkTextEntry.ts +321 -0
  164. package/src/scene/SdkTextMetrics.ts +136 -0
  165. package/src/scene/SdkTextRasterTransport.ts +191 -0
  166. package/src/scene/SdkWebTransport.ts +122 -0
  167. package/src/scene/createRokuHost.ts +213 -0
  168. package/src/scene/sceneGraph.types.ts +38 -0
  169. package/src/services/DeviceServices.ts +53 -0
  170. package/src/services/RegistryStorage.ts +85 -0
  171. package/src/services/RokuKeySession.ts +29 -0
  172. package/src/services/asyncStorage.ts +23 -0
  173. package/src/services/base64.ts +52 -0
  174. package/src/services/crypto.ts +18 -0
  175. package/src/services/expoConstants.ts +11 -0
  176. package/src/services/expoLinking.ts +12 -0
  177. package/src/services/expoStatusBar.ts +4 -0
  178. package/src/services/installWebRuntime.ts +105 -0
  179. package/src/services/intlEnglish.ts +54 -0
  180. package/src/services/languageRuntime.ts +65 -0
  181. package/src/services/nativeTimers.ts +96 -0
  182. package/src/services/secureStore.ts +23 -0
  183. package/src/services/textEntryRequest.ts +22 -0
  184. package/src/services/utf8.ts +57 -0
  185. package/src/services/webRuntime.ts +346 -0
  186. package/src/testing/CanvasResources.ts +141 -0
  187. package/src/testing/CanvasSceneGraph.ts +496 -0
  188. package/src/testing/CanvasTextEntry.ts +237 -0
  189. package/src/testing/PreviewTextObservations.ts +82 -0
  190. package/src/testing/RecordingSceneGraph.ts +136 -0
  191. package/src/types/normalize-colors.d.ts +4 -0
  192. package/src/vector/dynamicSvg.tsx +226 -0
  193. package/src/vector/svg.ts +222 -0
  194. package/src/vector/svg.types.ts +4 -0
  195. package/src/vector/svgElements.ts +58 -0
  196. package/src/vector/svgKey.d.mts +4 -0
  197. package/src/vector/svgKey.mjs +16 -0
  198. package/src/vector/svgPath.ts +157 -0
  199. package/src/vector/svgPixels.ts +133 -0
  200. package/tsconfig.consumer.json +29 -0
@@ -0,0 +1,368 @@
1
+ # Maintaining react-native-roku
2
+
3
+ This experimental platform package is published on npm. Keep it independent of any
4
+ application's routes, server contracts, query policy and focus topology. The
5
+ React application owns those decisions; this package owns renderer and native
6
+ mechanics. The developer preview uses the MIT license.
7
+
8
+ ## Setup and checks
9
+
10
+ Use the Node version in `.node-version` and pnpm from `packageManager`:
11
+
12
+ ```sh
13
+ pnpm setup:repo
14
+ pnpm run doctor
15
+ pnpm check:fast
16
+ pnpm check
17
+ ```
18
+
19
+ `setup:repo` installs the frozen graph and checks Node, pnpm, macOS/Linux, ZIP
20
+ tools, Chromium and the pinned SDK/runtime cohort. It does not install system
21
+ software, change shell configuration, access a device or publish. Use
22
+ `ROKU_TEST_CHROMIUM` for a nonstandard Chrome/Chromium executable. `pnpm setup`
23
+ is pnpm's own global setup command; the repository command is `setup:repo`.
24
+
25
+ `check:fast` checks formatting, React and SDK types, host/build contracts,
26
+ package boundaries, public exports, toolchain consistency and the adapter
27
+ inventory. Package checks also parse authored BrightScript helpers before
28
+ packing or consumer installation; the SDK lane separately parses the generated
29
+ channel. `check` additionally qualifies independent packed consumers, an
30
+ official SDK channel, and a real browser edit/error/fix/activation journey.
31
+ It also runs the optional Metro build, reload and Fast Refresh lanes locally. The exact-archive candidate
32
+ runner used by runtime adoption checks all six lane reports against that same
33
+ archive hash.
34
+ Intentional malformed source in the browser journey produces an expected
35
+ compiler error before recovery. Both consumer installers allow metadata fetches
36
+ on a fresh machine instead of assuming the maintainer's offline cache exists.
37
+
38
+ GitHub Actions runs the quick Ubuntu lane on main pushes and pull requests,
39
+ with a five-minute job limit. A manual workflow dispatch with `full_qualification` enabled runs all six lanes
40
+ against one packed archive per host, then verifies the seal. Linux and macOS
41
+ have separate evidence. Routine CI also checks source independence and runs the
42
+ offline navigation regressions. The standalone release workflow prepares its own
43
+ exact archive before a separately authorized publication.
44
+ A workflow definition is not execution evidence; retain the run and artifact
45
+ records for any claimed remote pass.
46
+
47
+ Hosted Linux jobs remove unused preinstalled toolchains/container images and
48
+ install the qualification owner's Python/lsof/ZIP prerequisites before checks.
49
+ The accepted main's November 11 fast job refused its storage startup floor
50
+ before running checks; runner preparation funds that same unchanged gate.
51
+ Local execution does not assert a subsequent remote pass.
52
+
53
+ ## Qualification storage
54
+
55
+ Under the owner lock, admission identifies terminal workspaces eligible for
56
+ retirement. An ordinary launch with none to retire uses one fresh retained-byte
57
+ measurement. A retirement still requires admission before mutation and a fresh
58
+ measurement after it. Cold-history maintenance that writes a cycle record,
59
+ inspects enrolled archives, or defers after an error also invalidates its
60
+ measurement. Startup receipts distinguish retirement discovery from compaction.
61
+
62
+ Maintainer tests require Python 3.9 or later. `pnpm test`, `check:fast`, `check`,
63
+ and all six qualification CLIs
64
+ delegate to one storage owner before launching work. Public consumer builds do
65
+ not require this maintainer helper. `pnpm check` packs once, qualifies all six
66
+ lanes against that archive and verifies the sealed result.
67
+
68
+ Defaults reserve 20 GiB of available disk, require 32 GiB before starting,
69
+ limit a run to 12 GiB of tracked allocated files, and limit managed retained
70
+ outputs/history to 20 GiB. Explicitly tracked existing reuse inputs and stable
71
+ generated outputs also count. Another run must fit within the retained budget too.
72
+ Only one managed heavy run can hold the shared lock. Available disk is polled
73
+ every second; file allocation is sampled every five polls. These checks cannot
74
+ prevent unrelated processes from filling the disk between polls.
75
+
76
+ An owned store may retain an explicit workspace approval in `policy.json`.
77
+ Independent processes resolve that file through this same owner; other stores
78
+ keep the conservative defaults. The file binds the canonical store, workspace,
79
+ account UID, retained ceiling and authorization. Malformed, foreign or symlinked
80
+ configuration fails closed. Configure only an explicitly approved ceiling, while
81
+ the heavy lock is free and all prior owners are terminal:
82
+
83
+ ```sh
84
+ python3 scripts/qualification_storage.py configure --store=/absolute/workspace/.react-native-roku-qualification --workspace=/absolute/workspace --history-limit-gib=64 --authorization='Owner-approved qualification capacity'
85
+ python3 scripts/qualification_storage.py status --store=/absolute/workspace/.react-native-roku-qualification
86
+ python3 scripts/qualification_storage.py admit --project="$PWD" --store=/absolute/workspace/.react-native-roku-qualification --run-limit-gib=12 --retained-headroom-gib=2
87
+ ```
88
+
89
+ The configuration ceiling is **80 GiB total retained**, with **12 GiB maximum
90
+ per run**, **20 GiB physical reserve**, and **32 GiB startup floor**. Record any
91
+ workspace-specific approval through `configure`. New stores retain the 20 GiB
92
+ default.
93
+ It is local workspace state, not a repository-wide default. Keep it
94
+ with the shared store across sessions. `status`, `admit`, `run`, `archive` and
95
+ `restore` report the effective policy and its provenance. Original historical
96
+ state policies are never rewritten. Explicit Python `Policy` callers remain
97
+ available for separately authorized task policies and small test fixtures, and
98
+ are identified as `explicit-policy`.
99
+
100
+ Admission requires the larger of the startup floor and reserve plus the complete
101
+ run/recovery reservation. Retained usage plus the run reservation and optional
102
+ `--retained-headroom-gib` must fit the ceiling. Before a dependency transaction,
103
+ budget its complete recovery schedule and use at least **2 GiB** additional
104
+ retained headroom outside the run reservation. `admit` is a read-only locked
105
+ snapshot, not a reservation; `run` rechecks while acquiring the actual owner:
106
+
107
+ ```sh
108
+ python3 scripts/qualification_storage.py run --project="$PWD" --store=/absolute/workspace/.react-native-roku-qualification --run-limit-gib=12 --retained-headroom-gib=2 --kind=benchmark --dynamic="$PWD/.local/benchmarks" -- COMMAND ARGUMENTS
109
+ ```
110
+
111
+ Allocation is measured freshly; no cross-run usage cache authorizes admission.
112
+ The walker visits overlapping namespaces once, counts actual file blocks with
113
+ hard-link deduplication, and refuses unreadable trees. It does not follow links.
114
+ Under the held lock, startup checks admission before compaction and again
115
+ afterward. The latter includes the full run/recovery budget, so compaction does
116
+ not also repeat a weaker retained-only scan immediately before it. Standalone
117
+ compaction still enforces its own retained ceiling; archive overlap checks remain.
118
+
119
+ Owner records retain `startupTiming`: total startup duration and inclusive phase
120
+ durations for retained-root discovery, allocation, compaction, quiescence,
121
+ archival and initial run allocation. Nested phases overlap; do not sum them as
122
+ wall-clock time. `admit` returns `timingPhases` on success. Refusals state the
123
+ available/required capacity or retained/run/recovery/ceiling values and shortfall.
124
+ The tiny isolated CLI test fixtures supply synthetic free space explicitly;
125
+ production commands and production floor tests keep the actual policy.
126
+
127
+ Declare every output/reuse namespace needed by that schedule using the existing
128
+ `--track`, `--dynamic` and `--evidence` options. Children inherit the actual owner's
129
+ session, temporary namespace, recorded policy and heavy lock; they cannot start
130
+ a second owner or enlarge its budget. The canonical Python session validator
131
+ checks nonce, terminal status, canonical paths, live process ancestry and lock
132
+ ownership. The JavaScript bootstrap uses that validator too. Never construct
133
+ session credentials. Configuration is captured as an immutable run input.
134
+
135
+ The owned store defaults to `../.react-native-roku-qualification`, outside both producer
136
+ and consumer checkouts; `RNR_QUALIFICATION_STORAGE_ROOT` can select another
137
+ owned location. Temporary consumers and browser profiles use its `workspaces`
138
+ directory. Successful sealed cohorts retain their evidence and retire their
139
+ temporary environments and unretained dependency caches. Failed/unsealed work
140
+ keeps its inputs; earlier raw temporary environments are compacted when their
141
+ entry types can be archived losslessly. A terminal test fixture containing a
142
+ symbolic link is compacted using versioned link metadata without following or
143
+ flattening its target. FIFOs, sockets and other unsupported entry types stay raw,
144
+ with an explicit archive refusal in their owner record; those bytes remain charged.
145
+ Link archives use `rnr-qualification-archive/v2`, which old restorers reject.
146
+ Regular-file archives keep their existing format. Manual archive calls still
147
+ refuse links unless `--preserve-links` is explicit. Restore refuses link archives
148
+ until the operator inspects their recorded targets and supplies `--restore-links`.
149
+ That option recreates original links, including absolute and dangling targets,
150
+ only after writing regular files; it never reads or writes through their targets.
151
+ No archive entry may descend through a file or link, and linked destination
152
+ ancestors reject before extraction.
153
+ Quiescence, changed-input failures, all admission limits and manual archive
154
+ refusals remain enforced. Archives preserve paths, file contents, modes and times,
155
+ deduplicate equal contents, and verify every object before source retirement.
156
+ No retained inventory's `node_modules` namespace is treated as a cache.
157
+ The serial package runner also retires completed lanes' reinstallable
158
+ dependencies before starting the next independent lane. It waits for the SDK's
159
+ dependent browser journey, verifies the passed archive-bound proof and retained
160
+ inputs, and refuses active or unowned trees. Generated and captured files remain
161
+ available for final sealing; each retirement has a record in the cohort.
162
+
163
+ Inspect usage and compact a terminal, superseded private evidence directory:
164
+
165
+ ```sh
166
+ python3 scripts/qualification_storage.py status --store=../.react-native-roku-qualification
167
+ python3 scripts/qualification_storage.py archive --root=/absolute/.local/old-evidence --store=../.react-native-roku-qualification --manifest-sha256=RECORDED_FILES_JSON_SHA256 --retire
168
+ python3 scripts/qualification_storage.py restore --archive=/absolute/history/ARCHIVE.zip --sha256=RECORDED_ARCHIVE_SHA256 --destination=/absolute/fresh-restored-evidence
169
+ ```
170
+
171
+ Retirement requires process/open-file inspection (`ps` and `lsof`) and refuses
172
+ active, changed, unowned or symlinked evidence. Index records under the store's
173
+ `index` retain original locations and archive hashes. Restore refuses existing
174
+ destinations and verifies the original inventory. When a budget is full, stop
175
+ and compact or explicitly retire verified environments; do not raise limits or
176
+ delete source captures to make a test pass. Storage-limit exits are failures,
177
+ never qualification passes.
178
+ Cleanup reaps its direct `Popen` child even when the process-group signal reports
179
+ absence, observing the child's actual exit status rather than inferring it from
180
+ the group probe. A denied probe remains an error; interrupted evidence and the
181
+ caller's signal handler retain the diagnostic behavior above.
182
+
183
+ Success-only temporary retirement (including `--cleanup-success`) also verifies
184
+ that its root is unchanged, retained evidence does not overlap it, and no process
185
+ or open file still uses it. Busy or denied inspection records an interrupted
186
+ `temporary-cleanup` phase and preserves the data. A successful child exit alone
187
+ does not authorize deleting a detached process's working files. Durable external
188
+ evidence remains retained; failed children never use this cleanup path.
189
+
190
+ Besides private `.local` evidence, an explicit `archive --root ...` may seal and
191
+ retire a child of a project's `build-artifacts` only when a terminal owner record
192
+ names that exact evidence directory. The manifest hash, shared lock, quiescence,
193
+ unchanged-input verification and policy checks still apply. A project root,
194
+ arbitrary cache, active run or merely tracked output is not admitted by this rule.
195
+
196
+ ## Renderer fixture comparisons
197
+
198
+ Run the package-owned catalog workload on the exact archive.
199
+
200
+ ```sh
201
+ node scripts/host-performance.mjs --archive=/path/to/runtime.tgz --output=/path/to/new-directory
202
+ ```
203
+
204
+ The runner installs a frozen independent consumer and verifies the renderer inputs against the tarball. For physical workloads see [navigation](https://github.com/react-native-roku/react-native-roku/blob/HEAD/benchmarks/navigation/README.md).
205
+
206
+ ## Compatibility ownership
207
+
208
+ `compatibility/registry.json` owns the adapter aliases, reviewed upstream
209
+ versions, exported runtime API inventory, member/prop surfaces, contract test
210
+ references, implementation limits and device-pending status. The bundler and
211
+ consumer TypeScript paths use this alias owner. `check:compatibility` compares
212
+ the recorded surface with the actual TypeScript exports. A new export begins as
213
+ `review-required`; author its behavior/failure/cleanup contracts and review its
214
+ limits before changing that status. Refresh inventory explicitly with:
215
+
216
+ ```sh
217
+ pnpm compatibility:refresh
218
+ pnpm check:compatibility
219
+ ```
220
+
221
+ An exported type is not proof of complete implementation. Partial adapters,
222
+ unsupported placeholders, open SVG attributes and dynamic/spread usage remain
223
+ explicit. Host contracts cannot certify firmware, secure storage, decoding or
224
+ native accessibility. Do not turn device-pending into device-tested without
225
+ source- and artifact-attested device evidence.
226
+
227
+ The public `auditCompatibility` helper checks literal imports, members and JSX
228
+ props. A consuming application supplies its workspace prefixes and reviewed
229
+ third-party library versions. New dependencies and unregistered API usage must
230
+ fail review. A consumer may track exact existing gaps, with reasons and bounded
231
+ occurrence counts; those gaps are debt and must remain visible in reports.
232
+ Never regenerate a gap baseline automatically during build or package update.
233
+
234
+ `pnpm test:metro` is a separate finite local qualification lane for the optional
235
+ Metro resolver/Babel transformer. It installs the actual archive and the reviewed
236
+ optional tool cohort, retains failure evidence, and compiles cold production and
237
+ development output through the public frontend and project/SDK builders, using
238
+ both entry conventions, full Intl data and compiled CSS interop. It does not
239
+ expand the automatic CI lane.
240
+ Set `ROKU_QUALIFY_ARCHIVE` to test an existing archive, `ROKU_QUALIFY_EVIDENCE_DIR`
241
+ for a durable evidence root, and `ROKU_HERMES_EXECUTABLE` for actual host-Hermes
242
+ execution. An unset Hermes path is recorded as not requested. The source/maps,
243
+ host runners and SDK payloads remain in its owned workspace after completion;
244
+ firmware and Fast Refresh need separate evidence.
245
+
246
+ `pnpm test:metro-development` generates another fresh Metro app from the archive,
247
+ installs it, runs types/doctor and the real public CLI SDK build, then reuses
248
+ `qualify-development.mjs` for fonts, edit/reload, syntax-error retention,
249
+ correction, session restoration and activation. Its SDK input report comes from
250
+ that successful build. Preexecution helper/installed-source copies, logs,
251
+ generated projects and ZIPs remain under its owned `.local` evidence directory.
252
+ This lane keeps full reload distinct from state-preserving Fast Refresh. The
253
+ existing manual Actions matrix remains the default esbuild SDK/browser lane;
254
+ these additional Metro lanes run locally and do not expand automatic CI.
255
+
256
+ `pnpm test:fast-refresh` installs another archived Metro consumer and exercises
257
+ the public project development server in Chromium with dynamic code disabled.
258
+ It checks preserved state, module/render/syntax failure and correction, changed
259
+ hook signatures, resource/asset/font/config reloads, rapid edits, both entry
260
+ conventions and complete retirement. Each stage retains its inputs, browser
261
+ snapshot, actual preview/patch programs and source maps. Required font/image
262
+ bytes are retained separately. `ROKU_QUALIFY_ARCHIVE` and
263
+ `ROKU_QUALIFY_EVIDENCE_DIR` select the same archive/evidence contracts as the
264
+ other lanes. This is browser Canvas evidence; native SDK package reload and
265
+ native stateful hot reload require separate mechanisms and qualification.
266
+
267
+ `compatibility/public-api.json` classifies every package export by audience:
268
+ application, advanced host, build, testing, types or metadata. All are currently
269
+ experimental. Adding an export without a classification fails package checks.
270
+ Avoid consumers reaching through private filesystem paths to repair a missing
271
+ public contract.
272
+
273
+ ## Development lifetime and timing
274
+
275
+ The watch server serializes/coalesces builds and keeps the last good app after
276
+ an error. Its owned workspace retains two published generations and any active
277
+ candidate. Normal shutdown removes the workspace. Startup removes abandoned
278
+ workspaces only when they have the ownership manifest and their process is no
279
+ longer alive. Active, unowned and symlinked directories are preserved.
280
+
281
+ Source directories use recursive filesystem events. Individual configuration
282
+ files use a 100 ms metadata check, including inode and timestamps, because an
283
+ atomic rename notification may not identify the destination file reliably.
284
+ Watches start before cold compilation; edits during it coalesce into a fresh
285
+ candidate before publication. Close/error paths retire both event watchers and
286
+ file polling timers.
287
+
288
+ `/__roku/status` includes a bounded window of build durations, successful
289
+ generation count, failure count and edit-to-ready timing.
290
+ Metro development uses React Refresh at safe component boundaries.
291
+ The esbuild workflow and production-profile previews use full page reload.
292
+ Configuration, dependency graph, runtime, asset/font and unsafe module lifetime
293
+ changes also reload. Syntax/build errors retain the last good app. Static update
294
+ chunks are loaded before applying factories to the existing Metro runtime;
295
+ source maps refer back to original source. A discarded/coalesced candidate never
296
+ becomes the refresh base. `createRokuProjectDevServer` owns this lifetime for
297
+ custom callers, including watchers, refresh session and workspace cleanup.
298
+
299
+ ## Dependency and release policy
300
+
301
+ `config/toolchain.json` defines the accepted Node/pnpm and runtime cohort. React,
302
+ reconciler and scheduler move together; all SDK packages share one reviewed
303
+ version. NativeWind/CSS interop/Tailwind and Yoga have explicit upgrade groups.
304
+ Dependabot proposes grouped changes; do not auto-merge upgrades. Update the
305
+ cohort, templates, adapters, inventory and conformance evidence together.
306
+
307
+ Before 1.0, a breaking public contract increments the minor version; patch
308
+ releases preserve the documented subset. Record changes in `CHANGELOG.md`.
309
+ Published versions are immutable.
310
+
311
+ ```sh
312
+ pnpm release:prepare
313
+ pnpm release:check
314
+ ```
315
+
316
+ Preparation prints blockers without publishing. The check fails while the
317
+ package is private/UNLICENSED, lacks a source commit, has a dirty tree, lacks the exact
318
+ version tag, or has inconsistent public API/cohort/changelog metadata. Stable
319
+ 1.0+ releases additionally need an explicit qualified release policy and device
320
+ evidence. No maintenance command commits, tags, pushes or publishes.
321
+
322
+ Dispatch `release.yml` at the reviewed source ref with the inputs blank to
323
+ prepare. The job packs once through `pnpm check --archive=ABSOLUTE_TGZ --output=ABSOLUTE_EVIDENCE`,
324
+ uploads the tarball and six-lane evidence as `release-candidate-<attempt>`, and verifies
325
+ a fresh download using the upload’s immutable artifact ID and SHA-256. Record the run ID, source commit and both SHA-256 values from
326
+ the run summary. Verify an independent download before building the device
327
+ consumer from it:
328
+
329
+ ```sh
330
+ node scripts/qualify-package.mjs --verify-only --archive=DOWNLOADED_TGZ \
331
+ --output=DOWNLOADED_EVIDENCE --manifest-sha256=ORIGINAL_SEAL_SHA256
332
+ ```
333
+
334
+ The first npm submission requires an approved public GitHub repository matching
335
+ `package.json` and the protected `npm-release` environment. For a new package,
336
+ the owner supplies an npm granular token with **Read and write (stage only)** package permission and **Bypass two-factor authentication** unchecked as
337
+ `NPM_BOOTSTRAP_STAGE_TOKEN` on that environment. Staging a new name creates a
338
+ public `0.0.0-stage` placeholder. The owner can configure
339
+ [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/) for this
340
+ repository, `release.yml`, and `npm-release` once the package exists, then remove
341
+ the bootstrap secret and revoke the token.
342
+
343
+ After the fresh Ultra journey and [physical Roku clipping check](qualification.md#physical-roku-clipping)
344
+ pass on ZIPs built from that archive, obtain owner authorization. Supply the compact verified JSON as the staging input `clipping-receipt`. Dispatch the same workflow
345
+ on `v<version>` with `preparation-run`, `tarball-sha256` and `seal-sha256` from
346
+ the original run. The job checks the run's source commit and both digests,
347
+ downloads and verifies the sealed files, and stages the tarball with public
348
+ access, provenance, and the explicit `latest` dist-tag, including for preview
349
+ versions. This makes each approved release the default install. Inspect the
350
+ staged version and download it in an empty directory to compare its SHA-256
351
+ with the reviewed tarball. The owner uses `npm stage approve <stage-id>` with 2FA
352
+ to publish those bytes. Verify that `npm view react-native-roku@latest version`
353
+ matches the approved version. For a preview, also run
354
+ `npm dist-tag add react-native-roku@<approved-version> preview` to keep existing
355
+ `@preview` consumers on that release. Check that the main package page shows
356
+ the release README. npm refreshes that README on publication of a new version.
357
+ [npm package README updates](https://docs.npmjs.com/about-package-readme-files/)
358
+ See [npm staged publishing](https://docs.npmjs.com/staged-publishing/).
359
+
360
+ ## Device evidence
361
+
362
+ The public Node device helper implements ECP requests, observation parsing and
363
+ developer-installer screenshots without putting passwords in command arguments
364
+ or reports. It follows the installed SDK's public developer-installer behavior;
365
+ retail devices need not expose the privileged ECP screenshot endpoint. See
366
+ [Roku ECP](https://developer.roku.com/dev/docs/external-control-api).
367
+
368
+ Use the [standalone navigation suite](https://github.com/react-native-roku/react-native-roku/blob/HEAD/benchmarks/navigation/README.md) for physical runs. Supply device credentials locally. Store receipts outside the checkout. Score SDK swaps, settled pixels, and physical presentation separately.
@@ -0,0 +1,241 @@
1
+ # Exact-archive qualification
2
+
3
+ This is maintainer tooling in the producer checkout. Consumer setup remains in
4
+ `getting-started.md`.
5
+
6
+ All lane CLIs use the [bounded storage owner](maintenance.md#qualification-storage).
7
+ The owned temporary directory stays fixed across individually executed lanes
8
+ for the same archive and evidence root, including prepare/seal steps. Do not
9
+ change `RNR_QUALIFICATION_STORAGE_ROOT` mid-cohort. Completed sealed runs retire
10
+ their temporary consumers; older archived evidence must be restored before
11
+ exact-archive reuse. An interrupted or storage-limited run is not a pass.
12
+
13
+ The default runner executes all six independent lanes and seals their actual
14
+ reports, captured conformance sources and retained artifacts:
15
+
16
+ ```sh
17
+ node scripts/qualify-package.mjs --archive=/absolute/runtime.tgz --output=/absolute/fresh-evidence
18
+ ```
19
+
20
+ After a lane and its dependents finish, the serial runner retires only its
21
+ reinstallable dependency directories. The SDK consumer remains installed until
22
+ the browser development lane finishes. Captured installed sources, generated
23
+ programs and complete default consumer trees remain and are checked again at
24
+ sealing. Retirement requires the live storage owner's namespace, a passed
25
+ exact-archive lane proof, no open processes/files and unchanged retained inputs;
26
+ `cache-retirement.json` records each operation. This reduces peak allocation
27
+ without skipping lanes or relaxing the shared storage policy.
28
+
29
+ For limited disk capacity, the same owner supports individually executed lanes.
30
+ Prepare a fresh directory before the first lane:
31
+
32
+ ```sh
33
+ node scripts/qualify-package.mjs --prepare-only --archive=/absolute/runtime.tgz --output=/absolute/fresh-evidence
34
+ ```
35
+
36
+ This captures the lane helpers, browser driver and minimal example, records their
37
+ inventory and archive identity, and prints the required lane commands. It does
38
+ not execute or qualify an application. Keep producer source and helpers fixed
39
+ until all lanes finish. Set `ROKU_QUALIFY_ARCHIVE` and
40
+ `ROKU_QUALIFY_EVIDENCE_DIR` to those same absolute paths and run the printed
41
+ scripts with Node. The development lane uses the SDK lane's real consumer and
42
+ must follow it. Run one lane at a time and check its terminal result. Keep both
43
+ temporary default consumers until sealing. Both orchestration modes retain their
44
+ complete trees without `node_modules`; seal-only compares existing snapshots to
45
+ the finished originals and refuses partial or changed copies. Verification
46
+ requires retained React source and the compiled SDK program in the sealed inventory.
47
+
48
+ An explicit `ROKU_HERMES_EXECUTABLE` selects actual host-Hermes execution in the
49
+ Metro lane and SDK observer check; an omitted executable does not establish a
50
+ Hermes pass. SDK builds
51
+ and browser results do not qualify Roku firmware.
52
+
53
+ The SDK lane also bundles the installed archive's public `sdk-services` export
54
+ and executes its actual pinned SDK wrappers in a fresh Node child. It captures
55
+ all program inputs and its runner before execution, then checks string storage,
56
+ legacy reads, failure/flush recovery, namespaces and randomness binding through
57
+ explicitly synthetic native ports. Its retained `sdk-services-*` proof does not
58
+ qualify native encryption, durable relaunch, key protection or revocation.
59
+
60
+ The SDK lane's `sdk-observers-*` check bundles the installed public device-facts
61
+ and raster transports. It captures and executes the pinned SDK's actual
62
+ `setProperty`, handler-name detection and field-name transformation against
63
+ explicit synthetic Tree API field, registration and timer ports. Unadmitted
64
+ native operations fail. The check covers handler-unregister cues, replacement
65
+ subscriptions, reentrant retirement, failed request timers and cleanup retries.
66
+ Node and an explicitly selected Hermes execute the same ES5 program bytes,
67
+ lowered with the existing TypeScript compiler. Inputs, primary SDK source,
68
+ compiler identity, executable/program hashes and separate execution logs remain
69
+ in the SDK evidence. Native task execution and physical cleanup remain pending.
70
+
71
+ After all required lanes pass:
72
+
73
+ ```sh
74
+ node scripts/qualify-package.mjs --seal-only --archive=/absolute/runtime.tgz --output=/absolute/fresh-evidence
75
+ ```
76
+
77
+ Sealing refuses missing, failed or mismatched lane reports and changed prepared
78
+ sources, captures or example inventories. It records its own finalizer bytes and
79
+ the execution mode. It also accepts older independently captured cohorts with
80
+ the existing `orchestration-inputs` layout, checking their conformance sources
81
+ and identifying that capture mode explicitly. Existing input records retain
82
+ their original timing; sealing does not turn a later copy into an earlier one.
83
+
84
+ Retain the printed `manifestSha256` outside that sealed directory. Reuse requires
85
+ that recorded value, every retained byte, all six exact-archive reports and
86
+ unchanged conformance sources:
87
+
88
+ ```sh
89
+ node scripts/qualify-package.mjs --verify-only --archive=/absolute/runtime.tgz --output=/absolute/sealed-evidence --manifest-sha256=RECORDED_SHA256
90
+ ```
91
+
92
+ No operation overwrites a completed cohort. Preserve failed attempts and choose
93
+ fresh output for a retry. Regeneratable `node_modules` trees are excluded from
94
+ the final inventory; source captures, programs, maps, resources and SDK artifacts
95
+ remain. Do not delete a cache if any preserved manifest includes its files.
96
+ Recover capacity only after a lane is terminal and retained evidence is verified.
97
+ Physical device checks have their own evidence.
98
+
99
+ A smaller run budget may be selected when retained history leaves less than the
100
+ 12 GiB default allocation. For example:
101
+
102
+ ```sh
103
+ RNR_QUALIFICATION_RUN_LIMIT_GIB=6 node scripts/qualify-package.mjs --archive=/absolute/runtime.tgz --output=/absolute/fresh-evidence
104
+ ```
105
+
106
+ This accepts whole GiB values from 1 through 12 and only lowers the allocation
107
+ limit; 32 GiB must still be free before launch, the 20 GiB reserve and history cap
108
+ remain, and retained output plus the selected budget must fit. All stages and durations still
109
+ run. An allocation-limit failure preserves its inputs and never becomes a pass.
110
+ The state record exposes the selected limit and peak sampled allocation. Nested
111
+ commands reuse the existing owner's allocation and cannot increase it.
112
+
113
+ ### Planning a series of runs
114
+
115
+ Use the configured storage owner's capacity preview before starting a sequence. Each
116
+ stage specifies its maximum allocation in GiB and the additional bytes expected to
117
+ remain afterwards in MiB. Include build products, probe evidence, and cleanup scratch.
118
+ Use the full stage allocation as carry if the retained size is unknown. Preview reads
119
+ one snapshot. Each real stage still acquires the owner lock and checks current space.
120
+
121
+ python3 scripts/qualification_capacity.py --store "$STORE" plan --project "$PROJECT" \
122
+ --stage build 4 4096 --stage probe 3 512 --stage cleanup 1 0 --recovery-gib 2
123
+
124
+ On the 80 GiB store, the maintenance trigger is 72 GiB and the target is 70 GiB.
125
+ For cold history, supply a reviewed JSON selection with the canonical store path and
126
+ an `archives` array of `identity` and original `sha256` pairs. Only enroll terminal
127
+ archives whose consumers can use the indexed restore command. Keep raw ZIPs named
128
+ by active workflows, rollback, and preserved checkpoints out of the selection.
129
+ Run `qualification_capacity.py --store "$STORE" maintain --selection cold.json --limit 4`.
130
+ The owner takes its normal nonblocking lock for one archive at a time. A busy owner
131
+ takes precedence. To finish an already-triggered campaign below the trigger, set
132
+ `continueToTarget` in its reviewed selection. Each index pins the original ZIP hash
133
+ and the manifest for reconstructing it. Preserve all packs, including those shared
134
+ by later archives. The ordinary storage restore CLI accepts the original archive path
135
+ and hash for packed history. Reports that need a directly readable ZIP should retain
136
+ their raw archive path.
137
+
138
+ To enroll reviewed cold archives for proactive maintenance, place their selection
139
+ in `maintenance/cold-archives.json` in the owned store. At the trigger a new guard
140
+ may compact one enrolled archive of up to 96 MiB before normal admission. After
141
+ updating the runner, a physical probe automatically goes through this same path.
142
+ The separate maintenance command handles larger archives and catch-up batches.
143
+
144
+ On macOS, `python3 scripts/qualification_cache_macos.py --store "$STORE" --limit 32`
145
+ can reclaim space in the private pnpm v11 cache above the trigger. It uses filesystem
146
+ compression, verifies both files against the content-addressed SHA-512 name, skips
147
+ linked files, ACLs and pre-existing resource forks, and atomically replaces only
148
+ smaller verified representations.
149
+
150
+ A cold file selection for the macOS tool can also list reviewed `roots` under
151
+ terminal private `.local` cohorts and exact `files` with `path` and `sha256`.
152
+ Every selected path must belong to a registered terminal output. The owner checks
153
+ open files and processes for the selected cohorts before changing representation.
154
+ Use `qualification_capacity.py --store "$STORE" verify-restore --identity ID --sha256 SHA`
155
+ for a bounded full restore and inventory verification in disposable store scratch.
156
+
157
+ A historical worktree’s exact top-level dependency directory also qualifies when
158
+ a terminal owner explicitly registered it. A separately authorized
159
+ `--user-pnpm-cache` selects the current user’s pnpm v11 content-addressed payload
160
+ directory only when the owner already counts that store and its quiescence check
161
+ passes. Each replacement preserves its SHA-512 name, metadata and independent inode
162
+ semantics. `--to-target` continues a triggered campaign to the low-water mark.
163
+
164
+ For standalone ZIPs and existing chunk packs that must remain directly readable, a file selection can name
165
+ the owned `history` directory as its sole root. The macOS tool checks each original
166
+ ZIP digest against its index. A pack must be referenced by a digest-verified
167
+ manifest. Both its source and compressed copy must match the reviewed whole-file
168
+ digest. The tool keeps the original path, bytes and index. Historical
169
+ applications that open the raw ZIP directly can continue doing so.
170
+
171
+ Set `includeManagedScratch` in the store enrollment to include future archived
172
+ temporary trees from runs that explicitly pass `--cold-temporary-history`.
173
+ Selection requires the terminal owner state, matching temporary path, retirement
174
+ receipt, archive index and original SHA-256. The maintained restore command
175
+ resolves these archives. Output directories, signed products, and rollback
176
+ archives remain individually enrolled.
177
+
178
+ ## Shared core UI comparison
179
+
180
+ `node --test build/core-ui-fixture.test.mjs` is the fast check. The ordinary
181
+ `check:fast` job discovers it with the other build tests. It checks committed
182
+ geometry, style removal, exact Pressable events, and retirement using the public
183
+ React Native fixture in `examples/minimal/src/coreUiFixture.tsx`.
184
+
185
+ For an archive under review, copy that same fixture into an isolated app
186
+ generated by the archive and into a standalone React Native Web reference.
187
+ Use React and React DOM 19.2.8, React Native Web 0.21.2, esbuild 0.28.1, and the
188
+ starter's Inter 400 font bytes. Use the public `pnpm dev` command on the Roku
189
+ side. On the web side map `react-native` to `react-native-web` in the browser
190
+ bundler. Set the body margin to zero and load the same Inter asset with
191
+ `@font-face`. Each launcher renders the fixture as
192
+ `<CoreUiFixture left={96} top={64} onEvent={record} />`. Expose the event array at
193
+ `globalThis.__CORE_UI_EVENTS__`, and append to it from a stable `record` callback.
194
+
195
+ With the two loopback development servers started, run:
196
+
197
+ ```sh
198
+ node scripts/qualify-core-ui.mjs ROKU_PREVIEW_URL RN_WEB_URL NEW_OUTPUT
199
+ ```
200
+
201
+ The runner uses Chromium and ffmpeg. It captures three 1920×1080 frames per
202
+ backend at device scale 1, checks the semantic activation sequence and scores
203
+ named pixel probes. It retains original frames and raw readings. Use a fresh
204
+ output directory for each run. A missing state or failed probe exits nonzero.
205
+ The only nonzero browser tolerance is two color levels for leaf alpha rounding.
206
+ A missing mask exposes the red or blue art band at a corner. Setting
207
+ `opacity: state.opacity ?? 0.25` must fail the third-state opacity probe.
208
+ Make these edits in a disposable consumer, restore both files, and rerun.
209
+
210
+ The standalone catalogue uses `examples/minimal/src/catalogAdoptionFixture.tsx`
211
+ with the documented registry entry and `react-native-safe-area-context` 5.8.1.
212
+ Pass a stable `onEvent` callback from the launcher and expose its events as
213
+ `globalThis.__CATALOG_TRACE__`. Run
214
+ `node scripts/qualify-catalog-preview.mjs PREVIEW_URL NEW_OUTPUT` against that
215
+ app. The trace distinguishes each list mount, row focus request and observation,
216
+ and Select down/up leading to `onPressIn`, `onPressOut` and `onPress`.
217
+
218
+ ### Physical Roku clipping
219
+
220
+ Run the [paired installer screenshot test](https://github.com/react-native-roku/react-native-roku/blob/HEAD/benchmarks/clipping/README.md)
221
+ against the exact archive. One developer-mode Roku supplies the install, input,
222
+ native state and original screenshots. All four corners in three states must
223
+ pass in two captures each, with a visible square control and verified restoration.
224
+ An inconclusive result leaves the gate open. The six software lanes and the
225
+ fresh device app journey have separate evidence.
226
+
227
+ For the historical per-pixel JPEG diagnostic, capture the same initial state and the states after
228
+ one and two spaced Select presses with the Roku developer installer. Preserve
229
+ the original JPEGs, installer checksum, exact ZIP and native input observations.
230
+ Score the stills with the same coordinate table and a twelve-level RGB allowance
231
+ for JPEG:
232
+
233
+ ```sh
234
+ node scripts/qualify-core-ui.mjs --native-stills NEW_OUTPUT STATE0.jpg STATE1.jpg STATE2.jpg
235
+ ```
236
+
237
+ Review new probes and tolerance changes against both positive and negative
238
+ captures. Keep the fixture's public JSX shared when adding cases. Record the
239
+ stock native reference and physical device as separate executions. Browser
240
+ keyboard and pointer events establish shared Pressable behavior within the
241
+ browser harness. A held handheld remote needs physical observation.