Commit Graph

69 Commits

Author SHA1 Message Date
01ffe79bbe Update ROLLBACK.md with review completion (FRE-4808) 2026-05-12 01:11:59 -04:00
0f997b639f Fix P2/P3 review findings: DNR redirect format, runtime type guard, cache test setup 2026-05-11 13:54:51 -04:00
726aafef74 Fix dd-trace init timing in index.ts (FRE-4806)
Import datadog-init as first module to ensure dd-trace .init()
runs before any other imports, fixing P1 auto-instrumentation issue.
Removed redundant manual initDatadog/initSentry calls since
datadog-init.ts already invokes all three init functions.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 02:58:51 -04:00
31e0b39794 fix: address Code Reviewer findings for Datadog/Sentry integration FRE-4806
P1: Load dd-trace before other modules via datadog-init.ts entry point
P1: Batch all CloudWatch metrics into single PutMetricDataCommand per request
P2: Deduplicate warning logs with else-if for high latency vs error
P3: Add response.ok check to Datadog log forwarding fetch
P3: Update getSentryHub() to use getCurrentScope() for Sentry SDK 8.x

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 16:02:18 -04:00
a653c77959 FRE-5006: VoicePrint quality improvements
- P2-1: Consolidate mock ML logic to Python canonical source
- P2-2: Fix weak hashes with SHA-256
- P2-3: Parallelize batch processing with Promise.allSettled()
- P2-4: Add DI pattern support to services
- P2-5: Add structured logging utility
- P3-2: Persist batch jobId for result retrieval

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 12:06:16 -04:00
35e9f7e812 Fix 4 P1 and 2 P2 code review findings for FRE-4576
P1 fixes:
- Fix import paths in background/index.ts (./ -> ../lib/)
- Fix Promise-in-string bug in api-client.ts authenticate()
- Add missing background/service_worker key to manifest
- Copy HTML to public/ so Vite places them in dist

P2 fixes:
- Add notifications permission to manifest
- Make showWarningNotification async with proper await

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 11:53:25 -04:00
4a2f6cf0fd Fix 4 Code Review findings on FRE-4928: dead heredoc, token warmup, summary path, .gitignore
- P2: Remove dead heredoc from run.sh mixed scenario
- P2: Add setup() warmup to seed real tokens for standalone scenarios
- P3: Replace handleSummary file output with --summary-export in run.sh
- P3: Add .gitignore for k6 results and .env
- Fix stray closing brace in scripts/load-test/lib/common.js

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 11:44:56 -04:00
c1e4e8e404 Fix 3 P1 code review findings in VoicePrint job worker layer (FRE-5004)
- P1-4: Replace fragile relative import with dynamic import within job handler
- P1-5: Move worker creation to lazy createAnalysisWorker() function
- P1-8: Add maxRetryAttempts cap to Redis retryStrategy

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 11:38:09 -04:00
bc72a5b1cb Fix VoicePrint service-layer correctness bugs P1-1, P1-7, P2-2 (FRE-5002)
P1-1: Replace non-deterministic Math.random() with buffer-variance score
P1-7: Fix findSimilar result ordering by using Map instead of index zip
P2-2: Replace weak hashes with SHA-256 for both embedding and audio

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 11:17:23 -04:00
7b925c89bd Fix 3 Code Review findings on FRE-4574
- P2: Replace wget with curl for ECS health check (Alpine lacks wget)
- P2: Add AWS credentials step to CI terraform-plan job for S3 backend auth
- P3: Remove unused GitHub provider from infra/main.tf

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 07:09:39 -04:00
b391338d5b Fix k6 load test: 1-call/iteration, credential pool, merged scenarios, logout API contract, summary thresholds (FRE-4928)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 03:36:09 -04:00
2d0611c2c9 Fix VoicePrint config validation & env safety (FRE-5005)
P3-1: Replace envSchema.parse() with safeParse() + default fallback to
avoid module-level crash when env vars are missing.

P3-3: Add fs.existsSync check on ECAPA_TDNN_MODEL_PATH at startup
with warning log when model path is missing.

