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