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