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
//! Internal collection names for the VCS ("Git for Data") layer.
//!
//! All VCS-owned collections share the `red_*` prefix — matching existing
//! internal stores like `red_config`, `red_stats`, and `red_queue_meta`.
//! Keeping every name in one file makes it obvious which collections are
//! system-owned and prevents accidental divergence between bootstrap code,
//! runtime access, and schema documentation.
/// Commit entities: hash, parent pointers, root snapshot xid, author, message,
/// timestamp, height, optional signature.
pub const COMMITS: &str = "red_commits";
/// Refs: branches (`refs/heads/*`), tags (`refs/tags/*`), and per-connection
/// `HEAD` pointers.
pub const REFS: &str = "red_refs";
/// Per-connection working set: working_xid, staged_xid, current branch,
/// base commit, optional in-progress merge state id.
pub const WORKSETS: &str = "red_worksets";
/// Commit ancestry index (height, commit_hash, ancestor_hash) used for
/// sub-linear LCA queries. Populated lazily at commit time.
pub const CLOSURE: &str = "red_closure";
/// Shadow documents representing unresolved merge conflicts. One row per
/// conflicting entity, scoped to a `merge_state_id`.
pub const CONFLICTS: &str = "red_conflicts";
/// In-progress merge / rebase / cherry-pick / revert metadata. Stores
/// pending commit series and current step for resumable operations.
pub const MERGE_STATE: &str = "red_merge_state";
/// Remote repository configuration: url, fetch_specs, auth key ref.
pub const REMOTES: &str = "red_remotes";
/// Per-user-collection opt-in flag for Git-for-Data. Each row:
/// `_id = <user_collection_name>`, `versioned = true`, `ts_ms`.
/// A collection is treated as versioned iff a row exists here with
/// `versioned = true`. Default (no row) is non-versioned — merge,
/// diff, conflict materialisation, and AS OF queries skip it.
pub const SETTINGS: &str = "red_vcs_settings";
/// All VCS collections, in bootstrap order. Consumed by the runtime
/// bootstrap to call `get_or_create_collection` once at startup.
pub const ALL: & = &;
/// Ref name for the default branch.
pub const DEFAULT_BRANCH_REF: &str = "refs/heads/main";
/// Ref prefix for branches.
pub const BRANCH_REF_PREFIX: &str = "refs/heads/";
/// Ref prefix for tags.
pub const TAG_REF_PREFIX: &str = "refs/tags/";
/// Ref id prefix for per-connection HEAD pointers (`HEAD:<connection_id>`).
pub const HEAD_ID_PREFIX: &str = "HEAD:";
/// `red_config` namespace for VCS configuration (retention, protected
/// branches, merge policy). Matches the `red.logging.*` / `red.ml.*`
/// namespacing convention.
pub const CONFIG_NAMESPACE: &str = "red.vcs";