tighten module interfaces: explicit re-exports, private helpers, inline dedup
- Replace `pub use types::*` in store/mod.rs with explicit re-export list - Make transcript_dedup_key private in agents/enrich.rs (only used internally) - Inline duplicated projects_dir() helper in agents/knowledge.rs and daemon.rs
This commit is contained in:
parent
cee9b76a7b
commit
7c491e92eb
4 changed files with 10 additions and 12 deletions
|
|
@ -34,10 +34,6 @@ fn log_path() -> PathBuf {
|
|||
crate::config::get().data_dir.join(log_file())
|
||||
}
|
||||
|
||||
fn projects_dir() -> PathBuf {
|
||||
crate::config::get().projects_dir.clone()
|
||||
}
|
||||
|
||||
// --- Logging ---
|
||||
|
||||
const LOG_MAX_BYTES: u64 = 1_000_000; // 1MB, then truncate to last half
|
||||
|
|
@ -181,7 +177,7 @@ fn job_daily_check(ctx: &ExecutionContext) -> Result<(), TaskError> {
|
|||
const MIN_SESSION_BYTES: u64 = 100_000;
|
||||
|
||||
fn find_stale_sessions() -> Vec<PathBuf> {
|
||||
let projects = projects_dir();
|
||||
let projects = crate::config::get().projects_dir.clone();
|
||||
if !projects.exists() {
|
||||
return Vec::new();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use crate::util::parse_timestamp_to_epoch;
|
|||
|
||||
/// Compute the store dedup key for a transcript file.
|
||||
/// This is the same key experience_mine uses to mark a transcript as mined.
|
||||
pub fn transcript_dedup_key(path: &str) -> Result<String, String> {
|
||||
fn transcript_dedup_key(path: &str) -> Result<String, String> {
|
||||
let bytes = fs::read(path).map_err(|e| format!("read {}: {}", path, e))?;
|
||||
let mut hasher = DefaultHasher::new();
|
||||
bytes.hash(&mut hasher);
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ use std::collections::{HashMap, HashSet};
|
|||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
fn projects_dir() -> PathBuf {
|
||||
crate::config::get().projects_dir.clone()
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Action types
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -420,7 +416,7 @@ fn count_dialogue_turns(path: &Path) -> usize {
|
|||
|
||||
/// Select conversation fragments for the observation extractor
|
||||
fn select_conversation_fragments(n: usize) -> Vec<(String, String)> {
|
||||
let projects = projects_dir();
|
||||
let projects = crate::config::get().projects_dir.clone();
|
||||
if !projects.exists() { return Vec::new(); }
|
||||
|
||||
let mut jsonl_files: Vec<PathBuf> = Vec::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue