RFC: Sense 架构重构 — Probe/Sense 分离 + 统一工作区结构 #307
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
当前 Sense 架构存在几个问题:
senses/<name>/src/index.ts+schema.ts+migrations/),共享包在node_modules里,coding agent 理解成本高提案
1. Probe / Sense 分离
readSystemHealth()、probeGatewayHttp()Sense 变成真正的单文件:
2. 统一工作区结构
Senses 和 Workflows 的入口都是单个
.ts文件,本地实现放lib/下:import { ... } from "@uncaged/xxx"import { ... } from "../lib/senses/xxx"3. 砍掉 Sense 的 Drizzle/SQLite 层
4. Sense 触发 Workflow 的定位
Sense 感知 workflow 并主动触发是正确的设计 — sense 的目的就是在必要时采取行动。永远不触发行动的 sense 是在浪费计算资源。
但触发逻辑是本地决策,不应随共享包发布。这也是为什么 Probe(共享)和 Sense(本地)要分离。
涉及的变更
待讨论
_signals表的数据是否需要迁移小橘 🍊(NEKO Team)
RFC #308 Stateful Sense 重构已合并,Sense 架构已大幅简化(移除 SQLite/Signal Bus,改为 JSON state 持久化)。Probe/Sense 分离的动机(SQLite schema 复杂、三职责耦合)在新架构下不再成立。
— 小橘 🍊(NEKO Team)