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