fix: four audit findings (config wiring, stale analysis, agent output validation, vitest workspace)#74
Open
leap21ai wants to merge 1 commit into
Open
Conversation
… validation, vitest workspace) 1. Wire config intelligence end to end (CLI > config > legacy data > defaults) 2. Hash-change detection clears stale findings on re-scan 3. Zod validation on agent output before persistence (no more silent corrupt records) 4. Root vitest.config.ts replaces deprecated bare-array workspace file 2104/2104 tests pass · build clean · lint clean · bundle clean Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@treyanderson is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
| // Handle files that were previously recorded but not touched this scan: | ||
| // either deleted from disk or no longer matching any pattern. Clear their | ||
| // candidates and findings so they don't continue to appear as active. | ||
| const allExisting = loadAllFileRecords(projectId); |
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four independent fixes surfaced by an internal audit while running deepsec across multiple Convex/Hono products at Leap21. All four are quality-of-life issues that were either silently degrading scan accuracy or breaking type/test infrastructure.
1. Wire config intelligence end-to-end (CLI > config > legacy data > defaults)
Previously the
deepsec.config.{ts,mjs}file was loaded but its values weren't always honored downstream — CLI flags always won, but plugin contracts and data-derived defaults could silently override config. Now precedence is explicit: CLI > config file > data dir defaults > built-in defaults.2. Hash-change detection clears stale findings on re-scan
When a file's content hash changed between scans, prior findings for that file were kept in the index, producing zombie findings (line numbers wrong, snippets stale). The fix invalidates findings whose
fileHashno longer matches the current file and re-runs the matcher pipeline on changed files.3. Zod validation on agent output before persistence
The Claude/Codex SDK can occasionally return tool-call output that doesn't conform to the expected
AgentFindingSchema(a structured-output edge case). Previously these silently corrupted the findings store. Now agent output is parsed through Zod at the boundary and rejected with a clear error if it fails to validate.4. Root
vitest.config.tsreplaces deprecated bare-array workspace fileVitest 4 deprecated the bare-array form of
vitest.workspace.ts. The fix moves the workspace declaration into a rootvitest.config.tswithtest.projectsand removes the deprecated file. Resolves a TypeScript build warning + a vitest 4.x deprecation log line.Test plan
pnpm -r build— typecheck clean across all packagespnpm test— 2104/2104 tests passpnpm bundle— esbuild bundle cleanContext
Authored while operating deepsec as the security gate for ParentSplit (a COPPA-regulated Convex+Expo product). The deprecated-vitest-workspace and stale-findings fixes were blocking our CI integration; the config-wiring and agent-output-validation fixes surfaced as scan-accuracy issues during a 90-day backtest.
Happy to split into separate PRs if preferred — all four changes are independent.
🤖 Generated with Claude Code