The wire's ProvActivityInput bundle (schema "atomic.prov.input.v1") → the plain projector input — the same field-for-field shape the handler serialized.
(payload: &[u8])
| 4984 | /// the plain projector input — the same field-for-field shape the handler |
| 4985 | /// serialized. |
| 4986 | fn prov_input_domain(payload: &[u8]) -> CliResult<atomic_canonical::prov::ProvActivityInput> { |
| 4987 | let value: serde_json::Value = serde_json::from_slice(payload) |
| 4988 | .map_err(|error| CliError::Internal(anyhow::anyhow!("prov input bundle: {error}")))?; |
| 4989 | let field = |name: &str| -> CliResult<Option<String>> { |
| 4990 | match &value[name] { |
| 4991 | serde_json::Value::Null => Ok(None), |
| 4992 | serde_json::Value::String(text) => Ok(Some(text.clone())), |
| 4993 | other => Err(CliError::Internal(anyhow::anyhow!( |
| 4994 | "prov input field {name}: unexpected {other}" |
| 4995 | ))), |
| 4996 | } |
| 4997 | }; |
| 4998 | Ok(atomic_canonical::prov::ProvActivityInput { |
| 4999 | change_id_base32: field("change_id_base32")?.unwrap_or_default(), |
| 5000 | activity_id: field("activity_id")?.unwrap_or_default(), |
| 5001 | started_at: field("started_at")?, |
| 5002 | ended_at: field("ended_at")?, |
| 5003 | agent_slug: field("agent_slug")?.unwrap_or_default(), |
| 5004 | agent_display_name: field("agent_display_name")?.unwrap_or_default(), |
| 5005 | agent_vendor: field("agent_vendor")?, |
| 5006 | person_did: field("person_did")?.unwrap_or_default(), |
| 5007 | generated: value["generated"] |
| 5008 | .as_array() |
| 5009 | .map(|items| { |
| 5010 | items |
| 5011 | .iter() |
| 5012 | .map(|item| item.as_str().unwrap_or_default().to_string()) |
| 5013 | .collect() |
| 5014 | }) |
| 5015 | .unwrap_or_default(), |
| 5016 | used: value["used"] |
| 5017 | .as_array() |
| 5018 | .map(|items| { |
| 5019 | items |
| 5020 | .iter() |
| 5021 | .map(|item| item.as_str().unwrap_or_default().to_string()) |
| 5022 | .collect() |
| 5023 | }) |
| 5024 | .unwrap_or_default(), |
| 5025 | turn_parent: field("turn_parent")?, |
| 5026 | }) |
| 5027 | } |
| 5028 | |
| 5029 | /// `atomic provenance trace/show <target>` over ExportProvenance — the |
| 5030 | /// handler resolves the target (URN/prefix/hash), loads the explaining |