gradatum_core/lib.rs
1//! # gradatum-core
2//!
3//! Shared primitives: traits, canonical types, errors. The L0 crate every other Gradatum crate depends on.
4//!
5//! ## Stability
6//!
7//! `0.x` — no API stability guarantee. All public traits are tagged
8//! [`#[stability::unstable]`] or [`#[stability::experimental]`].
9//! See the [versioning policy](https://github.com/gradatum/gradatum/blob/main/RELEASE-POLICY.md).
10//!
11//! ## Contents
12//!
13//! Shared primitives used across all Gradatum crates: note identity ([`identity`]),
14//! canonical frontmatter ([`frontmatter`]), provenance and trust scoring ([`provenance`],
15//! [`trust`]), JCS-canonical hashing ([`history`]), job types and the [`QueueStore`] trait
16//! ([`job`]), storage traits ([`DocumentStore`], [`IndexStore`], [`VectorStore`]),
17//! ACL evaluation ([`acl`]), and error types ([`error`]).
18//!
19//! ## Multi-tenancy invariant
20//!
21//! Every persisted row carries `tenant_id TEXT NOT NULL`.
22//! Default tenant: `"main"`. Aliased to `vault` in user-facing UI/CLI/SDK.
23//! Enforced at storage layer; ACL filters by `tenant_id` first.
24
25#![forbid(unsafe_code)]
26#![warn(missing_docs)]
27#![warn(rust_2018_idioms)]
28
29pub mod acl;
30pub mod audit;
31pub mod author;
32pub mod config;
33pub mod document_store;
34pub mod error;
35pub mod event_sink;
36pub mod frontmatter;
37/// F-40 — Hash d'historique pour le Copy-on-Write.
38///
39/// Contient [`history::HISTORY_EXCLUDED_FIELDS`] et [`history::sha256_for_history`].
40pub mod history;
41pub mod identity;
42pub mod index;
43pub mod index_store;
44/// Types primitifs pour le système de jobs (ARCH-D15).
45///
46/// Contient [`Job`], [`JobRecord`], [`JobSpec`], [`JobClass`], [`JobMode`],
47/// [`JobScope`], [`JobPriority`], [`QueueStore`], [`QueueEvent`], [`DryRunAware`]
48/// et tous les types associés du pipeline de jobs.
49pub mod job;
50pub mod note;
51pub mod overrides;
52pub mod provenance;
53pub mod schema_registry;
54pub mod scope;
55pub mod secrets;
56pub mod section;
57pub mod status;
58pub mod tag;
59pub mod trust;
60pub mod vector_store;
61
62pub use job::{
63 job_kind_str,
64 // Source structs nouveaux variants v59
65 ConflictStrategy,
66 // Specs variants actifs
67 CurateSpec,
68 // Traits
69 DryRunAware,
70 EmbedSpec,
71 ExportFormat,
72 ExportSource,
73 // Forget sémantique F-44
74 ForgetScope,
75 ForgetSpec,
76 // Apalis payload
77 GradatumJob,
78 IngestInputSource,
79 IngestSource,
80 IngestStrategy,
81 // Enum principal + helper routing
82 Job,
83 JobClass,
84 JobError,
85 // Filter
86 JobFilter,
87 // Lifecycle
88 JobLifecycle,
89 // Lineage
90 JobLineage,
91 JobMode,
92 JobOutput,
93 JobOutputFile,
94 JobPriority,
95 JobProgress,
96 // Record principal
97 JobRecord,
98 JobResult,
99 // Retry
100 JobRetry,
101 // Scheduling
102 JobScheduling,
103 JobScope,
104 JobSource,
105 // JobSpec + composants
106 JobSpec,
107 JobStatus,
108 JobTrigger,
109 // Workspace + Progress + Output
110 JobWorkspace,
111 MigrateMode,
112 MigrateSource,
113 NotifyChannel,
114 NotifySource,
115 // Purge lifecycle F-32C
116 PurgeMode,
117 PurgeSpec,
118 QueueError,
119 // Queue events
120 QueueEvent,
121 QueueStore,
122 // ReIndex
123 ReIndexMode,
124 RetryBackoff,
125 TriggerCondition,
126 TriggerSource,
127 // VaultScope alias
128 VaultScope,
129};
130
131pub use document_store::DocumentStore;
132pub use index_store::{AuthorRow, IndexStore, Lineage, SearchHitRaw};
133pub use vector_store::VectorStore;
134
135/// Crate version (from `workspace.package.version`).
136pub const VERSION: &str = env!("CARGO_PKG_VERSION");
137
138#[cfg(test)]
139mod tests {
140 use super::*;
141
142 #[test]
143 fn version_is_set() {
144 assert!(!VERSION.is_empty());
145 }
146}