State runtime

Contract

v0.1.17 starts the reusable GX framework/runtime packages inside the bus-ui module. The package is built on the handle-scoped scheduling from v0.1.13 and gives Go function components local state without package-global mutable variables.

The first state helpers are UseState, UseRef, and UseMemo. They are available only while a mounted root is rendering. State is scoped to the mount handle and component position.

Requirements

  • State belongs to one mount handle and one component position.
  • Renders remain deterministic when several state updates are queued.
  • Unmounted handles release state and callback references.
  • Server-side rendering can render the initial state without browser APIs.

Boundary

This patch does not add effects, resource clients, browser storage policy, event helper objects, streaming, or terminal behavior. It only defines the state layer used by later reusable bus-ui runtime packages and higher-level libraries.

UseCallback is not part of this patch. Add it only if later incremental rendering needs stable listener identity or memoized child props.

The bus-ui Bus module may host this runtime package and separate higher-level libraries such as terminal UI. The state package is not the whole bus-ui module, and it should not absorb product workflow state or provider policy.