Skip to content

Latest commit

 

History

552 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SecNews · AI + 安全 知识工作站

SecNews v0.8.1 — 单人本地 AI + 安全工作站: Sentinel Terminal 三层工作流 (Data/Judge/Action) + 8 子系统 + 19 MCP 工具

SecNews(开发代号 hotspot)是面向 AI + 安全从业者 的单人本地工作站。 全站统一收敛为 Sentinel Terminal 三层工作流:Data → Judge → Action, 通过 MCP 协议 对外暴露 19 个工具 (11 读 + 8 写), Cursor / Claude Desktop / Trae / Claude Code 等外部 AI Agent 零改造接入。

一个人 · 一台电脑 · 零外部服务。


快速开始

git clone https://github.com/anyeduke11/secnews.git && cd secnews

# 后端(端口 8000)
python -m venv .venv && source .venv/bin/activate
pip install -r backend/requirements.txt
python run.py                        # http://127.0.0.1:8000

# 前端(端口 8898,严格端口,占用即报错)
cd frontend && npm install && npm run dev   # http://localhost:8898

代理配置(可选)backend/proxy_config.json 默认 mode=off。 需要时把 127.0.0.1:7897 改成你的代理端口; security_collectorgithub_collector 走代理才能拿到数据, 前端 /secnews/settings 可运行时改,无需重启。

隐私保护proxy_config.json / .env / *.db / node_modules 全部已在 .gitignore 排除。 仓库仅包含 proxy_config.example.json / .env.example 模板, 你需要本地复制并填入自己的代理 / API key,不会被推送到 GitHub

为什么选择 SecNews?

能力 说明
热点聚合 14 采集器 · 12 质量门禁 · 8 大领域覆盖
知识沉淀 md 真源 · kl_pipeline 5 阶段 · FTS5 检索 · 注意力评分
项目管理 CodeGarden 项目生命周期 + 服务网格 + 资源中枢
安全图谱 MITRE ATT&CK · NVD CVE · 等保 / 关基 / 数安法
AI 协作 19 MCP 工具 · 外部 AI Agent 零改造接入
单机部署 SQLite + 单进程 · 零外部依赖 · git clone 即跑

Sentinel Terminal — 三层工作流

解决什么 入口路由
Data 14 采集器 · 12 质量门禁 · Pipeline 流水线 · 趋势 / 搜索 / 导出 /secnews (统一工作台 6 tab: Feed · Pipeline · Knowledge · Analyze · Analytics · Settings)
Judge 知识库 v2 · md 真源 · kl_pipeline 5 阶段 · FTS5 检索 · 注意力 5 维 /knowledge (Import · Process · Compile · Compound 4 tab) + /judge (Sentinel Judge)
Action CodeGarden 资源中枢 · Service Mesh · 联动引擎 · AI 协作 /action (Sentinel Action) + /codegarden + /garden (Sentinel Garden) + /settings

主入口(v0.7.1 起 /SentinelHomePage 决策指挥中心):

路由 作用
/ SentinelHomePage — Data/Judge/Action 健康度指挥台 · 今日关键决策
/judge SentinelJudgePage — 知识管线判官
/judge/graph SentinelGraphPage — 知识图谱可视化
/action SentinelActionPage — 执行层 · CodeGarden 联动
/garden SentinelGardenPage — 个人项目花园
/settings 统一设置入口:dsh 受管子进程 / pi agent / 同步策略 / MCP / 观测
/secnews 统一工作台 6 tab:Feed · Pipeline · Knowledge · Analyze · Analytics · Settings
/knowledge 知识库 4 tab:Import · Process · Compile · Compound
/codegarden CodeGarden 项目管理(项目 · 服务 · 资源 · 事件 · Playbook)
/crm CRM 业绩座舱

重大变更:原 /workbench 5 视图已物理删除并并入 /secnews 统一工作台; dsh 认知大脑从外部子进程降级为受管子进程(gate dsh=true 由前端一键启停)。 v0.6.3 起 knowledge/ 根被废弃,唯一真源为 llm-wiki-2.0/ md 文件,SQLite 只做投影索引。

架构

三层架构: 浏览器 / AI Agent 在最上, FastAPI 单进程在中间, SQLite + .md 在底层, 经 MCP 暴露给外部 AI Agent

MCP Server — 19 个工具

