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