refactor: eliminate date shell-outs, move logic to Store methods

- Replace all 5 `Command::new("date")` calls across 4 files with
  pure Rust time formatting via libc localtime_r
- Add format_date/format_datetime/format_datetime_space helpers to
  capnp_store
- Move import_file, find_journal_node, export_to_markdown, render_file,
  file_sections into Store methods where they belong
- Fix find_current_transcript to search all project dirs instead of
  hardcoding bcachefs-tools path
- Fix double-reference .clone() warnings in cmd_trace
- Fix unused variable warning in neuro.rs

main.rs: 1290 → 1137 lines, zero warnings.
This commit is contained in:
ProofOfConcept 2026-02-28 23:44:44 -05:00
parent d14710e477
commit 7ee6f9c651
4 changed files with 263 additions and 233 deletions

View file

@ -603,13 +603,8 @@ pub fn health_report(graph: &Graph, store: &Store) -> String {
let cats = store.category_counts();
// Snapshot current metrics and log
let now = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH).unwrap().as_secs_f64();
let date = {
let out = std::process::Command::new("date").arg("+%Y-%m-%d %H:%M")
.output().unwrap_or_else(|_| std::process::Command::new("echo").output().unwrap());
String::from_utf8_lossy(&out.stdout).trim().to_string()
};
let now = crate::capnp_store::now_epoch();
let date = crate::capnp_store::format_datetime_space(now);
let snap = MetricsSnapshot {
timestamp: now,
date: date.clone(),