Parallel Implementation: UCXLWatcher (FS-to-Metadata) and chrs-sync (P2P Graph Sync)

This commit is contained in:
anthonyrawlins
2026-03-03 17:32:26 +11:00
parent 003cb60c0f
commit f134b1d060
7 changed files with 142 additions and 0 deletions

View File

@@ -4,3 +4,5 @@ version = "0.1.0"
edition = "2024"
[dependencies]
notify = "6.1.1"
walkdir = "2.4"

View File

@@ -0,0 +1,15 @@
{
"keep": {
"days": true,
"amount": 14
},
"auditLog": "/home/tony/rust/projects/reset/CHORUS/UCXL/logs/.6faacdcce0b3695d429f7b102ede9ce5ae292f3e-audit.json",
"files": [
{
"date": 1772519476002,
"name": "/home/tony/rust/projects/reset/CHORUS/UCXL/logs/mcp-puppeteer-2026-03-03.log",
"hash": "da658db1c8508e25efec34d759a51688a90bc438a120e72b8f365dd866fd972e"
}
],
"hashType": "sha256"
}

View File

@@ -0,0 +1,3 @@
{"level":"info","message":"Starting MCP server","service":"mcp-puppeteer","timestamp":"2026-03-03 17:31:16.039"}
{"level":"info","message":"MCP server started successfully","service":"mcp-puppeteer","timestamp":"2026-03-03 17:31:16.040"}
{"level":"info","message":"Puppeteer MCP Server closing","service":"mcp-puppeteer","timestamp":"2026-03-03 17:31:22.517"}

View File

@@ -1,5 +1,7 @@
// UCXL Core Data Structures
pub mod watcher;
use std::collections::HashMap;
use std::fmt;
use std::str::FromStr;

45
UCXL/src/watcher.rs Normal file
View File

@@ -0,0 +1,45 @@
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
use std::path::Path;
use std::sync::mpsc::channel;
use crate::{UCXLAddress, TemporalAxis};
use std::str::FromStr;
pub struct UCXLWatcher {
base_path: std::path::PathBuf,
}
impl UCXLWatcher {
pub fn new<P: AsRef<Path>>(path: P) -> Self {
Self {
base_path: path.as_ref().to_path_buf(),
}
}
pub fn watch_loop(&self) -> Result<(), Box<dyn std::error::Error>> {
let (tx, rx) = channel();
let mut watcher = RecommendedWatcher::new(tx, Config::default())?;
watcher.watch(&self.base_path, RecursiveMode::Recursive)?;
println!("UCXL Watcher started on {:?}", self.base_path);
for res in rx {
match res {
Ok(event) => {
for path in event.paths {
if let Some(rel_path) = path.strip_prefix(&self.base_path).ok() {
let rel_str = rel_path.to_string_lossy();
// Attempt a heuristic address mapping: ucxl://system:watcher@local:filesystem/#/path
let addr_str = format!("ucxl://system:watcher@local:filesystem/#/{}", rel_str);
if let Ok(addr) = UCXLAddress::from_str(&addr_str) {
println!("[UCXL EVENT] {:?} -> {}", event.kind, addr);
}
}
}
}
Err(e) => println!("watch error: {:?}", e),
}
}
Ok(())
}
}