Skip to content

Dashboard improvements: DB migrations, file caching, and architecture enhancements#492

Merged
bhekanik merged 18 commits into
mainfrom
feat/dashboard-improvements
Oct 11, 2025
Merged

Dashboard improvements: DB migrations, file caching, and architecture enhancements#492
bhekanik merged 18 commits into
mainfrom
feat/dashboard-improvements

Conversation

@bhekanik

@bhekanik bhekanik commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces several key improvements to the Interview Optimiser platform, focusing on developer experience, performance, and architecture:

  • CI/CD: Automated database migration validation with dry-run on PRs
  • Developer Experience: Pre-commit hook for automatic migration generation
  • Performance: Database-backed file extraction caching with SHA-256 hashing
  • Architecture: Migration from server actions to proper authenticated API routes
  • Code Quality: Consolidated extraction logic and removed deprecated patterns

Changes Made

1. Database Migration Workflow Enhancement

  • Dry-run on PRs: New GitHub Action job validates migrations can be generated on pull requests
  • Production migrations: Automatically runs migrations when changes merge to main
  • PR comments: Bot posts migration validation status on PRs
  • Path filtering: Only triggers on schema/migration file changes

2. Pre-commit Hook for Migrations

  • Auto-detects schema file changes in db/schema/
  • Runs bun run db:generate when schema changes detected
  • Auto-stages generated migration files
  • Clear logging of migration generation process

3. File Extraction Caching Infrastructure

  • New fileExtractionCache table with file hash indexing
  • Cache utilities with race condition handling and hit count tracking
  • Support for CV, job description, and general document types
  • Automatic cache cleanup for old entries
  • Comprehensive error handling and logging

4. New API Routes

  • POST /api/extract/file: Authenticated file extraction with caching
  • POST /api/extract/url: Authenticated URL extraction with caching
  • React Query hooks: useExtractFile and useExtractUrl
  • Vision AI (gpt-5-mini) for document extraction
  • 60s timeout for long-running extractions
  • Proper validation and error handling

5. Component Refactoring

  • Updated Step1JobDescription to use new extraction hooks
  • Updated Step2CV to use new extraction hooks
  • Removed deprecated server actions: extractTextFromFile, extractTextFromUrl
  • Better loading states with React Query mutations
  • Improved error handling

6. Middleware Simplification

  • Removed redundant CSRF protection middleware
  • Kept rate limiting as primary security layer
  • Cleaner, more maintainable middleware code

7. Build Fixes

  • Fixed test failures in auth.test.ts (missing logger mocks)
  • Updated dependencies: esbuild, vitest, @vitejs/plugin-react
  • All 160 tests passing

Testing

  • ✅ Build passes (bun run build)
  • ✅ Tests pass (bun run test - 160/161 tests passing, 1 skipped)
  • ✅ Type checking passes (bun run typecheck)
  • ✅ Linting passes (bun run lint)
  • ✅ Pre-commit hooks working correctly
  • ✅ GitHub Actions workflow validated

Type of Change

  • New feature (non-breaking change)
  • Bug fix (non-breaking change)
  • Refactoring (non-breaking change)
  • CI/CD improvements
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated and passing
  • Linear commit history maintained
  • No secrets exposed
  • Build, typecheck, and lint pass
  • Documentation updated where needed

Performance Impact

Positive impacts:

  • File extraction caching reduces API calls and processing time
  • SHA-256 hashing enables efficient cache lookups
  • Hit count tracking for cache optimization insights

No negative impacts expected.

Security Considerations

  • All new API routes protected with authentication middleware
  • File hash-based caching prevents cache poisoning
  • Rate limiting remains in place
  • No secrets exposed in code

🤖 Generated with Claude Code

Add extract-from-document.ts utility that uses gpt-5-mini vision model for extracting text from PDFs and images. This replaces the deprecated pdf-parse library and provides better extraction quality.

Features:
- Supports PDFs and multiple image formats (png, jpeg, jpg, webp, gif)
- Context-aware extraction with specialized prompts for CVs and job descriptions
- Uses base64 encoding for file transmission to OpenAI vision API
- Includes comprehensive logging and error handling
- Low temperature (0.1) for accurate extraction
…xtraction

Replace pdf-parse library with gpt-5-mini vision model in both server action and client extraction utilities. This eliminates Buffer() and util._extend deprecation warnings while improving extraction quality.

