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