Establish agent swarm quality evidence

Define Agent and swarm-specific acceptance evidence, move the reports under docs, and make the homepage point to the current standard, live run, model I/O, and handoff evidence.

Constraint: Agent quality standards are configured from industry AI and agent risk references because there is no single accepted swarm-Agent certification standard.

Rejected: Treating py_compile or unittest as the primary quality standard | they are evidence collection tools, not the Agent quality standard itself.

Confidence: high

Scope-risk: moderate

Directive: Keep future standard reports under docs/ and keep secrets in ignored local .env files only.

Tested: git diff --cached --check; python -B -m py_compile swarm_minimal/*.py examples/*.py tests/*.py; python -B -m unittest discover -s tests; python -u -B examples/run_academic_standard_evaluation.py

Not-tested: Did not rerun the full live Azure/NewAPI S07 scenario after moving docs; previous live run 3e8e58ae4e084bc8b90cf5c46f8992f3 passed before the docs relocation.

Co-authored-by: OmX <omx@oh-my-codex.dev>
This commit is contained in:
gongzhiyong
2026-05-16 14:36:47 +08:00
co-authored by OmX
parent 111be3e435
commit 10a980b0bf
21 changed files with 1994 additions and 135 deletions
+45 -4
View File
@@ -2,6 +2,30 @@
这是一个独立的最小蜂群闭环原型,不接入 Heicode Manager 主项目,也不修改现有 API。
## 当前状态
本仓库已经补齐最小 Agent / 蜂群 Agent 标准化测试闭环。这里的标准不是普通软件开发质量标准,而是围绕 Agent 的任务理解、上下文承接、模型选择、工具边界、敏感信息保护、可观测性、handoff、信息素协作、收敛和马尔可夫式状态转移建立的 AQS / SW-AQS v1。
最新 live 标准矩阵已通过:
```json
{
"run_id": "3e8e58ae4e084bc8b90cf5c46f8992f3",
"completed_tasks": 7,
"accepted_score": 1.0,
"check_count": 12,
"failed_checks": []
}
```
主要报告入口都放在 `docs/`,完整索引见 `docs/README.md`:
- `docs/AGENT_SWARM_QUALITY_STANDARD.zh-CN.md`:Agent / 蜂群 Agent 质量标准、测试标准来源、S07 任务分配和接手机制。
- `docs/ACADEMIC_STANDARD_TEST_REPORT.zh-CN.md`:测试场景、测试过程、测试结果、算法清单和马尔可夫过程判定。
- `docs/MODEL_AGNET_IO_REPORT.zh-CN.md`:每个模型 / Agnet 的任务、输入、输出、评分和交接过程。
- `docs/STANDARD_TEST_MATRIX.md`:S01-S07 标准矩阵。
- `docs/INDUSTRY_STANDARD_AGNET_TEST_PLAN.md`:行业参考框架到本项目标准的映射。
目标是先把蜂群的四个共享资源跑通:
1. 任务池:记录待执行、执行中、完成和失败的任务。
@@ -44,11 +68,24 @@ MVP 不使用 NATS,也不使用 Cosmos DB。
## 本地运行
```bash
cd swarm-minimal
python3 -B examples/run_demo.py
python3 -B -m unittest discover -s tests
```
标准化测试入口:
```bash
python3 -B -m py_compile swarm_minimal/*.py examples/*.py tests/*.py
python3 -B -m unittest discover -s tests
python3 -u -B examples/run_academic_standard_evaluation.py
```
完整 live 标准矩阵需要本机被忽略的 `.env` 中提供 Azure PostgreSQL、Redis、Blob 和 NewAPI 测试凭据:
```bash
python3 -u -B examples/run_standard_scenario_acceptance.py
```
## Agnet / NewAPI 测试
NewAPI 连接使用 OpenAI-compatible `/v1/chat/completions` 形式。真实 key 只通过环境变量注入:
@@ -62,7 +99,7 @@ export NEWAPI_API_KEY=<newapi-api-key>
python3 -B examples/run_newapi_agnet_demo.py
```
也可以在本机创建 `swarm-minimal/.env`,demo 会自动读取;该文件已被 `.gitignore` 忽略:
也可以在本机创建项目根目录 `.env`,demo 会自动读取;该文件已被 `.gitignore` 忽略:
```bash
NEWAPI_BASE_URL=<newapi-base-url>
@@ -113,7 +150,7 @@ export SWARM_BLOB_CONTAINER=swarm-artifacts
python3 -B examples/run_azure_demo.py
```
`examples/run_azure_demo.py`、`examples/run_newapi_agnet_demo.py`、`examples/run_three_newapi_agnets.py` 和 `examples/run_full_live_test.py` 都会自动读取本地私有 `swarm-minimal/.env`。
`examples/run_azure_demo.py`、`examples/run_newapi_agnet_demo.py`、`examples/run_three_newapi_agnets.py` 和 `examples/run_full_live_test.py` 都会自动读取本地私有 `.env`;优先读取项目根目录 `.env`,没有时读取 `examples/.env`。
如果连接字符串、数据库密码、Redis key 或 Storage account key 曾经出现在聊天、日志、截图或提交记录里,应在 Azure 侧轮换后再长期使用。
@@ -121,7 +158,7 @@ python3 -B examples/run_azure_demo.py
- `swarm_minimal/core.py`:最小蜂群闭环逻辑。
- `swarm_minimal/config.py`:从环境变量读取 PostgreSQL、Redis、Blob 配置,并只输出脱敏摘要。
- `swarm_minimal/local_env.py`:读取本地私有 `.env`,不依赖第三方 dotenv 包。
- `swarm_minimal/local_env.py`:读取本地私有 `.env` 或 `examples/.env`,不依赖第三方 dotenv 包。
- `swarm_minimal/azure_store.py`:可选 Azure 后端,使用 PostgreSQL、Redis Streams / Sorted Set 和 Blob Storage。
- `swarm_minimal/azure_resources.py`:Azure 资源需求清单。
- `swarm_minimal/newapi_agnet.py`:NewAPI / OpenAI-compatible Agnet 适配器。
@@ -133,3 +170,7 @@ python3 -B examples/run_azure_demo.py
- `examples/run_full_live_test_interactive.py`:本机交互式输入密钥并运行完整 live 测试。
- `tests/test_minimal_swarm.py`:闭环和资源约束测试。
- `tests/test_newapi_agnet.py`:NewAPI Agnet 的 mock 测试。
- `tests/test_markov_process_properties.py`:马尔可夫式状态转移判定测试。
- `examples/run_academic_standard_evaluation.py`:学术化标准测试汇总入口。
- `docs/ACADEMIC_STANDARD_TEST_REPORT.zh-CN.md`:标准来源、测试过程、结果、算法和马尔可夫过程结论。
- `docs/AGENT_SWARM_QUALITY_STANDARD.zh-CN.md`:Agent / 蜂群 Agent 质量标准、S07 任务分配、模型接手机制和当前结论。