Skip to content

test(downgrader): cover a 3.2 security requirement name holding undefined - #334

Merged
dinwwwh merged 5 commits into
mainfrom
claude/project-thread-rixcs1
Nov 2, 2026
Merged

dinwwwh merged 5 commits into
mainfrom
claude/project-thread-rixcs1

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Nov 2, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

https://claude.ai/code/session_01VVaw7RYWCsn8myBE4Rncuq


Test-only. Stryker on main (55c2570) has one survivor that #331 introduced: requirement[name] !== undefined → true in the 3.2 convertSecurity.

Before #331, the oRPC undefined-key test (which adds missing: undefined to every object) killed that mutant. isScheme('missing') was true then, because securitySchemes had the key, so only the requirement check removed the name. Since #331, isScheme is false for a scheme holding undefined, so the requirement check is never reached.

The #331 test now also has a requirement { key: undefined } whose scheme exists, and checks the result with toStrictEqual. Without the check, the output keeps an own key holding undefined, which a tool listing the requirement's keys would read as a needed scheme.


Generated by Claude Code

…and repeated keywords beside properties

Stryker on 94c60c7 leaves 77 mutants alive where 0.5.0 left 70. Seven of
the new ones are untested branches from #313, #314 and #318:

- cutHolders.clear() removed: a $ref object cut in one call still tells no
  oneOf branch apart in the next.
- follow's check for a $ref into a target being inlined removed: a $ref to
  a component whose own $ref into that target is cut only later keeps a
  oneOf whose branches now overlap.
- isOneWay ignoring writeOnly, or not following a $ref to the tag.
- repeats(): a repeated additionalProperties beside the same properties,
  and another keyword beside different properties.
- mayRepeatUnseen counting null as an object.

Each of these mutants now fails a test. No source change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7RYWCsn8myBE4Rncuq
…me holds undefined

#324 keeps a requirement name only when components.securitySchemes has it
as an own key, so a scheme entry holding undefined, as spreading options
often leaves, still counted as a scheme. The 3.1 output leaves that entry
out, so the requirement named a scheme the document no longer defines,
and the same input with the key deleted gave a different output.

The check now also needs the entry to hold a value, as every other key
holding undefined counts as missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7RYWCsn8myBE4Rncuq
…ined

Since #331 a scheme holding undefined fails the scheme check first, so
the oRPC undefined-key test no longer reaches the check that leaves out a
requirement name holding undefined, and Stryker leaves that mutant alive.
A requirement name holding undefined whose scheme exists now must come
out as a missing key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVaw7RYWCsn8myBE4Rncuq
@dinwwwh dinwwwh self-assigned this Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • convertSecurity undefined-name coverage — the existing "leaves out security requirement names that are not a component name" test gains a second requirement { key: undefined }, and the assertion is tightened from toEqual to toStrictEqual so an own key holding undefined is observable. This kills the Stryker survivor on requirement[name] !== undefined in v3.2-to-v3.1.ts:184 that #331 reintroduced.

I verified the affected test passes (vitest run tests/v3.2-to-v3.1.test.ts -t "leaves out security requirement names"), and confirmed the expectation matches convertSecurity: requirement[name] !== undefined && isScheme(name) drops the undefined-valued name, and Object.fromEntries leaves no key behind, yielding {} for the second requirement.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 29 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing claude/project-thread-rixcs1 (720cf6e) with main (7828201)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@dinwwwh
dinwwwh merged commit 0dfea2b into main Nov 2, 2026
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.

2 participants