1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2026 AlphaOne LLC
// SPDX-License-Identifier: Apache-2.0
//! L4 layered-capture data-transfer types (#1416 / RFC-0001).
//!
//! These live in `models` (always compiled) rather than `store`
//! (`#[cfg(feature = "sal")]`-gated) because they are shared by three
//! always-compiled surfaces: the MCP `memory_capture_turn` tool
//! (`crate::mcp::tools::capture_turn::prepare_capture_turn` builds a
//! [`CaptureTurnWrite`]), the sqlite SSOT free function
//! (`crate::storage::capture_turn_idempotent`), and the HTTP route
//! handler (`crate::handlers::capture_turn`). The SAL
//! `MemoryStore::capture_turn_idempotent` trait method re-exports them
//! from `crate::store` so both the sqlite and postgres adapters consume
//! the same backend-agnostic bundle.
use Memory;
/// Fully-prepared, backend-agnostic payload for the L4 layered-capture
/// idempotent write (#1416 / RFC-0001).
///
/// All host-signature verification (#1414), agent_id agreement (#1413),
/// and canonical-bytes hashing happen BEFORE this struct is built — see
/// [`crate::mcp::tools::capture_turn::prepare_capture_turn`]. Adapters
/// receive a ready-to-write bundle and only run the dedup-keyed
/// transaction, so the verification logic lives in exactly one place
/// regardless of which backend (sqlite / postgres) serves the write.
/// Outcome of [`crate::store::MemoryStore::capture_turn_idempotent`].