Repository navigation
Description
Summary
Track the follow-up to a five-pass audit of Octane's app/server path, client runtime and SSR, compiler/build adapters, React-facing bindings, and package validation. This is one coordination issue; fixes should be split into package-owned PRs with behavioral regressions and performance evidence.
Status (2026-09-08): PR #968, PR #969, PR #994, and PR #998 are merged; PR #971 closed #962. The reproduced hoisted head listener rollback is fixed by #994, which passed current-head CI. Performance and cleanup checks remain open; the separate V8 audit is tracked in #981.
The audit ran against local commit 3574f50c81f5ef831e4a0a113c6b38a3903e5c1c on feat/chat-stream-nested-host-memoization. That SHA is not available in the upstream repository. Upstream main was c6516c0752eabe2d47dc75b0e5105bd1af2a9dbc when this issue was drafted. Reproduce each item on current main before treating it as an outstanding upstream defect. The first several source patterns (server error text, static symlink handling, config cache filename, Rspack compiler creation, and SSR callback placement) were also checked on current main.
Highest priority: production correctness and containment
- ServerRoute error disclosure:
packages/app-core/src/server/server-route.jsreturns an exception'serror.messagein the production 500 JSON body. Return a generic client response while retaining server diagnostics; cover a thrown message containing a sensitive marker. PR #968 - Static symlink containment:
packages/app-core/src/server/node-http.jsverifies a lexical path insidestaticDir, then follows symlinks withstatSync/createReadStream. An HTTP probe served a file outside the static root through an in-root symlink. Enforce the real file boundary and cover file and directory symlinks; exposure requires a symlink in the served tree. PR #968 - Streaming injection under backpressure:
packages/octane/src/runtime.server.tscan close before an accepted injection write drains; the audit reproduced a missing fragment. Preserve ordering and wait for queued writes before terminal close, including failure paths. PR #968 - SSR callback settlement:
renderToReadableStreamcan hang ifonShellReadyor error reporting throws before its deferred promises settle. Guard user callbacks and settle/release resources exactly once. PR #968 - Imported descriptor children in Rspack/Rsbuild:
packages/rspack-plugin-octane/src/loader.jsdoes not supplyisDescriptorChildrenImportto the bundler compiler. A current-source client/server transform of an imported markedSlotemitted ordinary block children; the Vite proof emitted inspectable descriptor children. Cover direct imports and re-exports in real adapter builds, includingChildren.onlybehavior. PR #968
Runtime, SSR, compiler, and binding correctness
- Config evaluation:
packages/app-core/src/config-loader.jswrites a fixedoctane.config.mjsand imports it with a query keyed only to emitted bytes. Two loads of unchanged source reading different environment values returned the first value twice; concurrent Rsbuild client/server loads can overwrite the shared file. Test sequential reevaluation and simultaneous config changes; use immutable emitted paths and explicit invalidation semantics. PR #969 - Injection finalization on early abort: pre-shell cancellation and shell-write failure in
runtime.server.tsskipinjection.renderComplete(). An abort whileuse()awaited a never-settling promise rejected the stream with zero completion calls. Exercise all terminal paths against the exact-once contract. PR #968 - Form controls: updating an uncontrolled input's
defaultCheckedcurrently changes its pristine livecheckedvalue; a controlled same-name radio group inside a ShadowRoot fails to restore after a click because cousin lookup usesdocument.getElementsByName. Add public-render differential cases against pinned React and inspect the related rollback lookup. PR #969 - Head and descriptor bindings: recheck removal of hoisted title/attributes in
packages/octane/src/runtime.ts, and lexical shadowing ofdescriptorChildrenbindings inpackages/octane/src/compiler/compile.js. Both produced incorrect output in the earlier audit probes. PR #969 - Hoisted direct-listener transition rollback: a suspended render can detach a retained head element's direct listener without restoring its handler record/native listener on rollback. Merged PR #994 reproduces an aliased native-listener collision in development and production, covers replacement/removal/explicit-undefined neighbors, and passes CI.
- Window binding:
packages/window/src/components/{list,grid}/types.tsdeclares ReactReactNode/ReactElementfor Octane-rendered children and row/cell components. Four ordinary Octane JSX consumer cases failed typechecking. Also fixsrc/hooks/useMemoizedObject.ts:{left: 1}to{right: 1}retains the old object because onlyObject.valuesare compared. The latter is inherited from upstream react-window, but is still observable here. PR #969 - Day Picker event types: public callbacks advertise React synthetic mouse/keyboard/focus events while
DayPicker.tsrxforwards native DOM events. A type-correct callback can access nonexistentevent.nativeEvent. Make its public contract match delivered values; remove the typecheck suppression where practical. PR #969 - Redux SSR edge case:
packages/redux/src/Provider.tsrxtreats a falsyserverStateas absent. Confirm the public state contract and cover a valid falsy value. PR #969
The TanStack Router selector-cache defect tracked by #962 was fixed in merged PR #971; #962 is closed.
Measured and source-level performance follow-up
- SSR pending subscriptions: staggered settlement of 32 deferred thenables attached 1,056
.thencallbacks during one completed stream (runtime.server.ts). Track subscriptions across waves; retain shell/segment semantics in the benchmark. - Effect postorder (common comparisons): Merged PR #998 short-circuits direct parent and sibling comparisons while retaining ancestry fallback and effect/ref order. Its focused 400-node sort benchmark measured 80,199 → 798 parent reads, and current-head CI passed. Profile deep disjoint branches in a full render before considering traversal or indexing; that residual question remains tracked in #981.
- Rspack compiler lifecycle:
rspack-plugin-octane/src/loader.jscreates a new compiler per module and discards manifest-rule caches. A 100-module probe readpackage.json300 times versus three with a shared compiler. Share within a compilation with correct option/layer invalidation. - Dev route lookup:
rsbuild-plugin-octane/src/dev-server.jscreates and sorts a router on every request even while caching the handler. A pre-#955 synthetic 1,000-route/1,000-request probe took 485 ms versus 61 ms when reused. PR perf: index dynamic app-core routes by last static segment #955 improved route matching but left per-request router construction intact; remeasure on currentmainand cache by manifest identity. - Compiler scaling:
compiler/slot-hooks.jsrepeatedly slices the whole source for edits.compiler/compile.jsrepeatedly scans component graphs to fixed point: a 1,000-component forward chain required 1,000 memo-safety passes versus two in reverse declaration order. Compare a single-pass edit application and reverse-edge worklists with equivalent output. - Vite CSS proof scheduling: independent concurrent importers of the same CSS module can receive static versus dynamic class writers depending on
inFlighttiming. Coalesce safe independent requests without creating dependency cycles. - Broader runtime costs: benchmark global Fragment-ref rebinding, context-epoch invalidation of unrelated memo subtrees, and HMR strong-set retention of disposed blocks. Distinguish production cost from development-only memory behavior.
Cross-cutting cleanup and review gates
- Share the development and production route hydration-payload serializer (
vite-plugin-octane/src/server/render-route.jsandapp-core/src/server/production.js), preserving byte-level payload compatibility. — Landed in #1162, merged as5f4b258d; development and production use the sharedapp-core/htmlhelper. - Review the documented process-global async transition-priority window with an unrelated-root regression. Preserve intended post-
awaittransition behavior while preventing or clearly specifying priority bleed. - Plan down the 101 pre-existing entries in
scripts/check-source-publication.mjs(80Node-type validation configs,4.tsrxprojects checked bytsgo,17packages with untyped published JavaScript). The gate currently passes because these are tracked debt; see historical consumer report Several published TSRX source bindings fail strict consumer tsrx-tsc typechecking #721. Do not add wildcard.tsrxdeclarations or suppress consumer diagnostics. - Verify one lower-confidence candidate before adding fix scope:
tanstack-virtual/src/index.tscaches only a numeric direct-DOM offset, apparently skipping the style write when switching from transform to position mode at an unchanged offset.
Completion criteria
- Reproduce each checked item on current
main; close or annotate items already fixed or intentionally divergent. Keep separate issue/PR links next to each checklist item. - Fix defects in their owning packages with consumer-visible regressions (including production compiler, SSR, adapter, and React differential cases where applicable). Do not assert private operation counts in correctness tests.
- For performance items, capture before/after deterministic benchmarks with semantic controls and account for per-render, per-node, SSR, compiler, and bundle costs as relevant.
- Run targeted tests/typechecks,
pnpm syncbefore any push, and current-head CI for each PR. This audit did not run the full Vitest suite because the review checkout'snode_modulessymlink was dangling; focused current-source probes and the standalone typecheck-coverage,.tsrxdeclaration, and source-publication checks were used instead. Synthetic timings are directional, not release benchmarks.
Activity
domgan-oai commentedon Sep 19, 2026
The shared development/production route hydration-payload serializer landed in #1162, merged as
5f4b258d80701d70f17790d14c6ac39ec9cb3d0b. Both routes use the sameapp-core/htmlhelper, preserving payload fields, defaults, build omission and inline-script escaping. Eight regression cases compare raw payload bytes across build metadata on/off, defaults and streaming/buffered rendering, normalizing only the independent per-request UUID. All 26 current-head CI jobs and Bugbot passed. The matching checklist item is checked; the remaining audit work stays open.