Foundational primitives for Softadastra systems.
The core module provides the fundamental building blocks used across all Softadastra modules.
It is designed to be:
- Minimal
- Stable
- Deterministic
- Fully reusable
The goal of softadastra/core is simple:
Provide a clean, dependency-free foundation for all higher-level modules.
Everything in Softadastra depends on this module.
Build once. Reuse everywhere.
The core module defines primitives that must remain:
- Generic
- Independent
- Long-term stable
The core module provides:
- Shared types
- Error system
- Strongly-typed identifiers
- Time utilities
- Hash utilities
- Configuration primitives
- No sync logic
- No filesystem logic
- No network logic
- No storage logic
π It defines primitives, not behavior.
core must not depend on any other internal module.
Changes in core affect the entire system.
It must evolve slowly and carefully.
All primitives must behave consistently across:
- Platforms
- Machines
- Time
Designed to be extracted into:
- Softadastra Core
- SDK
- Other systems
modules/core/
βββ include/softadastra/core/
β βββ types/
β βββ errors/
β βββ ids/
β βββ time/
β βββ hash/
β βββ config/
βββ src/
Common reusable types used across modules.
Examples:
- Strong wrappers
- Generic containers
- Utility structures
Structured error handling system.
Features:
- Typed errors
- Severity levels
- Context support
Strongly-typed identifiers:
FileIdDeviceIdOperationId
π Prevents misuse of raw primitives.
Time-related utilities:
- Timestamps
- Monotonic clocks
- Duration helpers
Hashing utilities:
- File hashing
- Content fingerprinting
- Deterministic hashing
Configuration primitives:
- Structured config objects
- Validation
- Runtime-safe access
#include <softadastra/core/ids/FileId.hpp>
#include <softadastra/core/time/Timestamp.hpp>
#include <softadastra/core/errors/Error.hpp>
using namespace softadastra::core;
FileId fileId = FileId::generate();
auto now = Timestamp::now();
if (!fileId.isValid())
{
throw Error("Invalid file id");
}None.
- C++20 standard library only
Used by all modules:
- fs
- wal
- metadata
- discovery
- transport
- sync
- store
- No dependency on higher-level modules
- No business logic
- No side effects
- No hidden behavior
Only if:
- A primitive is needed by multiple modules
- The abstraction is fundamental
- It does not introduce coupling
Do not add:
- Sync logic
- Network logic
- Filesystem logic
- Application-specific code
- Deterministic ID generation strategies
- Streaming hash utilities
- Structured logging primitives
- Platform abstraction layer
The core module is the foundation.
If core is clean, everything built on top stays clean.
- Lowest-level module
- No internal dependencies
- Used everywhere
- Designed for long-term stability
vix add @softadastra/coreSee root LICENSE file.