MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / project

Function project

atomic-cli/src/commands/intent/show.rs:33–62  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

31/// node. Shared by the local body (repo-read inputs) and the routed hook
32/// (wire-carried inputs) — one render, two data sources.
33pub(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
64impl Command for IntentShow {
65 fn run(&self) -> CliResult<()> {

Callers 5

runMethod · 0.70
intent_showFunction · 0.50
memory_showFunction · 0.50
runMethod · 0.50
print_activity_chainFunction · 0.50

Calls 2

liftFunction · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected