Skip to content

test(core): add false positive fixtures for technical strings - #171

Merged
sam247 merged 2 commits into
sam247:mainfrom
BilliamBaSH:test/technical-false-positive-fixtures
Nov 26, 2026
Merged

sam247 merged 2 commits into
sam247:mainfrom
BilliamBaSH:test/technical-false-positive-fixtures

Conversation

@BilliamBaSH

Copy link
Copy Markdown
Contributor

Summary

Adds the technical false-positive fixtures from #75: UUIDs, hashes, timestamps and version strings that hold no PII, kept as reusable regression fixtures so future pattern changes can be tested against them.

Refs #75; the multilingual set comes next as its own PR.

Changes

  • tests/fixtures/technical-strings.ts: 396 made-up lines, 33 shapes with 12 each, every value inside the kind of line it shows up in (logs, configs, git output, HTTP headers). Each line lists its technical values.
  • tests/technical-false-positives.test.ts: a detection that overlaps one of a line's technical values fails that line.
  • The 87 lines flagged today run as it.fails, so CI stays green and a later fix shows up as a test to take off the list. Happy to switch to it.skip or a plain list if you'd prefer.
  • Tests only, so no changeset.

What gets flagged today, on the technical value itself:

  • JWT exp/iat epoch seconds as PHONE_UK (12 of 12)
  • git log dates as NAME on "Thu Jul" (12 of 12)
  • HTTP Last-Modified dates as DATE (12 of 12)
  • [email protected] as DATE (12 of 12)
  • firmware like 10.6.135.x as IPV4, DATE and PHONE_UK (12 of 12)
  • Windows builds like 10.0.19045.5668 as PHONE_UK and XBOX_GAMERTAG (12 of 12)
  • AssemblyVersion like 1.88.1238.79945 as DATE and ZIP_CODE_US (12 of 12)
  • one each: a credit card inside a docker digest, a SEDOL in a git short hash, a UK phone inside a UUID

I didn't count NAME hits on the words around a value ("Fix typo in README"), since that's a different problem from this one.

Testing

  • npm test
  • npm run lint
  • Other (describe): ran with bun 1.4.4 on Node 24: bun run lint 9 of 9, bun run typecheck 9 of 9, build 8 of 8, bun run test 8 of 8. Core went from 653 passing to 963 passing plus 87 expected failures, 0 failing.

Checklist

  • Added/updated tests
  • Updated documentation
  • Checked for breaking changes and documented migration steps if needed
  • Linked any relevant issues

396 lines of UUIDs, hashes, timestamps and version strings in the
places they show up (logs, configs, git output, HTTP headers). 87 are
flagged today and run as it.fails, so the suite stays green and a fix
shows up as a test to take off the list.
@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown

@BilliamBaSH is attempting to deploy a commit to the Sam Pettiford's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sam247

sam247 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Reviewed — good fixture design, and I'd like to merge this.

What works: each line carries its own technical values, so a detection that overlaps one is a real signal rather than a string match. Keeping the 87 currently flagged lines as it.fails keeps CI green without hiding the debt.

Two refinements before merge:

  1. Group the known false positives under one clearly named describe (e.g. describe("known false positives (baseline)")) so a future fix shows up as a coherent block rather than 87 scattered entries.
  2. Assert the baseline count, e.g. expect(flaggedLines).toHaveLength(87). Without it, a fix that flips two entries to passing is invisible; with it, the number can only be paid down deliberately.

Worth adding that count to #75 so it is tracked as a number that goes down. No changeset needed for tests only — correct call.

@BilliamBaSH

Copy link
Copy Markdown
Contributor Author

Thanks for the review, both are done.

The 87 now sit in one "known false positives (baseline)" block, and a test pins the count at 87. it.fails already turns red when one starts passing, so between the two a fix can't slip by.

I'll add the 87 to #75 too.

@sam247
sam247 merged commit 9b141d1 into sam247:main Nov 26, 2026
9 of 10 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