Thread Model
Thread is the persisted conversation and state history entity.
Fields
id: thread identifierresource_id: optional ownership key for listing/filteringparent_thread_id: lineage for delegated/sub-agent runsmessages: ordered message historystate: base snapshot valuepatches: tracked patch history since base snapshotmetadata.version: persisted version cursor
Core Methods
Thread::new(id)Thread::with_initial_state(id, state)with_message/with_messageswith_patch/with_patchesrebuild_state()replay_to(index)snapshot()
Persistence Coupling
Storage append operations consume ThreadChangeSet plus VersionPrecondition.