fix: add --all to cargo fmt in script/test and autoformat codebase

cargo fmt without --all fails with "Failed to find targets" in
workspace repos. This was blocking every story's gates. Also ran
cargo fmt --all to fix all existing formatting issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dave
2026-04-13 14:07:08 +00:00
parent ed2526ce41
commit 845b85e7a7
128 changed files with 3566 additions and 2395 deletions
@@ -52,18 +52,18 @@ pub(super) fn is_story_blocked(project_root: &Path, _stage_dir: &str, story_id:
///
/// Reads dependency state from the CRDT document first. Falls back to the
/// filesystem when the CRDT layer is not initialised.
pub(super) fn has_unmet_dependencies(
project_root: &Path,
stage_dir: &str,
story_id: &str,
) -> bool {
pub(super) fn has_unmet_dependencies(project_root: &Path, stage_dir: &str, story_id: &str) -> bool {
// Prefer CRDT-based check.
let crdt_deps = crate::crdt_state::check_unmet_deps_crdt(story_id);
if !crdt_deps.is_empty() {
return true;
}
// If the CRDT had the item and returned empty deps, it means all are met.
if crate::pipeline_state::read_typed(story_id).ok().flatten().is_some() {
if crate::pipeline_state::read_typed(story_id)
.ok()
.flatten()
.is_some()
{
return false;
}
// Fallback: filesystem check (CRDT not initialised or item not yet in CRDT).
@@ -82,7 +82,11 @@ pub(super) fn check_archived_dependencies(
story_id: &str,
) -> Vec<u32> {
// Prefer CRDT-based check when the item is known to CRDT.
if crate::pipeline_state::read_typed(story_id).ok().flatten().is_some() {
if crate::pipeline_state::read_typed(story_id)
.ok()
.flatten()
.is_some()
{
return crate::crdt_state::check_archived_deps_crdt(story_id);
}
// Fallback: filesystem.
@@ -146,7 +150,11 @@ mod tests {
"---\nname: Blocked\ndepends_on: [999]\n---\n",
)
.unwrap();
assert!(has_unmet_dependencies(tmp.path(), "2_current", "10_story_blocked"));
assert!(has_unmet_dependencies(
tmp.path(),
"2_current",
"10_story_blocked"
));
}
#[test]
@@ -162,7 +170,11 @@ mod tests {
"---\nname: Ok\ndepends_on: [999]\n---\n",
)
.unwrap();
assert!(!has_unmet_dependencies(tmp.path(), "2_current", "10_story_ok"));
assert!(!has_unmet_dependencies(
tmp.path(),
"2_current",
"10_story_ok"
));
}
#[test]
@@ -171,7 +183,11 @@ mod tests {
let current = tmp.path().join(".huskies/work/2_current");
std::fs::create_dir_all(&current).unwrap();
std::fs::write(current.join("5_story_free.md"), "---\nname: Free\n---\n").unwrap();
assert!(!has_unmet_dependencies(tmp.path(), "2_current", "5_story_free"));
assert!(!has_unmet_dependencies(
tmp.path(),
"2_current",
"5_story_free"
));
}
// ── Bug 503: archived-dep visibility ─────────────────────────────────────
@@ -184,7 +200,11 @@ mod tests {
let archived = tmp.path().join(".huskies/work/6_archived");
std::fs::create_dir_all(&backlog).unwrap();
std::fs::create_dir_all(&archived).unwrap();
std::fs::write(archived.join("500_spike_crdt.md"), "---\nname: CRDT Spike\n---\n").unwrap();
std::fs::write(
archived.join("500_spike_crdt.md"),
"---\nname: CRDT Spike\n---\n",
)
.unwrap();
std::fs::write(
backlog.join("503_story_dependent.md"),
"---\nname: Dependent\ndepends_on: [500]\n---\n",