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