Session infrastructure: OpenRouter + tree-split reducer + observer→LLM Team + scrum_applier #11

Merged
profit merged 118 commits from scrum/auto-apply-19814 into main 2026-04-27 15:55:24 +00:00
2 changed files with 19 additions and 10 deletions
Showing only changes of commit 12e615bb5d - Show all commits

View File

@ -72,12 +72,14 @@ async fn process_inbox(
let path = entry.path(); let path = entry.path();
// Skip directories and hidden files // Skip directories and hidden files. Bind filename once via
if path.is_dir() || path.file_name().map_or(true, |n| n.to_string_lossy().starts_with('.')) { // let-else so the subsequent use is unwrap-free — previous
continue; // version relied on a map_or guard above + an .unwrap() here
} // being consistent, which is a fragile invariant.
if path.is_dir() { continue; }
let filename = path.file_name().unwrap().to_string_lossy().to_string(); let Some(fn_os) = path.file_name() else { continue; };
let filename = fn_os.to_string_lossy().to_string();
if filename.starts_with('.') { continue; }
tracing::info!("watcher: found new file '{}'", filename); tracing::info!("watcher: found new file '{}'", filename);
// Read file // Read file

View File

@ -131,6 +131,11 @@ impl PromotionRegistry {
file.history.drain(0..drop); file.history.drain(0..drop);
} }
} }
// Bind `entry` ref-captured for the log line below so the log
// doesn't double-unwrap file.current — entry is Some-by-construction
// at the function boundary; past versions reached in via
// `.as_ref().unwrap()` twice, which compiled but would panic if
// the construction above ever changed.
file.current = Some(entry); file.current = Some(entry);
file.index_name = index_name.to_string(); file.index_name = index_name.to_string();
@ -140,10 +145,12 @@ impl PromotionRegistry {
ops::put(&store, &key, json.into()).await?; ops::put(&store, &key, json.into()).await?;
self.cache.write().await.insert(index_name.to_string(), file.clone()); self.cache.write().await.insert(index_name.to_string(), file.clone());
if let Some(cur) = &file.current {
tracing::info!( tracing::info!(
"promoted '{}' to config {:?} (trial={})", "promoted '{}' to config {:?} (trial={})",
index_name, file.current.as_ref().unwrap().config, file.current.as_ref().unwrap().trial_id, index_name, cur.config, cur.trial_id,
); );
}
Ok(file) Ok(file)
} }