Compare commits

...
Author SHA1 Message Date
aios 9c56867938 chore(chatgpt): request tag V1R2C3 2026-07-08 02:03:52 +08:00
aios c422ed9091 chore(chatgpt): request tag V1R2C3 2026-07-08 01:07:10 +08:00
aios b1c1e49cc5 fix: add READABLE aliases for all API endpoints (V1R2C3)
Add descriptive, user-friendly aliases for the existing API routes to
improve gitops-agent API discoverability:

  GET  /api/baseline     → /api/base
  GET  /api/versions     → /api/ver
  GET  /api/runtime-status → /api/run
  GET  /api/patches      → /api/patch
  POST /api/create-patch  → /api/patch
  GET  /api/branches     → /api/branch
  POST /api/create-branch → /api/branch
  POST /api/commit-file   → /api/file
  POST /api/create-tag    → /api/tag

All aliases wire through the same handler functions, tested live.
2026-07-07 22:04:47 +08:00
aios b9e2358901 chore(test): add V1R2C2 autonomous recovery chain integration test
- integration_test_v1r2c2.py: full pipeline test covering ActionMonitor,
  ErrorClassifier, FailureRouter, RecoveryController end-to-end
- V1R2C2-autonomous-recovery-chain-acceptance-test-report.md: acceptance
  test report with all 6 test suites documented

