Repository navigation
qa: standalone FSMA 204 7-CTE copy check in Fast Gate #3564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/usr/bin/env node | ||
| /** | ||
| * FSMA 204 CTE count copy check. | ||
| * | ||
| * Reads the real frontend FSMA 204 page source and fails if it says the rule | ||
| * has 6 Critical Tracking Events, or if it does not state 7. Restores the | ||
| * regulatory copy check from the former qa/fsma-lite-check.js, with no sample | ||
| * files. Node built-ins only. | ||
| */ | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| const PAGE = path.join(__dirname, '..', 'frontend', 'src', 'app', 'fsma-204', 'page.tsx'); | ||
|
|
||
| if (!fs.existsSync(PAGE)) { | ||
| console.error(`✗ FSMA 204 page not found: ${path.relative(process.cwd(), PAGE)}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| const content = fs.readFileSync(PAGE, 'utf8'); | ||
| const failures = []; | ||
|
|
||
| const sixPattern = /\b(?:6|six)\s+(?:Critical\s+Tracking\s+Events|CTEs)\b/i; | ||
| const sevenPattern = /\b7\s+Critical\s+Tracking\s+Events\b/; | ||
|
|
||
| const six = content.match(sixPattern); | ||
| if (six) failures.push(`Found "${six[0]}" — FSMA 204 has 7 CTEs, never 6`); | ||
| if (!sevenPattern.test(content)) failures.push('Missing "7 Critical Tracking Events"'); | ||
|
|
||
| console.log('FSMA 204 CTE count copy check'); | ||
| console.log(` ${six ? '✗' : '✓'} Page does not say 6 CTEs`); | ||
| console.log(` ${sevenPattern.test(content) ? '✓' : '✗'} Page says "7 Critical Tracking Events"`); | ||
|
|
||
| if (failures.length) { | ||
| for (const f of failures) console.error(` ${f}`); | ||
| process.exit(1); | ||
| } | ||
| console.log('PASS'); | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness |
Minor | ⚡ Quick win
Detect parenthesized six-count wording.
If the page says “six (6) Critical Tracking Events,”
sixPatterndoes not match. The existing “7 Critical Tracking Events” sentence still satisfiessevenPattern, so this incorrect copy passes the check. Allow a parenthesized count between the word and the CTE label.Proposed change
📝 Committable suggestion