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

Function refuse_unfillable

libatomic/src/daemon/services_agent.rs:3054–3068  ·  view source on GitHub ↗

The pre-attest gate the CLI's `attest` body applies: refuse violations signing cannot fill (everything except `proof` and `attributedTo`), so a signer never signs a node recording would refuse anyway.

(node: &CanonicalNode)

Source from the content-addressed store, hash-verified

3052/// signing cannot fill (everything except `proof` and `attributedTo`), so a
3053/// signer never signs a node recording would refuse anyway.
3054fn refuse_unfillable(node: &CanonicalNode) -> Result<(), Status> {
3055 let report = validate_intent(node);
3056 let blocking: Vec<_> = report
3057 .results
3058 .iter()
3059 .filter(|v| !matches!(v.path.as_deref(), Some("proof") | Some("attributedTo")))
3060 .collect();
3061 if !blocking.is_empty() {
3062 return Err(domain_status(
3063 ErrorCode::PreconditionFailed,
3064 format!("the intent does not conform: {report}"),
3065 ));
3066 }
3067 Ok(())
3068}
3069
3070/// blake3 source hash of (frontmatter + body) — the attestation freshness
3071/// anchor, mirroring the CLI bridges.

Callers 2

prepare_attestationMethod · 0.85
record_attestationMethod · 0.85

Calls 5

validate_intentFunction · 0.85
domain_statusFunction · 0.85
collectMethod · 0.45
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected