KeiSeiKit-1.0/_assembler/tests
Parfii-bot 889da7f941 test(assembler): determinism + roundtrip + validator-negative cases
tests/determinism.rs (3 cases):
- same input across 2 isolated tempdirs → byte-identical output
- same input across 10 isolated tempdirs → all byte-identical
  (catches HashMap iteration nondeterminism a 2-run check can miss)
- reordering blocks in the manifest changes output, but only in the
  block region — frontmatter + role + trailing sections are stable

tests/roundtrip.rs (2 cases):
- every manifest string (name, model, tools list, all domain_in /
  forbidden_domain / handoff.target / handoff.trigger entries)
  appears verbatim in the generated output; no field silently dropped
- two consecutive runs in the SAME tempdir produce identical bytes
  (defence against caching / mutable-global drift)

tests/validator_negative.rs (6 cases):
- unknown block ref → error mentions the bad name
- missing obligatory block (memory-protocol removed) → error names it
- empty handoff array → error mentions "handoff"
- whitespace-only role → error mentions "role"
- empty domain_in → error mentions "domain_in"
- --validate flag on a valid manifest: exit 0, no file written

Not covered: unsubstituted `{{placeholder}}` check — that validator
rule is being added in a parallel PR (fix/remaining-findings) and is
not yet on this base branch. Add a case for it when the check lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 04:31:41 +08:00
..
common test(assembler): add insta dev-dep and fixture-loading helpers 2026-04-21 04:15:04 +08:00
fixtures test(assembler): add insta dev-dep and fixture-loading helpers 2026-04-21 04:15:04 +08:00
snapshots test(assembler): golden-file snapshots for 4 representative manifests 2026-04-21 04:21:40 +08:00
determinism.rs test(assembler): determinism + roundtrip + validator-negative cases 2026-04-21 04:31:41 +08:00
golden.rs test(assembler): golden-file snapshots for 4 representative manifests 2026-04-21 04:21:40 +08:00
roundtrip.rs test(assembler): determinism + roundtrip + validator-negative cases 2026-04-21 04:31:41 +08:00
validator_negative.rs test(assembler): determinism + roundtrip + validator-negative cases 2026-04-21 04:31:41 +08:00