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