Repository navigation
Conversation
Add `--waivers FILE` (TOML) with per-layer mm boxes and a required reason. Only a changed region wholly inside a box is waived; partial overlaps stay unwaived and are reported. Gates count only unwaived changes; summary, JSON, Markdown and HTML list every waived region with count, area and reason (TRUST-3). Stale waivers warn; --fail-on-stale-waivers exits 1. A malformed file, unknown key or unknown layer exits 2. Fixes #425 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The review found an issue that should be addressed before approval.
3 open issues
box_mmis publicly writable, but containment uses the privatebox_nmcached by the constructor.… · New Dividing the waived and unwaived twice-areas separately loses half-nm² remainders. For two disjoint… · New The terminal summary prints each waiver's aggregate count and area but never lists its matched… · New
What changed in this PR
Adds explicit, box-based waivers for known PCB changes, implementing #425 within the feature expansion tracked by #418. CLI gates count only unwaived changes while retaining the complete raw diff.
Changes:
- Adds core waiver validation, geometry classification, and reporting for matched, stale, and partially overlapping waivers.
- Integrates TOML waiver files and stale-waiver enforcement into CLI gates and report outputs.
- Adds unit/integration coverage and documents the waiver workflow.
| File | Description |
|---|---|
| site/docs.html | Updated as part of this pull request. |
| README.md | Updated as part of this pull request. |
| docs/REQUIREMENTS.md | Updated as part of this pull request. |
| crates/etchy-core/src/waiver.rs | Updated as part of this pull request. |
| crates/etchy-core/src/report.rs | Updated as part of this pull request. |
| crates/etchy-core/src/lib.rs | Updated as part of this pull request. |
| crates/etchy-core/src/export.rs | Updated as part of this pull request. |
| crates/etchy-core/src/diff.rs | Updated as part of this pull request. |
| crates/etchy-cli/tests/cli.rs | Updated as part of this pull request. |
| crates/etchy-cli/src/main.rs | Updated as part of this pull request. |
| crates/etchy-cli/Cargo.toml | Updated as part of this pull request. |
| CHANGELOG.md | Updated as part of this pull request. |
| Cargo.lock | Updated as part of this pull request. |
Review effort: Balanced
| pub layer: String, | ||
| /// `[x_min, y_min, x_max, y_max]` in mm, in the board's own coordinates | ||
| /// (the same numbers etchy prints as a region's bbox). | ||
| pub box_mm: [f64; 4], |
Comment on lines
+326
to
+327
| let unwaived_nm2 = if any_waived { | ||
| unwaived_2x / 2 |
| m.matched_area_mm2, | ||
| Self::status(m), | ||
| m.reason | ||
| ); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #425 (part of #418).
What
etchy old/ new/ --waivers waivers.tomlaccepts known changes, such as a bumped date code or revision text, so--fail-on-area,--fail-on-regionsand the any-change exit code still pass.etchy-core/src/waiver.rs, pure):Waiver::newvalidates the layer name, box and reason.apply_waivers(&BoardDiff, &[Waiver]) -> WaiverReportclassifies every changed shape, including sub-floor slivers, so waived and unwaived areas add up exactly. Areas are summed as exact twice-area integers. The report renders as text, Markdown and HTML, and itswarnings()covers stale waivers and partial overlaps.--waivers FILEand--fail-on-stale-waivers(which requires--waivers). TOML parsing uses thetomlcrate (MIT/Apache, already inCargo.lock) withdeny_unknown_fields.waiversobject), Markdown (### Waiverssection, so the Action PR comment gets it too) and HTML all list each waiver's region count, area, reason and status. They also list the waived regions and the regions that partially overlap a waiver without being waived. The raw diff (layers, totals, overlays) is unchanged, so waiving never hides a change.Design decisions (user unavailable — please check)
.etchy.toml. A waiver file that is picked up silently could quietly disarm a gate. Whenever a file is used, etchy printsetchy: using N waiver(s) from PATH.--fail-on-stale-waiversmakes them exit 1.top-copper,inner-copperN,drill-pth, …), an unknown key, a box that isn't 4 finite values or is inverted or zero-width, a missing or blank reason, invalid TOML, a file with no[[waiver]]entries, or--waiverswith PDF inputs.action.ymldoesn't expose the gate thresholds or extra flags yet, so it doesn't get awaiversinput here. Its comment renders from--format md, so once a flag passthrough exists it will show waivers with no further work.Tests
parse_waivers(integer boxes, unknown keys and tables, bad layer, 3-value box, blank and missing reason, empty file).--fail-on-stale-waiversexits 1.cargo fmt --check,cargo clippy --workspace --exclude etchy-gui --all-targets -D warnings,cargo test --workspace --exclude etchy-guiandcargo deny checkall pass.Docs: README,
site/docs.html(flags and a Waivers section),docs/REQUIREMENTS.md(new CLI-14, referencing TRUST-3) and CHANGELOG [Unreleased].