Skip to content
TinyChain-IncPublic

About

The root `State` used by the TinyChain cloud service runtime

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

43 Commits

Folders and files

Repository files navigation

tc-state

tc-state owns TinyChain's universal native State<Txn> value. It combines scalar IR and collection values behind one recursive routing, resolution, view, and codec boundary without owning host storage or transports.

Responsibilities

  • Symmetric format-neutral State encoding and decoding.
  • Recursive resolution of Scalar, TCRef, operation parameters, control flow, and concrete $self values.
  • Native routing for scalar values, tuples, maps, objects, Classes, and delegated collections and Chain-owned members.
  • Canonical Class construction, digest verification, inheritance, cycle/depth validation, and declaring-Class method ownership.
  • Recursive transaction-consistent view acquisition before adapter encoding.

State::Chain preserves the WAL boundary during native method execution. Its terminal view delegates to the collection view; no additional wire envelope is introduced. BoundMethod executes an existing OpDef with its native $self; maps recursively delegate member routes without discarding a Chain owner. route_scalar(&scalar, || subject) selects application scalar handlers and constructs the subject only for a method. Its operation-reference GET evaluates the reference; native map member observations continue returning reference values.

Collection behavior belongs to tc-collection. tc-ir reports syntax-level requirements but owns no execution plan; graph scheduling and OpDef execution belong to tc-server. StateExecutor is trusted in-process host SPI for external dispatch, Class lookup, and server-owned OpDef execution. Its declaring-Class origin is supplied only by canonical Class routing and is not encodable in State or IR.

Non-responsibilities

tc-state does not own filesystem roots, caches, txfs layouts, application bootstrap, persistent named collections, media storage, HTTP, PyO3, or WASM projection. Decoding receives only a delegated collection allocation context.

Tensor remains the single tc-collection Tensor variant exposed through State; its future storage backend must not create another State variant or route family.

Testing

cargo test --all-targets --all-features

Changes to recursive State or Class behavior require symmetric codec tests, native routing tests, and mocked StateExecutor tests proving transaction, deadline, and concrete-subject preservation.

See the crate invariants. For non-normative integration context, see the TinyChain workspace architecture and the collection transaction contract.

About

The root `State` used by the TinyChain cloud service runtime

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages