Repository navigation
feat(scanner): add Trustabl Enrich for scanner findings - #1973
ericksondelacruz wants to merge 5 commits into
Conversation
… the API Downloads a GitHub working copy of the scanned commit, runs `trustabl enrich --apply --diff` on the selected finding with the provider key from Vault, optionally re-checks the result, and keeps the run in connector metadata so the UI can poll, cancel or discard it. - Contracts, input validation and Vault provider-key lookup - Tarball workspace with ref and path guards - Background runner with one run per connector, 10-minute timeout and cancel - Provider keys redacted by value from logs and errors - Project-scoped enrich API routes
Adds Copy and Enrich actions to the suggested fix, an Enrich dialog for provider, model, attempts and re-check, and a panel that shows the running command, its progress, failures and the resulting diff. Polling keeps going through network and server errors and clears the panel only when the server no longer has the run.
Playwright drives the finding sheet against a fake trustabl CLI and a local GitHub API stub, using a throwaway ClickHouse from E2E_CLICKHOUSE_URL.
Covers the Copy and Enrich actions, the Vault provider keys, what is sent to the provider, and the six enrich API operations in the OpenAPI spec and the API reference.
The CLI only writes a fix when the model's verbatim echo of the lines matches the file exactly, so a range ending in a blank line the model dropped is refused. When the fix stays on the finding's lines and is not a false positive, OpenLIT splices it into the review copy itself and the usual re-check decides the result.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
Sorry @ericksondelacruz, your pull request is larger than the review limit of 150,000 diff characters |
PR Summary by QodoAdd Trustabl Enrich to scanner findings
AI Description
Merge Risk
|
Code Review by Qodo
1. Large repositories can fill server disk
|
Issue number:
Change description:
Adds Trustabl Enrich to scanner findings. From a finding's suggested fix, you can copy the fix or run
trustabl enrich. Enrich asks an LLM to produce a concrete fix for the finding, optionally re-checks it, and shows the resulting diff.trustabl enrich --apply --diffon the selected finding with the LLM provider's key from Vault. Each connector runs one enrich at a time, with a 10-minute timeout and cancel. Provider keys are redacted by value from logs and errors. Runs are kept in connector metadata so the UI can poll, cancel or discard them. Endpoints, all project-scoped:GET/POST /api/scanners/{id}/enrichGET /api/scanners/{id}/enrich/providersGET/DELETE /api/scanners/{id}/enrich/{runId}POST /api/scanners/{id}/enrich/{runId}/cancel--apply: The CLI writes a fix only when the model's verbatim echo of the lines matches the file exactly. When the fix stays on the finding's lines and is not a false positive, OpenLIT splices it into the review copy itself, and the usual re-check decides the result.e2e/scanner-enrich.spec.ts) drives the finding sheet against a faketrustablCLI and a local GitHub API stub, using a throwaway ClickHouse fromE2E_CLICKHOUSE_URL.Checks on the branch rebased onto current
main, fromsrc/client:npm run lint: no warnings or errorsnpx tsc --noEmit: 0 errorsnpx jest: 436/436 suites, 6260/6260 testsChecklist
If your change doesn't seem to apply, please leave them unchecked.
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.