KeiSeiKit-1.0/_assembler/tests/golden.rs
Parfii-bot 4859e1cdf7 refactor: remove restricted-scope agents and blocks from public kit
Strip all patent-related tooling from the generic kit so it can ship
publicly under MIT without leaking sensitive IP. restricted-scope agents,
blocks, and skill conditionals live in the private PROJECT-E.

Deleted (5 files):
- _manifests/kei-patent-compliance.toml
- _manifests/kei-patent-researcher.toml
- _blocks/domain-sensitive IP-aware.md
- _assembler/tests/fixtures/_manifests/kei-patent-compliance.toml
- _assembler/tests/snapshots/kei-patent-compliance.snap

Cross-reference cleanup:
- 6 manifests: remove kei-patent-* handoffs and "sensitive IP" forbidden lines
- _blocks/deploy-local-only.md: drop sensitive IP rationale, keep ML weights /
  offensive / kernel / client-confidential banned-public triggers
- skills/research/SKILL.md: drop patent-angle-scanner + "Patent angles" section
- skills/new-agent/SKILL.md: drop Q5 (patent), renumber Q6→Q5 Q7→Q6
- README.md: drop 2 restricted agents rows, renumber wizard questions 5-7→5-6,
  update counts 34→33 blocks / 14→12 agents
- _assembler/tests/golden.rs: remove golden_patent_compliance test
- _assembler/tests/roundtrip.rs: swap kei-patent-compliance fixture to
  kei-cost-guardian for double-assembly determinism test
- _assembler/tests/fixtures/_manifests/kei-researcher.toml + snapshot:
  remove kei-patent-researcher handoff

Tests: 21 → 20 integration tests, all passing. Grep for "patent" in
main tree returns zero hits outside .claude/worktrees.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 19:07:02 +08:00

48 lines
1.6 KiB
Rust

//! Golden-file snapshot tests for the assembler.
//!
//! Contract under test: `same manifest + blocks → byte-identical .md`
//! (assembler.rs:2). This file locks the generated output for 3
//! representative manifests:
//!
//! - `kei-researcher` — minimal (only obligatory blocks)
//! - `kei-cost-guardian` — minimal + output_extra_fields
//! - `kei-code-implementer` — obligatory + 4 implementer blocks
//!
//! First run generates `tests/snapshots/*.snap.new`; approve with
//! `cargo insta review`. Subsequent runs assert byte-equality against
//! the approved snapshot. Any drift in assembler output will fail loudly.
mod common;
use common::{assemble_one, seed_tempdir};
/// Point insta at `tests/snapshots/` (not the default
/// `tests/snapshots/` inside each test binary) and use our own stable
/// snapshot naming scheme.
fn insta_settings() -> insta::Settings {
let mut s = insta::Settings::clone_current();
s.set_snapshot_path("snapshots");
s.set_prepend_module_to_snapshot(false);
s
}
#[test]
fn golden_researcher() {
let (_tmp, root) = seed_tempdir();
let out = assemble_one(&root, "kei-researcher");
insta_settings().bind(|| insta::assert_snapshot!("kei-researcher", out));
}
#[test]
fn golden_cost_guardian() {
let (_tmp, root) = seed_tempdir();
let out = assemble_one(&root, "kei-cost-guardian");
insta_settings().bind(|| insta::assert_snapshot!("kei-cost-guardian", out));
}
#[test]
fn golden_code_implementer() {
let (_tmp, root) = seed_tempdir();
let out = assemble_one(&root, "kei-code-implementer");
insta_settings().bind(|| insta::assert_snapshot!("kei-code-implementer", out));
}