huskies: merge 997
This commit is contained in:
@@ -377,7 +377,6 @@ mod tests {
|
||||
let meta = ItemMeta {
|
||||
name: Some("Typed Name".into()),
|
||||
agent: Some("coder-1".into()),
|
||||
retry_count: Some(2),
|
||||
depends_on: Some(vec![100, 200]),
|
||||
};
|
||||
write_item_with_content(story_id, "2_current", content, meta);
|
||||
@@ -386,7 +385,7 @@ mod tests {
|
||||
assert_eq!(view.stage().dir_name(), "coding");
|
||||
assert_eq!(view.name(), "Typed Name");
|
||||
assert_eq!(view.agent(), Some(crate::config::AgentName::Coder1));
|
||||
assert_eq!(view.retry_count(), 2);
|
||||
assert_eq!(view.retry_count(), 0);
|
||||
assert_eq!(view.depends_on(), &[100, 200]);
|
||||
|
||||
// Content is stored verbatim (no parsing, no rewrite).
|
||||
@@ -461,18 +460,14 @@ mod tests {
|
||||
"2_current",
|
||||
Some("Retry reset test"),
|
||||
None,
|
||||
Some(3),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
write_content(
|
||||
ContentKey::Story(story_id),
|
||||
"---\nname: Retry reset test\nretry_count: 3\n---\n",
|
||||
);
|
||||
crate::crdt_state::set_retry_count(story_id, 3);
|
||||
let typed = crate::pipeline_state::read_typed(story_id)
|
||||
.expect("read should succeed")
|
||||
.expect("story exists in CRDT");
|
||||
assert_eq!(typed.retry_count, 3);
|
||||
assert_eq!(typed.retry_count(), 3);
|
||||
|
||||
// Promote to 4_merge. retry_count must reset.
|
||||
move_item_stage(story_id, "4_merge", None);
|
||||
@@ -482,7 +477,8 @@ mod tests {
|
||||
.expect("story exists in CRDT");
|
||||
assert_eq!(typed_after.stage.dir_name(), "merge");
|
||||
assert_eq!(
|
||||
typed_after.retry_count, 0,
|
||||
typed_after.retry_count(),
|
||||
0,
|
||||
"retry_count must reset to 0 on stage transition"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ use super::shadow_write::{PIPELINE_DB, PipelineWriteMsg};
|
||||
pub struct ItemMeta {
|
||||
pub name: Option<String>,
|
||||
pub agent: Option<String>,
|
||||
pub retry_count: Option<i64>,
|
||||
pub depends_on: Option<Vec<u32>>,
|
||||
}
|
||||
|
||||
@@ -91,7 +90,6 @@ pub fn write_item_with_content(story_id: &str, stage: &str, content: &str, meta:
|
||||
&typed_stage,
|
||||
meta.name.as_deref(),
|
||||
meta.agent.as_deref(),
|
||||
meta.retry_count,
|
||||
depends_on_json.as_deref(),
|
||||
merged_at_ts,
|
||||
);
|
||||
@@ -103,7 +101,7 @@ pub fn write_item_with_content(story_id: &str, stage: &str, content: &str, meta:
|
||||
stage: stage.to_string(),
|
||||
name: meta.name,
|
||||
agent: meta.agent,
|
||||
retry_count: meta.retry_count,
|
||||
retry_count: None,
|
||||
depends_on: depends_on_json,
|
||||
content: Some(content.to_string()),
|
||||
};
|
||||
@@ -146,7 +144,7 @@ pub fn move_item_stage(
|
||||
};
|
||||
let merged_at_ts = matches!(typed_stage, crate::pipeline_state::Stage::Done { .. })
|
||||
.then(|| chrono::Utc::now().timestamp() as f64);
|
||||
crate::crdt_state::write_item(story_id, &typed_stage, None, None, None, None, merged_at_ts);
|
||||
crate::crdt_state::write_item(story_id, &typed_stage, None, None, None, merged_at_ts);
|
||||
// Bug 780: stage transitions reset retry_count to 0. retry_count tracks
|
||||
// attempts at THIS stage's work (coding, merging, qa); a fresh attempt at
|
||||
// a new stage is conceptually distinct from prior attempts at a different
|
||||
|
||||
@@ -349,7 +349,6 @@ mod tests {
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
assert!(
|
||||
crdt_state::read_item(old_id).is_none(),
|
||||
|
||||
Reference in New Issue
Block a user