Changes:
- Use extractFromDocument() utility with gpt-5-mini model
- Add support for image formats (png, jpeg, jpg, webp, gif) alongside PDFs
- Implement intelligent extraction type detection from file names
- Maintain consistent error handling and logging
- Improve extraction accuracy with context-aware prompts

Benefits:
- Eliminates Node.js deprecation warnings from pdf-parse
- Better extraction quality from Vision AI
- Support for multiple file formats
- Matches approach used in cvoptimiser sibling project
Remove deprecated pdf-parse library and its dependencies as document extraction now uses Vision AI (gpt-5-mini).

Removed packages:
- pdf-parse (deprecated, causes Buffer() warnings)
- pdfreader (unused)
- @types/pdf-parse (no longer needed)

This completes the migration to Vision AI for document extraction, eliminating Node.js deprecation warnings and improving extraction quality.
Remove unused TrustedCompaniesSection and VideoTestimonialsSection imports from landing page.
Copilot AI review requested due to automatic review settings October 11, 2025 10:12
@vercel

vercel Bot commented Oct 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
interviewoptimiser Ready Ready Preview Comment Oct 11, 2025 8:52pm

@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


PR Review: Vision AI Migration

Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • Multiple files: Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini

Good Patterns

  • Proper error handling with Sentry integration
  • Comprehensive logging throughout the extraction flow
  • Smart filename-based extraction type detection

Recommendation

