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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//! Lifecycle cache codec and importer (DC-09 Phase 4.4-2b.1).
//!
//! A persisted, **non-identity-bearing, rebuildable** accelerator for
//! `NodeLifecycleState` (FDD-02 §12; design v3). This module only decodes and
//! *structurally* validates a cache into a [`DecodedLifecycleCache`]; per design v3 §0
//! that type is **not validation authority** — it cannot seed an accept/reject `node_id`
//! reuse decision. Blob-kind verification (against a resolver), provenance-vs-baseline
//! staleness, and replay reconstruction/compare are later slices; until then there is no
//! type here that an identity decision can consume.
//!
//! Wire format: ascii magic `PRIKK-NODE-LIFECYCLE-CACHE-v1\0` followed by canonical
//! `FieldRecord` TLV (design v3 wire table). Deterministic, versioned, and validated
//! fail-closed: any structural or cross-set violation is rejected.
//!
//! **Split in two (DC-58).** Nearly all of this module's content — the codec, the
//! `DecodedLifecycleCache` → `ValidatedLifecycleCache` → `ComparedLifecycleCache` trust ladder,
//! and their field-level helpers — was already `#[cfg(test)]`-gated item-by-item before the
//! split, per the "later slices" note above: this scaffolding exists for validation, provenance,
//! and compare-against-replay, none of which is wired into production yet. That bulk moved to
//! `lifecycle_cache/cache_ladder.rs`, gated as a whole test-only module instead of per item, and
//! re-exported here (also `#[cfg(test)]`) so every path `lifecycle_cache::tests` already used via
//! `super::X` keeps resolving unchanged. What remains here is the genuinely production-only
//! surface: the resolver traits, the real store-backed resolver, the replay entry points, and
//! `ReplayDerivedLifecycleState`. No behaviour change.
use Result;
use ;
use crateNodeLifecycleState;
use crateObjectReader;
pub use ;
/// Resolves a referenced blob's kind for file-entry verification. `Ok(None)` means the
/// blob is absent/unreadable, which makes the cache unusable (fail-closed). A real store
/// resolver is wired in the threading slice; this trait keeps verification testable and
/// keeps the codec module free of a store handle.
pub
/// Resolves a blob's kind and full content bytes, for `EditText` text materialization (2c-2d).
/// Returns `None` only when the blob is absent (fail-closed sentinel); a present non-Blob object
/// is an error.
pub
/// Real store-backed implementations of the resolver traits (4.4-2c-1).
/// Explicit boundary (E1): authoritative store access enters the lifecycle trust ladder here.
pub use StoreBackedResolver;
/// Authoritative lifecycle replay: lineage walker + dispatch skeleton (4.4-2c-2a).
pub
/// Incremental baseline lifecycle-state cache, scoped to the commit path (DC-64).
pub
/// Authoritative replay-derived lifecycle state for a specific baseline (rung 3). It must be
/// produced **only** by authoritative replay over the actual walked single-parent chain; the
/// real producer is the threading slice. This type is the reference truth a cache is compared
/// against.
pub
/// Rung-3 producer: authoritative replay-derived lifecycle state for `baseline_block_id`, with
/// `lineage_horizon_id` the claimed genesis. Runs the authoritative single-parent replay and wraps
/// it through `ReplayDerivedLifecycleState::from_replay`, which validates internal consistency
/// before the state can be used as the reference truth. This is the only sanctioned way to obtain
/// a `ReplayDerivedLifecycleState`.
pub
/// Materialize a `TextFile` node's current bytes by full replay (DC-65). A `TextFile` node's
/// `blob_id` after any `EditText` is a content identity, not necessarily a stored `Blob` object —
/// see `rfcs/handoffs/DC-65-text-edit-baseline-content/prerequisite-questions-v1.md` for the
/// invariant this implements. Returns `Ok(None)` if the node was never edited (nothing was
/// materialized for it — callers should already have a real stored blob to fall back to in that
/// case, since only `EditText` produces an unstored identity).
pub