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

Function recording_fixture

atomic-repository/tests/it/intent_graph.rs:177–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175}
176
177fn recording_fixture() -> (WorkflowSnapshot, String, String, String, String, String) {
178 let (mut snapshot, root, change, dependency, unrelated) = fixture();
179 snapshot
180 .edges
181 .retain(|e| !matches!(e.kind, P::Implements | P::HasPlan | P::GovernsTurn));
182 let (project, uid) = iri::parse_intent(&root).unwrap();
183 let path = format!("intents/{uid}/intent.md");
184 snapshot
185 .nodes
186 .iter_mut()
187 .find(|n| n.id == root)
188 .unwrap()
189 .metadata = Some(serde_json::json!({"vault_path": path}));
190 let artifact = iri::mint_file(&project, &format!(".vault/{path}"));
191 let other_artifact = iri::mint_file(
192 &project,
193 ".vault/intents/01ARZ3NDEKTSV4RRFFQ69G5FAW/intent.md",
194 );
195 for file in [&artifact, &other_artifact] {
196 snapshot.nodes.push(KgNode::new(file, C::File, file, "vcs"));
197 }
198 snapshot
199 .edges
200 .push(KgEdge::new(&change, &artifact, P::ModifiesFile));
201 snapshot
202 .edges
203 .push(KgEdge::new(&unrelated, &other_artifact, P::ModifiesFile));
204 (snapshot, root, change, dependency, unrelated, artifact)
205}
206
207#[test]
208fn exposes_recorded_intent_evidence_without_inventing_implementation() {

Calls 5

parse_intentFunction · 0.85
iter_mutMethod · 0.80
fixtureFunction · 0.70
unwrapMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected