Skip to content

refactor(host): explicit host for configuration reads and one entered runtime store #3794

Open

Description

@thymikee

Part of #3747. Follow-up to #3763 and #3772, which leave two pieces deferred in their PR bodies.

1. Narrow commandHostEnvironment() to command execution

About 60 call sites remain in the root platform-runtime-* files and the platform packages. They read configuration (toolchain and SDK paths, caches, path resolution) through the ambient, AsyncLocalStorage-bound commandHostEnvironment(). The holistic review on the stack decided:

  • Configuration reads take the host explicitly. Pass it as a parameter, through the runtime deps, or through a port bound at construction.
  • The ambient lookup is only for host-kit command execution and diagnostics.

Done when:

  • Every non-test call of commandHostEnvironment() outside host-kit's command execution and diagnostics is replaced by an explicit host.
  • A test on the daemon route proves configuration is read from the runtime's host and not from the process, when the two differ.

2. One entered runtime store

#3772 moved per-runtime state onto defineRuntimeSlots. Each module still exposes its own handle, collected into runtimeStates.

Required:

  • Collapse them into one store, entered once per runtime.
  • Modules declare slots; the runtime owns entry and disposal.

Done when:

  • No module-level handle or runtimeStates aggregation remains.
  • The two-runtime isolation tests (Apple runner, Android helper, PNG worker, daemon modules) still pass.

Ordering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions