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.
The repository currently includes baseline and implementation work through:
M0foundation (types, error model, logging/redaction, CI baseline)M1frontend state model (home/settings/result pending flow)M2LLM provider adapterM3search provider adapterM4URL extraction and degradation handlingM5analysis pipeline orchestrationM6result UI renderingM7export (Markdown + print/PDF view)M8quality round 1 (error mapping + frontend user-friendly hints)
- Unified
InsightErrormodel 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
npm install
npm run devnpm run dev now generates the M6 preview artifacts and serves the local API + static pages together at http://127.0.0.1:4173.
npm run release:checkThis 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 startDocker local pre-release:
docker build -t insightflow:local .
docker run --env-file .env -p 4173:4173 insightflow:localCopy .env.example to .env first when testing Docker or platform-key demo mode.
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:fullGenerate preview files:
npm run preview:m6Generated under app/.preview/:
m6-home.htmlm6-settings.htmlm6-ready.htmlm6-pending.htmlm6-error.htmlm6-report.mdm6-report-print.htmlindex.html
Serve preview + API together:
npm run preview:m6:serveLocal endpoints:
GET /api/healthGET /api/health/dependenciesGET /api/metricsPOST /api/analyzePOST /api/settings/test-llmPOST /api/settings/test-search
Implemented:
lib/error-presentation.tsfor centralized error hint mappingapp/m6-shared-styles.tsfor 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:localeenables 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:fullVisual snapshots output to app/.preview/shots/ for ready/home/settings/pending/error pages.
If Chromium is missing locally, install once:
npx playwright install chromiumFor intentional API contract shape changes, refresh the contract baseline:
npm run qa:m8:contract:baseline:updateMilestone WBS:
Milestone acceptance:
- M1 Acceptance
- M2 Acceptance
- M3 Acceptance
- M4 Acceptance
- M5 Acceptance
- M6 Acceptance
- M7 Acceptance
- M8 Acceptance
- M8 Runbook
Phase-0 design notes: