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