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