Phase 0: bootstrap Rust workspace

- Cargo workspace with 6 crates: shared, storaged, catalogd, queryd, aibridge, gateway
- shared: types (DatasetId, ObjectRef, SchemaFingerprint, DatasetManifest) + error enum
- gateway: Axum HTTP entrypoint with nested service routers + tracing
- All services expose /health stubs
- justfile with build/test/run recipes
- PRD, phase tracker, and ADR docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
root
2026-03-27 04:59:05 -05:00
co-authored by Claude Opus 4.6
commit a52ca841c6
25 changed files with 1823 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
use thiserror::Error;
#[derive(Debug, Error)]
pub enum LakehouseError {
#[error("dataset not found: {0}")]
DatasetNotFound(String),
#[error("object not found: {bucket}/{key}")]
ObjectNotFound { bucket: String, key: String },
#[error("storage error: {0}")]
Storage(String),
#[error("catalog error: {0}")]
Catalog(String),
#[error("query error: {0}")]
Query(String),
#[error("ai bridge error: {0}")]
AiBridge(String),
#[error("serialization error: {0}")]
Serialization(String),
}
impl LakehouseError {
pub fn status_code(&self) -> u16 {
match self {
Self::DatasetNotFound(_) | Self::ObjectNotFound { .. } => 404,
Self::Storage(_) | Self::Catalog(_) | Self::Query(_) | Self::AiBridge(_) => 500,
Self::Serialization(_) => 400,
}
}
}
+2
View File
@@ -0,0 +1,2 @@
pub mod types;
pub mod errors;
+42
View File
@@ -0,0 +1,42 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// Unique identifier for a dataset in the catalog.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct DatasetId(pub Uuid);
impl DatasetId {
pub fn new() -> Self {
Self(Uuid::new_v4())
}
}
impl std::fmt::Display for DatasetId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
/// Pointer to an object in storage. This is what the catalog stores — never raw data.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ObjectRef {
pub bucket: String,
pub key: String,
pub size_bytes: u64,
pub created_at: chrono::DateTime<chrono::Utc>,
}
/// Schema fingerprint — deterministic hash of an Arrow schema.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct SchemaFingerprint(pub String);
/// Dataset manifest — the catalog's view of a dataset.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DatasetManifest {
pub id: DatasetId,
pub name: String,
pub schema_fingerprint: SchemaFingerprint,
pub objects: Vec<ObjectRef>,
pub created_at: chrono::DateTime<chrono::Utc>,
pub updated_at: chrono::DateTime<chrono::Utc>,
}