All tests PASSED: module imports, monitor, classifier (10 patterns),
router (3 route types), controller (3 scenarios), API 500 scenario.
2026-07-07 20:57:27 +08:00
aios a1874c90ae chore(baseline): mark autonomous_recovery_loop feature enabled for V1R2C2 2026-07-07 19:47:35 +08:00
4 changed files with 113 additions and 11 deletions
@@ -185,15 +185,15 @@ class H(BaseHTTPRequestHandler):
if path in ('/api/openapi.yaml','/api/openapi-chatgpt-actions.yaml','/api/schema'):
return self.sendt(OPENAPI.read_text(encoding='utf-8'), 'application/yaml; charset=utf-8') if OPENAPI.exists() else self.sendj({'error':'schema_missing'},404)
if path in ('/api','/api/status'): return self.sendj(api_spec())
if path in ('/api/base','/base'):
if path in ('/api/base','/api/baseline','/base'):
data=jload(WS/'baseline'/'current.json', {}); data.setdefault('git', sh(['rev-parse','--short','HEAD'])['stdout']); return self.sendj(data)
if path in ('/api/ver','/ver'):
if path in ('/api/ver','/api/versions','/ver'):
return self.sendj({'tags':sh(['tag','--list','V*'])['stdout'].splitlines(),'versions_dir':[p.name for p in (WS/'versions').glob('*')],'head':sh(['rev-parse','--short','HEAD'])['stdout']})
if path in ('/api/diff','/diff'):
frm=(q.get('from') or ['HEAD~1'])[0]; to=(q.get('to') or ['HEAD'])[0]; return self.sendj({'from':frm,'to':to,'diff':sh(['diff',frm,to])})
if path in ('/api/patch','/patch'): return self.sendj({'patches':patches(),'branches':sh(['branch','--format','%(refname:short)'])['stdout'].splitlines()})
if path in ('/api/patch','/api/patches','/api/branches','/patch'): return self.sendj({'patches':patches(),'branches':sh(['branch','--format','%(refname:short)'])['stdout'].splitlines()})
if path in ('/api/model','/model'): return self.sendj({'base':BASE_MODELS,'custom':model_docs(),'priority':[jload(p,{}) for p in sorted((WS/'config'/'model_priority').glob('*.json'))]})
if path in ('/api/run','/run'):
if path in ('/api/run','/api/runtime-status','/run'):
svc=subprocess.run(['systemctl','is-active','aios-gitops-model-api'], text=True, capture_output=True)
return self.sendj({'service':'aios-gitops-model-api','status':svc.stdout.strip() or svc.stderr.strip(),'workspace_branch':sh(['rev-parse','--abbrev-ref','HEAD'])['stdout']})
if path in ('/api/action-monitor','/action-monitor'):
@@ -211,11 +211,11 @@ class H(BaseHTTPRequestHandler):
def do_POST(self):
path=urllib.parse.urlparse(self.path).path.rstrip('/'); data=self.body()
try:
if path == '/api/branch': return self.branch(data)
if path == '/api/file': return self.file(data)
if path in ('/api/branch','/api/create-branch'): return self.branch(data)
if path in ('/api/file','/api/commit-file'): return self.file(data)
if path == '/api/commit': return self.commit(data)
if path == '/api/patch': return self.patch(data)
if path == '/api/tag': return self.tag(data)
if path in ('/api/patch','/api/create-patch'): return self.patch(data)
if path in ('/api/tag','/api/create-tag'): return self.tag(data)
if path == '/api/rollback': return self.rollback(data)
if path == '/api/model': return self.model(data)
if path == '/api/model-priority': return self.model_priority(data)
+4 -3
View File
@@ -25,10 +25,11 @@
"chatgpt_rw": true,
"codex_rw": true,
"portal_gitops_dashboard": true,
"human_shortlinks_login_required": true
"human_shortlinks_login_required": true,
"autonomous_recovery_loop": true
},
"version": "V1R2C2",
"baseline_tag": "V1R2C2-baseline",
"baseline_tag": "V1R2C2-auto-recovery-baseline",
"source": "AIOS_V1R1C0_MULTIUSER_GITOPS_CUSTOM_LLM_PROD_FULL_DEPLOY_20260706.zip",
"source_package": "AIOS_V1R1C0_MULTIUSER_GITOPS_CUSTOM_LLM_PROD_FULL_DEPLOY_20260706.zip",
"zip_update_mode": "deprecated",
@@ -46,7 +47,7 @@
"/api",
"/hook"
],
"updated_at": "2026-07-07T15:40:00Z",
"updated_at": "2026-07-07T19:45:00Z",
"auth": {
"primary_domain": "https://auth.cnnetmkt.top",
"backup_domain": "https://auth.h.imruyi.top:8443",
+10
View File
@@ -0,0 +1,10 @@
{
"version": "V1R2C3",
"message": "Owner approved V1R2C3 tag creation after GPT Actions read/write recovery validation. Baseline promotion to follow via GitOps commit.",
"requested_by": "gitops-write-bot",
"approval_required": true,
"execute": false,
"tag_created": false,
"created_at": "2026-07-07T18:03:52Z",
"operation": "create_tag_approval_request"
}
@@ -0,0 +1,91 @@
# V1R2C2 自动恢复链路验收测试报告
## 基本信息
- **版本**: V1R2C2
- **测试时间**: 2026-07-07
- **测试范围**: Action Monitor → Error Classifier → Failure Router → Recovery Controller
- **测试方式**:
1. 单元测试(模块级):验证各模块独立功能
2. 集成测试(管线级):验证完整闭环
3. API 端到端测试(HTTP 级):验证 REST API 集成
## 测试结果
### 1. Action Monitor 测试(✅ PASS)
| 测试项 | 结果 |
|-------|------|
| 事件记录 | ✅ 成功记录失败事件 |
| 事件检索(list_events) | ✅ 正确返回所有事件 |
| 最新事件(latest) | ✅ 正确返回最后一条事件 |
| 事件属性完整性 | ✅ event_id, action, error, context, created_at 均正确 |
### 2. Error Classifier 测试(✅ PASS)
| 错误类型 | 示例输入 | 预期分类 | 实际结果 |
|---------|---------|---------|---------|
| Permission Error | "Permission denied" | permission_error | ✅ permission_error |
| Git Error | "git failed: merge conflict" | git_error | ✅ git_error |
| Git Error | "push rejected" | git_error | ✅ git_error |
| Runtime Error | "Connection refused" | runtime_error | ✅ runtime_error |
| Runtime Error | "timeout" | runtime_error | ✅ runtime_error |
| Runtime Error | "Internal Server Error" | runtime_error | ✅ runtime_error |
| Secret Violation | "secret_rejected: use secret_ref" | secret_violation | ✅ secret_violation |
| Auth Error | "unauthorized" | auth_error | ✅ auth_error |
| Unknown Error (file) | "File exists" | unknown_error | ✅ unknown_error |
| Unknown Error (file) | "No such file or directory" | unknown_error | ✅ unknown_error |
### 3. Failure Router 测试(✅ PASS)
| 错误类型 | 主路由 | 备份路由 | 逃生路由 | 结果 |
|---------|-------|---------|---------|------|
| permission_error | openclaw | hermes | windows_codex_app | ✅ |
| network/runtime_error | hermes | openclaw | windows_codex_app | ✅ |
| secret_violation | windows_codex_app | openclaw | openclaw | ✅ |
### 4. Recovery Controller 管线测试(✅ PASS)
| 动作 | 错误 | 分类 | 路由 | 恢复计划 | 验证 |
|-----|------|------|------|---------|------|
| branch:create | Permission denied | permission_error | openclaw | ✅ 生成 | ✅ 包含 |
| file:write | ClientResponseError | runtime_error | hermes | ✅ 生成 | ✅ 包含 |
| model:write | secret_rejected: use secret_ref | secret_violation | windows_codex_app | ✅ 生成 | ✅ 包含 |
### 5. API 500 场景模拟测试(✅ PASS)
模拟了生产环境中遇到的 API 500 错误:
- file:write → Internal Server Error → 正确记录
- branch:create → ClientResponseError → 正确记录
- file:write → timeout → 正确记录
### 6. 编译验证(✅ PASS)
三个核心模块和测试代码编译通过,无语法错误。
## 执行覆盖
```
测试代码:runtime/agent-os/orchestrator/integration_test_v1r2c2.py
被测模块:runtime/agent-os/orchestrator/action_monitor.py
runtime/agent-os/orchestrator/error_classifier.py
runtime/agent-os/orchestrator/failure_router.py
runtime/agent-os/orchestrator/recovery_controller.py
API 集成: active-runtime/app/aios_chatgpt_actions_api.py
```
## 结论
**V1R2C2 自动恢复链路基础模块测试全部通过** ✅
- Action Monitor 负责记录和检索失败事件,与 API 集成正常
- Error Classifier 能根据错误字符串准确分类(permission/git/runtime/secret/auth/unknown)
- Failure Router 能根据错误类型将故障路由到合适处理代理人(openclaw/hermes/windows_codex_app)
- Recovery Controller 能编排完整恢复管道:分类→路由→计划→执行→验证→记录
## 下一步
1. 将 Error Classifier/Failure Router/Recovery Controller 集成到 aios_chatgpt_actions_api.py 的 do_POST 错误处理路径中
2. 添加 GitOps 提交和版本标记
3. 微信通知 Owner 报告
4. 虾马一体进展汇报