fabric/graph/fork

Observable membership and outcomes of structured graph forks. Ordinals identify members within a parent activation; equal inputs retain distinct members. A failed member does not discard settled sibling results.

Types

pub type Cause {
  MemberFailed(Reference)
  CancelledByCaller
  DeadlineElapsed(due: Int)
}

Constructors

  • MemberFailed(Reference)
  • CancelledByCaller
  • DeadlineElapsed(due: Int)

A settled definite failure that the parent node can route on. Detailed member evidence remains in the parent snapshot and child records.

pub type Failure {
  Failure(member: Int, reason: String)
}

Constructors

  • Failure(member: Int, reason: String)
pub type Member {
  Member(request: Request, status: Status)
}

Constructors

pub type Occurrence {
  Occurrence(run: run.RunId, activation: Int)
}

Constructors

  • Occurrence(run: run.RunId, activation: Int)
pub type Progress {
  Active
  Uncertain(evidence: String)
  Succeeded(output: String)
  Failed(reason: String)
  Cancelled
}

Constructors

  • Active
  • Uncertain(evidence: String)
  • Succeeded(output: String)
  • Failed(reason: String)
  • Cancelled

    Only use after the child has no unresolved effects.

pub type Reference {
  Reference(occurrence: Occurrence, member: Int)
}

Constructors

pub type Request {
  Request(definition: run.DefinitionId, input: String)
}

Constructors

Data for the owning graph record. List position is the member ordinal; there is no second set of indices that can disagree with that order.

pub type Snapshot {
  Snapshot(
    occurrence: Occurrence,
    max_members: Int,
    concurrency: Int,
    members: List(Member),
    stop: option.Option(Cause),
  )
}

Constructors

pub type Status {
  Pending
  Withdrawn
  Rejected(reason: String)
  Reserved
  Admitted(Progress)
}

Constructors

  • Pending
  • Withdrawn
  • Rejected(reason: String)
  • Reserved

    Admission is saved; child creation has not yet been acknowledged.

  • Admitted(Progress)

Values

pub fn result_codec(
  success: codec.Codec(output),
) -> codec.Codec(Result(output, Failure))

Codec for a typed fork result, including its explicit failure alternative. The JSON is {"tag": "ok", "value": output} or {"tag": "error", "value": [member, reason]}.

✨ Search Document