Skip to content

Deep audit fixes: finding sheet, inline errors, honest grades, exports, error states - #6

Merged
sanketpatel32 merged 20 commits into
mainfrom
fix/deep-audit
Oct 31, 2026
Merged

sanketpatel32 merged 20 commits into
mainfrom
fix/deep-audit

Conversation

@sanketpatel32

Copy link
Copy Markdown
Owner

Fixes from the second, deep (nested-page) audit. Focused commits, API stays backward compatible (report.json is a new alias of findings.json; ?inline=1 is opt-in).

Fixes

  1. Finding detail: now a drawer (desktop) or a sheet (phone) instead of sitting 26k px below the list. The problem is shown first, plus an Open in editor link.
  2. Add workspace: plain-language path errors show inline in the dialog. No raw Go stat/getwd text.
  3. Grade: one analyzer-coverage count, a plain-language explanation of the grade, and a "provisional" flag when analyzers didn't run.
  4. Missing tools: one grouped "tools aren't installed" notice with Set up tools.
  5. Search: dedupes to each workspace's latest scan by default (scope=all keeps the old behaviour).
  6. Exports: Markdown verdict summary; branded HTML (grade tile, coverage line); JSON in the menu; "Open HTML report in a new tab" (sandboxed CSP).
  7. Suppressions: suppressing updates counts, grade and status chips; the UI asks for a reason.
  8. Live scan: the headline, badge and pills tell one story ("Running analyzers · X of Y finished").
  9. History: a visible "Compare latest two scans" action, a Close button, and timestamps with seconds; notifications name the workspace instead of a scan ID.
  10. Files page: "Files & rules" is renamed "Files & paths" / "Include / exclude paths".
  11. OWASP matrix: TODO markers no longer go under A09; tighter A07/A10 matching; percentages are of security-relevant findings.
  12. Report: no "0" chips for failed tools; titles no longer split inside file names.
  13. Performance: the workspace list never walks folders; analyzer runs are batched; comparisons are cached.
  14. Error states: NOT_FOUND shows "Nothing here anymore" with way-back actions instead of Try again. When workspaces fail to load, Home shows "grade unavailable" instead of fake zero stats. Phone overflow is fixed for the Search Columns panel and the CLI tabs.
  15. Cleanup (partial): staticcheck is clean on Linux and Windows. The extended e2e smoke suite covers these regressions. The embedded UI is rebuilt.

Not in this PR

  • Item 3 (ZAP/Nuclei/Burp tabs, Execute Check, Rules page, Dependencies tab) is out of scope by request.
  • The mechanical server.go split and the styles.css consolidation are deferred to a follow-up. They are large, purely structural diffs and would bury the behaviour changes above in review.

Checks

  • go vet ./... passes; GOOS=windows go build ./... passes; staticcheck is clean for both GOOS.
  • go test ./...: everything passes except the same 18 Linux-only analyzer tests that also fail on main.
  • go test -race passes on api, database, scans, reports and tools (perf-budget tests skipped under race).
  • Web: tsc -b, vitest 578/578 and npm run build all pass.
  • e2e smoke: 23/23, with zero console errors.
  • axe (WCAG A/AA, contrast included): 0 violations on 13 pages, light and dark.

Relative, missing, file and unreadable paths now return 400 INVALID_PATH
with field=root_path and a sentence the user can act on instead of raw Go
errors; quoted and ~ paths are accepted. The add-workspace dialog checks
for relative paths before calling the API and shows any path error under
the Folder path field (aria-invalid, focus kept) instead of a toast.

Also: mux 404/405 for /api/ answer with the JSON error envelope, and bad
JSON on settings/workspace create is INVALID_JSON.
…en in editor

