Parse a `VaultEntry` into the frontmatter map + body the lift consumes. `frontmatter_json` is parsed exactly as the repository itself parses it (`serde_json::from_str` into a `Map`). A malformed frontmatter string is a clean argument error rather than an internal panic.
(entry: &VaultEntry)
| 136 | /// (`serde_json::from_str` into a `Map`). A malformed frontmatter string is a |
| 137 | /// clean argument error rather than an internal panic. |
| 138 | pub fn inputs_from_entry(entry: &VaultEntry) -> BridgeResult<LiftInputs> { |
| 139 | let frontmatter: Map<String, Value> = |
| 140 | serde_json::from_str(&entry.frontmatter_json).map_err(|e| { |
| 141 | RepositoryError::InvalidOperation { |
| 142 | message: format!("intent frontmatter is not valid JSON: {e}"), |
| 143 | } |
| 144 | })?; |
| 145 | let body = String::from_utf8_lossy(&entry.content_bytes).into_owned(); |
| 146 | Ok(LiftInputs { frontmatter, body }) |
| 147 | } |
| 148 | |
| 149 | /// Read an intent by ID from the vault and return its lift inputs. |
| 150 | /// |
no outgoing calls
no test coverage detected