huskies: merge 961
This commit is contained in:
@@ -463,7 +463,7 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(crate::db::read_content("5_story_test").is_some());
|
||||
assert!(crate::db::read_content(crate::db::ContentKey::Story("5_story_test")).is_some());
|
||||
let parsed: Value = serde_json::from_str(&result).unwrap();
|
||||
assert_eq!(parsed["story_id"], "5_story_test");
|
||||
assert_eq!(parsed["from_stage"], "backlog");
|
||||
@@ -495,7 +495,7 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(crate::db::read_content("6_story_back").is_some());
|
||||
assert!(crate::db::read_content(crate::db::ContentKey::Story("6_story_back")).is_some());
|
||||
let parsed: Value = serde_json::from_str(&result).unwrap();
|
||||
// from_stage may be inaccurate when using the content-store fallback
|
||||
// (it lacks stage tracking), but the move itself must succeed.
|
||||
@@ -527,7 +527,7 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(crate::db::read_content("9907_story_idem").is_some());
|
||||
assert!(crate::db::read_content(crate::db::ContentKey::Story("9907_story_idem")).is_some());
|
||||
let parsed: Value = serde_json::from_str(&result).unwrap();
|
||||
// When CRDT is uninitialised the content-store fallback handles the
|
||||
// move, so idempotency detection may not fire. Verify the to_stage
|
||||
|
||||
@@ -349,7 +349,7 @@ mod tests {
|
||||
let story_file = current_dir.join("24_story_test.md");
|
||||
std::fs::write(&story_file, content).unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_content("24_story_test", content);
|
||||
crate::db::write_content(crate::db::ContentKey::Story("24_story_test"), content);
|
||||
std::process::Command::new("git")
|
||||
.args(["add", "."])
|
||||
.current_dir(tmp.path())
|
||||
@@ -366,7 +366,7 @@ mod tests {
|
||||
let result = tool_move_story_to_merge(&json!({"story_id": "24_story_test"}), &ctx).await;
|
||||
// Content store should still have the item after the move
|
||||
assert!(
|
||||
crate::db::read_content("24_story_test").is_some(),
|
||||
crate::db::read_content(crate::db::ContentKey::Story("24_story_test")).is_some(),
|
||||
"content store should have the story after move"
|
||||
);
|
||||
// Result is either Ok (agent started) or Err (agent failed - acceptable in tests)
|
||||
|
||||
@@ -219,7 +219,7 @@ pub(crate) async fn tool_run_tests(args: &Value, ctx: &AppContext) -> Result<Str
|
||||
// ran passing tests before it died. Only written when running
|
||||
// in a story worktree (worktree_path arg provided).
|
||||
if passed && args.get("worktree_path").is_some() {
|
||||
crate::db::write_content(&format!("{sid}:run_tests_ok"), "1");
|
||||
crate::db::write_content(crate::db::ContentKey::RunTestsOk(&sid), "1");
|
||||
}
|
||||
return serde_json::to_string_pretty(&json!({
|
||||
"passed": passed,
|
||||
|
||||
@@ -171,7 +171,7 @@ pub(super) async fn tool_status(args: &Value, ctx: &AppContext) -> Result<String
|
||||
));
|
||||
}
|
||||
|
||||
let contents = crate::db::read_content(story_id)
|
||||
let contents = crate::db::read_content(crate::db::ContentKey::Story(story_id))
|
||||
.ok_or_else(|| format!("Story '{story_id}' has no content in the content store."))?;
|
||||
|
||||
// --- Metadata (story 929: CRDT-first, yaml_residue marks gaps) ---
|
||||
|
||||
@@ -284,7 +284,7 @@ mod tests {
|
||||
let bug_id = result.trim_start_matches("Created bug: ").trim();
|
||||
// Bug content should exist in the CRDT content store.
|
||||
assert!(
|
||||
crate::db::read_content(bug_id).is_some(),
|
||||
crate::db::read_content(crate::db::ContentKey::Story(bug_id)).is_some(),
|
||||
"expected bug content in CRDT for {bug_id}"
|
||||
);
|
||||
}
|
||||
@@ -482,7 +482,7 @@ mod tests {
|
||||
let result = tool_close_bug(&json!({"bug_id": "9901_bug_crash"}), &ctx).unwrap();
|
||||
assert!(result.contains("9901_bug_crash"));
|
||||
assert!(
|
||||
crate::db::read_content("9901_bug_crash").is_some(),
|
||||
crate::db::read_content(crate::db::ContentKey::Story("9901_bug_crash")).is_some(),
|
||||
"content store should have the bug after close"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let contents = crate::db::read_content("9906_story_persist")
|
||||
let contents = crate::db::read_content(crate::db::ContentKey::Story("9906_story_persist"))
|
||||
.expect("story content should exist in CRDT");
|
||||
assert!(
|
||||
contents.contains("## Test Results"),
|
||||
@@ -649,7 +649,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// Criterion must still be unchecked in the CRDT.
|
||||
let contents = crate::db::read_content("9997_empty_branch")
|
||||
let contents = crate::db::read_content(crate::db::ContentKey::Story("9997_empty_branch"))
|
||||
.expect("story content should still be in CRDT");
|
||||
assert!(
|
||||
contents.contains("- [ ] Implement the feature"),
|
||||
|
||||
@@ -105,7 +105,7 @@ pub(crate) fn tool_show_epic(args: &Value, _ctx: &AppContext) -> Result<String,
|
||||
.and_then(|v| v.as_str())
|
||||
.ok_or("Missing required argument: epic_id")?;
|
||||
|
||||
let content = crate::db::read_content(epic_id)
|
||||
let content = crate::db::read_content(crate::db::ContentKey::Story(epic_id))
|
||||
.ok_or_else(|| format!("Epic '{epic_id}' not found in content store"))?;
|
||||
|
||||
let epic_view = crate::crdt_state::read_item(epic_id)
|
||||
|
||||
@@ -140,7 +140,8 @@ mod tests {
|
||||
// Extract the actual spike ID from the result message (format: "Created spike: <id>").
|
||||
let spike_id = result.trim_start_matches("Created spike: ").trim();
|
||||
// Spike content should exist in the CRDT content store.
|
||||
let contents = crate::db::read_content(spike_id).expect("expected spike content in CRDT");
|
||||
let contents = crate::db::read_content(crate::db::ContentKey::Story(spike_id))
|
||||
.expect("expected spike content in CRDT");
|
||||
assert!(contents.starts_with("---\ntype: spike\nname: \"Compare Encoders\"\n---"));
|
||||
assert!(contents.contains("Which encoder is fastest?"));
|
||||
}
|
||||
@@ -163,7 +164,8 @@ mod tests {
|
||||
let spike_id = result.trim_start_matches("Created spike: ").trim();
|
||||
|
||||
// Spike content should exist in the CRDT content store.
|
||||
let contents = crate::db::read_content(spike_id).expect("expected spike content in CRDT");
|
||||
let contents = crate::db::read_content(crate::db::ContentKey::Story(spike_id))
|
||||
.expect("expected spike content in CRDT");
|
||||
assert!(contents.starts_with("---\ntype: spike\nname: \"My Spike\"\n---"));
|
||||
assert!(contents.contains("## Question\n\n- TBD\n"));
|
||||
}
|
||||
|
||||
@@ -239,7 +239,8 @@ mod tests {
|
||||
.trim_start_matches("Created story: ")
|
||||
.trim()
|
||||
.to_string();
|
||||
let content = crate::db::read_content(&story_id).expect("story content should exist");
|
||||
let content = crate::db::read_content(crate::db::ContentKey::Story(&story_id))
|
||||
.expect("story content should exist");
|
||||
assert!(
|
||||
content.contains("## Description"),
|
||||
"Description section missing from story: {content}"
|
||||
|
||||
Reference in New Issue
Block a user