P3-4: Add Zod strict() mode to env schema to catch typos in env
var names (extra keys now produce validation errors).

P1-6: Confirmed resolved - voiceprint.service.ts already imports
VoiceEnrollment/VoiceAnalysis from @shieldai/db (consolidated package).
2026-05-10 03:26:26 -04:00
Security Reviewer
4d30bacc53 Fix VoicePrint auth bypass & audio upload (FRE-5003)
P1-2: Add onRequest auth hook to reject anonymous requests on all 7
VoicePrint endpoints. Previously, the auth middleware always attached
a placeholder user (id='anonymous'), so per-route userId checks passed
for unauthenticated clients.

P1-3: Replace JSON body parsing with @fastify/multipart for POST
/endpoints (/enroll, /analyze, /batch). Fastify JSON parser cannot
produce Buffer from request.body; multipart/form-data is required
for audio file uploads. Added 50MB file size limit.
2026-05-10 03:20:31 -04:00
Senior Engineer
fb82dc68d7 Fix CORS origin trimming, unused import, and fragile error handling (FRE-4749)
- P2: Add .map(s => s.trim()) to trim whitespace from comma-separated ALLOWED_ORIGINS
- P3: Remove unused setSentryUser import from @shieldai/monitoring
- P3: Replace fragile string prefix matching with boolean isValidProtocol sentinel

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 02:58:02 -04:00
4ddd24fd72 Fix 6 P1 infrastructure issues from code review (FRE-4574)
- ALB: deploy to public subnets instead of private (adds public_subnet_ids var)
- ECS: fix launch_desired_count → launch_type = FARGATE
- Secrets: accept actual RDS/ElastiCache endpoints from parent module
- Deploy: fix circular dependency (needs.detect → steps.detect)
- Health check: dynamic ALB DNS lookup via aws elbv2 CLI
- Health check: exit 1 on failure so rollback triggers

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 02:28:48 -04:00
c7df40ac26 feat: integrate Datadog APM + Sentry error tracking with CloudWatch metrics FRE-4806
- Add CloudWatch metrics emitter (api_latency, api_requests, api_errors)
- Add request monitoring middleware for API (latency, error rate, throughput)
- Register error-handling, logging, and monitoring middleware in server.ts
- Add Datadog log forwarding via HTTP intake API
- Add application-level CloudWatch alarms for P99 latency, error rate, throughput
- Inject Datadog/Sentry env vars and secrets into ECS task definitions
- Add DD_API_KEY and SENTRY_DSN to ECS secrets
- Create CloudWatch log groups for datadog and sentry services
- Update .env.example with AWS_REGION and monitoring variables
- Add @aws-sdk/client-cloudwatch dependency to monitoring package

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-10 02:15:11 -04:00
57a206d7b3 Fix type errors in report routes (redundant parseInt, JsonValue cast) (FRE-4575)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 22:57:03 -04:00
2521c4e998 Add Protection Report Generator with HTML/PDF output and scheduled delivery (FRE-4575)
- Report service: data collection from all three engines, HTML rendering (Handlebars), PDF generation (pdfkit)
- REST API: /reports endpoints for generate, history, view, PDF download, scheduling
- BullMQ workers: queued report generation with retry, monthly/annual scheduler triggers
- DB: SecurityReport model with Prisma schema and type exports
- Email: report_ready template in shared-notifications
- All dependencies wired through existing packages

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 22:54:46 -04:00
de0ddac65d Add ShieldAI browser extension with phishing & spam detection (FRE-4576)
- Extension package: Manifest V3, background service worker, content scripts
- Phishing detection engine with heuristic analysis (typosquatting, entropy, TLD, brand impersonation)
- Local URL caching layer (Storage API) for <100ms cached lookups
- Popup UI with protection status, stats, and phishing report button
- Options page for settings management (blocked/allowed domains, feature toggles)
- Server-side extension routes: URL check, phishing report, auth, stats, exposure check
- Tier-aware feature gating (Basic/Plus/Premium)
- 25 passing tests for phishing detection heuristics
- Declarative net request rules for known phishing patterns
- DarkWatch integration for credential exposure checks
- Firefox compatibility layer via build modes

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 21:53:29 -04:00
e5294ec712 Add WebSocket maxPayload limit (64KB) (FRE-4747)
Set maxPayload: 65536 on WebSocketServer constructor to bound
per-message memory usage, addressing security review
recommendation M1 from FRE-4474.
2026-05-09 16:44:56 -04:00
Senior Engineer
a10ef7eb70 Harden CORS origin validation in production (FRE-4749)
- Add ALLOWED_ORIGINS env var with comma-separated origin list
- Validate origins at startup in production: reject wildcards, empty values,
  and malformed URLs (non-http/https protocol)
