Skip to content

Repository files navigation

InsightFlow

InsightFlow is a news-event insight web app.
Users provide a news title + URL or event text, then the system runs search, extraction, and LLM analysis to generate a structured report with timeline, sources, fact-check signals, and export output.

Current Progress

The repository currently includes baseline and implementation work through:

  • M0 foundation (types, error model, logging/redaction, CI baseline)
  • M1 frontend state model (home/settings/result pending flow)
  • M2 LLM provider adapter
  • M3 search provider adapter
  • M4 URL extraction and degradation handling
  • M5 analysis pipeline orchestration
  • M6 result UI rendering
  • M7 export (Markdown + print/PDF view)
  • M8 quality round 1 (error mapping + frontend user-friendly hints)

Core Capabilities

  • Unified InsightError model and error code dictionary
  • API key redaction and safe logging
  • Search/extraction/pipeline degradation paths for resilience
  • Local preview pages for home/settings/result states
  • Local API endpoints for analyze + provider connectivity checks

Quick Start

npm install
npm run dev

npm run dev now generates the M6 preview artifacts and serves the local API + static pages together at http://127.0.0.1:4173.

Local Pre-Release

npm run release:check

This runs the full M8 quality gate, builds production artifacts, and smoke-checks the generated API/static preview bundle. Production runtime commands:

npm run build
npm run start

Docker local pre-release:

docker build -t insightflow:local .
docker run --env-file .env -p 4173:4173 insightflow:local

Copy .env.example to .env first when testing Docker or platform-key demo mode.

Quality Checks

npm run lint
npm run typecheck
npm run test
npm run qa:m8
npm run qa:m8:safety
npm run qa:m8:perf
npm run qa:m8:stability
npm run qa:m8:contract
npm run qa:m8:contract:baseline
npm run qa:m8:error-hints
npm run qa:m8:visual
npm run qa:m8:visual:assert
npm run qa:m8:interaction:assert
npm run qa:m8:locale:assert
npm run qa:m8:mobile:assert
npm run qa:m8:visual:full
npm run qa:m8:full

Preview and Local API

Generate preview files:

npm run preview:m6

Generated under app/.preview/:

  • m6-home.html
  • m6-settings.html
  • m6-ready.html
  • m6-pending.html
  • m6-error.html
  • m6-report.md
  • m6-report-print.html
  • index.html

Serve preview + API together:

npm run preview:m6:serve

Local endpoints:

  • GET /api/health
  • GET /api/health/dependencies
  • GET /api/metrics
  • POST /api/analyze
  • POST /api/settings/test-llm
  • POST /api/settings/test-search

M8 Quality Update (Round 1)

Implemented:

  • lib/error-presentation.ts for centralized error hint mapping
  • app/m6-shared-styles.ts for shared M6 shell/theme styles (home/settings/result)
  • API error responses now include userHint (zh/en)
  • production runtime config supports CORS allowlists, request body limits, rate limits, dependency health, platform-key demo mode, and SSRF URL blocking
  • result/settings pages prefer user-friendly hint text over raw upstream error text
  • pending analyze fetch failure now reliably transitions to error page with guidance
  • locale persistence key insightflow:locale enables cross-page language consistency

Verification commands:

npm run test
npm run typecheck
npm run lint
npm run preview:m6
npm run qa:m8
npm run qa:m8:runtime
npm run qa:m8:contract
npm run qa:m8:contract:baseline
npm run qa:m8:error-hints
npm run qa:m8:perf
npm run qa:m8:stability
npm run qa:m8:safety
npm run qa:m8:visual
npm run qa:m8:visual:assert
npm run qa:m8:interaction:assert
npm run qa:m8:locale:assert
npm run qa:m8:mobile:assert
npm run qa:m8:visual:full
npm run qa:m8:full

Visual snapshots output to app/.preview/shots/ for ready/home/settings/pending/error pages. If Chromium is missing locally, install once:

npx playwright install chromium

For intentional API contract shape changes, refresh the contract baseline:

npm run qa:m8:contract:baseline:update

Documentation

Milestone WBS:

Milestone acceptance:

Phase-0 design notes:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages