test(storyboard): lock unified not_applicable note across all payload_must_contain modes#1490
Merged
Merged
Conversation
…_must_contain modes Follow-up to #1485. Per security-reviewer nit: a future refactor could emit a different `note` string for one match mode (present / equals / contains_any) and silently weaken the unified non-JSON `not_applicable` posture that adcp#3987 ratified. - Extract NON_JSON_NA_NOTE constant matching the runner string verbatim. - Replace regex `match(/non-JSON content_types/)` with exact-equality assertion at both existing test sites — any wording change forces every test to update in lockstep. - Add the missing contains_any non-JSON test to complete the matrix. - No runtime behavior change; test-only.
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.
Summary
Follow-up to #1485 (which aligned the runner with adcp#3987). Acts on the security-reviewer nit from the parallel review pass: lock the unified
not_applicableposture so a future refactor can't silently emit a differentnotestring for one match mode and weaken the contract.Changes
NON_JSON_NA_NOTEconstant matching the runner string verbatim.assert.match(result.note, /non-JSON content_types/)withassert.equal(result.note, NON_JSON_NA_NOTE)at both existing test sites (present,equals).contains_anynon-JSON test to complete the 3-mode matrix — same fixture shape asequals, asserts identical note.Why this matters
The runner emits the
not_applicablenote once at the validation level (validations.ts:2432), shared across all match modes. A regex-substring assertion would silently keep passing if someone refactored only one branch's wording. Exact-equality forces every test to update in lockstep.Test plan
payload_must_containsubtests + 33 existing).npm run format:checkclean.Cross-link
not_applicableposture.🤖 Generated with Claude Code