Repository navigation
test: probe every documented discretization payload for unknown-key rejection - #386
Conversation
…ejection The strictness boundary test reached a discretization payload only through the minimal example's uniform scheme, so only Subdivision's rejection was pinned; Grading, SkinDepthGrading and AxisGrading — the types carrying every grading parameter the document's strictness sentence is about — and the Vec element path per_segment takes were unpinned. Add a table-driven test that splices a typo into each scheme payload from the document's own scheme table (inside an element for the two array schemes) and asserts the error names it; extract the table scan into documented_scheme_rows shared with the spellings test. Closes #381
|
PR #386's |
|
✅ Approved! A test-only PR that closes exactly the coverage gap #381 names, and I independently reproduced the one measurement that proves it bites. Spec reconciliationReviewed against #381's current body plus its trusted comments (Curator enhancement @ Verification I ran (not inferred)Scoped run in an isolated PR worktree at Mutation check — the AC that distinguishes a real pin from a test that merely parses valid payloads. I deleted
The For the two array schemes the typo is inside the element, so Acceptance criteriaAll six met. Unknown key probed into a payload of each of the five documented schemes with rejection asserted by name (✅ measured above); typo inside a Code qualityThe test cannot pass vacuously in any reachable way, which is the property that matters for a pinning test:
Both panic messages quote the document's own claim and the offending JSON, so a future failure is self-diagnosing. Sharing TDD claim
CI and merge state
Not flagged: no rollout-check section is required (this moves no work between hosts), and neither live-verification trigger fires — the diff drives no browser, scraper or DOM parser, and #381's body carries none of the silent-omission fragments. |
|
PR #386's |
|
Champion Auto-Merge This PR meets all safety criteria for automatic merging:
Proceeding with merge... If this was merged in error, you can revert with: Automated by Champion role |
Summary
The strictness boundary test reached a
discretizationpayload only through the minimal example'suniformscheme, so of the five payload types onlySubdivisionhad its unknown-key rejection pinned — and only through theuniformspelling.Grading,SkinDepthGradingandAxisGrading(the types carrying every grading parameter the document's strictness sentence is about) and theVecelement pathper_segmenttakes were unpinned: droppingdeny_unknown_fieldsfrom any of them let a misspelledratio/target_skin_depthssilently change the solved grid with every committed test green. This PR adds one table-driven test that probes all five schemes from the document's own scheme table.Changes
fasterhenry-cli/tests/input_format_doc.rsonly (test-only change):the_documented_discretization_spellings_all_parseinto a shareddocumented_scheme_rows()helper (no case removed; the existing test is otherwise unmodified).the_documented_discretization_payloads_all_reject_unknown_keys: splices"typo": 1after the payload's first{for every scheme row — inside the payload object for{…}schemes and inside the first element for the[{…}]schemes (per_segment,per_segment_graded) — and asserts each is rejected with an error namingtypo.Acceptance Criteria Verification
uniform,per_segment,graded,skin_depth,per_segment_graded); each error asserted to containtypoper_segment/per_segment_gradedtypo lands inside aVecelement{, which for[{…}]shapes is inside the element;assert_ne!guards the splice applieddeny_unknown_fieldsfromGrading,AxisGradingorSkinDepthGradingturns the test redgraded,per_segment_graded,skin_depthrespectivelydocs/input-format.md's table, not hard-codeddocumented_scheme_rows(); the key-listassert_eq!is only the fail-loudly guardgit diff --stat origin/main→fasterhenry-cli/tests/input_format_doc.rsonlycargo test -p fasterhenry-cli --test input_format_docpasses; pre-existing tests unmodified except extracted helperTest Plan
cargo test -p fasterhenry-cli --test input_format_doc→ 7 passed, 0 failed.#[serde(deny_unknown_fields)]fromGrading,AxisGrading,SkinDepthGradinginfasterhenry/src/solve.rsin three separate runs; each run failed the new test with "an unknown key in a<scheme>payload is rejected, but this parsed"; reverted after each (git statusclean on solve.rs afterwards).cargo test -p fasterhenry-cli→ 161 + 20 + 7 + 22 passed, 0 failed.cargo clippy --workspace --all-targets -- -D warnings(CI line verbatim) → clean.cargo fmtapplied.TDD: yes — the new test is the deliverable and was verified in both directions: green on main, red under each of the three attribute-deletion mutations, green again on revert.
Closes #381
loom dashboard