⚠️ FIX FIRST - The model name needs to be corrected, but otherwise solid migration that eliminates deprecation warnings and adds multi-format support.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates document extraction from the deprecated pdf-parse library to OpenAI's Vision AI (gpt-5-mini), eliminating Node.js deprecation warnings and adding support for multiple file formats including images.

  • Replaces pdf-parse with AI-powered Vision extraction using gpt-5-mini
  • Adds intelligent extraction based on filename analysis (CV vs job description vs general)
  • Extends support to multiple formats: PDF, PNG, JPEG, JPG, WebP, GIF

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/lib/extractTextFromFile.ts Updated to use Vision AI for PDFs/images and improved logging
src/actions/extractTextFromFile.ts Server action migrated to Vision AI with enhanced error handling
lib/ai/extract-from-document.ts New utility for AI-powered document extraction with specialized prompts
package.json Removed deprecated pdf-parse dependencies
src/app/(marketing)/page.tsx Cleaned up unused section imports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/lib/extractTextFromFile.ts Outdated
// Use vision model (gpt-5-mini) for document extraction
const model = getOpenAiClient()("gpt-5-mini");
const result = await extractFromDocument({
model: model as any,

Copilot AI Oct 11, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'as any' bypasses TypeScript's type safety. Consider properly typing the model parameter or using a more specific type assertion.

Suggested change
model: model as any,
model: model,

Copilot uses AI. Check for mistakes.
Comment thread src/actions/extractTextFromFile.ts Outdated
// Use vision model (gpt-5-mini) for document extraction
const model = getOpenAiClient()("gpt-5-mini");
const result = await extractFromDocument({
model: model as any,

Copilot AI Oct 11, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'as any' bypasses TypeScript's type safety. Consider properly typing the model parameter or using a more specific type assertion.

Suggested change
model: model as any,
model,

Copilot uses AI. Check for mistakes.
Comment thread src/actions/extractTextFromFile.ts Outdated
const data = await pdf(buffer);
logger.info({ textLength: data.text?.trim().length }, "Extracted text from PDF");
return data.text?.trim();
return result.data;

Copilot AI Oct 11, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing null/undefined check. If result.data is null or undefined, this will return undefined instead of an empty string, which may break calling code expecting a string.

Suggested change
return result.data;
return result.data ?? "";

Copilot uses AI. Check for mistakes.
@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

bhekanik and others added 7 commits October 11, 2025 19:20
Add automated migration verification on pull requests with dry-run mode
that validates schema changes without modifying the database. Actual
migrations only run when changes are merged to main.

Changes:
- Add PR trigger with dry-run verification step
- Add PR comment bot to report migration status
- Improve migration output with clearer logging
- Add path filters to only trigger on schema/migration changes
- Separate dry-run job (PRs) from production migration job (main pushes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add automatic database migration generation when schema files change.
New migrations are auto-staged to ensure schema and migrations stay in sync.

Changes:
- Check for schema file changes in pre-commit
- Run db:generate if schema modified
- Auto-stage generated migration files
- Add clear logging of generated migrations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add database-backed caching for file extraction results to avoid redundant
AI processing of identical documents. Uses SHA-256 file hashing for cache
lookups with hit tracking and automatic cache statistics.

Changes:
- Add fileExtractionCache table with file hash indexing
- Implement cache get/set utilities with race condition handling
- Add hit count tracking and automatic timestamp updates
- Include cache cleanup utilities for old entries
- Support CV, job description, and general document types
- Add comprehensive error handling and logging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Migrate file/URL extraction from server actions to proper API routes with
authentication, caching, and comprehensive error handling. Includes React
Query hooks for client-side usage.

Changes:
- Add POST /api/extract/file with auth middleware
- Add POST /api/extract/url with auth middleware
- Implement file hash-based caching for extractions
- Add useExtractFile and useExtractUrl React Query hooks
- Support PDF, Word, and image file types
- Include Vision AI (gpt-5-mini) for document extraction
- Add proper validation, logging, and error handling
- Set 60s timeout for long-running extractions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace server actions with React Query mutations for file/URL extraction
in Step1 and Step2 components. Removes deprecated server actions and
utilities in favor of centralized API routes.

Changes:
- Update Step1JobDescription to use useExtractUrl and useExtractFile hooks
- Update Step2CV to use useExtractFile hook
- Remove extractTextFromFile and extractTextFromUrl server actions
- Remove lib/extractTextFromFile utility (consolidated into API route)
- Improve loading states with mutation isPending
- Better error handling with React Query mutations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove CSRF middleware in favor of built-in Next.js protections and
Clerk's security features. Simplifies middleware and reduces complexity.

Changes:
- Remove csrfMiddleware function and related logic
- Remove CSRF token validation checks
- Remove isCSRFExemptPath and isCSRFProtectedMethod utilities
- Keep rate limiting as primary security layer
- Remove /api/csrf-token from rate limit exemptions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing logger mock methods (info, error) in auth.test.ts
- Reinstall esbuild, vitest, and plugin-react dependencies
- All 160 tests now passing
- Build, typecheck, and lint all passing
- Ready for CI/deployment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • lib/ai/extract-from-document.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini

Good Patterns

  • Proper error handling with Sentry integration
  • Comprehensive logging throughout the extraction flow
  • Smart filename-based extraction type detection

Recommendation

⚠️ FIX FIRST - The model name needs to be corrected, but otherwise solid migration that eliminates deprecation warnings and adds multi-format support.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

@bhekanik bhekanik changed the title feat: migrate from pdf-parse to Vision AI for document extraction Dashboard improvements: DB migrations, file caching, and architecture enhancements Oct 11, 2025
@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

- Add GitHub Actions workflow for database migrations
  - Dry-run validation on PRs with migration file checks
  - Automatic migration execution on merge to main
  - PR comments with migration details and warnings
- Standardize pre-commit hook for schema changes
  - Detects schema file modifications
  - Automatically generates migrations
  - Stages migration files for commit
  - Fails commit if migration generation fails
- Add comprehensive documentation for migration setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini

Good Patterns

  • Proper error handling with Sentry integration
  • Comprehensive logging throughout the extraction flow
  • Smart filename-based extraction type detection

Recommendation

⚠️ FIX FIRST - The model name needs to be corrected, but otherwise solid migration that eliminates deprecation warnings and adds multi-format support.

@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

- Add permissions block to migrate-dry-run job
- Grant contents:read, issues:write, pull-requests:write
- Fixes "Resource not accessible by integration" error

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini

Good Patterns

  • Proper error handling with Sentry integration
  • Comprehensive logging throughout the extraction flow
  • Smart filename-based extraction type detection

Recommendation

⚠️ FIX FIRST - The model name needs to be corrected, but otherwise solid migration that eliminates deprecation warnings and adds multi-format support.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

- Remove Doppler CLI dependency from workflows
- Call bunx drizzle-kit migrate directly with DATABASE_URL
- Simplify dry-run job by removing unnecessary database checks
- Reduces CI dependencies and makes workflow more portable

Addresses code review feedback about Doppler not being available in CI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Check if gpt-5-mini model issue was fixed
  • Review file extraction caching implementation
  • Examine new API routes for security issues
  • Look for any bugs that could affect 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini
  • lib/file-extraction-cache.ts:168 Cache cleanup logic uses exact date equality (eq) instead of less than (lt) for updatedAt → Won't delete old entries

Quick Wins

  • lib/file-extraction-cache.ts:172 Same SQL issue in the delete operation → Fix both queries to use lt(fileExtractionCache.updatedAt, cutoffDate)

Good Patterns

  • SHA-256 file hashing prevents cache poisoning
  • Race condition handling in cache operations
  • Proper authentication on all new routes

Recommendation

⚠️ FIX FIRST - Model name breaks extraction completely, cache cleanup never runs. Otherwise solid caching architecture.


View job

@github-actions

Copy link
Copy Markdown

🗄️ Database Migration Check

Migration dry-run successful

Migration Files Found: 9

  • 0000_oval_post.sql
  • 0001_chubby_wild_pack.sql
  • 0002_rich_the_hand.sql
  • 0003_sticky_caretaker.sql
  • 0004_purple_charles_xavier.sql

...and 4 more

These migrations will be applied automatically when merged to main.

⚠️ Important: Ensure migrations are backwards compatible and test thoroughly in staging first.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

- Add permissions block at workflow level (not just job level)
- This ensures GITHUB_TOKEN has necessary permissions
- Fixes "Resource not accessible by integration" error

The error occurred because repository-level settings may restrict
default GITHUB_TOKEN permissions. Adding permissions at workflow
level explicitly grants the required access.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini
  • lib/file-extraction-cache.ts:168 Cache cleanup logic uses exact date equality (eq) instead of less than (lt) for updatedAt → Won't delete old entries

Quick Wins

  • lib/file-extraction-cache.ts:172 Same SQL issue in the delete operation → Fix both queries to use lt(fileExtractionCache.updatedAt, cutoffDate)

Good Patterns

  • SHA-256 file hashing prevents cache poisoning
  • Race condition handling in cache operations
  • Proper authentication on all new routes

Recommendation

⚠️ FIX FIRST - Model name breaks extraction completely, cache cleanup never runs. Otherwise solid caching architecture.


View job

@github-actions

Copy link
Copy Markdown

🗄️ Database Migration Check

Migration dry-run successful

Migration Files Found: 9

  • 0000_oval_post.sql
  • 0001_chubby_wild_pack.sql
  • 0002_rich_the_hand.sql
  • 0003_sticky_caretaker.sql
  • 0004_purple_charles_xavier.sql

...and 4 more

These migrations will be applied automatically when merged to main.

⚠️ Important: Ensure migrations are backwards compatible and test thoroughly in staging first.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

- Add continue-on-error to all github-script comment steps
- Workflow now succeeds even if commenting fails
- Migration validation still runs and reports status
- Commenting failures logged but don't block the workflow

This handles cases where repository settings restrict GITHUB_TOKEN
permissions. The user can still see results in workflow logs.

To enable PR comments, update repository settings:
Settings → Actions → General → Workflow permissions →
Select "Read and write permissions"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini
  • lib/file-extraction-cache.ts:168 Cache cleanup logic uses exact date equality (eq) instead of less than (lt) for updatedAt → Won't delete old entries

Quick Wins

  • lib/file-extraction-cache.ts:172 Same SQL issue in the delete operation → Fix both queries to use lt(fileExtractionCache.updatedAt, cutoffDate)

Good Patterns

  • SHA-256 file hashing prevents cache poisoning
  • Race condition handling in cache operations
  • Proper authentication on all new routes

Recommendation

⚠️ FIX FIRST - Model name breaks extraction completely, cache cleanup never runs. Otherwise solid caching architecture.


View job

@github-actions

Copy link
Copy Markdown

🗄️ Database Migration Check

Migration dry-run successful

Migration Files Found: 9

  • 0000_oval_post.sql
  • 0001_chubby_wild_pack.sql
  • 0002_rich_the_hand.sql
  • 0003_sticky_caretaker.sql
  • 0004_purple_charles_xavier.sql

...and 4 more

These migrations will be applied automatically when merged to main.

⚠️ Important: Ensure migrations are backwards compatible and test thoroughly in staging first.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini
  • lib/file-extraction-cache.ts:168 Cache cleanup logic uses exact date equality (eq) instead of less than (lt) for updatedAt → Won't delete old entries

Quick Wins

  • lib/file-extraction-cache.ts:172 Same SQL issue in the delete operation → Fix both queries to use lt(fileExtractionCache.updatedAt, cutoffDate)

Good Patterns

  • SHA-256 file hashing prevents cache poisoning
  • Race condition handling in cache operations
  • Proper authentication on all new routes

Recommendation

⚠️ FIX FIRST - Model name breaks extraction completely, cache cleanup never runs. Otherwise solid caching architecture.


View job

@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

@github-actions

Copy link
Copy Markdown

🗄️ Database Migration Check

Migration dry-run successful

Migration Files Found: 9

  • 0000_oval_post.sql
  • 0001_chubby_wild_pack.sql
  • 0002_rich_the_hand.sql
  • 0003_sticky_caretaker.sql
  • 0004_purple_charles_xavier.sql

...and 4 more

These migrations will be applied automatically when merged to main.

⚠️ Important: Ensure migrations are backwards compatible and test thoroughly in staging first.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

- Add github-token parameter to all github-script actions
- Falls back to GITHUB_TOKEN if PAT_TOKEN secret not set
- Enables PR comments even when enterprise policies restrict GITHUB_TOKEN

This works around enterprise-level policies that prevent GITHUB_TOKEN
from having write permissions. To enable PR comments:

1. Create a PAT at https://github.com/settings/tokens with 'repo' scope
2. Add it as PAT_TOKEN secret in repository settings
3. Workflow will automatically use it for commenting

Without PAT_TOKEN, workflow still succeeds but can't comment on PRs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude

claude Bot commented Oct 11, 2025

Copy link
Copy Markdown

Claude finished @bhekanik's task —— View job


Todo List:

  • Review new Vision AI extraction utility
  • Check modified server actions and library functions
  • Look for security issues or bugs
  • Assess scalability for 1000 users
  • Provide final recommendation

Issues Found

  • src/app/api/extract/file/route.ts:142 Using gpt-5-mini model which doesn't exist in OpenAI's API → Change to gpt-4o-mini
  • lib/file-extraction-cache.ts:168 Cache cleanup logic uses exact date equality (eq) instead of less than (lt) for updatedAt → Won't delete old entries

Quick Wins

  • lib/file-extraction-cache.ts:172 Same SQL issue in the delete operation → Fix both queries to use lt(fileExtractionCache.updatedAt, cutoffDate)

Good Patterns

  • SHA-256 file hashing prevents cache poisoning
  • Race condition handling in cache operations
  • Proper authentication on all new routes

Recommendation

⚠️ FIX FIRST - Model name breaks extraction completely, cache cleanup never runs. Otherwise solid caching architecture.

@github-actions

Copy link
Copy Markdown

🗄️ Database Migration Check

Migration dry-run successful

Migration Files Found: 9

  • 0000_oval_post.sql
  • 0001_chubby_wild_pack.sql
  • 0002_rich_the_hand.sql
  • 0003_sticky_caretaker.sql
  • 0004_purple_charles_xavier.sql

...and 4 more

These migrations will be applied automatically when merged to main.

⚠️ Important: Ensure migrations are backwards compatible and test thoroughly in staging first.

@github-actions

Copy link
Copy Markdown

🔒 Security Audit Summary

Security vulnerabilities were detected in the dependency update.

Scan Results

Scanner Status
Bun Security Check ✅ Passed
Snyk ✅ Passed
OSV Scanner ❌ Failed

Recommended Actions

  1. Review the security reports in the workflow artifacts
  2. Run bun update locally to get latest patches
  3. Check OSV Scanner results for known vulnerabilities
  4. Consider using dependency overrides for false positives

For more details, check the workflow run.

@github-actions

Copy link
Copy Markdown

⚖️ License Compliance Alert

Potential license compatibility issues detected.

Issues Found

  • Incompatible or unknown licenses detected
  • Review the license report in workflow artifacts

Allowed Licenses

MIT, Apache-2.0, BSD-3-Clause, BSD-2-Clause, ISC, 
CC0-1.0, 0BSD, Unlicense, Python-2.0, BlueOak-1.0.0

All other licenses are automatically blocked.

Please review dependencies with incompatible licenses before merging.

@bhekanik bhekanik merged commit b0cedc8 into main Oct 11, 2025
18 of 21 checks passed
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.

2 participants