Commit graph

2 commits

Author SHA1 Message Date
Parfii-bot
f4cfb001ad test(assembler): golden-file snapshots for 4 representative manifests
Add tests/golden.rs with insta-backed snapshot assertions for:
- researcher        (minimal — 3 obligatory blocks only)
- cost-guardian     (minimal + output_extra_fields)
- patent-compliance (minimal + references.extra)
- code-implementer  (obligatory + 4 implementer-specific blocks)

Coverage: all four frontmatter fields (name/description/tools/model),
role body, block concatenation order, domain_in / forbidden_domain /
handoffs / output format (including extra fields) / references (both
optional memory_project + project_claudemd and references.extra).

The snapshots in tests/snapshots/*.snap are the signed contract —
any change to assembler.rs output must be reviewed via
`cargo insta review` and committed alongside the code change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 04:21:40 +08:00
Parfii-bot
e3053df706 test(assembler): add insta dev-dep and fixture-loading helpers
- Add insta + tempfile to _assembler/Cargo.toml [dev-dependencies].
- Create tests/common/mod.rs with helpers: seed_tempdir (copies
  fixtures into an isolated AGENT_ROOT), run_assemble (invokes the
  built binary via std::process::Command), and assemble_one
  (end-to-end single-manifest helper).
- Seed tests/fixtures/ with the 4 manifests covered by the golden
  snapshots (code-implementer, researcher, cost-guardian,
  patent-compliance) and the 7 blocks they reference (baseline,
  evidence-grading, memory-protocol, rule-pre-dev-gate,
  rule-test-first, rule-error-budget, rule-double-audit).

Binary-only crate (no lib target), so integration tests invoke the
assemble binary in-process instead of calling internal functions.
This exercises the full main.rs I/O + validator + assembler pipeline
end-to-end, which is exactly what the determinism claim covers.

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