huskies: merge 880

This commit is contained in:
dave
2026-04-29 21:41:44 +00:00
parent 4d24b5b661
commit 7e2f122d36
16 changed files with 508 additions and 40 deletions
+17
View File
@@ -170,6 +170,23 @@ pub(super) async fn run_agent_spawn(
prompt.push_str(&local);
}
// Prepend epic context when the story belongs to an epic (AC3, story 880).
// Read the story's front matter to find the epic ID, then load the epic's
// 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 Some(ref epic_id) = meta.epic
&& let Some(epic_content) = crate::db::read_content(epic_id)
{
let block = format!(
"# Epic Context\n\nThis work item belongs to epic `{epic_id}`.\
The following is the authoritative epic context you must respect:\n\n\
---\n{epic_content}\n---"
);
prompt = format!("{block}\n\n{prompt}");
}
// Append a reference to the source map if the file was written.
let source_map_path = project_root_clone.join(".huskies").join("source-map.json");
if source_map_path.exists() {