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