Skip to main content

harn_cli/commands/
mod.rs

1pub(crate) mod agents_conformance;
2pub(crate) mod bench;
3pub(crate) mod check;
4pub(crate) mod connect;
5pub(crate) mod connector;
6pub(crate) mod contracts;
7pub(crate) mod crystallize;
8pub(crate) mod doctor;
9pub(crate) mod dump_highlight_keywords;
10pub(crate) mod dump_trigger_quickref;
11pub(crate) mod explain;
12pub mod flow;
13pub(crate) mod init;
14pub(crate) mod mcp;
15pub(crate) mod merge_captain;
16pub(crate) mod merge_captain_mock;
17pub mod orchestrator;
18pub mod persona;
19pub mod persona_doctor;
20pub mod persona_scaffold;
21pub mod playground;
22pub(crate) mod portal;
23pub(crate) mod protocol_conformance;
24pub(crate) mod repl;
25pub mod run;
26pub(crate) mod serve;
27pub(crate) mod skill;
28pub(crate) mod skills;
29pub(crate) mod test;
30pub(crate) mod trace;
31pub mod trigger;
32pub(crate) mod trust;
33pub(crate) mod viz;
34
35use std::path::{Path, PathBuf};
36
37/// Recursively collect `.harn` files under `dir`, sorted by path. Files with a
38/// sibling `<name>.conformance-skip` marker are excluded — used to temporarily
39/// park tests that are tracking a known regression in an issue so `make test`
40/// + `harn test conformance` can stay green while the fix is in flight.
41pub(crate) fn collect_harn_files(dir: &Path, out: &mut Vec<PathBuf>) {
42    if let Ok(entries) = std::fs::read_dir(dir) {
43        let mut entries: Vec<_> = entries.filter_map(|e| e.ok()).collect();
44        entries.sort_by_key(|e| e.path());
45        for entry in entries {
46            let path = entry.path();
47            if path.is_dir() {
48                collect_harn_files(&path, out);
49            } else if path.extension().is_some_and(|ext| ext == "harn") {
50                let skip_marker = path.with_extension("conformance-skip");
51                if skip_marker.exists() {
52                    continue;
53                }
54                out.push(path);
55            }
56        }
57    }
58}