- Update both server entry points (server.ts, index.ts) to use getCorsOrigins()
- Development mode retains existing localhost fallback behavior

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 11:48:33 -04:00
8506fd17ef Fix load test scenarios, runner, and CI threshold checks
- Add constant-arrival-rate scenarios to all 4 service scripts (api,
  darkwatch, spamshield, voiceprint) to enforce 500 req/s target
- Fix defaultThresholds() to return { thresholds: {...} } so
  http_req_duration and errors thresholds are actually applied
- Rewrite run-all.sh: per-service summary files, proper env var
  passing (DURATION, API_TOKEN), fixed threshold aggregation
- Update CI workflow threshold check jq to match new threshold-results
  structure (.services.<name>.exitCode)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 10:35:45 -04:00
d2097d8930 Fix spamshield k6 test to match actual API routes FRE-4929
- Rewrote spamshield.js to test real endpoints: POST /sms/classify,
  POST /number/reputation, POST /call/analyze, POST /feedback,
  GET /history, GET /statistics
- Added proper P99 latency thresholds per classification type:
  SMS classify < 150ms, number reputation < 300ms, call analyze < 400ms
- Previous version tested non-existent endpoints (/classify, /health, /blocklist/check)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 10:06:33 -04:00
a804cab431 Add load testing job to GitHub Actions CI pipeline (FRE-4931)
- Add load-test job to ci.yml that runs after docker-build on push to main
- Create combined load test runner (scripts/load-test/run-all.sh) for all services
- Create k6 load test scripts for api, darkwatch, spamshield, and voiceprint
- Add shared k6 utilities (lib/common.js)
- Update load-test.yml to support all services and report artifacts
- Configure k6 cloud output and P99 threshold validation
- Generate load test report as CI artifact

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 09:16:36 -04:00
98b01bf48f Add k6 load test scripts for Darkwatch authentication endpoints (FRE-4928)
- darkwatch-auth.js: k6 script testing POST /auth/login, /auth/logout, /auth/refresh
- P99 thresholds: login <200ms, logout <100ms, refresh <150ms
- Config: 500 req/s sustained for 5 minutes
- Mixed workload scenario + individual endpoint scenarios
- .env.example and run.sh for execution
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 08:08:10 -04:00
Senior Engineer
cb5851ec8c Add k6 load test scripts for Voiceprint verification endpoints (FRE-4930)
- k6 script with P99 latency thresholds (enrollment <500ms, verification <250ms, model retrieval <100ms)
- Configurable 500 req/s sustained throughput for 5 minutes
- Mixed workload scenario + individual endpoint scenarios
- GitHub Actions workflow for automated load testing
- Runner script with environment configuration
- JSON result export for CI artifact collection
- .gitignore entry for load test results
2026-05-09 07:50:29 -04:00
bce4787802 Add rollback procedure documentation and testing scripts (FRE-4808)
- infra/ROLLBACK.md: comprehensive rollback runbook with ECS, Docker Compose,
  database migration, blue-green, and emergency rollback procedures
- infra/scripts/rollback.sh: enhanced ECS rollback with validation, logging,
  health verification, and per-service rollback support
- infra/scripts/rollback-compose.sh: Docker Compose rollback for local/staging
- infra/scripts/rollback-migration.sh: Drizzle migration rollback with
  AWS Secrets Manager integration
