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
//! History — what prov contributes to a workspace recorded by historica.
//!
//! prov workspaces are plaintext, and versioning plaintext is
//! [historica](https://crates.io/crates/historica)'s whole subject: revisions,
//! merge, amendment, forgetting, and a store a person can read. prov used to
//! carry a versioned safety net of its own — an event store of
//! whole-workspace manifests, with capture, restore, prune and forget verbs —
//! and that machinery is retired rather than maintained in parallel: a second
//! implementation of recording inside prov could only fall behind the real
//! one.
//!
//! What prov still knows, and historica deliberately does not, is **which
//! files are the workspace**: the graph's bounded reachable walk, where the
//! recycle bin parks consigned bytes, which page is derived rather than
//! authored, and which directories a manifest claims in bulk. That knowledge
//! has exactly one place to land in historica's model — `history/skipped.txt`,
//! the file that says what recording does not take — and [`prov_history`]
//! computes it: a generated region of skip rules, regenerated whole as the
//! graph changes, scoping the store to the graph. Recording itself stays with
//! the `historica` command.
//!
//! ## Where the code lives
//!
//! **The computation is [`prov_history`]** — the walk, the subtraction, the
//! region convention, and the store I/O through the historica library. It
//! reaches this workspace through one trait ([`SkipHost`]), implemented
//! below; nothing in that crate names `prov`.
//!
//! What is left here is the integration:
//!
//! - the [`SkipHost`] answers — reachability, the bookkeeping prefixes, the
//! manifest claim — which are the workspace's policies, not history's;
//! - [`Workspace::skiplist`], the one forwarding method the CLI drives;
//! - the store's parking: a `history/` directory holding a historica marker
//! is a byte-parking store to every workspace walk
//! ([`parked_dirs`](Workspace::parked_dirs)), so the title index, the
//! orphan sweep and reachability stay blind to its interior.
//!
//! ## Audience honesty
//!
//! When the transport is **git**, none of this is needed: git already stores
//! every pre-image and reconciles concurrent histories. A historica store
//! earns its keep where the transport keeps no history — Dropbox, Syncthing,
//! iCloud, a synced network share — which is why the `history` axis
//! ([`History`](crate::config::History)) defaults off and the skiplist is
//! only maintained where it says `manual`.
use BTreeSet;
use ;
use crateWorkspace;
use Result;
use DirEntry;
use Storage;
use IndexStore;
pub use ;
/// A byte-parking store's directory — the parent of the index document that
/// names it. The recycle bin's `items/` hangs off its index this way, and the
/// retired history store's interior did too.
pub