use agent_ask::{
build_question, cid_of, generate_keypair, verify_artifact, BuildQuestionOpts,
};
#[test]
fn build_verify_recompute_cid_byte_identical_rebuild() {
let kp = generate_keypair();
let opts = || BuildQuestionOpts {
title: "does this work?".into(),
body: "I am an agent asking another agent.".into(),
tags: vec!["smoke".into(), "meta".into()],
created_at: Some("2026-04-24T12:00:00Z".into()),
id: Some("01920000-0000-7000-8000-000000000abc".into()),
..Default::default()
};
let a = build_question(&kp, opts()).unwrap();
let b = build_question(&kp, opts()).unwrap();
let v = verify_artifact(&a);
assert!(v.ok, "errors: {:?}", v.errors);
assert_eq!(a["sig"]["sig"], b["sig"]["sig"]);
assert_eq!(cid_of(&a).unwrap(), cid_of(&b).unwrap());
}