Fix 45 audit findings across 7 workstreams - #63
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Addresses 45 of 60 codebase audit findings from
docs/audit-findings.md, organized into 7 parallel workstreams executed by isolated agents and merged into a single integration branch.56 files changed, 974 insertions, 953 deletions (net +21 lines)
Workstream A — HIGH priority (#5-11)
jobPoolcolumns, cutting dashboard payload 80-90%feedStatus: ARCHIVEDin Zustand when status becomes APPLIEDWorkstream B — Redundancy extraction (#12-18)
src/lib/usage.ts— sharedincrementUsage()+checkUsageLimit()(replaces 9 copies)src/lib/auth-helpers.ts— sharedrequireProfile()+requireProfileWithUsage()(replaces 15+ copies)src/components/pipeline/use-pipeline-editing.ts— shared hook (~160 duplicated lines removed from each of PipelineTable and KanbanBoard)src/lib/pipeline-constants.ts— unifiedTERMINAL_STATUSES(replaces 3 definitions)parseAiJsonResponse<T>()inai-analysis.tsrematchAndRevalidate()in settings actionsWorkstream C — Consistency (#19-26)
max_completion_tokensResponse.json()overNextResponse.json()env.ADMIN_USER_IDin layoutfindUniquefor PK lookupsstatusUpdatedAtincreateApplicationsafeParse()in admin actionsupdateCustomJobthrows instead of returning error objectsz.string().cuid()for profileId in analyzeSchemaWorkstream D — Performance (#27-33)
pg_trgmGIN indexes onjob_pool.titleandjob_pool.locationNOT EXISTSoverNOT INin match-sqlPromise.allSettled()jobPoolselect in applications query (viajobPoolSummarySelect)indexOfin virtualizerWorkstream E — Data syncing (#34-39)
batchSaveJobsnow creates Application recordsupdateJobNotesrevalidationrevalidatePath("/dashboard")in match + analyze routesfollowUpCountafterfollowUpAtchangespendingMatchCountby using capped lengthWorkstream F — Security hardening (#40-43)
shortlist-onboardedcookie set server-side withHttpOnlyshortlist-activecookie TTL reduced to 60s withHttpOnlyWorkstream G — Cleanup (#44-53, 57-60)
rematchProfileSqlexportURL_REdeduplicated tovalidations.tssrc/lib/html-to-markdown.ts— shared TurndownServicesrc/lib/ai-logging.ts— sharedlogAiContext()with strict host check (Add Chrome extension for one-click job imports #59)src/lib/score-utils.ts— shared score label helpersPagePropsnaming, Metadata types, metadata exportsIntentionally skipped
getActiveProfileover-fetch (marginal — only 2 callers, deduped bycache())Verification
pnpm tsc --noEmit— zero type errorspnpm test:unit— 143/143 tests passingpnpm lint— no new errors (11 pre-existing from minified extension file)prisma migrate deploy)Test plan
jobPoolselectCHROME_EXTENSION_IDenv var controls CORS