Skip to content

test: add phase 2 dogfood gate - #138

Merged
aram-devdocs merged 2 commits into
mainfrom
phase2-dogfood-gate-20
Apr 29, 2026
Merged

test: add phase 2 dogfood gate#138
aram-devdocs merged 2 commits into
mainfrom
phase2-dogfood-gate-20

Conversation

@aram-devdocs

Copy link
Copy Markdown
Owner

Summary\n- add a dogfood phase-gate test that runs all 8 MVP built-in rules together and asserts exact per-rule finding counts\n- gate CI preflight on cargo xtask pre-release so runbook/schema/rules-index checks are covered in PR CI\n\n## Local validation\n- git diff --check\n- Rust toolchain unavailable in this runtime (cargo not found); CI is the source of truth

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

PR #138test: add phase 2 dogfood gate

Files: crates/plumb-core/tests/dogfood_phase_gate.rs (+316), .github/workflows/ci.yml (+2), crates/plumb-mcp/AGENTS.md (-1 blank line)


1. Determinism

BTreeMap appears only in the test-local fold over violations — not in any output path. All fixture data is static slices with deterministic insertion order. IndexMap is correctly used for ColorSpec::tokens matching the type definition. The run() function's sort guarantee ((rule_id, viewport, selector, dom_order)) means the into_iter().fold() receives violations in a stable order regardless of how the rules fire internally. Clean.

2. Workspace layering

dogfood_phase_gate.rs lives under crates/plumb-core/tests/ and imports exclusively from plumb_core. No cross-crate deps, no layering violation. Clean.

3. Error handling

No library code changed. clippy.toml has allow-unwrap-in-tests = true / allow-expect-in-tests = true, so the .or_default() fold and assert_eq! pattern are fine under the workspace lint config. Clean.

4. Test coverage

The dogfood gate is well-structured:

  • Covers exactly the 8 rules returned by register_builtin() — nothing missed, nothing invented.
  • assert_eq!(by_rule, expected) on a BTreeMap catches both missing rules and unexpected extra rules in one assertion.
  • Clean-control nodes (#controls) guard against cross-rule noise — good defensive design.
  • #[allow(clippy::too_many_lines)] on dogfood_snapshot() is correctly required: pedantic is set to warn workspace-wide and RUSTFLAGS: -Dwarnings promotes it to error in CI.

5. CI change — cargo xtask pre-release in preflight

sync_rules_index() is read-only (validates docs pages exist, bails if any are missing; does not write). pre_release() therefore fails fast on schema drift or undocumented rules without mutating the workspace. Correct placement in preflight — which all downstream jobs depend on — ensures these checks gate the full matrix.

Nit: .github/workflows/ci.yml:20 — the job name still reads Preflight (fmt, clippy, check, agents-md); xtask pre-release is not reflected. Not a blocker, but the name will mislead future readers.

6. Documentation

No new public items added. No docs/src/** changes. Humanizer check not required.


Punch list

  • .github/workflows/ci.yml:20 — job name should mention xtask pre-release (nit; won't fail CI).

Verdict: APPROVE

@aram-devdocs
aram-devdocs merged commit 001f601 into main Apr 29, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant