• Create an InputNode whose value is written through to a StorageAdapter on every commit that changes it.

    Type Parameters

    • T

      Stored value type. Cannot be a DerivedNode-like shape; the AssertNotDerived brand enforces this at compile time so a future refactor cannot silently widen the boundary.

    Parameters

    • graph: PersistenceGraph

      Engine handle exposing the input, read, and subscribeCommits capabilities the adapter needs.

    • id: string

      NodeId for the resulting input node.

    • initial: T & AssertNotDerived<T>

      Fallback value used when storage is empty, the envelope fails to parse, or version migration is unavailable.

    • options: PersistedInputOptions<T>

      PersistedInputOptions bundle (key, storage, version, optional migrate / preserveOnError / onError / onMigrationFailure).

    Returns PersistedInput<T>

    A live InputNode<T> whose value mirrors the storage envelope. Writes go through tx.set exactly as for a regular graph.input.

    The write hook is driven off subscribeCommits filtered by commit.changedNodes, not graph.subscribe, so the initial value is not round-tripped back to storage on cold start. On serialise / migrate / quota failures the error is funnelled through options.onError (default console.warn) and the on-disk envelope is preserved when preserveOnError is true (default).