Description
With the schema in place, the /scan and /scan-url endpoints need to write their findings into the database after each scan completes. This is what builds the training dataset over time.
What to implement
- After findings are aggregated from Semgrep, OSV-Scanner, and Gitleaks, insert each finding into the
findings table using the schema from Issue 1.1
- Insert a row into the
jobs table for each new job
- Each finding should get a stable
id — use uuid4() so it can be referenced later
- Wrap the insert in a try/except so a DB write failure never crashes the scan response
Acceptance criteria
Description
With the schema in place, the
/scanand/scan-urlendpoints need to write their findings into the database after each scan completes. This is what builds the training dataset over time.What to implement
findingstable using the schema from Issue 1.1jobstable for each new jobid— useuuid4()so it can be referenced laterAcceptance criteria
/scanand/scan-urlcall writes tofindingsandjobssqlite3 patchpilot.db "SELECT * FROM findings LIMIT 5;"