huskies: merge 865

This commit is contained in:
dave
2026-05-08 14:24:20 +00:00
parent fac4442969
commit 9be438e6d3
47 changed files with 733 additions and 731 deletions
@@ -24,7 +24,7 @@ impl AgentPool {
/// logged so the user can see the promotion was triggered by an archived dep, not
/// a clean completion.
pub(super) fn promote_ready_backlog_stories(&self, project_root: &Path) {
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let items = scan_stage_items(project_root, "1_backlog");
for story_id in &items {
+1 -1
View File
@@ -79,7 +79,7 @@ impl AgentPool {
// crash/restart doesn't re-trigger an infinite loop.
if let Some(contents) = crate::db::read_content(story_id) {
let updated =
crate::io::story_metadata::write_mergemaster_attempted_in_content(
crate::db::yaml_legacy::write_mergemaster_attempted_in_content(
&contents,
);
crate::db::write_content(story_id, &updated);
@@ -159,10 +159,7 @@ impl AgentPool {
let default_qa = crate::config::ProjectConfig::load(project_root)
.unwrap_or_default()
.default_qa_mode();
let story_path = project_root
.join(".huskies/work/2_current")
.join(format!("{story_id}.md"));
crate::io::story_metadata::resolve_qa_mode(&story_path, default_qa)
crate::io::story_metadata::resolve_qa_mode(story_id, default_qa)
}
};
@@ -221,9 +218,7 @@ impl AgentPool {
let story_path = project_root
.join(".huskies/work/3_qa")
.join(format!("{story_id}.md"));
if let Err(e) =
crate::io::story_metadata::write_review_hold(&story_path)
{
if let Err(e) = crate::db::yaml_legacy::write_review_hold(&story_path) {
eprintln!(
"[startup:reconcile] Failed to set review_hold on '{story_id}': {e}"
);
@@ -278,14 +273,11 @@ impl AgentPool {
if item_type == "spike" {
true
} else {
let story_path = project_root
.join(".huskies/work/3_qa")
.join(format!("{story_id}.md"));
let default_qa = crate::config::ProjectConfig::load(project_root)
.unwrap_or_default()
.default_qa_mode();
matches!(
crate::io::story_metadata::resolve_qa_mode(&story_path, default_qa),
crate::io::story_metadata::resolve_qa_mode(story_id, default_qa),
crate::io::story_metadata::QaMode::Human
)
}
@@ -295,7 +287,7 @@ impl AgentPool {
let story_path = project_root
.join(".huskies/work/3_qa")
.join(format!("{story_id}.md"));
if let Err(e) = crate::io::story_metadata::write_review_hold(&story_path) {
if let Err(e) = crate::db::yaml_legacy::write_review_hold(&story_path) {
eprintln!(
"[startup:reconcile] Failed to set review_hold on '{story_id}': {e}"
);
@@ -24,14 +24,14 @@ pub(super) fn read_story_front_matter_agent(
{
return Some(agent.clone());
}
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let contents = read_story_contents(project_root, story_id)?;
parse_front_matter(&contents).ok()?.agent
}
/// Return `true` if the story file in the given stage has `review_hold: true` in its front matter.
pub(super) fn has_review_hold(project_root: &Path, _stage_dir: &str, story_id: &str) -> bool {
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let contents = match read_story_contents(project_root, story_id) {
Some(c) => c,
None => return false,
@@ -52,7 +52,7 @@ pub(super) fn is_story_blocked(project_root: &Path, _stage_dir: &str, story_id:
return true;
}
// Legacy fallback: check front-matter field for backward compatibility.
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let contents = match read_story_contents(project_root, story_id) {
Some(c) => c,
None => return false,
@@ -122,7 +122,7 @@ pub(super) fn is_story_frozen(_project_root: &Path, _stage_dir: &str, story_id:
/// Return `true` if the story file has a `merge_failure` field in its front matter.
pub(super) fn has_merge_failure(project_root: &Path, _stage_dir: &str, story_id: &str) -> bool {
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let contents = match read_story_contents(project_root, story_id) {
Some(c) => c,
None => return false,
@@ -142,7 +142,7 @@ pub(super) fn has_content_conflict_failure(
_stage_dir: &str,
story_id: &str,
) -> bool {
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let contents = match read_story_contents(project_root, story_id) {
Some(c) => c,
None => return false,
@@ -163,7 +163,7 @@ pub(super) fn has_mergemaster_attempted(
_stage_dir: &str,
story_id: &str,
) -> bool {
use crate::io::story_metadata::parse_front_matter;
use crate::db::yaml_legacy::parse_front_matter;
let contents = match read_story_contents(project_root, story_id) {
Some(c) => c,
None => return false,
@@ -80,7 +80,7 @@ pub(super) fn resolve_qa_mode_from_store(
/// Write review_hold to the content store.
pub(super) fn write_review_hold_to_store(story_id: &str) {
if let Some(contents) = crate::db::read_content(story_id) {
let updated = crate::io::story_metadata::write_review_hold_in_content(&contents);
let updated = crate::db::yaml_legacy::write_review_hold_in_content(&contents);
crate::db::write_content(story_id, &updated);
// Also persist to SQLite via shadow write.
let stage = crate::pipeline_state::read_typed(story_id)
+1 -1
View File
@@ -230,7 +230,7 @@ pub(super) async fn run_agent_spawn(
// content and prepend it to the system prompt so the agent treats it as
// authoritative context.
if let Some(story_content) = crate::db::read_content(&sid)
&& let Ok(meta) = crate::io::story_metadata::parse_front_matter(&story_content)
&& let Ok(meta) = crate::db::yaml_legacy::parse_front_matter(&story_content)
&& let Some(ref epic_id) = meta.epic
&& let Some(epic_content) = crate::db::read_content(epic_id)
{
+1 -1
View File
@@ -70,7 +70,7 @@ pub(super) fn read_front_matter_agent(story_id: &str, agent_name: Option<&str>)
return Some(agent.clone());
}
crate::db::read_content(story_id).and_then(|contents| {
crate::io::story_metadata::parse_front_matter(&contents)
crate::db::yaml_legacy::parse_front_matter(&contents)
.ok()?
.agent
})