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