Single-commit clean baseline after security scrub of niche-tells, project codenames, internal jargon, and contributor-email leaks. Contents: - 100 Rust crates (_primitives/_rust/) - 37 agent manifests (_manifests/) + generated specs (_generated/) - 67 user-invocable skills (skills/) - 33 hooks (hooks/) - Composition blocks (_blocks/) - Documentation (docs/, README.md) - TS adapter packages (_ts_packages/) - Assembler (_assembler/) - Roles (_roles/) - Templates (_templates/) - Forgejo CI (.forgejo/) Author: Denis Parfionovich <info@greendragon.info> License: see LICENSE.
52 lines
1.3 KiB
Rust
52 lines
1.3 KiB
Rust
//! Detection smoke — feed each fixture to detect_format(), assert correct
|
|
//! winner with confidence ≥ 0.7.
|
|
|
|
use std::path::Path;
|
|
|
|
use kei_decompose::parsers::detect_format;
|
|
|
|
fn fixture(name: &str) -> std::path::PathBuf {
|
|
Path::new(env!("CARGO_MANIFEST_DIR"))
|
|
.join("tests/fixtures")
|
|
.join(name)
|
|
}
|
|
|
|
fn check(file: &str, expected: &str) {
|
|
let body = std::fs::read_to_string(fixture(file)).unwrap();
|
|
let r = detect_format(&body);
|
|
assert!(r.confidence >= 0.7, "{}: confidence {}", file, r.confidence);
|
|
let winner = r.winner.as_deref().unwrap_or("<none>");
|
|
assert_eq!(winner, expected, "{}: detected {}, expected {}", file, winner, expected);
|
|
}
|
|
|
|
#[test]
|
|
fn detects_research_master() {
|
|
check("sample-research.md", "research");
|
|
}
|
|
|
|
#[test]
|
|
fn detects_audit_report() {
|
|
check("sample-audit.md", "audit");
|
|
}
|
|
|
|
#[test]
|
|
fn detects_sleep_rem_report() {
|
|
check("sample-sleep.md", "sleep");
|
|
}
|
|
|
|
#[test]
|
|
fn detects_architecture_decision() {
|
|
check("sample-arch.md", "architecture");
|
|
}
|
|
|
|
#[test]
|
|
fn detects_new_project_phases() {
|
|
check("sample-new-project.md", "new-project");
|
|
}
|
|
|
|
#[test]
|
|
fn unknown_text_is_unclaimed() {
|
|
let body = "# Unrelated heading\n\nSome plain text without any kit cues.";
|
|
let r = detect_format(body);
|
|
assert!(r.confidence < 0.5, "expected NONE/AMBIGUOUS, got {}", r.confidence);
|
|
}
|