Skip to content

fix(ui-sdk): initialize worker policy independently of import order - #2299

Merged
schlessera merged 3 commits into
mainfrom
fix/2148-worker-xdg-initialization-07f4f991
Oct 18, 2026
Merged

schlessera merged 3 commits into
mainfrom
fix/2148-worker-xdg-initialization-07f4f991

Conversation

@schlessera

@schlessera schlessera commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #2148

What changed

Fresh imports of worker sandbox, maintenance worker and launcher initialize in all six entry orders. Worker XDG policy lives in one dependency-free leaf; the sandbox preserves its existing exports and the launcher reads the leaf before deriving maintenance paths. Exact worker/maintenance paths, authority and writable-area behavior remain unchanged.

Why this shape

Sandbox-first imports traversed maintenance and launcher before sandbox initialized WORKER_XDG_DIRS. The launcher spread that uninitialized binding at module scope. The leaf breaks this initialization dependency without duplicated policy or forced launcher preloading. Current documentation citations follow the moved source, and the owning SDK patch changeset is included.

Proof

Current candidate fec494fe97bb84d61e67ddd743be89403ef2a980, integrated main 78cfba4ff443ca2ce380502f7875a4a4283525ee. Hosted confirmation must qualify this actual head/base before merge.

  • Original baseline 41a00e0ab38937d752d320e932ba240bf2a19770 standalone core test fails before assertions with the WORKER_XDG_DIRS initialization error. The new native parent regression asserts all six fresh-child entry orders and exact literal worker/maintenance XDG values; both sandbox-first orders fail its intended FRESH_WORKER_ENTRY_ORDER_INITIALIZES assertion before repair. Restored source passes all six and the existing five core assertions.
  • Restoring the original initialization cycle in both sandbox and launcher on the refreshed SDK source fails the two intended parent assertions; restored import/core/citation controls pass 51 tests / 135 assertions. A narrower launcher-only re-export mutation still passes because the canonical leaf remains; it is not used as a failing receipt.
  • Historical native worker proof passes 48 tests / 501 assertions including read-only HOME, private XDG writes, runtime/host-temp/cross-worker isolation and six launcher modes. These retain their original candidate identities. Current complete affected proof covers the real worker fixtures again.
  • Required bun run check:pr --base origin/main on the current candidate passes all contribution gates, 730 fast tests and the complete 169-file affected feedback: 2,046 pass, zero fail, one existing unavailable-delegated-cgroup skip, 17,876 assertions, 1,895.58 seconds. All three share ownership cases execute and pass in the combined process. Hosted native proof must supply the unavailable local cgroup coverage.
  • Actual fixture capacity is a real owned 4 GiB TMPDIR in a private user/mount/network namespace, UID/GID 1000, capabilities zero, original /tmp visible, loopback plus a route-free fictional local interface for existing native socket tests. Source, assertions, deadlines and actual free-space guard are unchanged by this environmental setup.
  • The SDK implementation is byte-identical to the strict-typechecked refreshed source at 98ffbbb985e929d2fb9b64ea146073184cd913fe. Changeset package validation and the complete release plan pass, with no major bumps. Intervening main changes are delivered prerequisites, including tests: liveness clock pause races its own browser time read #2298, test(ui-sdk): exercise literal /tmp regardless of runner TMPDIR #2389 and test(ui-server): honor qualified temporary storage in native cancellation fixtures #2406.

Earlier full feedback failures are preserved: disk-backed capacity guard yielded 1,977 passes / 69 failures; a qualified-TMPDIR but incomplete-interface run yielded 2,037 passes / nine failures. Actual journals identify free_space_floor stopping turns, and #2406 fixes the native cancellation fixture’s hard-coded /tmp path. The original three combined share timeouts remain recorded in #2401: this passing changed-prerequisite control does not claim a production UI repair or final historical cause. No guard, frozen qualification pin, timeout or assertion is weakened to obtain this result.

Checklist

  • Complete selected hosted candidate qualification and actual delivery verification pass.
  • Local implementation, native import regression and required focused preflight pass; coverage limits are explicit above.
  • PR and issue retain verified release 0.44.0.
  • Owning SDK patch changeset included and complete pending release plan validates.
  • Leakage gate and source-citation checks pass.
  • Public machine surface and provider history are unchanged.
  • Documentation follows the implementation.

Anything left open

Nothing for #2148. Run 39090614647, attempt 1, passes all 16 selected jobs, including packaging and native host coverage. Actual metadata, verification, four units, two browser/two layout shards, captures, endurance, native runtime/host and aggregate checkout logs independently name e7711a1a01a4b937a7c0a1ae23597693808d7b14. Requested base and BRAIN_CANDIDATE_RECEIPT agree with immutable parents 78cfba4ff443ca2ce380502f7875a4a4283525ee / fec494fe97bb84d61e67ddd743be89403ef2a980 and tree fe23d693caaaa858181389c485706070295f8d81. Squash ea4c76c15eee2e23701910b7c2395bdd479b99c6 has that exact tree and qualified base parent; fetched main ancestry, issue closure and both 0.44.0 milestones are verified. Automatic main-push proof is separate.

Historical #2401 attribution remains independent; this implementation makes no broader UI or capacity-policy repair claim.

@schlessera schlessera added this to the 0.44.0 milestone Oct 17, 2026
@schlessera schlessera added type: fix Something is broken and must behave the way it is documented. area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. labels Oct 17, 2026
@schlessera
schlessera force-pushed the fix/2148-worker-xdg-initialization-07f4f991 branch from fef0c13 to 98ffbbb Compare October 18, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. type: fix Something is broken and must behave the way it is documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-sdk: fresh sandbox import reads worker XDG constants before initialization

1 participant