Skip to content

test(storyboard): lock unified not_applicable note across all payload_must_contain modes#1490

Merged
bokelley merged 1 commit into
mainfrom
bokelley/storyboard-na-note-lock
May 3, 2026
Merged

test(storyboard): lock unified not_applicable note across all payload_must_contain modes#1490
bokelley merged 1 commit into
mainfrom
bokelley/storyboard-na-note-lock

Conversation

@bokelley

@bokelley bokelley commented May 3, 2026

Copy link
Copy Markdown
Contributor

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_applicable posture so a future refactor can't silently emit a different note string for one match mode and weaken the contract.

Changes

  • Extract NON_JSON_NA_NOTE constant matching the runner string verbatim.
  • Replace assert.match(result.note, /non-JSON content_types/) with assert.equal(result.note, NON_JSON_NA_NOTE) at both existing test sites (present, equals).
  • Add the missing contains_any non-JSON test to complete the 3-mode matrix — same fixture shape as equals, asserts identical note.

Why this matters

The runner emits the not_applicable note 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

  • Targeted: 36/36 pass (3 non-JSON payload_must_contain subtests + 33 existing).
  • npm run format:check clean.
  • No runtime behavior change — test-only.
  • CI passes.

Cross-link

🤖 Generated with Claude Code

…_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.
@bokelley bokelley merged commit 65f8f6e into main May 3, 2026
8 of 9 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