Skip to main content

folderbase_core/
lib.rs

1//! Portable implementation of the Folderbase filesystem protocol.
2//!
3//! The four functions exported here form the external seam used by the CLI
4//! and, later, the native Mac application. Filesystem traversal, protocol
5//! layout, preservation rules, and validation stay behind this interface.
6
7pub mod availability;
8mod change_set;
9pub mod chunk_transfer;
10mod error;
11mod folder_analysis;
12mod folderbase_capture;
13mod folderbase_restore_authority;
14mod folderbase_seal;
15mod folderbase_state;
16pub mod folderbase_version;
17#[cfg(test)]
18mod folderbase_version_producer_tests;
19pub mod guide_policy;
20mod initialization;
21mod inspection;
22mod local_versions;
23mod migration;
24#[cfg(test)]
25mod migration_execution_contract_red_tests;
26mod migration_filesystem;
27mod model;
28mod physical_identity;
29mod portable_wire_path;
30mod protocol_upgrade;
31mod query;
32mod reorganization;
33mod root_attestation;
34pub mod root_reconstruction;
35mod sharing;
36mod sync;
37mod template;
38mod template_expansion;
39pub mod transfer_manifest;
40pub mod transfer_receiver;
41pub mod transfer_source;
42mod traversal_policy;
43mod validation;
44mod workspace;
45
46pub use change_set::{
47    AuthorizedPath, ChangeSetApplyOutcome, ChangeSetApplyResult, ChangeSetAssessment,
48    ChangeSetAssessmentOutcome, ChangeSetAttention, ChangeSetAttentionDetail, ChangeSetConflict,
49    ChangeSetEnvelope, ChangeSetError, ChangeSetPayload, CheckoutReceipt, CheckoutRequest,
50    CheckoutResult, ContentReference, DeltaDirectory, DeltaRegularFile, DeltaState, DeltaSymlink,
51    MAX_CHANGE_SET_BYTES, ObjectDelta, ProjectedEntry, ProjectionExclusion, StagedContent,
52    StagingIndex, StagingObject, apply_change_set, assess_change_set,
53    checkout_change_set_projection, propose_change_set,
54};
55pub use error::{FolderbaseError, InitializationInventoryLimitKind, Result};
56pub use folderbase_capture::{
57    CaptureEntryKind, CaptureExclusionKind, CaptureExclusionReason, CaptureIgnoredPath,
58    CaptureLocalHead, CapturePlan, CapturePlanEntry, CapturePlanExclusion, CapturePlanLimitKind,
59    FolderbaseCaptureError, FolderbaseVersionStore, LocalHeadAuthority, MAX_CAPTURE_PLAN_RECORDS,
60    MAX_FOLDERBASEIGNORE_BYTES, MAX_LOCAL_HEAD_BYTES,
61};
62pub use folderbase_seal::{RestoredTombstone, SealedCapture};
63pub use folderbase_version::PathBindingKind;
64pub use initialization::{
65    initialize, initialize_with_expected_plan_digest, plan_initialization,
66    plan_template_initialization,
67};
68pub use inspection::inspect;
69pub use local_versions::{
70    ApprovedHistoryTransfer, CaptureResult, ContentDigest, HistoryTransferPlan,
71    HistoryTransferResult, HistoryTransferState, JournalAction, LocalObjectRecord,
72    LocalVersionRecord, LocalVersionStore, ObjectId, ObjectJournalEvent, RestoreResult, VersionId,
73    apply_history_transfer, approve_history_transfer,
74};
75pub use migration::{
76    ApprovedMigration, MigrationAnalysis, MigrationAnswer, MigrationAnswerException,
77    MigrationCommand, MigrationConflict, MigrationConflictDirection, MigrationContentKind,
78    MigrationCopyPreview, MigrationExclusion, MigrationExecution, MigrationOperation,
79    MigrationOption, MigrationOutcome, MigrationPlan, MigrationPreview, MigrationQuestion,
80    MigrationQuestionKind, MigrationResult, MigrationState, MigrationTarget, MigrationTargetKind,
81    ProposedBoundary, RollbackResult, RootClaim, analyze_migration, apply_migration,
82    approve_migration, plan_migration, preview_migration, rollback_migration,
83};
84pub use model::{
85    BoundaryHint, Classification, ClassifiedPath, FolderbaseKind, InitializationOptions,
86    InitializationPlan, InitializationPlanDigest, InitializationResult, InspectionReport,
87    InventorySummary, NestedFolderbaseBoundary, NestedFolderbaseState, PlannedDirectory,
88    PlannedTemplateAddition, PlannedWrite, PreservedPath, ReconstructableTree, TemplateAnswerType,
89    TemplateAnswerValue, TemplateApplicationCreatedPath, TemplateApplicationPreservedTarget,
90    TemplateApplicationRecord, TemplateApplicationResult, TemplateApplicationState,
91    TemplateArtifactKind, TemplateArtifactPrecondition, TemplateComparisonSource,
92    TemplateDescriptor, TemplateExpansionPlan, TemplatePackage, TemplatePlanDigest,
93    TemplateQuestion, TemplateRenderPlan, TemplateStructuralChange, TemplateStructuralChangeKind,
94    ValidationFinding, ValidationLevel, ValidationReport, ValidationSeverity,
95};
96pub use protocol_upgrade::{
97    ProtocolUpgradePlan, ProtocolUpgradePlanDigest, ProtocolUpgradeResult, apply_protocol_upgrade,
98    plan_protocol_upgrade,
99};
100pub use query::{
101    FolderbaseQueryEngine, QueryEntry, QueryEntryKind, QueryError, QueryExclusion,
102    QueryExclusionKind, QueryExecution, QueryExplain, QueryIndexRebuildResult, QueryIndexState,
103    QueryIndexStatus, QueryLifecycle, QueryPageResult, QueryRequest, QueryResult, QuerySource,
104};
105pub use reorganization::{
106    AnalysisScope, ConsequentialAnswer, ConsequentialAnswerType, ConsequentialQuestion,
107    MAX_CANONICAL_JSON_INTEGER, MAX_REORGANIZATION_RECORD_BYTES, NestedBoundary, PathProfile,
108    ReorganizationDraft, ReorganizationOperation, ReorganizationPlan, ScopeEntry,
109    StructuralChangesPolicy, decode_reorganization_draft, decode_reorganization_draft_slice,
110    decode_reorganization_plan, decode_reorganization_plan_slice,
111    reorganization_analysis_scope_sha256, reorganization_plan_sha256, seal_reorganization_draft,
112    validate_reorganization_draft, validate_reorganization_plan,
113};
114pub use root_attestation::{
115    FolderbaseRootAttestation, FolderbaseRootMarker, MAX_FOLDERBASE_MANIFEST_BYTES,
116    ROOT_INSTANCE_FORMAT_V1, ROOT_INSTANCE_FORMAT_V2, RootAttestationError, attest_folderbase_root,
117};
118pub use sharing::{
119    AccessDecision, AccessReason, AccessRequest, FolderbaseRegistration, ShareGrant,
120    SharePermission, ShareScope, SharingControlPlane,
121};
122pub use sync::{
123    ConflictClassification, ContentKind, MemorySyncCloud, SyncConflict, SyncEvent, SyncReplica,
124    SyncReport, SyncVersion,
125};
126pub use template::{
127    list_templates, load_builtin_template, load_template, render_template, template_package_sha256,
128};
129pub use template_expansion::{
130    apply_template_expansion, apply_template_expansion_with_expected_plan_digest,
131    plan_template_expansion, template_application_history,
132};
133pub use transfer_source::{
134    ChunkTransferProfile, ChunkTransferSource, MANAGED_LARGE_PROFILE_THRESHOLD_BYTES,
135    TRANSFER_IO_BUFFER_BYTES, TransferSourceError, VerifiedChunk,
136};
137pub use validation::validate;
138pub use workspace::{
139    MAX_WORKSPACE_TEXT_BYTES, WorkspaceDocumentState, WorkspaceEntry, WorkspaceEntryKind,
140    WorkspaceListing, WorkspaceSaveResult, WorkspaceTextDocument, list_workspace,
141    read_workspace_text, save_workspace_text,
142};