feat: implement dual-transport WAL architecture with permanent background leader and lightweight stubs

This commit is contained in:
Riz Ashraf committed 2026-09-08 09:07:56 +01:00
1 parent a2febd1b00
commit e4ff476b6d
16 files changed
+1910 -52

No files matched your search

+175
View File
@@ -0,0 +1,175 @@
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct CodeChange {
pub timestamp: u64,
pub file_path: String,
pub description: String,
pub git_commit: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct StickyNote {
pub timestamp: u64,
pub content: String,
}
pub fn default_namespace() -> String {
"global".to_string()
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Entity {
pub name: String,
#[serde(rename = "entityType")]
pub entity_type: String,
#[serde(default)]
pub observations: Vec<String>,
#[serde(default = "default_namespace")]
pub namespace: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct Relation {
pub from: String,
pub to: String,
#[serde(rename = "relationType")]
pub relation_type: String,
#[serde(default = "default_namespace")]
pub namespace: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct KnowledgeGraph {
#[serde(default)]
pub entities: HashMap<String, Entity>,
#[serde(default)]
pub relations: Vec<Relation>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Task {
pub id: String,
pub title: String,
pub status: String,
pub description: String,
pub created_at: u64,
pub updated_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Snippet {
pub name: String,
pub language: String,
pub code: String,
pub description: String,
pub updated_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Adr {
pub id: String,
pub title: String,
pub context: String,
pub decision: String,
pub consequence: String,
pub timestamp: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Preference {
pub key: String,
pub value: String,
pub updated_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ErrorFix {
pub signature: String,
pub solution: String,
pub timestamp: u64,
pub git_commit: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PinnedFile {
pub namespace: String,
pub file_path: String,
pub timestamp: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct SessionSummary {
pub timestamp: u64,
pub summary: String,
pub namespace: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct HandoffMemo {
pub id: String,
pub author: String,
pub content: String,
pub namespace: String,
pub timestamp: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnvFingerprint {
pub namespace: String,
pub os: String,
pub shell: String,
pub tool_versions: HashMap<String, String>,
pub updated_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnvRequirement {
pub namespace: String,
pub key: String,
pub description: String,
pub is_secret: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Milestone {
pub id: String,
pub title: String,
pub status: String,
pub namespace: String,
pub target_date: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnvironmentDetail {
pub namespace: String,
pub name: String,
pub url: String,
pub description: String,
pub requires_vpn: bool,
pub updated_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PrChecklistItem {
pub namespace: String,
pub id: String,
pub description: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TechDebt {
pub id: String,
pub namespace: String,
pub description: String,
pub ideal_solution: String,
pub is_resolved: bool,
pub created_at: u64,
pub git_commit: Option<String>,
pub git_branch: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ContextWorkspace {
pub name: String,
pub namespace: String,
pub pinned_files: Vec<String>,
pub active_task_ids: Vec<String>,
pub saved_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Default)]
pub struct GateRecord {
pub id: String,
pub action: String,
pub target: String,
pub namespace: Option<String>,
pub params: std::collections::HashMap<String, String>,
pub status: String,
pub reason: Option<String>,
pub timestamp: u64,
}