Repository navigation
Conversation
[High impact] The PR replaces the product's main scanning, provider, storage, and dashboard workflows. Do not merge yet: scan errors are hidden by default, and earlier findings about lost notes, private workspace files, and skipped source remain open.
|
| .catch(() => { | ||
| if (!signal.aborted) | ||
| setRecords( | ||
| scan.findings.map((finding) => ({ | ||
| ...finding, | ||
| key: `${scan.id}:${finding.id}`, | ||
| scanId: scan.id, | ||
| project: scan.project, | ||
| root: scan.root, | ||
| status: "open", | ||
| note: "", | ||
| updatedAt: scan.startedAt, |
There was a problem hiding this comment.
useScanFindings turns a failed fetch into editable records with status: "open" and note: "". A temporary connection failure or server error can make a resolved finding with saved notes look new. Saving the form sends both invented values back, reopening the finding or erasing its notes.
Keep the last successful records, show the error, and block edits until the saved state is loaded.
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/src/pages/ScanDetail.tsx
Line: 293-304
Comment:
**Failed reads can erase notes**
`useScanFindings` turns a failed fetch into editable records with `status: "open"` and `note: ""`. A temporary connection failure or server error can make a resolved finding with saved notes look new. Saving the form sends both invented values back, reopening the finding or erasing its notes.
Keep the last successful records, show the error, and block edits until the saved state is loaded.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const full = resolve(dir, entry.name), name = relative(root, full).split(sep).join("/"); | ||
| if (entry.isSymbolicLink() || excludedDirs.has(entry.name) || secretName.test(entry.name) || secretExt.test(entry.name) || lockName.test(entry.name) || /\.min\.[cm]?js$/i.test(entry.name) || rules.some(r => r.matcher.ignores(relative(r.dir, full).split(sep).join("/") + (entry.isDirectory() ? "/" : "")))) { | ||
| project.skipped++; continue; | ||
| } | ||
| if (entry.isDirectory()) { await walk(full, rules, depth + 1); continue; } |
There was a problem hiding this comment.
Workspace files leave the machine
inventory excludes directories named .openhack, not the actual workspace path. If a user scans /project with --home /project/local-data, the scan includes dashboard-4900.json and saved reports there. These can contain the private shutdown token and source from other projects, which then go to the selected provider.
The scan also includes its own report. Later report writes make an unchanged project fail the saved-source check on resume. Pass the workspace path into source collection and exclude it before walking files.
How this was verified: A custom workspace inside the scan root passes the file filters, its dashboard record contains the private token, and collected JSON is included in provider prompts.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/harness/project.ts
Line: 65-69
Comment:
**Workspace files leave the machine**
`inventory` excludes directories named `.openhack`, not the actual workspace path. If a user scans `/project` with `--home /project/local-data`, the scan includes `dashboard-4900.json` and saved reports there. These can contain the private shutdown token and source from other projects, which then go to the selected provider.
The scan also includes its own report. Later report writes make an unchanged project fail the saved-source check on resume. Pass the workspace path into source collection and exclude it before walking files.
**How this was verified:** A custom workspace inside the scan root passes the file filters, its dashboard record contains the private token, and collected JSON is included in provider prompts.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| for (const entry of entries) { | ||
| signal?.throwIfAborted(); | ||
| const full = resolve(dir, entry.name), name = relative(root, full).split(sep).join("/"); | ||
| if (entry.isSymbolicLink() || excludedDirs.has(entry.name) || secretName.test(entry.name) || secretExt.test(entry.name) || lockName.test(entry.name) || /\.min\.[cm]?js$/i.test(entry.name) || rules.some(r => r.matcher.ignores(relative(r.dir, full).split(sep).join("/") + (entry.isDirectory() ? "/" : "")))) { |
There was a problem hiding this comment.
Nested ignore overrides are lost
rules.some(...) makes every earlier exclusion permanent. For example, a root .gitignore containing *.ts and src/.gitignore containing !keep.ts should include src/keep.ts. The parent matcher still returns true here, so the scanner silently skips that file and can report complete coverage without reviewing it.
Apply the rules in order so later rules can override earlier ones.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/harness/project.ts
Line: 66
Comment:
**Nested ignore overrides are lost**
`rules.some(...)` makes every earlier exclusion permanent. For example, a root `.gitignore` containing `*.ts` and `src/.gitignore` containing `!keep.ts` should include `src/keep.ts`. The parent matcher still returns true here, so the scanner silently skips that file and can report complete coverage without reviewing it.
Apply the rules in order so later rules can override earlier ones.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const key = groupBy === "project" ? finding.project : finding.severity; | ||
| const group = byKey.get(key) ?? { | ||
| key, | ||
| label: | ||
| groupBy === "project" | ||
| ? finding.project | ||
| : finding.severity.charAt(0).toUpperCase() + | ||
| finding.severity.slice(1), | ||
| root: finding.root, | ||
| rows: [], |
There was a problem hiding this comment.
Different projects share one group
Project groups and filters use project, which is only basename(root). Scanning /work/frontend and /archive/frontend merges both into one group and one filter option. The group's tooltip shows only the first directory, so users cannot tell the projects apart or filter them separately.
Use root as the group and filter value, with the short project name as its label.
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/src/components/FindingsInbox.tsx
Line: 159-168
Comment:
**Different projects share one group**
Project groups and filters use `project`, which is only `basename(root)`. Scanning `/work/frontend` and `/archive/frontend` merges both into one group and one filter option. The group's tooltip shows only the first directory, so users cannot tell the projects apart or filter them separately.
Use `root` as the group and filter value, with the short project name as its label.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| ? [] | ||
| : (records ?? []).filter((f) => f.validation !== "rejected"); | ||
| const open = listed.filter((f) => f.status === "open"); | ||
| const [view, setView] = useState<"findings" | "overview">("findings"); |
There was a problem hiding this comment.
Failed scans hide their reason
ScanDetail now always opens on Findings, but scan.error appears only under Progress. Opening a failed or partial scan with zero findings shows “This scan didn't report any vulnerabilities” without explaining that the review failed or stopped early. Users must discover the Progress tab to learn what went wrong.
Previously, these scans opened on Progress and showed the reason. Show scan.error outside the tabs, or keep Progress as the default for incomplete scans.
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/src/pages/ScanDetail.tsx
Line: 383
Comment:
**Failed scans hide their reason**
`ScanDetail` now always opens on Findings, but `scan.error` appears only under Progress. Opening a failed or partial scan with zero findings shows “This scan didn't report any vulnerabilities” without explaining that the review failed or stopped early. Users must discover the Progress tab to learn what went wrong.
Previously, these scans opened on Progress and showed the reason. Show `scan.error` outside the tabs, or keep Progress as the default for incomplete scans.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
No description provided.