Initial Tessera backup vault (M0–M2)

Scaffold Rust workspace, React canvas, vault engine, hub API,
providers, agent wormhole path, and Docker compose per SPEC.
This commit is contained in:
Tessera Agent
2026-11-09 09:59:42 +00:00
commit a5ffb2c1b4
54 changed files with 8379 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
mod filesystem;
mod postgres;
pub use filesystem::*;
pub use postgres::*;
use anyhow::Result;
use async_trait::async_trait;
use serde_json::Value;
use tessera_core::config::ProviderKind;
#[async_trait]
pub trait BackupProvider: Send + Sync {
fn kind(&self) -> ProviderKind;
async fn capture(&self) -> Result<CaptureResult>;
}
#[derive(Debug, Clone)]
pub struct CaptureResult {
pub payload: Vec<u8>,
pub labels: Vec<String>,
pub restore_hints: Value,
}
pub fn provider_from_config(kind: &ProviderKind, config: &Value) -> Result<Box<dyn BackupProvider>> {
match kind {
ProviderKind::Filesystem => Ok(Box::new(FilesystemProvider::from_config(config)?)),
ProviderKind::Postgres => Ok(Box::new(PostgresProvider::from_config(config)?)),
ProviderKind::Command => anyhow::bail!("command provider not implemented in v1"),
}
}