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)
| 63 | /// (`serde_json::from_str` into a `Map`). A malformed frontmatter string is a |
| 64 | /// clean argument error rather than an internal panic. |
| 65 | pub fn inputs_from_entry(entry: &VaultEntry) -> BridgeResult<LiftInputs> { |
| 66 | let frontmatter: Map<String, Value> = |
| 67 | serde_json::from_str(&entry.frontmatter_json).map_err(|e| { |
| 68 | RepositoryError::InvalidOperation { |
| 69 | message: format!("intent frontmatter is not valid JSON: {e}"), |
| 70 | } |
| 71 | })?; |
| 72 | let body = String::from_utf8_lossy(&entry.content_bytes).into_owned(); |
| 73 | Ok(LiftInputs { frontmatter, body }) |
| 74 | } |
| 75 | |
| 76 | /// Read an intent by ID from the vault and return its lift inputs. |
| 77 | /// |