docs(requirements): split state rows

Add explicit northstar ring fields to state requirements, split atom type-hash guidance, and shorten SSR bootstrap wording without changing behavior.

req: state/001

req: state/002

req: state/003

req: state/004

req: state/005

req: state/006

req: state/007
This commit is contained in:
slhx agent
2026-06-25 17:08:02 +02:00
parent 12bab8d5f7
commit a787e5473a
2 changed files with 10 additions and 7 deletions
+9 -6
View File
@@ -874,22 +874,25 @@ what a valid business email is. [north_star]
## state
### req: state/001
001 Typed atoms with `Atom<T>` are explicit addressable state resources.
0 001 Typed atoms with `Atom<T>` are explicit addressable state resources. [north_star]
### req: state/002
002 Atoms are not reactive by default. Updating an atom does not re-render anything until a handler returns an effect referencing it.
0 002 Atoms are not reactive by default. Updating an atom does not re-render anything until a handler returns an effect referencing it. [north_star]
### req: state/003
003 The JS runtime may maintain a narrow atom value table keyed by `AtomId` only for explicit `Atom<T>` resources and SSR bootstrap. This is not an app state framework, component store, cache, or reactive graph. Runtime values are type-erased postcard bytes; types are compile-time only. A deterministic `TypeHash` may be generated by `hemx_build` for diagnostics, but the JS runtime does not depend on Rust `TypeId`.
0 003 The JS runtime may maintain a narrow atom value table keyed by `AtomId` only for explicit `Atom<T>` resources and SSR bootstrap. This is not an app state framework, component store, cache, or reactive graph. [north_star]
### req: state/007
0 007 Atom runtime values are type-erased postcard bytes; types are compile-time only. A deterministic `TypeHash` may be generated by `hemx_build` for diagnostics, but JS runtime behavior must not depend on Rust `TypeId`. [north_star]
### req: state/004
004 SSR roots may carry a `data-hemx-st` base64url-encoded postcard blob on the `data-hemx-root` element. Runtime decodes it into the client atom store. Atoms computed from server state are immediately available to client-side handlers without a round-trip.
0 004 SSR roots may carry a `data-hemx-st` base64url postcard blob on `data-hemx-root`. Runtime decodes it into the client atom store. Server-computed atoms are available to client-side handlers without a round-trip. [north_star]
### req: state/006
006 Malformed `data-hemx-st` bootstrap state must not stop the standard runtime from binding roots, handlers, navigation, or push. The runtime reports `hemx:state-error` and continues with an empty atom store for that root.
0 006 Malformed `data-hemx-st` bootstrap state must not stop the standard runtime from binding roots, handlers, navigation, or push. The runtime reports `hemx:state-error` and continues with an empty atom store for that root. [north_star]
### req: state/005
005 Not all state is an Atom. Ordinary Rust fields are preferred unless the value must be independently addressed, bootstrapped, synced, or subscribed. Atoms are explicit resources, not the default state container.
0 005 Not all state is an Atom. Ordinary Rust fields are preferred unless the value must be independently addressed, bootstrapped, synced, or subscribed. Atoms are explicit resources, not the default state container. [north_star]
---