| 1570 | } |
| 1571 | |
| 1572 | pub fn memory_attest(args: &super::memory::attest::MemoryAttest) -> CliResult<bool> { |
| 1573 | let Some(session) = Service::open()? else { |
| 1574 | return Ok(false); |
| 1575 | }; |
| 1576 | let request = pb::RecordAttestationRequest { |
| 1577 | repository: Some(session.reference.clone()), |
| 1578 | meta: request_meta(), |
| 1579 | target: Some(pb::AttestationTarget { |
| 1580 | kind: Some(TargetKind::MemoryId(args.id.clone())), |
| 1581 | }), |
| 1582 | identity_did: args.identity.clone().unwrap_or_default(), |
| 1583 | signature: Vec::new(), |
| 1584 | view: None, |
| 1585 | expected_snapshot: None, |
| 1586 | }; |
| 1587 | let response = session.record_attestation(request)?; |
| 1588 | let info = response.attestation.expect("recorded attestation"); |
| 1589 | if args.json { |
| 1590 | print_attestation_json(&session, &info)?; |
| 1591 | return Ok(true); |
| 1592 | } |
| 1593 | println!("Attested memory: {}", info.id); |
| 1594 | println!( |
| 1595 | " vault: {}", |
| 1596 | info.vault_path.clone().unwrap_or_default() |
| 1597 | ); |
| 1598 | println!( |
| 1599 | " sidecar: {}", |
| 1600 | info.sidecar_path.clone().unwrap_or_default() |
| 1601 | ); |
| 1602 | println!(" author: {}", info.identity_did); |
| 1603 | println!("conforms: yes"); |
| 1604 | println!("note: signing keys are stored unencrypted on disk; treat this attestation as a non-production dev signature until key-at-rest encryption lands."); |
| 1605 | Ok(true) |
| 1606 | } |
| 1607 | |
| 1608 | pub fn memory_validate(args: &super::memory::validate::MemoryValidate) -> CliResult<bool> { |
| 1609 | if args.id_or_path.ends_with(".md") { |