- infra/scripts/test-rollback.sh: automated test suite (51 tests)
- Updated infra/README.md to reference ROLLBACK.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 06:27:31 -04:00
540ca5ebad Add k6 load testing infrastructure for Darkwatch service
- Create load test directory structure (infra/load-tests/)
- Implement k6 script for Darkwatch endpoints (darkwatch.js)
  - Tests watchlist, scan, exposure, and alert operations
  - Configured for 500 req/s sustained load with P99 < 200ms
  - Includes error rate metrics and threshold validation
- Add documentation and usage guide (README.md)

Related: [FRE-4807](/FRE/issues/FRE-4807)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-09 06:18:47 -04:00
Senior Engineer
a0799c0647 Add Terraform AWS infrastructure and enhanced CI/CD pipeline (FRE-4574)
- Terraform modules: VPC, ECS Fargate, RDS PostgreSQL, ElastiCache Redis, S3, Secrets Manager, CloudWatch
- Multi-environment support: staging and production configs
- ECS auto-scaling: CPU-based scaling with configurable min/max
- CI/CD: pnpm caching, Docker Buildx, Trivy security scanning, Terraform plan on PR
- Deploy: ECS service updates with automatic rollback on health check failure
- Backup: automated RDS snapshots, S3 versioning, ElastiCache snapshots
- Monitoring: CloudWatch dashboards, CPU/memory/5xx alarms
- Rollback script for manual service rollback
- Infrastructure documentation with architecture overview
2026-05-08 02:54:39 -04:00
baa216d62c turbo 2026-05-03 22:45:03 -04:00
f2593c1e67 use crypto package instead 2026-05-03 22:44:48 -04:00
a4684e9121 Fix SMS classifier test mock: add defaultScores and metadataLimits exports (FRE-4509)
The test mock for spamshield.config was missing defaultScores and
metadataLimits exports that are imported by spamshield.service.ts,
causing 8 tests to fail with 'No defaultScores export is defined'.
2026-05-02 20:23:29 -04:00
Senior Engineer
91e4985a8e FRE-4474 Phase 5: Verify and resolve security review findings for SpamShield and Cross-Service Correlation
- FRE-4499 (SpamShield): Verified 6 security fixes (2 High, 4 Medium)
  - S01: Pre-compiled regex in RuleEngine (ReDoS fix)
  - S02: SmsClassifier accepts senderPhoneNumber context
  - S03: AlertServer JWT auth + origin validation
  - S04: SHA-256 phone hashing (PII protection)
  - S05: DecisionEngine timeout enforcement via Promise.race
  - S06: CarrierFactory.getAllCarriers properly async/await

- FRE-4500 (Correlation): Verified 7 security fixes (2 Critical, 2 High, 2 Medium, 1 Low)
  - C1: Ingest endpoints auth via request.user.id
  - C2: IDOR protection on group endpoints (userId filter)
  - H3: JWT middleware registered in server.ts
  - H4: Fastify schema validation on all routes
  - M6: Payload sanitization with depth limit and circular ref detection
  - L7: CORS origin restricted to env var

- Resolved liveness incidents FRE-4652 and FRE-4654
- All Phase 5 child issues now complete
2026-05-02 18:36:29 -04:00
0afdf8b6e8 FRE-4500: Fix security review findings (Critical/High/Medium/Low)
- Critical #1: Add auth check to ingest endpoints (use request.user.id)
- Critical #2: Add IDOR protection on group endpoints (userId ownership)
- High #3: Register auth middleware in server.ts (populates request.user)
- High #4: Add Fastify schema validation to all route handlers
- Medium #5: Add NormalizedAlert/CorrelationGroup models to Prisma schema
- Medium #6: Sanitize payload storage in normalizer (depth limit, circular ref)
- Low #7: Restrict CORS origins (use CORS_ORIGIN env var)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 16:40:01 -04:00
274afa6335 FRE-4499: Fix security review findings (S01-S06)
- S01 (High): Pre-compile regex patterns in RuleEngine.loadActiveRules() and
  cache them; eliminate per-evaluation RegExp construction in rule-engine.ts
  and spamshield.service.ts (ReDoS mitigation)
- S02 (High): SMS classifier now accepts optional senderPhoneNumber via
  SmsClassificationContext; reputation check uses actual sender instead of
  hardcoded 'placeholder'
