pub enum FoldParse {
Lenient,
Raw,
}Expand description
How [fold_final_and_parts] treats Value::String content when
assembling the BP-chain value — the fold half of the
SUBMIT_FORMAT_KEY contract.
Lenient is the default for every step: a string whose bytes parse as
a JSON object or array folds as the parsed structure, so a
downstream node can address fields inside it ($.<step>.lanes, a
fanout items expression, a branch cond) with no declaration —
uniformly across the HTTP submit, artifact staging, and in-process
lanes, because they all meet here. A container the model wrapped in a
markdown code fence (```json ... ```) folds the same way:
the fence is stripped and the inner bytes reparsed, because a prompt
asking for bare JSON does not guarantee the shape of what comes back.
Scalar JSON (true, 42, "quoted", null) deliberately stays a
string: a scalar has no addressable interior, so parsing it buys no
path capability while silently changing Eq conds and verdict
comparisons for any declared token that happens to be valid JSON. A
step that wants full-JSON semantics (scalars included) declares
submit_format: "json" and gets the strict submit-time parse
instead; a step that needs a JSON-container-looking body — fenced or
bare — folded as a raw string declares submit_format: "text"
(Raw: no parsing, no fence stripping at all).
Parsing at the fold — not at staging — is also what keeps materialized
part files verbatim: Engine::stage_worker_artifact_trusted /
materialize_part still see the submitted Value::String bytes, and
so do the verdict-contract checks (staging-time and completion-time),
which all run before the fold.
Variants§
Lenient
Default: fold a JSON-container string as its parsed structure.
Raw
submit_format: "text" opt-out: fold every string as itself.
Trait Implementations§
impl Copy for FoldParse
impl Eq for FoldParse
impl StructuralPartialEq for FoldParse
Auto Trait Implementations§
impl Freeze for FoldParse
impl RefUnwindSafe for FoldParse
impl Send for FoldParse
impl Sync for FoldParse
impl Unpin for FoldParse
impl UnsafeUnpin for FoldParse
impl UnwindSafe for FoldParse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more