Skip to main content

merge_init_ctx_3layer

Function merge_init_ctx_3layer 

Source
pub fn merge_init_ctx_3layer(
    bp_default: Option<&Value>,
    task_init_ctx: &Value,
    run_override: Option<&Value>,
) -> Value
Expand description

Issue #19 ST4: 3-layer shallow-merge of the init-ctx cascade — BP default → Task → Run (lowest to highest priority). Built by chaining [merge_init_ctx] twice rather than introducing a distinct 3-way merge algorithm, so the Run layer inherits exactly the same “shallow Object merge, non-Object fully replaces” rule [merge_init_ctx] already established for the BP/Task pair (see its doc for the full semantics).

  • run_override: None is a no-op — the BP+Task merge passes through unchanged, so POST /v1/tasks/:id/runs with no body (or a body that omits init_ctx_override) preserves today’s rekick behavior byte-for-byte.
  • run_override: Some(_) layers on top exactly like task_init_ctx layers on top of bp_default above: both Object → shallow key-wise merge with Run winning collisions; Run non-Object → fully replaces the BP+Task merge.