Skip to content

test(tax-packs): move ReDoS-fixture pattern out of analyzed TS source - #407

Merged
itsbkm merged 1 commit into
mainfrom
fix/tax-pack-registration-number-format
Aug 19, 2026
Merged

itsbkm merged 1 commit into
mainfrom
fix/tax-pack-registration-number-format

Conversation

@itsbkm

@itsbkm itsbkm commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #405 (merged via admin override while the CodeQL default-setup PR gate was still red on this one file).

  • The check-25 rejection test embeds the textbook (A+)+ catastrophic-backtracking shape as fixture data to prove validationChecklist rejects it. CodeQL's PR-time gate correctly recognizes the shape as dangerous and flags it as a new high-severity alert, even though it's negative-test fixture data never compiled or run against untrusted input outside that one reject-path assertion.
  • Two attempts at inline codeql[...] suppression comments (wrong rule id, then the corrected one) did not stop the gate from flagging it.
  • This moves the pattern into tests/fixtures/catastrophic-registration-format.json, loaded the same way this file already loads its other pack fixtures — it's data, not a regex literal in analyzed TypeScript source, so there's nothing left for the scanner to flag.

Confirmed separately that main currently has zero open CodeQL alerts — the persisted alert list uses a stricter "remote threat model" filter than the PR-time gate, and a test-only fixture never qualified. This is pure cleanup so future PRs touching this file don't hit the same false positive.

Test plan

  • npx tsc --noEmit
  • npm run lint
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/tax-pack-management.test.ts (159/159 passing)

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves the deliberately catastrophic registration-number pattern from inline TypeScript into a JSON fixture while preserving the existing check-25 rejection assertion.

  • Adds a dedicated catastrophic registration-format fixture.
  • Loads that fixture through the test suite’s existing CommonJS JSON-fixture convention.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains in the reviewed changes.

Important Files Changed

Filename Overview
tests/tax-pack-management.test.ts Replaces the inline catastrophic pattern with a JSON fixture loaded using an established mechanism while preserving the rejection test.
tests/fixtures/catastrophic-registration-format.json Adds fixture data with the expected pattern-and-description shape for the check-25 negative test.

Reviews (3): Last reviewed commit: "test(tax-packs): load the check-25 rejec..." | Re-trigger Greptile

@itsbkm
itsbkm force-pushed the fix/tax-pack-registration-number-format branch from ed2b598 to 56ccc0c Compare August 19, 2026 21:22
…nline

Two attempts at an inline codeql[] suppression comment (js/polynomial-redos,
then the correct js/redos) did not stop CodeQL's default-setup PR gate from
flagging the deliberately-catastrophic (A+)+ pattern as a new high-severity
alert. Move the pattern into a JSON fixture instead, matching how this file
already loads its other pack fixtures (synthetic-dual-rate-pack.json etc.)
— it's data, not a regex literal in analyzed TypeScript source, so it's
no longer something the scanner has a literal to flag in the first place.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@itsbkm
itsbkm force-pushed the fix/tax-pack-registration-number-format branch from 56ccc0c to 06c70cb Compare August 19, 2026 21:45
@itsbkm
itsbkm merged commit 9243a51 into main Aug 19, 2026
13 checks passed
@itsbkm
itsbkm deleted the fix/tax-pack-registration-number-format branch August 19, 2026 21:49
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