Skip to content

feat: Add realtime updates, static analysis, and UI enhancements - #23

Merged
mertkaradayi merged 4 commits into
mainfrom
dev
Dec 15, 2025
Merged

feat: Add realtime updates, static analysis, and UI enhancements#23
mertkaradayi merged 4 commits into
mainfrom
dev

Conversation

@mertkaradayi

Copy link
Copy Markdown
Owner

Summary

This PR introduces realtime deployment monitoring, enhanced static analysis infrastructure, and improved UI components for displaying contract analysis results.

Key Features

Realtime Deployment Updates

  • Integrated Supabase realtime subscriptions for live deployment feed
  • Added connection status indicator with reconnect capability
  • Implemented animated new deployment cards with framer-motion
  • Created custom hooks: useRealtimeDeployments, useDebouncedValue, useTimeTick
  • Added ErrorBoundary component for graceful error handling
  • Optimized DeploymentCard with React.memo and useCallback
  • Enhanced DeploymentsTable with debounced search and stats refresh
  • Capped deployment list at 500 items to prevent unbounded growth
  • Added network parameter support to Sui Explorer URLs

Static Analysis Infrastructure

  • Added ConfidenceBadge component for analysis confidence levels
  • Added AnalysisQualityCard to display coverage and validation metrics
  • Added DependencySummaryCard for dependency audit status
  • Added TechnicalFindingsSection for detailed pattern-matched findings
  • Extended AnalyzedContractCard to display new analysis metadata
  • Added type definitions for confidence intervals, quality metrics, and findings
  • Added utility functions for confidence/severity styling and validation rates
  • Improved RPC error handling for "effect is empty" errors in sui-client

LLM Output Quality Improvements

  • Enhanced Zod schema descriptions for reporter output
  • Added explicit rule to prevent pattern IDs as pattern names
  • Ensures human-readable pattern names in rug_pull_indicators
  • Improved LLM guidance through better structured output definitions

UI Component Refactoring

  • Extracted CodeSnippet component for syntax-highlighted code display
  • Extracted EvidenceBlock component for formatted evidence text
  • Improved consistency in evidence presentation across the UI

Files Changed

Backend:

  • backend/src/lib/sui-client.ts - RPC error handling
  • backend/src/lib/langchain-prompts.ts - Enhanced prompts
  • backend/src/lib/langchain-schemas.ts - Improved schemas

Frontend:

  • frontend/app/components/ - New components: AnalysisQualityCard, ConfidenceBadge, DependencySummaryCard, TechnicalFindingsSection, CodeSnippet, EvidenceBlock, ErrorBoundary
  • frontend/app/components/DeploymentCard.tsx - Performance optimizations
  • frontend/app/components/DeploymentsTable.tsx - Realtime integration
  • frontend/app/components/AnalyzedContractCard.tsx - Enhanced display
  • frontend/app/dashboard/types.ts - Extended type definitions
  • frontend/app/dashboard/risk-utils.ts - New utility functions
  • frontend/lib/ - New hooks: useRealtimeDeployments, useDebouncedValue, useTimeTick
  • frontend/lib/supabase.ts - Supabase client
  • frontend/lib/deployments.ts - Enhanced API client
  • frontend/.env.example - Supabase configuration

Test Plan

  • Verify realtime deployments appear with animation
  • Check connection status indicator shows correct state
  • Test debounced search functionality
  • Verify new analysis cards display correctly
  • Confirm code snippets and evidence blocks render properly
  • Test network parameter in Sui Explorer links
  • Verify error boundary catches component errors
  • Check performance improvements in DeploymentCard

…frastructure

- Add static analyzer for pre-LLM deterministic pattern detection
- Add cross-module analyzer for capability flow analysis across modules
- Add evidence validator to filter LLM hallucinations against bytecode
- Add confidence calculator for analysis quality metrics
- Add dependency analyzer to track risks from contract dependencies
- Add audit trail for analysis metadata, debugging, and cost monitoring
- Add migrations for dependency_risks and audit_trail tables
- Update langchain analyzer and prompts with new capabilities
- Expand risk patterns knowledge base
- Extend supabase client with new table operations
…frastructure

Backend:
- Handle "effect is empty" RPC errors gracefully in sui-client

Frontend:
- Add ConfidenceBadge component for analysis confidence levels
- Add AnalysisQualityCard to display coverage and validation metrics
- Add DependencySummaryCard for dependency audit status
- Add TechnicalFindingsSection for detailed pattern-matched findings
- Extend AnalyzedContractCard to display new analysis metadata
- Add type definitions for confidence intervals, quality metrics, and findings
- Add utility functions for confidence/severity styling and validation rates
- Add explicit field descriptions to reporter Zod schema
- Enforce human-readable pattern names in rug_pull_indicators
- Prevent pattern IDs (HIGH-01, SUI-CRITICAL-01) from being used as pattern_name
- Clarify intent of each output field for better LLM guidance
- Add CodeSnippet component for syntax-highlighted code display
- Add EvidenceBlock component for formatted evidence text
- Update AnalyzedContractCard to use EvidenceBlock for risky functions and rug pull indicators
- Update TechnicalFindingsSection to use CodeSnippet for evidence display
- Improve consistency in evidence presentation across the UI
@vercel

vercel Bot commented Dec 15, 2025

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
redflag Ready Ready Preview, Comment Dec 15, 2025 0:44am

@mertkaradayi
mertkaradayi merged commit ca8b5a0 into main Dec 15, 2025
3 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.

1 participant