pub struct CaseSeed {
pub workflow: WorkflowKey,
pub case_id: CaseId,
pub label: String,
pub revision: u64,
pub state: Value,
pub conversation: Option<String>,
}Expand description
One case seeded before the turn.
The state crosses as JSON because the harness owns the domain types and this crate does not: an item file for a trip and one for a traveler differ only in what this value contains.
Fields§
§workflow: WorkflowKeyWhich workflow the case belongs to.
case_id: CaseIdIdentifier within the workflow.
label: StringServer-authored label the model and the cards see instead of the id.
revision: u64Revision the case starts at.
state: ValueThe persisted state, as the workflow’s own JSON.
conversation: Option<String>The conversation that opened this case, named rather than identified.
Absent means the one the turn happens in, which is what almost every item wants. A name — any name — means a different one, and the harness mints an identifier per distinct name: a file cannot know an identifier that is created while the corpus runs, and asking it to would make every item unrunnable on a second machine.
«This record belongs to another conversation» is a scenario of its own: the record is reachable and nameable there by design, so an old case can be resumed, and it is not the subject of the turn.
Implementations§
Source§impl CaseSeed
impl CaseSeed
Sourcepub fn validate(&self) -> Result<(), CorpusError>
pub fn validate(&self) -> Result<(), CorpusError>
Checks the seed is one a harness could apply.
§Errors
CorpusError::Invalid when the state is not a JSON object.