Skip to content

Refactor/pure parsers - #18

Merged
devtofunmi merged 9 commits into
mainfrom
refactor/pure-parsers
Aug 12, 2026
Merged

Refactor/pure parsers#18
devtofunmi merged 9 commits into
mainfrom
refactor/pure-parsers

Conversation

@devtofunmi

Copy link
Copy Markdown
Owner

No description provided.

Kept separate from vite.config.ts so Vitest runs the unit tests without spinning up the TanStack Start / Nitro stack. Includes src/**/*.test.ts under the node environment.
Add a Test step (npm run test) after lint and format so the new unit tests gate pull requests.
Move the JSON-to-findings parser and the SEVERITIES list into findings.ts — no I/O, no provider coupling — so it can be unit-tested directly and shared by the review and scan adapters instead of being duplicated in both.
Well-formed parse, malformed JSON, missing/non-array findings, dropped entries (missing title/filePath, non-objects), unknown-severity fallback to note, and optional-field coercion.
Drop the local SEVERITIES/parseFindings and import them from ./findings; reviewDiff and RESPONSE_SCHEMA are unchanged otherwise.
Move ScanFindingCounts, emptyCounts, the ScanSummary shape, and summaryToCounts into scan-engine/summary.ts so the counts logic is I/O-free and unit-testable.
Null/undefined/non-object summaries read as zero, partial counts merge over the baseline, counts are summed without a findings array, the findings-array length wins when present, and the shared baseline isn't mutated.
Drop the duplicated SEVERITIES/parseFindings and import them from ../review-engine/findings; behavior unchanged.
Import summaryToCounts and the ScanFindingCounts/ScanSummary types from scan-engine/summary (re-exporting ScanFindingCounts for existing consumers); removes the inline copies.
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jargons-8yyz Ready Ready Preview Aug 12, 2026 9:49pm

@devtofunmi
devtofunmi merged commit 7c0689d into main Aug 12, 2026
3 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