Skip to content
Open
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
3 changes: 3 additions & 0 deletions src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ pub fn bootstrap(data_root: &Path) -> Result<()> {
// Create .index directory
let index_dir = data_root.join(".index");
std::fs::create_dir_all(&index_dir)?;
let projections_dir = data_root.join("projections");
std::fs::create_dir_all(projections_dir.join("artifacts"))?;
std::fs::create_dir_all(projections_dir.join("jobs"))?;

Ok(())
}
Expand Down
10 changes: 5 additions & 5 deletions src/evolution/move_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub async fn move_action<P: EmbeddingProvider + ?Sized>(
Ok(MoveResult {
old_path: old_path.to_string(),
new_path: new_path.to_string(),
moved: true,
})
}

Expand Down Expand Up @@ -90,10 +91,8 @@ mod tests {

// Index should have new path, not old
assert_eq!(store.len(), 1);
let search_results = store.search(
&provider.embed("test folder description").await.unwrap(),
1,
);
let search_results =
store.search(&provider.embed("test folder description").await.unwrap(), 1);
assert_eq!(search_results[0].0.path, "new_folder");
}

Expand Down Expand Up @@ -163,7 +162,8 @@ mod tests {
let provider = MockEmbeddingProvider::new(8);
let mut store = HnswStore::new(&tmp.path().join(".index"));

let content = "{\"ts\":\"t1\",\"data\":\"preserved\"}\n{\"ts\":\"t2\",\"data\":\"also preserved\"}\n";
let content =
"{\"ts\":\"t1\",\"data\":\"preserved\"}\n{\"ts\":\"t2\",\"data\":\"also preserved\"}\n";
let src = tmp.path().join("original.jsonl");
std::fs::write(&src, content).unwrap();

Expand Down
2 changes: 2 additions & 0 deletions src/evolution/rename_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pub fn rename_action(data_root: &Path, file_path: &str, new_name: &str) -> Resul
.to_string();

Ok(RenameResult {
old_path: file_path.to_string(),
new_path: new_path_str,
old_name,
new_name: new_name.to_string(),
warning,
Expand Down
1 change: 1 addition & 0 deletions src/fs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod action;
pub mod meta;
pub mod naming;
pub mod projection;
pub mod skills;
pub mod warnings;
6 changes: 4 additions & 2 deletions src/fs/naming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ pub fn validate_name(filename: &str, file_path: &str) -> Option<Warning> {
None
} else {
Some(Warning {
ts: chrono::Utc::now().to_rfc3339(),
file_path: file_path.to_string(),
code: "naming_convention".to_string(),
message: format!(
"Filename '{}' does not match naming convention: verb_object[_method].jsonl",
filename
),
path: file_path.to_string(),
ts: chrono::Utc::now().to_rfc3339(),
file_path: file_path.to_string(),
rule_violated: "naming_convention".to_string(),
})
}
Expand Down
Loading