Below 100rem the docked column squeezed the findings table and, under
1250px, a position:relative override pushed the pane below every row
(26k px down on a phone). The pane is now a right-edge drawer over the
full-width table below 100rem and a near-full-height sheet over a dimmed
list on phones; it docks beside the list only on very wide screens.
Title, rule, message and fix come before the code, which scrolls with
them, and an Open in editor (vscode://) link joins Copy location.
…up tools

Missing tools read as raw manifest jargon ('ruff: ruff: No pinned managed
artifact is configured.') repeated per tool and again as 'could not be
fully evaluated'. Scans now record 'Not installed on this computer. Set it
up from Tools.', the report drops the doubled id prefix and the duplicate
not-evaluated line, and the UI folds every not-installed wording (old
scans included) into one notice naming the tools with a single Set up
tools action: report banner, live timeline and workspace analyzer status.
The workspace analyzer list now opens with a one-line summary and folds
the per-analyzer rows into a disclosure.
…; reason required

Suppressing or restoring a finding now recounts the workspace's finished
scans so severity totals and the grade drop immediately. The findings page
envelope carries status_counts (first page, page mode) so the Suppressed chip
is real. The suppress dialog requires a reason (API stays optional).
…e comparisons

GET /workspaces no longer runs a directory discovery per never-scanned
workspace inside the request: languages come from a TTL cache warmed in the
background (one walk at a time, also on create). Analyzer runs for every card
load in one query, and finished scans' new/fixed counts are cached by
(scan, previous scan) and dropped on suppression, scan or workspace changes.
…tion, provisional grade

Every surface (scan header and stats, workspace risk card, analyzer status,
dashboard badge, report foot) prints the same "X of Y analyzers ran" from
lib/risk coverage helpers. Grades carry a sentence explaining the letter, its
drivers and what the next grade needs, and partial coverage marks the grade
provisional (dashed ring plus wording).
GET /findings/search now searches each workspace's newest completed scan
unless scope=all is passed, so a finding that persisted across scans is one
hit. The response echoes scope; the Search page adds an Include older scans
toggle that round-trips through the URL.
Markdown opens with the grade, score, severity totals and the same
"X of Y analyzers ran" coverage line the app shows, and drops N/A metric
rows that only an analyzer that did not run could fill. The HTML report
gets a branded header with a grade tile (dashed when provisional) and the
coverage line. ?inline=1 serves report.md/.html/.sarif/.json for viewing
in a tab under a sandbox CSP; GET /scans/{id}/report.json aliases
findings.json. The export dialog adds JSON and an Open-in-new-tab link.
Analyzers run concurrently, so the headline no longer names whichever one
started last ("Pentest Suite is checking your code" over a list of four
running tools); it reads "Running analyzers · 1 of 3 finished · 1 needs
attention". The state badge says Running once analyzer events arrive
instead of the stale persisted Preparing, pills take each analyzer's latest
event so a failed tool no longer shows Running, and the event list uses
display names (Ruff, Gitleaks) like the rest of the page.
Compare lived only in each row's overflow menu. The history header now
offers "Compare latest two scans", the panel gets a Close action, and the
comparison names both scans with seconds and profile ("Comparing the Oct
31, 4:04:12 PM standard scan with the 4:04:48 PM deep scan") so two runs a
minute apart no longer read identical. The history detail row and row
tooltip show seconds too. The scan-completed notification names the
workspace and profile instead of a raw scan id prefix.
The Files panel and the global Rules page (custom analysis rules) both
said "Rules". The panel is now "Include / exclude paths" with path-pattern
wording on its controls, the nav item reads "Files & paths", the summary
counts "saved path choices", and "1 languages" is pluralized correctly.
A09 (Security Logging and Monitoring Failures) carried a 'todo' hint, so
every TODO/FIXME comment landed there and the row read 58% of findings.
TODO-tracker and code-quality findings (maintainability, style, smells,
complexity, duplication, performance) are no longer classified at all,
percentages are of security-relevant findings, and hints match at word
starts so 'auth' no longer fires on 'author'.
A tool that failed and found nothing showed a "Ruff 0" chip that read as
"ran clean"; it is now left to the incomplete-analysis notice (tools that
ran clean keep their 0). Synthesized finding titles split at the first
"." anywhere, so "package.json declares GPL-3.0" became title "package"
over "json declares GPL-3.0"; a clause now ends only at "."/":" before
whitespace or the end.
- ErrorPanel: NOT_FOUND errors read 'Nothing here anymore', drop the
  pointless Try again and render page-specific way-back actions
  (scan, workspace, history, files pages).
- Home: when the workspace list fails, hide the zero stat rail and
  show 'grade unavailable' instead of 'not graded yet'.
- Phones: the search Columns panel can no longer overflow the viewport
  and the CLI tabs wrap instead of hiding the third tab off-screen.
Lower-case error strings (ST1005), drop unused test fixture fields
(U1000), and document the platform-only SA4023 in the SonarQube
credential loader (the non-Windows store stub always errors).
Add-workspace inline path error, phone finding sheet in view,
suppression count round-trip, and latest-scan search dedup.
lib/features.ts hides, until they work:
- the OWASP ZAP / Nuclei / Burp template-library tabs on Pentest,
- the per-test Execute Check runner (the OWASP checks stay as a
  reference catalogue; scan matches live under Active Security Findings),
- the Rules page (rail, palette; /rules now resolves to Page not found),
- the workspace Dependencies insight tab.
Copy no longer advertises them. Back-end code is untouched; flip a flag
to bring a feature back. Tests and smoke cover the hidden state.
@sanketpatel32
sanketpatel32 merged commit 86ee5af into main Oct 31, 2026
@sanketpatel32
sanketpatel32 deleted the fix/deep-audit branch November 22, 2026 04:41
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