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

Function lift_scope

atomic-canonical/src/lift.rs:187–196  ·  view source on GitHub ↗

Lift a `:::scope-in` / `:::scope-out` container into a `ScopeItem`. `kind` is "scope-in" or "scope-out" and drives the generated id slug. Prose body is the unconstrained narrative (never graded).

(d: &Directive, human_key: &str, kind: &str, n: usize)

Source from the content-addressed store, hash-verified

185/// `kind` is "scope-in" or "scope-out" and drives the generated id slug.
186/// Prose body is the unconstrained narrative (never graded).
187fn lift_scope(d: &Directive, human_key: &str, kind: &str, n: usize) -> ScopeItem {
188 let local =
189 d.id.clone()
190 .unwrap_or_else(|| format!("{}-{kind}-{n}", slug(human_key)));
191 ScopeItem {
192 type_: NodeType::ScopeItem.as_str().to_string(),
193 id: as_urn("scope", &local),
194 text: d.body.clone(),
195 }
196}
197
198/// Lift a `:::constraint` container into a `Constraint`.
199fn lift_constraint(d: &Directive, human_key: &str, n: usize) -> Constraint {

Callers 1

lift_intentFunction · 0.85

Calls 3

as_urnFunction · 0.85
cloneMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected