# hub9 得分

## 摘要

hub9 是一个轻量 cloud hub + local daemon 系统。它最清晰的设计信号是职责拆分：

```text
cloud hub: identity、channels、messages、job routing、durable state
local daemon: runtime execution
```

按这个 framework 的目标来看，hub9 更接近：

```text
P1: controlled remote-agent runtime and routing layer
```

它具备较好的轻量 agent coordination primitives，但还不是完整的 production-grade agent application framework。

## 分数

| 核心技术维度 | 分数 | 判断依据 |
|---|---:|---|
| Application Factory Efficiency | 3.8 | 通过 web UI、hub API、tenant key、local daemon，可以很快搭出轻量 agent collaboration/routing 应用。 |
| Reliability & Correctness | 3.6 | TiDB-backed durable state、jobs、queues、messages、deleted archives、dedupe、routing tests、daemon completion loop 提供了不错的正确性基础。 |
| Security & Governance | 2.5 | tenant key 和 tenant database derivation 是有用的第一层边界，但还不是完整 RBAC、scoped credentials、DLP、approval、audit governance。 |
| Scalability & Performance | 3.2 | Cloudflare Worker/static web/TiDB Cloud 的形态轻量且可扩展，但 queue fairness、backpressure、leases、retry policy、dead-letter handling 等生产 scheduler 能力还不明显。 |
| Cost Efficiency | 3.8 | 部署形态很轻：static UI、Worker API、TiDB state、local daemon execution。平台开销低，但没有显式 usage/budget accounting。 |
| Continuous Improvement | 2.0 | 没有看到强 eval registry、trace grading、feedback loop、version comparison 或 regression framework。 |

加权分：**3.14 / 5**

## 强项维度

### Application Factory Efficiency

当目标是“快速创建轻量 remote agent workspace”时，hub9 很强：

- tenant key 得到 tenant-scoped hub。
- web UI 提供 channels 和 messages。
- local daemon 注册 machine 和 agent。
- job routing 把 cloud message 接到 local runtime execution。

这是快速长出 agent collaboration product 的有用模式。

### Reliability & Correctness

hub9 有真实的 durable state surfaces：

- workers。
- agents。
- channels。
- messages。
- jobs。
- queues。
- deleted channel/message/job archives。

测试也覆盖了一些 correctness behavior：

- stable SQL-safe tenant database names。
- deleting agents。
- verified remote deletion。
- channel deletion archives rows。
- canonical direct-message channel routing。
- rapid duplicate message submission dedupe。

相关参考：

- `https://github.com/siddontang/hub9`
- `internal/hub/tidb_store.go`
- `cmd/hub9-daemon/main.go`
- `internal/hub/store_test.go`
- `internal/hub/tenant_test.go`

### Cost Efficiency

hub9 的部署形态很轻：

- static web。
- Cloudflare Worker API。
- TiDB Cloud durable state。
- local daemon 执行 runtime work。

这降低了平台成本，也避免了重型 centralized execution fleet。

## 弱项维度

### Security & Governance

hub9 有第一层 security boundary，但不是完整 governance layer：

- tenant key 控制 tenant access。
- tenant key 映射到 deterministic tenant database name。
- 没有看到完整 user/RBAC model。
- 没有 scoped per-tool credentials。
- 没有 high-risk action approval workflow。
- 没有 DLP/retention/compliance model。

### Scalability & Performance

架构形态上具备扩展性，但 production scheduler layer 还比较基础：

- 没有看到 worker leases。
- 没有 dead-letter queue。
- 没有 tenant-level fairness policy。
- 没有 priority scheduling。
- 没有 budget-aware throttling。
- durable state 中没有显式 retry/backoff contract。

### Continuous Improvement

hub9 看起来还不是 eval-driven：

- 没有看到 eval registry。
- 没有 trace grading。
- 没有 versioned prompt/tool/workflow comparison。
- 没有 production feedback-to-regression loop。

## 阶段判断

| 阶段 | 判断 |
|---|---|
| P0: Application can be generated | 对轻量 hub/daemon agent app 已通过。 |
| P1: Controlled trial | 基本通过。core routing 和 durable state path 清楚。 |
| P2: Production service | 部分满足。还需要更强 governance、observability、scheduling、recovery contracts。 |
| P3: Leading value | 尚未证明。 |

## 结论

hub9 最适合作为这些方向的参考：

- hub/daemon responsibility split。
- tenant-scoped durable routing state。
- lightweight agent collaboration UX。
- 不由中心平台持有全部 compute 的 local runtime execution。
- TiDB-backed workers、agents、messages、jobs、queues 状态。

它暂时不适合作为这些方向的参考：

- enterprise security and governance。
- eval-driven improvement。
- cost/budget enforcement。
- complex production scheduling。
- multi-application factory behavior。
