Make the user's six swarm characteristics first-class acceptance gates by adding S10/A07 tests, a standard document, and synchronized reports. Constraint: The user asked to set acceptance indicators and test standard details around decentralization, self-organization, emergence, robustness, scalability, and implicit collaboration. Rejected: Treating the six traits as prose-only documentation | they now run as deterministic tests and scenario matrix gates. Confidence: high Scope-risk: moderate Directive: Future swarm-readiness claims must report F01-F06 explicitly and distinguish local Agent-layer proof from production no-coordinator runtime. Tested: py_compile; unittest discover ran 41 tests; run_swarm_characteristics_acceptance PASS; run_academic_standard_evaluation A01-A07 PASS; run_standard_scenario_acceptance S01-S10 PASS with S07 run_id 9c7ccc6087c1435694a52efb12c32301; docs/README secret-pattern scan clean; git diff --cached --check clean. Not-tested: Production no-coordinator distributed runtime and Kubernetes-scale worker telemetry remain outside this minimal local acceptance gate. Co-authored-by: OmX <omx@oh-my-codex.dev>
66 lines
2.4 KiB
Python
66 lines
2.4 KiB
Python
from pathlib import Path
|
|
import re
|
|
import unittest
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
REPORT = ROOT / "docs" / "MODEL_AGNET_IO_REPORT.zh-CN.md"
|
|
|
|
|
|
class ModelIoReportAuditTests(unittest.TestCase):
|
|
def test_report_exposes_scenarios_inputs_outputs_and_handoff(self) -> None:
|
|
text = REPORT.read_text(encoding="utf-8")
|
|
|
|
for required in [
|
|
"## 场景说明:FastAPI 是什么项目",
|
|
"## 本轮实际做了什么代码 / 测试工作",
|
|
"## 不同 Agnet 的工作怎么实现",
|
|
"## 收敛过程如何发生",
|
|
"## 本轮测试场景补充",
|
|
"| S01 | syntax_import_sanity |",
|
|
"| S02 | unit_regression |",
|
|
"| S03-S06 | deterministic_standard_scenarios |",
|
|
"| S07 | live_external_github_code_reasoning |",
|
|
"| S08 | model_io_report_audit |",
|
|
"| S09 | next_boundary_minimal_acceptance |",
|
|
"| S10 | swarm_six_characteristics_acceptance |",
|
|
"fastapi/fastapi",
|
|
"ecace740f3eaccb1aba152cf1de79477095c56f4",
|
|
"fastapi/routing.py",
|
|
"#### 本次任务输入 task.input",
|
|
"#### Agnet / 模型实际输出 task.output(审计摘要)",
|
|
"#### 接手 / 交接机制",
|
|
"原始来源:PostgreSQL `swarm_tasks.output`",
|
|
"质量补救",
|
|
"共识质量门",
|
|
"quality_attempt=1",
|
|
"chain_edge=",
|
|
]:
|
|
self.assertIn(required, text)
|
|
for forbidden in [
|
|
"为 swarm-minimal 设计可恢复的大规模代码任务推理链",
|
|
"swarm_minimal/core.py",
|
|
"swarm_minimal/newapi_agnet.py",
|
|
"swarm_minimal/azure_store.py",
|
|
"I appreciate the detailed context",
|
|
"What I can actually do",
|
|
"What I cannot do",
|
|
"输出质量风险",
|
|
]:
|
|
self.assertNotIn(forbidden, text)
|
|
|
|
def test_report_does_not_contain_obvious_secret_values(self) -> None:
|
|
text = REPORT.read_text(encoding="utf-8")
|
|
forbidden_patterns = [
|
|
r"sk-[A-Za-z0-9]{20,}",
|
|
r"AccountKey=[^<\s`]+",
|
|
r"password=[^<\s`]+",
|
|
r"BEGIN [A-Z ]*PRIVATE KEY",
|
|
]
|
|
for pattern in forbidden_patterns:
|
|
self.assertIsNone(re.search(pattern, text, flags=re.IGNORECASE))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|