Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion rust/crates/agentforge-candidates/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ pub use promote::{ab_prep, promote_candidate, PromotionResult};
// Submodules provide organization + inherent impl extensions (store.rs etc).
// Full split of types into modules will happen as real logic is ported.

/// Default AgentForge subdir under $HOME (legacy /home/eveselove fallback).
pub(crate) fn home_agentforge(sub: &str) -> PathBuf {
let home = std::env::var("HOME").unwrap_or_else(|_| "/home/eveselove".to_string());
PathBuf::from(home).join("agentforge").join(sub)
}

/// Canonical candidate metadata (candidate_meta.json).
/// Mirrors Python structure for seamless migration.
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
Expand Down Expand Up @@ -96,7 +102,7 @@ impl CandidateStore {
std::env::var("AGENTFORGE_PENDING_CANDIDATES_DIR")
.or_else(|_| std::env::var("AGENTFORGE_PENDING_CANDIDATES"))
.map(PathBuf::from)
.unwrap_or_else(|_| PathBuf::from("/home/eveselove/agentforge/pending_candidates"))
.unwrap_or_else(|_| home_agentforge("pending_candidates"))
});
// In real: mkdir
let _ = std::fs::create_dir_all(&root);
Expand Down
4 changes: 2 additions & 2 deletions rust/crates/agentforge-candidates/src/promote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn promote_candidate(
if copy_to_skills && yaml_src.exists() {
let skills_dir = std::env::var("AGENTFORGE_SKILLS_DIR")
.map(PathBuf::from)
.unwrap_or_else(|_| PathBuf::from("/home/eveselove/agentforge/skills"));
.unwrap_or_else(|_| crate::home_agentforge("skills"));

let mut base = candidate_id.to_string();
// Prefer yaml "name:" (Python parity for clean promoted filenames on real data)
Expand Down Expand Up @@ -315,7 +315,7 @@ pub fn promote_candidate(
// 5) Rolling skills/promotion_history.json (exact Python shape, last 50) for complete audit/UX on real data (full end-to-end)
let skills_dir = std::env::var("AGENTFORGE_SKILLS_DIR")
.map(PathBuf::from)
.unwrap_or_else(|_| PathBuf::from("/home/eveselove/agentforge/skills"));
.unwrap_or_else(|_| crate::home_agentforge("skills"));
let skills_hist_p = skills_dir.join("promotion_history.json");
if !dry_run {
if let Some(p) = skills_hist_p.parent() {
Expand Down
Loading