Files
Agent-System-Backend/PROJECT.md
T

24 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Agent-System-Backend 项目事实
- 用途:见 README。定位与边界见设计文档(Agent-System-Documents)。
- 技术栈:Go(静态链接,CGO_ENABLED=0)
- 构建/验证:见仓内 Makefile 或 Dev 仓顶层 Makefile(待 P1 起补充并保持本节同步)。
- 状态:P0 骨架;当前阶段见 Dev 仓任务记录。
## 验证(P1–P4 状态)
- `go test ./...` — 单元 + 端到端(mock runner 全链路:流式/折叠部件/HITL 三分支/子代理任务树/工件/上传解析/中文检索/SSE 在线与重放/命令路由/插件装卸 fail-closed)。
- `CGO_ENABLED=0 go build ./cmd/agent-system` — 单二进制(静态,内嵌前端后)。
- `scripts/agent-exec validate --repo .` — 校验 AGENT-EXECUTION.md 执行路由配置。
- `scripts/dm governance check --repo .` — 只读核验治理文件与 gitlink(CI:.gitea/workflows/governance.yml)。
- 存储:嵌入式 SQLite(modernc.org/sqlite,纯 Go);FTS5 全文 + CJK LIKE 兜底。
- 依赖:agent-system-core(deps submodule + replace)、agent-native(runtime/llm 复用)。
## 配置(启动层)
- 来源优先级:内置默认 → 显式配置文件(`--config <json>`,无自动发现)→ 环境变量(`AGENT_SYSTEM_ADDR/DATA/PLUGINS/DSN/ARTIFACTS/AUTH/MOCK/INSTANCE/INSECURE_LISTEN/ALLOWED_HOSTS`)→ 显式 CLI(未传入的 flag 不覆盖)。
- 监听守卫:非回环地址且未开认证时拒绝启动(在打开数据库之前)。出路是改用 `127.0.0.1`、`--auth on`,或显式 `--insecure-listen`(每次启动警告)。`config explain` 会打印 `listen guard`。
- 只读诊断:`agent-system config explain [--config …] [--<flag> …]`——逐字段打印解析值与来源,DSN 脱敏;不建库、不写目录。
- 多实例:`envs/{dev,test,prod}.json` 为隔离示例(data 根/DB 不得重叠);实例约定详见 Documents 仓 `docs/proposals/2026-09-30-configuration-surface.md`。
- 运行时业务设置(`/api/settings` user/project scope、profiles 路由)是独立的业务策略层,不参与启动合并。