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