Skip to content

ui-react: native chunk request oracle accepts eager registration controls #3156

Closed

Description

@schlessera

Context

Found while implementing #2981 at 3e05ff2cd8edd57b8f2bb547c59f86d5af3613b5, based on 10c05ab39a46668043f044dda2743d9c5f6adbf8. The unchanged native request-log test accepts two eager-loading controls, so the requested eager-import negative receipt cannot currently be supplied honestly.

Source anchors:

  • register, packages/ui-react/tests/browser/renderer-dispatch.layout.tsx:27-30, normally supplies a lazy importer.
  • pack chunk is requested only when its matching fence first appears, same file:31-44, starts recording, registers and mounts unmatched plaintext, snapshots the log immediately, then introduces a matching fence.
  • startRequestLog and requestLog, packages/ui-kit/tests/visual/request-log.ts:20-35, observe Playwright context request events and return the current snapshot. A snapshot is not an importer/network-settled boundary.

Two controls ran in the pinned offline browser with Bun 1.4.2, unchanged assertions and no changed timeout:

  1. Replace the lazy registration expression with const loaded=import("./renderer-demo-chunk.js"); const Component=lazy(()=>loaded);. This starts the importer during registration, before a matching fence is supplied. The complete six-case native file still passes. Restoring the original also passes 6/6.
  2. Add a rel="modulepreload" link for renderer-demo-chunk.tsx during registration, retaining the original lazy component. The complete native file again passes 6/6; restored 6/6.

These are fixture/host-registration mutations, not production repairs. Both controls preserve real source fallback, chunk delivery, sibling error handling, axe and view-mode execution. No module-load error was counted as a negative receipt. This observation does not claim that every premature chunk acquisition escapes detection, or that the native suite lacks independent value.

Scope

Establish a native observation boundary that distinguishes registration-time eager acquisition from first-matching-fence lazy acquisition, then repair the focused request-log oracle without arbitrary sleeps or weaker doubles. Attribute importer invocation and actual browser requests separately. Preserve the existing six native cases and all their assertions.

Out of scope

Product behavior, changing renderer registration contracts, weakening offline/Worker/egress guards, changing runtime/image pins, shortening the suite or increasing deadlines. The markup relocation and production hook/reset mutations remain #2981's work.

Acceptance criteria

  • Both stated eager controls fail a named native laziness assertion while the real lazy registration passes.
  • A native synchronization/control explains when an unmatched-content observation is complete; an instantaneous empty log alone is insufficient.
  • Keep source fallback during real lazy load, positive chunk delivery, reuse across two figures, sibling error/axe, theme, file/raw/missing-pack and share-mode assertions.
  • Record exact negative/restored case results and distinguish importer initiation from network dispatch.

Verification

Use the repository's pinned offline node scripts/visual.mjs --project=ui-react-layout --filter=renderer-dispatch --proof-report, running original and both mutated registrations in the same runtime/resources and restoring the file byte for byte. Preserve proof-case reports and exit codes. No timing improvement is claimed.

Contract impact

None. This is a native test-oracle repair. No public contract, product behavior or release content is selected.

The maintainer scope ruling below resolves the prior unchanged-owner constraint. This issue is ready for the bounded native-oracle repair; do not claim #2981 fully verified until both eager controls are detected and the original lazy path is restored and passing.

Decision (maintainer, 2026-10-29): Include #3156’s native observation-boundary repair in this audit. Preserve all six native cases and every existing assertion. The prior unchanged-test constraint in #2981 is relaxed only to strengthen this laziness oracle; product behavior, registration contracts, offline guards, runtime pins and deadlines remain unchanged. Both stated eager controls must fail and the restored lazy path must pass.

2026-10-29 scope reconciliation: folded the explicit maintainer authorization into the current specification. This records scope only; no passing mutation or repair is claimed.

Activity

  1. added
    type: test
    area: ui-react
    area: ui-kit
    priority: p2
    needs: decision
    on Oct 29, 2026
  2. added
    agent-ready
    and removed
    needs: decision
    on Oct 29, 2026
  3. schlessera commented on Oct 29, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-10-29): Include #3156’s native observation-boundary repair in this audit. Preserve all six native cases and every existing assertion. The prior unchanged-test constraint in #2981 is relaxed only to strengthen this laziness oracle; product behavior, registration contracts, offline guards, runtime pins and deadlines remain unchanged. Both stated eager controls must fail and the restored lazy path must pass.

  4. added this to the 0.44.0 milestone on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-kitarea: ui-reactpriority: p2type: test

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions