You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Factor the wire-decoded context transient out of the live context model into a dedicated type. The live model should be unambiguously live — never a half-decoded variant — and the decoded shape should be its own wire-view value object.
Split the model in two:
The live chain (Chain) carries only its bound-var index: id, vars, and resets. It holds no decode-side _manifest field, so there is no decoded-but-not-live variant of it.
A dedicated manifest type (_ChainManifest) carries the deserialised state of a wire ChainManifest: id, vars, resets, stubs, and decode_error. It is a wire-view POD — never installed, never the active chain state.
The decode path returns the manifest type rather than a half-populated chain. A decoded manifest lives on the dispatch session and the frame (DispatchSession.decoded, Frame.context); Frame.mount merges it into the live chain key-wise at mount time.
Leave external_used out of the manifest. Cross-process token transport — the consumed-token log's only consumer — is out of scope here and tracked in #231.
Motivation
Context carries three near-overlapping concepts in one class: the bound-var index, the decode-side dict[var, value] transient (_manifest), and a vars proxy over it. "Bound" lives in one field; "value" lives elsewhere — except in the window between decode and mount, when it lives in _manifest. A reader has to hold that exception in their head to follow the model. A dedicated decoded type removes it: the live chain is always live, and the decoded shape is a separate thing with a separate name.
Expected Outcome
Chain has no _manifest field and is always a live chain.
A dedicated manifest type holds the wire-decoded state (id, vars, resets, stubs, decode_error) and is never installed as active state.
The decode path yields the manifest type; Frame.mount merges it into the live chain key-wise.
Description
Factor the wire-decoded context transient out of the live context model into a dedicated type. The live model should be unambiguously live — never a half-decoded variant — and the decoded shape should be its own wire-view value object.
Split the model in two:
Chain) carries only its bound-var index:id,vars, andresets. It holds no decode-side_manifestfield, so there is no decoded-but-not-live variant of it._ChainManifest) carries the deserialised state of a wireChainManifest:id,vars,resets,stubs, anddecode_error. It is a wire-view POD — never installed, never the active chain state.The decode path returns the manifest type rather than a half-populated chain. A decoded manifest lives on the dispatch session and the frame (
DispatchSession.decoded,Frame.context);Frame.mountmerges it into the live chain key-wise at mount time.Leave
external_usedout of the manifest. Cross-process token transport — the consumed-token log's only consumer — is out of scope here and tracked in #231.Motivation
Contextcarries three near-overlapping concepts in one class: the bound-var index, the decode-sidedict[var, value]transient (_manifest), and avarsproxy over it. "Bound" lives in one field; "value" lives elsewhere — except in the window between decode and mount, when it lives in_manifest. A reader has to hold that exception in their head to follow the model. A dedicated decoded type removes it: the live chain is always live, and the decoded shape is a separate thing with a separate name.Expected Outcome
Chainhas no_manifestfield and is always a live chain.id,vars,resets,stubs,decode_error) and is never installed as active state.Frame.mountmerges it into the live chain key-wise.external_usedlog; cross-process token transport stays out of scope (Picklable wool.Token: enable cross-wire token transport with stdlib parity #231).