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

Function record_signed_turn

atomic-agent/src/record/tests.rs:2212–2239  ·  view source on GitHub ↗
(
    repo_root: &Path,
    initial: &str,
    agent_identity: Option<&str>,
    identity_dir: Option<std::path::PathBuf>,
)

Source from the content-addressed store, hash-verified

2210}
2211
2212fn record_signed_turn(
2213 repo_root: &Path,
2214 initial: &str,
2215 agent_identity: Option<&str>,
2216 identity_dir: Option<std::path::PathBuf>,
2217) -> crate::record::TurnRecordOutcome {
2218 let mut session = AgentSession::new("signed-sess", "claude-code", "Claude Code");
2219 session.view_name = "session-signed".to_string();
2220 session.set_parent_view("dev");
2221
2222 std::fs::write(repo_root.join("sign-me.txt"), "second\n").unwrap();
2223 debug_assert_ne!(initial, "second\n");
2224
2225 let event = TurnEvent::new("signed-sess", HookType::TurnEnd);
2226 let options = TurnRecordOptions {
2227 session: &session,
2228 event: &event,
2229 turn_number: 1,
2230 turn_duration_ms: 1000,
2231 prompt: Some("Edit sign-me.txt".to_string()),
2232 agent_identity: agent_identity.map(str::to_string),
2233 identity_dir,
2234 };
2235 match record_turn(repo_root, &options).unwrap() {
2236 crate::record::TurnRecordResult::Recorded(outcome) => outcome,
2237 other => panic!("expected recorded outcome, got {other:?}"),
2238 }
2239}
2240
2241#[test]
2242fn a_turn_with_a_selected_agent_identity_is_signed_with_the_agents_key() {

Calls 4

record_turnFunction · 0.85
set_parent_viewMethod · 0.80
writeFunction · 0.50
unwrapMethod · 0.45

Tested by

no test coverage detected