11 读 + 8 写,外部 AI Agent 零改造接入(/api/mcp SSE 通道 + python -m backend.mcp_stdio_main stdio 通道双暴露)。

读 (11) 写 (8)
search_hotspots · get_hotspot · list_favorites · search_knowledge · get_personal_profile · wiki_search · wiki_read · wiki_graph · db_trace · kl_status · dsh_analyze add_favorite · remove_favorite · add_annotation · update_knowledge_item · wiki_write · kl_enqueue · kl_retry · dsh_summarize

stdio 配置(粘到你的 AI Agent 配置):

{
  "mcpServers": {
    "hotspot": {
      "command": "python",
      "args": ["-m", "backend.mcp_stdio_main"],
      "cwd": "/绝对路径/secnews"
    }
  }
}
AI Agent 配置文件路径
Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json
Trae ~/.trae/mcp_config.json
Cursor ~/.cursor/mcp.json
Claude Code 项目根目录 .mcp.json

启动 AI Agent 后直接说「给我列最近 24h 的安全热点」「把今天这几条喂给 kl_pipeline」即可。

技术选型

组件 选型 理由
Web 框架 FastAPI async + OpenAPI 生态成熟
主存储 SQLite WAL + llm-wiki-2.0/ 零部署 · FTS5 · git 友好 · LLM 可直读 · md 文件是 source of truth
调度 APScheduler · 51 jobs 单进程内调度,无外部 MQ;含 cg_service_scan / cg_event_process 等 CodeGarden job
采集器 14 个 BaseCollector 8 大领域覆盖,stdin/stdout 标准化
路由器 73 个 FastAPI include_router core 45 个白名单 + 28 个扩展域(feature_gates 条件注册)
业务服务 107 个 services 包 含 ai_hub / kl_pipeline / dsh / wiki_fs / model_router / agent_bridge 等
MCP fastapi-mcp OpenAPI → MCP 自动转换 · 19 个工具
前端 React 18 + Vite 5 + TypeScript 300+ 组件 · 类型安全 · 热重载
图表 echarts + recharts 看板风格
加密 Fernet (PBKDF2 派生) secrets · 同步包
跨端同步 WebDAV (坚果云) · zip 容器 加密包最小化 · 不依赖云服务

数字由 scripts/generate_meta.py AST 反推维护,CI generate_meta.py --check 强约束, 改完注册代码必须同步 docs/ARCHITECTURE.md

路线图

SecNews 路线图: 5 个发布版本从 v0.4.3 软分层到 v0.7.0 Sentinel Terminal

历史版本(GitHub Releases)

每个版本附带源码 zip(git archive 产物,不含依赖与个人数据):

版本 发布日期 关键里程碑 源码归档
v0.8.1 2026-09-05 七 gate 开闸 + 运行时弹性层 + graceful shutdown + deep 场景权重重排 Source code (zip)
v0.8.0 2026-09-04 v0.8 Skills 四阶段收口:20 内置 skill + /skill-store + /dashboard Source code (zip)
v0.7.4 2026-09-01 观测深化 + 扩展开闸 + i18n 全量 + secrets ACL + 历史债清偿 Source code (zip)
v0.7.0 2026-08-30 Sentinel Terminal 三层工作流 (Data/Judge/Action) Source code (zip)
v0.6.0 2026-08-27 统一工作台 6 tab · dsh 受管子进程 · CRM 业绩座舱 Source code (zip)
v0.5.1 2026-08-26 Chunks / Attention · FTS5 检索 · 5 维注意力评分 Source code (zip)
v0.5.0 2026-08-23 LLM-Wiki 2.0 · kl_pipeline 5 阶段 · md 真源 Source code (zip)
v0.4.3 2026-08-19 软分层 / Feature Gates · core/exec 边界 Source code (zip)

测试

# 后端(3818+ passed / 0 skipped)
python -m pytest backend/tests/ --tb=short -q
python -m pytest backend/tests/ -k "merge"        # 单一域筛选
python -m py_compile backend/services/sync_merge.py

# 前端(425+ passed)
cd frontend
npx vitest run
npx tsc --noEmit
npm run build

CI: .github/workflows/ci.yml — Python compile + pytest + tsc + vitest + vite build + generate_meta.py --check + harness_analyze.py --check

常见问题

Q: 为什么不内置 LLM 推理? A: 让用户在自己已配好的 AI Agent 环境(Cursor / Claude Desktop / Trae / Claude Code)中推理, 避免重复配置和 API key 管理。SecNews 只负责数据存储 + 19 工具暴露。

