Skip to main content

rebuild_shape

Function rebuild_shape 

Source
pub fn rebuild_shape(
    previous: Option<(&Value, &Value)>,
    assembled: &Value,
    compared: &Value,
) -> Result<(), AxError>
Expand description

A15 over one request’s cache shape: rebuild it from two records - prompt_shape_compared for the tool table and the conversation, and for the four segments the run’s most recent prompt_assembled at or before that line, because a run records prompt_assembled once and prompt_shape_compared once per request - re-derive what moved since the request before it, and refuse either line when the rebuild disagrees with what was written down. A replay re-derives an attribution; it does not trust one.

previous is the same pair of payloads for the request before this one; None is a run’s first request.

§Errors

A payload that does not parse, or a line whose recorded judgement or billing bound disagrees with the parts it states.