- S03 (Medium): AlertServer (services/spamshield) now enforces JWT auth,
  origin allowlist, and max client limit on WebSocket connections
- S04 (Medium): hashPhoneNumber() uses SHA-256 (crypto.createHash) instead
  of reversible hex encoding (Buffer.toString('hex'))
- S05 (Medium): DecisionEngine.evaluate() wraps evaluation in Promise.race
  with configurable evaluationTimeout; returns fallback decision on timeout
- S06 (Medium): CarrierFactory.getAllCarriers() is now async and properly
  awaits isHealthy() promises instead of returning raw Promise objects

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 15:58:49 -04:00
24bc9c235f Consolidate @shieldai/db and @shieldsai/shared-db packages (FRE-4603)
- Merged singleton pattern + type exports from shared-db
- Kept FieldEncryptionService from original db package
- Upgraded to Prisma v6.2.0 (newer version)
- Adopted shared-db's complete schema for multi-service platform
- Updated 17 consumer imports across darkwatch, voiceprint, jobs, api
- Standardized on @shieldai/db namespace

Files changed:
- packages/db/package.json (v0.1.0 → v0.2.0)
- packages/db/src/index.ts (consolidated exports)
- packages/db/prisma/schema.prisma (merged schema)
- packages/db/prisma/seed.ts (updated for new schema)
- 17 consumer files updated

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 15:06:02 -04:00
93ff4885ee Add integration tests README documentation (FRE-4522)
Documentation for integration test suite including:
- Test file descriptions and coverage
- External provider mock configuration
- Running tests commands
- CI integration requirements
- Environment variables needed
- Test strategy and error scenarios
2026-05-02 13:23:12 -04:00
67622a2f11 Add integration tests for notification services (FRE-4522)
Comprehensive integration test suite for notification services:
- EmailService integration tests (Resend provider)
- SMSService integration tests (Twilio provider)
- PushService integration tests (FCM/APNs providers)
- NotificationService integration tests (orchestration layer)

Test coverage includes:
- Successful notification delivery
- Error handling (API errors, network timeouts, invalid inputs)
- Rate limiting enforcement
- Batch operations with partial failures
- Notification preferences and deduplication
- Template-based email sending
- Metadata and attachment handling

Total: ~1400 lines across 4 test files
2026-05-02 13:22:41 -04:00
bdf8ad30b6 Apply security remediations for FRE-4498 (FRE-4612)
Security findings from April 30 review were claimed fixed but never committed.
Applied all remediations:

HIGH:
- WebhookHandler: fail fast when DARKWATCH_WEBHOOK_SECRET missing instead of defaulting to hardcoded secret
- field-encryption.service: require PII_ENCRYPTION_KEY at startup instead of defaulting

MEDIUM:
- WebhookHandler: make signature required (was optional, accepted unsigned events)
- WebhookHandler: reject unknown event types instead of silently defaulting to SCAN_TRIGGER
- scheduler.routes + webhook.routes: add ownership checks on /:userId endpoints (IDOR)

