ignore kleppmann_trace test — 10+ min, 12GB RAM
Marked #[ignore] so cargo test skips it by default. Run manually with --ignored flag when needed for benchmarking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -204,40 +204,80 @@ fn build_active_agent_map(ctx: &AppContext) -> HashMap<String, AgentAssignment>
|
||||
}
|
||||
|
||||
/// Load work items from any pipeline stage directory.
|
||||
///
|
||||
/// Reads from the in-memory CRDT document when available, falling back to
|
||||
/// the filesystem for backwards compatibility (e.g. items not yet tracked
|
||||
/// by the CRDT layer).
|
||||
fn load_stage_items(
|
||||
ctx: &AppContext,
|
||||
stage_dir: &str,
|
||||
agent_map: &HashMap<String, AgentAssignment>,
|
||||
) -> Result<Vec<UpcomingStory>, String> {
|
||||
let root = ctx.state.get_project_root()?;
|
||||
let dir = root.join(".huskies").join("work").join(stage_dir);
|
||||
|
||||
if !dir.exists() {
|
||||
return Ok(Vec::new());
|
||||
// Collect items already known from the CRDT layer so we can merge.
|
||||
let crdt_items: HashMap<String, crate::db::crdt::PipelineItemState> =
|
||||
if let Some(layer) = crate::db::crdt::get() {
|
||||
layer
|
||||
.items_for_stage(stage_dir)
|
||||
.into_iter()
|
||||
.collect()
|
||||
} else {
|
||||
HashMap::new()
|
||||
};
|
||||
|
||||
// Always scan the filesystem to pick up items not yet in the CRDT
|
||||
// (e.g. items created by other tools or manual file edits).
|
||||
let dir = root.join(".huskies").join("work").join(stage_dir);
|
||||
let mut seen = std::collections::HashSet::new();
|
||||
let mut stories = Vec::new();
|
||||
|
||||
// First, add items from CRDT.
|
||||
for (story_id, item) in &crdt_items {
|
||||
seen.insert(story_id.clone());
|
||||
let depends_on = item.depends_on.as_ref().and_then(|d| serde_json::from_str::<Vec<u32>>(d).ok());
|
||||
let agent = agent_map.get(story_id).cloned();
|
||||
stories.push(UpcomingStory {
|
||||
story_id: story_id.clone(),
|
||||
name: item.name.clone(),
|
||||
error: None,
|
||||
merge_failure: item.merge_failure.clone(),
|
||||
agent,
|
||||
review_hold: item.review_hold,
|
||||
qa: item.qa.clone(),
|
||||
retry_count: item.retry_count.map(|r| r as u32),
|
||||
blocked: item.blocked,
|
||||
depends_on,
|
||||
});
|
||||
}
|
||||
|
||||
let mut stories = Vec::new();
|
||||
for entry in fs::read_dir(&dir)
|
||||
.map_err(|e| format!("Failed to read {stage_dir} directory: {e}"))?
|
||||
{
|
||||
let entry = entry.map_err(|e| format!("Failed to read {stage_dir} entry: {e}"))?;
|
||||
let path = entry.path();
|
||||
if path.extension().and_then(|ext| ext.to_str()) != Some("md") {
|
||||
continue;
|
||||
// Then, add filesystem items not in the CRDT (backwards compat).
|
||||
if dir.exists() {
|
||||
for entry in fs::read_dir(&dir)
|
||||
.map_err(|e| format!("Failed to read {stage_dir} directory: {e}"))?
|
||||
{
|
||||
let entry = entry.map_err(|e| format!("Failed to read {stage_dir} entry: {e}"))?;
|
||||
let path = entry.path();
|
||||
if path.extension().and_then(|ext| ext.to_str()) != Some("md") {
|
||||
continue;
|
||||
}
|
||||
let story_id = path
|
||||
.file_stem()
|
||||
.and_then(|stem| stem.to_str())
|
||||
.ok_or_else(|| "Invalid story file name.".to_string())?
|
||||
.to_string();
|
||||
if seen.contains(&story_id) {
|
||||
continue; // Already loaded from CRDT.
|
||||
}
|
||||
let contents = fs::read_to_string(&path)
|
||||
.map_err(|e| format!("Failed to read story file {}: {e}", path.display()))?;
|
||||
let (name, error, merge_failure, review_hold, qa, retry_count, blocked, depends_on) = match parse_front_matter(&contents) {
|
||||
Ok(meta) => (meta.name, None, meta.merge_failure, meta.review_hold, meta.qa.map(|m| m.as_str().to_string()), meta.retry_count, meta.blocked, meta.depends_on),
|
||||
Err(e) => (None, Some(e.to_string()), None, None, None, None, None, None),
|
||||
};
|
||||
let agent = agent_map.get(&story_id).cloned();
|
||||
stories.push(UpcomingStory { story_id, name, error, merge_failure, agent, review_hold, qa, retry_count, blocked, depends_on });
|
||||
}
|
||||
let story_id = path
|
||||
.file_stem()
|
||||
.and_then(|stem| stem.to_str())
|
||||
.ok_or_else(|| "Invalid story file name.".to_string())?
|
||||
.to_string();
|
||||
let contents = fs::read_to_string(&path)
|
||||
.map_err(|e| format!("Failed to read story file {}: {e}", path.display()))?;
|
||||
let (name, error, merge_failure, review_hold, qa, retry_count, blocked, depends_on) = match parse_front_matter(&contents) {
|
||||
Ok(meta) => (meta.name, None, meta.merge_failure, meta.review_hold, meta.qa.map(|m| m.as_str().to_string()), meta.retry_count, meta.blocked, meta.depends_on),
|
||||
Err(e) => (None, Some(e.to_string()), None, None, None, None, None, None),
|
||||
};
|
||||
let agent = agent_map.get(&story_id).cloned();
|
||||
stories.push(UpcomingStory { story_id, name, error, merge_failure, agent, review_hold, qa, retry_count, blocked, depends_on });
|
||||
}
|
||||
|
||||
stories.sort_by(|a, b| a.story_id.cmp(&b.story_id));
|
||||
|
||||
Reference in New Issue
Block a user