The pure read-time projection: lift then render. No gate, no proof requirement — this must work on a plain (un-attested) intent. The status line is regenerated from the spine by the renderer. If a FRESH attestation sidecar exists we project that (so `show` reflects the attested author/proof); a stale one warns and falls back to the raw node. Shared by the local body (repo-read inputs) and the rout
(
id: &str,
inputs: &bridge::LiftInputs,
attestation: &bridge::Attestation,
json: bool,
)
| 31 | /// node. Shared by the local body (repo-read inputs) and the routed hook |
| 32 | /// (wire-carried inputs) — one render, two data sources. |
| 33 | pub(crate) fn project( |
| 34 | id: &str, |
| 35 | inputs: &bridge::LiftInputs, |
| 36 | attestation: &bridge::Attestation, |
| 37 | json: bool, |
| 38 | ) -> CliResult<()> { |
| 39 | let node = match attestation { |
| 40 | bridge::Attestation::Fresh(node) => (**node).clone(), |
| 41 | bridge::Attestation::Stale(_) => { |
| 42 | eprintln!( |
| 43 | "warning: the attestation for {id} is stale; showing the current \ |
| 44 | (un-attested) intent." |
| 45 | ); |
| 46 | bridge::lift(inputs)? |
| 47 | } |
| 48 | bridge::Attestation::None => bridge::lift(inputs)?, |
| 49 | }; |
| 50 | |
| 51 | if json { |
| 52 | // The canonical JSON already carries `kind` (when non-default) and the |
| 53 | // `reviews` refs under `dependsOn`, so no supplement is needed here. |
| 54 | println!( |
| 55 | "{}", |
| 56 | serde_json::to_string_pretty(&node.to_value()).unwrap() |
| 57 | ); |
| 58 | } else { |
| 59 | print!("{}", render(&node, Target::Cli)); |
| 60 | } |
| 61 | Ok(()) |
| 62 | } |
| 63 | |
| 64 | impl Command for IntentShow { |
| 65 | fn run(&self) -> CliResult<()> { |
no test coverage detected