LOW:
- webhook.routes: generic error responses, full error logged server-side

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 13:03:28 -04:00
f34adc5e82 Add null checks in feedback processing pipeline (FRE-4514)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 13:01:02 -04:00
e704a9074a FRE-4533: Merge apps/{api,web,mobile} and shared-db into ShieldAI repo
Merge FrenoCorp apps into ShieldAI packages/:
- packages/api: merged routes (notifications), middleware (auth, rate-limit, error, logging), config, services (darkwatch, spamshield, voiceprint), tests
- packages/web: new SolidJS web app stub
- packages/mobile: new SolidJS mobile app stub
- packages/shared-db: new Prisma DB package (separate from existing packages/db)
- pnpm-workspace.yaml: restored (apps/* removed, already covered by packages/*)

Next: reconcile packages/shared-db with packages/db, and fix server.ts correlationRoutes import
2026-05-02 10:19:11 -04:00
1197fe48f7 FRE-4533: Merge apps/{api,web,mobile} and shared-db into ShieldAI repo
- Copy apps/api (Fastify server with spamshield/voiceprint/darkwatch services)
- Copy apps/web (SolidJS web app)
- Copy apps/mobile (SolidJS mobile app)
- Copy packages/shared-db (Prisma schema/models)
- Add apps/* to pnpm-workspace.yaml
2026-05-02 10:16:18 -04:00
1e42c4a5c2 FRE-4529: Transfer ShieldAI code from FrenoCorp repo
Transferred ShieldAI-related files mistakenly placed in ~/code/FrenoCorp:
- Services: spamshield (feature-flags, audit-logger, error-handler), voiceprint (config, service, feature-flags), darkwatch (pipeline, scan, scheduler, watchlist, webhook)
- Packages: shared-analytics, shared-auth, shared-ui, shared-utils (new); shared-billing, jobs supplemented with unique FC files
- Server: alerts (FC version newer), routes (spamshield, darkwatch, voiceprint)
- Config: turbo.json, tsconfig.base.json, vite/vitest configs, drizzle, Dockerfile
- VoicePrint ML service
- Examples

Pending: apps/{api,web,mobile}/ structured merge, shared-db/db mapping

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 10:13:13 -04:00
8687868632 Add request ID validation and CSPRNG fallback (FRE-4516)
- Max-length guard (256 chars) on incoming request IDs to prevent log bloat
- Format whitelist (alphanumeric, hyphen, underscore) to prevent log injection
- Replace Math.random() with crypto.randomBytes in fallback for CSPRNG
2026-05-02 09:43:13 -04:00
fe754761d9 Auto-commit 2026-05-02 09:37 2026-05-02 09:37:30 -04:00
b6b0f86d73 Add MixpanelService with hashed phoneNumber in spamBlocked() (FRE-4519)
Create MixpanelService that uses FieldEncryptionService.hashPhoneNumber()
to SHA-256 hash phone numbers before sending to Mixpanel analytics.

- Implement spamBlocked() method with phone number hashing
- Add 16 unit tests verifying hash correctness and API behavior
- Export service from package index

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 09:21:42 -04:00
b01b79d02a Add ReDoS validation for SpamRule.pattern field (FRE-4512)
- Create regex-validation utility with ReDoS detection (nested quantifiers,
  overlapping alternations, complexity limits)
- Add @db.VarChar(500) constraint on pattern field in Prisma schema
- Integrate validation in rule-engine at load time and evaluation time
- Add 46 unit tests covering syntax, ReDoS patterns, complexity, edge cases

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 07:23:39 -04:00
e580a693c7 FRE-4510: Implement feature flag checks for spam classification
- Add runtime flag evaluation from FLAG_<KEY> environment variables
- Add enableCallAnalysis flag check to analyzeCall() and interceptCall()
- Add enableFeedbackLoop flag check to recordFeedback()
- Add 19 tests for feature flag behavior (checkFeatureFlag, getters, service integration)
- Add vitest config and test script to spamshield package
2026-05-02 01:53:59 -04:00
90fbbc4465 FRE-4493: Complete API gateway review
 Approved Fastify API gateway implementation with:
- Request ID correlation middleware
- Multi-service routing (DarkWatch, VoicePrint, Correlation)
- CORS, Helmet security, health checks
- Docker containerization

Production gaps: rate limiting registration, JWT middleware, CORS whitelist

Artifacts:
- Review doc: packages/api/docs/FRE-4493-review.md
- Daily notes: memory/2026-05-02.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 01:51:23 -04:00
Senior Engineer
03276dde2d Add cross-service alert correlation system FRE-4500
- Unified alert types (AlertSource, AlertCategory, CorrelationStatus, EntityType)
- NormalizedAlert and CorrelationGroup Prisma models
- AlertNormalizer for all 4 services (DarkWatch, SpamShield, VoicePrint, CallAnalysis)
- CorrelationEngine with temporal + entity-based correlation detection
- CorrelationService orchestrator with dashboard API
- Correlation API routes (/api/v1/correlation/*)
- Service emitters wired to DarkWatch, SpamShield, VoicePrint
- pnpm workspace config for monorepo
2026-05-02 01:10:44 -04:00