Q: 能多用户吗? A: 当前是单用户本地工作站,无多用户 / 权限隔离。SQLite WAL 模式下 WORKERS=1 是约束条件。

Q: 数据怎么备份? A: 3 选 1:

  1. backend/data/backup_*.db(24h 滚动,APScheduler 自动)
  2. WebDAV 同步包(坚果云 · zip + Fernet 加密)
  3. git 跟踪 llm-wiki-2.0/ 目录

Q: 端口冲突怎么办? A: 后端改 PORT=8001 启动;前端改 vite --port 88998898 是受保护端口(CodeGarden 资源中枢),禁止释放。

Q: 为什么不用 PostgreSQL / Redis / Celery? A: 违反「简单胜过复杂」原则 — 单机单用户场景下 SQLite WAL + APScheduler 已足够; 引入分布式组件会破坏「git clone 就能跑」的承诺。

Q: dsh / pi agent 怎么启停? A: 走前端 /settings 一键启停(gate dsh=true), 控制面经 /api/dsh/control/*;pi 执行 agent 经 /api/agents/run 调用。

贡献

新源 → 继承 BaseCollector + 测试 新门禁 → 继承 BaseGate + 进 pipeline.py 新 MCP tool → mcp_types.py 加 Pydantic + mcp_config.py 加 operation_id(当前 19 个工具: 11 读 + 8 写)

详细:AGENTS.md · CLAUDE.md · docs/ARCHITECTURE.md · docs/CHANGELOG.md

禁止

  • 提交 .env / 真实 proxy 配置 / 个人数据 / SQLite 数据库
  • 引入 Redis / PostgreSQL / Celery(违反「简单胜过复杂」原则)
  • 多 worker(SQLite WAL 锁限制)

许可证

LICENSE — GNU GPL-3.0


English

SecNews (codename hotspot) is a single-user local workstation for AI + security practitioners. The whole app is unified into the Sentinel Terminal 3-layer workflow: Data (collect / pipeline) → Judge (knowledge / evaluate) → Action (execute / collaborate). It exposes 19 MCP tools (11 read + 8 write) to external AI Agents — Cursor, Claude Desktop, Trae, Claude Code — with zero modifications.

One person · one machine · zero external services.

Quick start

git clone https://github.com/anyeduke11/secnews.git && cd secnews
python -m venv .venv && source .venv/bin/activate
pip install -r backend/requirements.txt
python run.py                          # http://127.0.0.1:8000
cd frontend && npm install && npm run dev   # http://localhost:8898

Configure backend/proxy_config.json (set your proxy port, default mode=off). Copy proxy_config.example.jsonproxy_config.json first; the real file is gitignored.

MCP stdio config

{
  "mcpServers": {
    "hotspot": {
      "command": "python",
      "args": ["-m", "backend.mcp_stdio_main"],
      "cwd": "/absolute/path/to/secnews"
    }
  }
}

Releases

Version Date Milestone
v0.8.1 2026-09-05 Seven gates opened + runtime elasticity + graceful shutdown + deep scenario reranking
v0.8.0 2026-09-04 v0.8 Skills 4-stage收口: 20 built-in skills + /skill-store + /dashboard
v0.7.4 2026-09-01 Observability deepening + expansion gates + i18n + secrets ACL + historical debt
v0.7.0 2026-08-30 Sentinel Terminal 3-layer workflow (Data / Judge / Action)
v0.6.0 2026-08-27 Unified workbench (6 tab) · dsh as managed subprocess · CRM cockpit
v0.5.1 2026-08-26 Chunks / Attention · FTS5 search · 5-dimensional attention scoring
v0.5.0 2026-08-23 LLM-Wiki 2.0 · kl_pipeline 5-stage · md as source of truth
v0.4.3 2026-08-19 Soft core/exec partitioning · Feature Gates (TOML)

License

LICENSE — GNU GPL-3.0

About

v0.8.1: 面向 AI + 安全从业者的单人本地工作站 · Sentinel Terminal 三层工作流 (Data/Judge/Action) · llm-wiki-2.0 wiki-first 知识库 · CodeGarden 项目全生命周期 · 七 gate 开闸 + 运行时弹性层 + graceful shutdown · MCP 开放 19 个工具给 Cursor/Claude Desktop/Trae/Claude Code

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages