Compare commits

...
Author SHA1 Message Date
aios 4b504821e3 feat(agent-os): add V1R2C2 supervisor recovery instruction 2026-07-07 18:27:40 +08:00
aios e2b9cc6849 chore(report): add V1R2C2 cgpt-actions action monitor execution report 2026-07-07 18:00:52 +08:00
aios 4f4c95ffce chore(version): bump baseline to V1R2C2 for action monitor & confirm guards 2026-07-07 18:00:08 +08:00
aios edd3bd239e feat(cgpt-actions): add ActionMonitor for failure tracking & confirm-guard for tag/model/model-priority 2026-07-07 17:58:11 +08:00
aios 7a1e862a03 feat(V1R2C2): add autonomous recovery action monitor 2026-07-07 16:11:47 +08:00
aios dc0ac18aea chore(patches): remove stale artifact files
Remove 4 stale patch artifact files that have outlived their purpose:
- patches/nl/*.json - ephemeral natural-language plan records (unknown, patch_create)
- patches/patch_collab-*.branch.json - collab test branch records for branches
  that have been merged and had no local residual branch

The self-evolution-agent-orchestration-policy.json patch record is retained
because patch/self-evolution-agent-orchestration-policy branch is still live.
2026-07-07 15:53:02 +08:00
aios 9e3dbdf146 chore(version): bump baseline to V1R1C6 for chatgpt-actions consequential governance 2026-07-07 15:22:24 +08:00
aios 87b1a5357c feat(cgpt-actions): add confirm protection to tag/model/model-priority 2026-07-07 15:12:00 +08:00
aios 128a7d9050 feat(agent-os): implement V1R1C5 conditional approval mechanism with consensus engine updates and integration tests 2026-07-07 12:19:34 +08:00
aios e8cf0f6348 feat(agent-instructions): add v1r1c5 main merge verification instruction 2026-07-07 12:12:04 +08:00
aios 786a3b6250 feat(agent-instructions): add openclaw hermes improvement execution instruction 2026-07-07 11:36:11 +08:00
aios b9a739fd95 docs(agent-os): add Custom GPT solution review result 2026-07-07 11:34:50 +08:00
aios 0fb71cd191 feat(agent-governance): add owner channel registry policy 2026-07-07 11:33:21 +08:00
aios 3b8e74bed4 feat(agent-instructions): add owner approval gate workflow 2026-07-07 11:31:02 +08:00
aios 9df07a5d7d feat(agent-instructions): add owner notification routing 2026-07-07 11:29:48 +08:00
aios 54356c0fcc fix(agent-instructions): correct openclaw hermes routing 2026-07-07 11:27:51 +08:00
aios 4b62b18a39 docs(agent-instructions): add openclaw instruction index 2026-07-07 11:23:13 +08:00
aios bb69d76a7b docs(agent-os): add Windows Codex recovery admin assistance result 2026-07-07 11:21:47 +08:00
aios 27eef25d12 feat(agent-instructions): add openclaw hermes coordination instruction 2026-07-07 11:17:18 +08:00
aios 7b563590b4 feat(agent-instructions): add windows codex v1r1c5 recovery instruction 2026-07-07 11:17:14 +08:00
aios 50bceb1d45 docs(agent-os): add hermes review result template 2026-07-07 11:15:18 +08:00
aios f89619f576 docs(agent-os): add V1R1C5 multi agent review request 2026-07-07 11:13:57 +08:00
aios 365ea5d06c docs(agent-os): add V1R1C5 release readiness report 2026-07-07 11:12:58 +08:00
aios f15a19d525 feat(agent-os): add V1R1C5 evolution proposal 2026-07-07 11:11:57 +08:00
aios 3bdb5f9d59 docs(agent-os): add self evolution acceptance report 2026-07-07 11:09:25 +08:00
aios 4a9f3fff1a docs(reports): add UCC WeChat owner test report 2026-07-07 11:02:43 +08:00
aios ffbc1e0e01 feat(agent-instructions): add codex reports permission fix instruction 2026-07-07 10:58:23 +08:00
aios 8365afbeb8 feat(agent-os): add custom gpt solution review instruction 2026-07-07 10:56:55 +08:00
aios d34ef72f5d feat(agent-os): add hermes architecture review instruction 2026-07-07 10:56:20 +08:00
aios 7f118fa205 feat(agent-os): add openclaw maintenance instruction 2026-07-07 10:55:37 +08:00
aios 97867386a3 feat(agent-os): add codex recovery instruction 2026-07-07 10:53:59 +08:00
aios e17abc12be feat(agent-os): add runtime integration test suite 2026-07-07 10:52:19 +08:00
aios bec612c67d feat(agent-os): add recovery manager runtime 2026-07-07 10:50:45 +08:00
aios 19bcb8aeed feat(agent-os): add escalation engine runtime 2026-07-07 10:50:05 +08:00
aios 79e00ef089 feat(agent-os): add agent instruction template 2026-07-07 10:49:06 +08:00
aios 4833b9f93a feat(agent-os): add versioned agent instruction center 2026-07-07 10:45:39 +08:00
aios fd715457da fix(agent-os): restore instruction center usage examples 2026-07-07 10:44:24 +08:00
aios 4325f0b7d2 feat(agent-os): add versioned agent instruction center 2026-07-07 10:41:21 +08:00
aios b2a4f67f93 chore(chatgpt): record nl plan patch_create 2026-07-07 10:37:29 +08:00
aios c2e4a5b078 feat(agent-os): add consensus engine runtime 2026-07-07 10:18:16 +08:00
aios 707cfe4d60 feat(agent-os): add agent evaluator runtime 2026-07-07 10:17:39 +08:00
aios cf97cf697d feat(agent-os): add skill loader runtime 2026-07-07 10:17:14 +08:00
aios 82eecc27b4 feat(agent-os): add memory service runtime 2026-07-07 10:16:49 +08:00
aios bea425052f feat(agent-os): add message bus runtime 2026-07-07 10:16:27 +08:00
aios 45c26a1a4a feat(agent-os): add task scheduler runtime 2026-07-07 10:16:07 +08:00
aios 6ea5047dbb feat(agent-os): add runtime lifecycle manager 2026-07-07 10:15:32 +08:00
aios a5fdfbf057 feat(agent-os): add agent registry runtime implementation 2026-07-07 10:15:05 +08:00
aios 8a5ce63069 feat(agent-os): implement runtime framework 2026-07-07 10:12:27 +08:00
aios bce254790c feat(agent-os): add release automation framework 2026-07-07 09:50:12 +08:00
aios 14a3b84fc6 feat(agent-os): add continuous evolution engine 2026-07-07 09:45:56 +08:00
aios 39f23b0891 feat(agent-os): add consensus engine framework 2026-07-07 09:42:42 +08:00
aios 034d5f0faa feat(agent-os): add acceptance pipeline framework 2026-07-07 09:42:07 +08:00
aios cb6851b751 feat(agent-os): add task scheduler policy 2026-07-07 09:41:42 +08:00
aios a79010f788 feat(agent-os): add skill package schema 2026-07-07 09:41:01 +08:00
aios 95b1d82738 feat(agent-os): add memory schema 2026-07-07 09:40:12 +08:00
aios afa5c0eb3e feat(agent-os): add agent protocol schema 2026-07-07 09:38:51 +08:00
aios ca9d7a7424 feat(agent-os): add runtime component definitions 2026-07-07 09:36:58 +08:00
aios 890699efaa feat(agent-os): add implementation roadmap for agent platform 2026-07-07 09:35:01 +08:00
aios 142f827feb feat(agent-os): add governance framework 2026-07-07 09:03:03 +08:00
aios 32949d9dac feat(agent-os): add platform roadmap modules 2026-07-07 08:59:52 +08:00
aios 4c505d2b6a feat(agent-os): add agent operating system blueprint 2026-07-07 08:48:45 +08:00
aios d2bcf4d5af feat(self-evolution): define server agent roles memory and skills 2026-07-07 08:40:36 +08:00
aios 76b33c0c6a feat(self-evolution): add agent orchestration policy config 2026-07-07 08:20:54 +08:00
aios 9babbcca43 feat(self-evolution): add multi-agent orchestration policy patch 2026-07-07 08:19:00 +08:00
aios c387c83c13 chore(chatgpt): record nl plan unknown 2026-07-07 08:03:34 +08:00
66 changed files with 2460 additions and 26 deletions
+21 -2
View File
@@ -5,6 +5,8 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from typing import Any
from orchestrator.action_monitor import ActionMonitor
ROOT = Path(os.getenv('AIOS_GITOPS_ROOT', '/data/aios-gitops'))
WS = Path(os.getenv('AIOS_GITOPS_WORKSPACE', str(ROOT / 'workspace')))
SECRETS = Path(os.getenv('AIOS_GITOPS_SECRETS_DIR', str(ROOT / 'runtime' / 'secrets')))
@@ -13,6 +15,8 @@ HOST = os.getenv('AIOS_GITOPS_HOST', '127.0.0.1')
PORT = int(os.getenv('AIOS_GITOPS_PORT', '18890'))
OPENAPI = WS / 'docs' / 'gitops' / 'openapi-chatgpt-actions.yaml'
BARE_REPO = Path(os.getenv('AIOS_GITOPS_BARE_REPO', str(ROOT / 'runtime' / 'gitea-bin' / 'data' / 'repositories' / 'aios' / 'aios-v23.git')))
monitor = ActionMonitor()
BASE_MODELS = [
{'id':'base.deepseekv4-flash','provider':'one-api','model':'deepseekv4-flash','display_name':'DeepSeek V4 Flash','scope':'global'},
{'id':'base.qwen3.6-35b','provider':'one-api','model':'qwen3.6-35b','display_name':'Qwen 3.6 35B','scope':'global'},
@@ -191,8 +195,12 @@ class H(BaseHTTPRequestHandler):
if path in ('/api/run','/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'):
return self.sendj({'events':[{"event_id":e.event_id,"action":e.action,"error":e.error,"context":e.context,"created_at":e.created_at} for e in monitor.list_events()],'latest':monitor.latest()})
return self.sendj({'error':'not_found','path':path},404)
except Exception as e: return self.sendj({'error':str(e)},500)
except Exception as e:
monitor.record_failure('do_GET', str(e), {'path':path})
return self.sendj({'error':str(e)},500)
def do_PUT(self):
path=urllib.parse.urlparse(self.path).path.rstrip('/'); data=self.body()
if path == '/api/model-priority': return self.model_priority(data)
@@ -210,7 +218,9 @@ class H(BaseHTTPRequestHandler):
if path == '/api/model-priority': return self.model_priority(data)
if path == '/api/nl': return self.nl(data)
return self.sendj({'error':'not_found','path':path},404)
except Exception as e: return self.sendj({'error':str(e)},500)
except Exception as e:
monitor.record_failure('do_POST', str(e), {'path':path})
return self.sendj({'error':str(e)},500)
def branch(self,data):
a=self.need('branch:create');
if not a: return
@@ -234,6 +244,9 @@ class H(BaseHTTPRequestHandler):
if not a: return
ver=data.get('version') or data.get('tag')
if not re.match(r'^V\d+R\d+C\d+(-[A-Za-z0-9_.-]+)?$', ver or ''): return self.sendj({'error':'version must match VxRxCx'},400)
if data.get('confirm') != True:
self.sendj({'status':'confirm_required','operation':'tag','hint':'This operation creates a Git tag. Confirm to proceed.','x-openai-isConsequential':True}, 428)
return
if a['role'] != 'owner' or not data.get('execute'):
b=checkout(data.get('branch') or f'request/tag-{safe(ver)}', 'main', True); req={'version':ver,'requested_by':a['account'],'approval_required':True,'created_at':now()}; r=write_json(f'baseline/tag_requests/{safe(ver)}.json', req); c=commit([r], f'chore(chatgpt): request tag {ver}'); return self.sendj({'status':'approval_required','branch':b,'commit':c})
out=sh(['tag','-a',ver,'-m',data.get('message') or f'release {ver}'], True); self.sendj({'status':'tagged','version':ver,'git':out,'sync':sync_tag(ver)})
@@ -254,10 +267,16 @@ class H(BaseHTTPRequestHandler):
if not secret_ref: return self.sendj({'error':'api_key_secret_ref or api_key required'},400)
mid=data.get('model_id') or f'custom.{owner}.{hashlib.sha1((prov+base+name).encode()).hexdigest()[:10]}'; b=checkout(data.get('branch') or f'patch/model-{safe(mid)}','main',True)
doc=sanitize({k:v for k,v in data.items() if k!='api_key'}); doc.update({'model_id':mid,'provider_name':prov,'base_url':base,'model_name':name,'api_key_secret_ref':secret_ref,'created_by':a['account'],'created_at':now()})
if data.get('confirm') != True:
self.sendj({'status':'confirm_required','operation':'model','hint':'This operation registers a new model. Confirm to proceed.','x-openai-isConsequential':True}, 428)
return
r=write_json(f'config/model_registry/chatgpt/{safe(mid)}.json', doc); c=commit([r], data.get('message') or f'chore(chatgpt): register model {name}'); audit(a['account'],'model',mid,doc); self.sendj({'status':'model_registered','branch':b,'model_id':mid,'secret_ref':secret_ref,'commit':c})
def model_priority(self,data):
a=self.need('model:priority');
if not a: return
if data.get('confirm') != True:
self.sendj({'status':'confirm_required','operation':'model-priority','hint':'This operation updates model priority. Confirm to proceed.','x-openai-isConsequential':True}, 428)
return
user=safe(data.get('username') or a['account']); b=checkout(data.get('branch') or f'patch/model-priority-{user}', 'main', True); doc={'username':user,'items':data.get('items') or data.get('priority') or [],'updated_by':a['account'],'updated_at':now()}; r=write_json(f'config/model_priority/{user}.json', doc); c=commit([r], data.get('message') or f'chore(chatgpt): update model priority {user}'); audit(a['account'],'model-priority',user,doc); self.sendj({'status':'updated','branch':b,'priority':doc,'commit':c})
def nl(self,data):
a=self.need('nl:plan');
+29
View File
@@ -0,0 +1,29 @@
# Agent Instruction Center
Version-controlled execution instructions for AIOS agents.
## Supported agents
- codex
- openclaw
- hermes
- windows_codex_app
- custom_gpt_review
## Workflow
1. Create versioned instruction file.
2. Target agent executes instruction.
3. Result is recorded with GitOps audit information.
## Naming
agent-instructions/<agent>/<instruction-name>-v<version>.md
## Rules
- GitOps managed only.
- Patch-first workflow.
- No secrets, tokens, passwords or credentials.
- Production changes require approval.
- Main branch changes require approval.
+34
View File
@@ -0,0 +1,34 @@
# Agent Execution Instruction
Instruction ID:
Version:
Target Agent:
## Objective
## Context
## Execution Steps
## Constraints
- GitOps only
- Patch-first
- No secrets
- No force push
- Production changes require approval
## Validation
## Return Format
Status:
Branch:
Commit:
Rev:
Sync Status:
Issues:
+1
View File
@@ -0,0 +1 @@
# Placeholder for versioned Codex instructions.
@@ -0,0 +1,66 @@
# Codex Execution Instruction
Instruction ID: fix-reports-permission-v1
Version: v1
Target Agent: codex
## Objective
Fix the GitOps workspace reports directory permission issue so the Agent OS acceptance report can be committed.
## Context
Current blocked path:
/data/aios-gitops/workspace/reports/
Error:
Permission denied
## Execution Steps
1. Enter workspace:
cd /data/aios-gitops/workspace
2. Check current user and permissions:
whoami
id
ls -ld reports
3. Create directory if missing:
mkdir -p reports
4. Fix ownership and write permission for this directory only:
chown -R <gitops-user>:<gitops-group> reports
chmod -R u+rwX reports
5. Verify write access:
touch reports/.write-test
rm reports/.write-test
6. Commit pending acceptance report changes after verification.
## Constraints
- GitOps only.
- No force push.
- No chmod 777.
- Do not modify unrelated directories.
- Do not write secrets.
- Production changes require approval.
## Validation
Return:
Status:
Branch:
Commit:
Rev:
Sync Status:
Permission Result:
Issues:
@@ -0,0 +1,31 @@
# Codex System Recovery Instruction
Version: v1
Target Agent: codex
## Objective
Recover AIOS system issues requiring deep diagnosis or administrator assistance.
## Execution
1. Inspect runtime status.
2. Inspect GitOps state.
3. Identify root cause.
4. Propose safe patch.
5. Apply only approved GitOps changes.
## Escalation
Use when server agents cannot resolve issues.
## Constraints
- GitOps only.
- No secrets.
- No force push.
- Production changes require approval.
## Return
Status:
Branch:
Commit:
Rev:
Sync Status:
Issues:
@@ -0,0 +1,48 @@
# Codex Main Merge Verification Instruction
Instruction ID: v1r1c5-main-merge-verify-v1
Version: v1
Target Agent: codex
## Objective
Verify whether V1R1C5 patch branch has been merged into main.
## Preconditions
Ensure GitOps authentication is healthy.
If Gitea account password state blocks access, resolve account activation through approved admin procedure before continuing.
## Verification Steps
1. Check repository status.
2. Fetch remote branches.
3. Compare:
source:
patch/self-evolution-agent-orchestration-policy
target:
main
4. Confirm merge commit.
5. Confirm main HEAD.
6. Confirm no divergence.
## Constraints
- No force push.
- No direct production publish.
- No secret output.
- Preserve audit trail.
## Return Format
Status:
Source Branch:
Target Branch:
Merge Commit:
Rev:
Sync Status:
Conflicts:
Main HEAD:
Issues:
@@ -0,0 +1 @@
# Placeholder for versioned custom GPT review instructions.
@@ -0,0 +1,31 @@
# Custom GPT Solution Review Instruction
Version: v1
Target Agent: custom_gpt_review
## Objective
Review difficult architecture decisions and implementation proposals from server agents.
## Role
Act as reviewer and advisor for OpenClaw, Hermes and other AIOS agents.
## Execution
1. Receive complete problem context.
2. Review baseline, branch and proposed changes.
3. Analyze alternative solutions.
4. Recommend implementation approach.
5. Identify risks and validation requirements.
## Constraints
- Advisory role only.
- No direct production changes.
- No secrets.
- GitOps workflow required.
- Release requires approval.
## Return
Status:
Recommendation:
Risk:
Validation:
Next Step:
+1
View File
@@ -0,0 +1 @@
# Placeholder for versioned Hermes instructions.
@@ -0,0 +1,32 @@
# Hermes Architecture Review Instruction
Version: v1
Target Agent: hermes
## Objective
Review AIOS architecture, policies and implementation plans.
## Execution
1. Review baseline and branch diff.
2. Analyze architecture impact.
3. Review OpenClaw execution proposals.
4. Validate acceptance criteria.
5. Provide improvement recommendations.
## Escalation
For unresolved architecture choices, prepare complete context for external review.
## Constraints
- GitOps only.
- No secrets.
- No direct production changes.
- Approval required for release.
## Return
Status:
Branch:
Commit:
Rev:
Sync Status:
Issues:
Recommendations:
+1
View File
@@ -0,0 +1 @@
# Placeholder for versioned OpenClaw instructions.
+24
View File
@@ -0,0 +1,24 @@
# OpenClaw Agent Instructions Index
## Available Instructions
### v1r1c5-hermes-coordination-v1
Instruction file:
agent-instructions/openclaw/v1r1c5-hermes-coordination-v1.md
Purpose:
Coordinate Hermes architecture review through OpenClaw controlled communication channel.
Invocation:
Execute openclaw/v1r1c5-hermes-coordination-v1 instruction
Requirements:
- Read the referenced markdown file from the GitOps workspace.
- Do not treat the identifier as a local shell command.
- Do not search external skill marketplaces unless the file is missing.
- Follow GitOps workflow rules defined in the instruction.
@@ -0,0 +1,32 @@
# OpenClaw Runtime Maintenance Instruction
Version: v1
Target Agent: openclaw
## Objective
Maintain server-side AIOS runtime and perform safe optimization tasks.
## Execution
1. Check runtime health.
2. Review logs and GitOps status.
3. Identify optimization opportunities.
4. Create patch proposals.
5. Execute approved changes.
## Escalation
When solution selection or implementation is uncertain, prepare full context and escalate for review.
## Constraints
- GitOps only.
- Patch-first workflow.
- No secrets.
- No force push.
- Production release requires approval.
## Return
Status:
Branch:
Commit:
Rev:
Sync Status:
Issues:
@@ -0,0 +1,51 @@
# OpenClaw Execution Instruction: Hermes Coordination
Instruction ID: v1r1c5-hermes-coordination-v1
Version: v1
Target Agent: openclaw
## Objective
Coordinate Hermes architecture review through OpenClaw-controlled communication channel.
## Architecture Rule
Hermes is not directly connected to external control channels.
All Hermes requests and responses must be routed through OpenClaw personal WeChat channel.
## Workflow
1. Receive AIOS task or review request.
2. Send required context to Hermes through OpenClaw WeChat.
3. Collect Hermes architecture analysis.
4. Record review result in GitOps reports.
5. Continue execution or escalate when required.
## Context Package
Include:
- Baseline version
- Branch
- Diff summary
- Problem description
- Proposed solution
- Validation requirements
## Constraints
- GitOps only.
- No secrets.
- No direct production changes.
- Maintain audit records.
- Use escalation flow for unresolved decisions.
## Return Format
Status:
Branch:
Commit:
Rev:
Sync Status:
Hermes Result:
Issues:
@@ -0,0 +1,119 @@
# OpenClaw Execution Instruction
Instruction ID: v1r1c5-hermes-review-improvement-v1
Version: v1
Target Agent: openclaw
## Objective
Implement V1R1C5 improvements based on Hermes Conditional Approval review.
## Context
Baseline:
V1R1C4
Branch:
patch/self-evolution-agent-orchestration-policy
Proposal:
V1R1C5-agent-os-evolution-proposal
## Required Changes
1. Add Agent Resource Governance:
Create:
config/self-evolution/agent-resource-manager.json
Support:
- resource limits
- parallel task limits
- agent priority
- runtime isolation
- overload handling
2. Enhance Consensus Engine:
Add dynamic weighting:
Final Weight = Base Weight * Quality Score * Historical Reliability * Domain Expertise
Base weights:
- custom_gpt: 2
- windows_codex: 2
- server_agent: 1
Add risk gates:
- Production Release
- V-Level Change
- Security Policy Change
Require:
Consensus Approval + Owner Approval
3. Enhance Message Bus:
Update runtime/agent-os/message_bus.py
Add:
- task_id
- correlation_id
- retry_state
- delivery_status
Support:
- message tracking
- retry
- recovery
- audit
4. Add Agent Health Score:
Create:
runtime/agent-os/agent_health_score.py
Calculate from:
- quality score
- acceptance rate
- historical reliability
Use for:
- scheduler selection
- consensus weighting
## Validation
Run:
python3 -m compileall runtime/agent-os
Run:
runtime/agent-os/integration_test.py
Validate:
- scheduler
- consensus
- message bus
- escalation
- recovery
## Constraints
- GitOps only
- Patch-first
- No secrets
- No force push
- No direct main write
- Production changes require approval
## Return Format
Status:
Branch:
Commit:
Rev:
Sync Status:
Changed Files:
Tests:
Hermes Review Items Completed:
Remaining Issues:
@@ -0,0 +1,61 @@
# OpenClaw Hermes Routing Correction Instruction
Instruction ID: v1r1c5-hermes-routing-correction-v1
Version: v1
Target Agent: openclaw
## Objective
Correct Hermes coordination routing. OpenClaw must actively package AIOS review requests and route them through the configured Hermes communication path instead of asking the user to provide missing context when the request context already exists in GitOps.
## Current Architecture
OpenClaw is the coordination entry point.
Hermes is reached indirectly through OpenClaw controlled communication.
## Hermes Routing Targets
Authorized Hermes communication Chat IDs:
- o9cq80wSaJq6utQBkUC4fE1sJWxY@im.wechat
- o9cq80x9RoA6ljoFZDxg71mS0gDA@im.wechat
## Execution Flow
1. Read current AIOS GitOps context.
2. Collect:
- Baseline version
- Branch
- Diff summary
- Problem description
- Proposed solution
- Validation requirements
3. Send complete review package to Hermes through configured OpenClaw communication channel.
4. Receive Hermes analysis.
5. Record review result in GitOps reports.
## Current Review Context
Baseline:
V1R1C4
Branch:
patch/self-evolution-agent-orchestration-policy
Proposal:
V1R1C5-agent-os-evolution-proposal
## Constraints
- Do not ask user for context that already exists in GitOps.
- Do not treat instruction ID as external skill package.
- GitOps audit required.
- No secrets.
- No direct production changes.
## Return
Status:
Hermes Routing:
Review Context:
Result:
Issues:
@@ -0,0 +1,52 @@
# OpenClaw Owner Approval Gate Instruction
Instruction ID: v1r1c5-owner-approval-gate-v1
Version: v1
Target Agent: openclaw
## Objective
Manage owner approval workflow for high-risk AIOS operations.
## Approval Required For
- V-level version changes.
- Production release.
- Tag creation.
- Runtime changes with production impact.
- Administrator authorization actions.
- Unresolved multi-agent decisions.
## Workflow
1. Collect approval context.
2. Include baseline version, branch, diff summary and risk assessment.
3. Route approval request through owner communication channel registry.
4. Wait for approval decision.
5. Record decision in GitOps audit.
## Approval Context
Must include:
- Request reason.
- Affected components.
- Validation results.
- Rollback considerations.
- Risk level.
## Constraints
- No direct production action without approval.
- No secrets in messages or reports.
- Use configured owner communication channels only.
- Maintain audit records.
## Return Format
Status:
Approval Status:
Channel Used:
Decision:
Audit Record:
Issues:
@@ -0,0 +1,43 @@
# OpenClaw Owner Notification Routing Instruction
Instruction ID: v1r1c5-owner-notification-routing-v1
Version: v1
Target Agent: openclaw
## Objective
Implement owner notification routing through configured owner communication channels.
## Routing Rules
1. OpenClaw must first inspect the owner-bound communication channels already configured in the system.
2. Select the primary owner communication channel according to system priority configuration.
3. If the primary channel is unavailable, unhealthy, or delivery fails, automatically fallback to the configured backup communication channel.
4. Record routing decision and delivery status in GitOps audit records.
## Notification Scenarios
Notify owner for:
- High risk architecture decisions.
- Agent consensus deadlock.
- Production-impacting approval requests.
- Required administrator authorization.
- Release approval gates.
## Constraints
- Do not hardcode personal communication identifiers in instruction files.
- Use configured channel registry only.
- Do not expose private contact information in logs.
- Maintain audit trail.
- GitOps workflow required.
## Return Format
Status:
Primary Channel Status:
Fallback Channel Status:
Delivery Result:
Audit Record:
Issues:
@@ -0,0 +1 @@
# Placeholder for versioned Windows Codex App instructions.
@@ -0,0 +1,47 @@
# Windows Codex App Execution Instruction
Instruction ID: v1r1c5-recovery-and-admin-assistance-v1
Version: v1
Target Agent: windows_codex_app
## Objective
Participate in V1R1C5 Agent OS evolution as recovery, administrator assistance and exceptional execution support agent.
## Responsibilities
1. Assist when server OpenClaw agents have runtime failures.
2. Assist when Hermes review cannot be completed through OpenClaw.
3. Handle cases requiring administrator authorization workflow.
4. Participate in multi-agent voting when decision conflicts occur.
5. Validate recovery results after server agent restoration.
## Execution Rules
- Work from online GitOps versions.
- Use patch-first workflow.
- Do not bypass approval gates.
- Do not write secrets.
- Do not force push.
- Do not directly publish production versions.
## Recovery Flow
Server agent failure:
OpenClaw/Hermes issue
-> Windows Codex diagnosis
-> propose fix
-> GitOps patch
-> validation
-> approval
## Return Format
Status:
Branch:
Commit:
Rev:
Sync Status:
Recovery Result:
Issues:
@@ -0,0 +1,107 @@
# Instruction
ID: windows_codex_app/v1r2c2-system-supervisor-recovery-v1
Version: v1
Target Agent: Windows Codex App
Purpose: Operate as the AIOS escape recovery supervisor when OpenClaw and Hermes cannot clear long-running system blockers.
## Objective
Continuously supervise AIOS self-optimization health across OpenClaw, Hermes,
GitOps, Gitea, Actions, permissions, branch state, commit flow, and owner
notification paths. Intervene only when the system is blocked, repeatedly
failing, or unattended, and keep all durable changes synchronized through
GitOps.
## Role Boundaries
- OpenClaw is the primary execution agent for daily tasks, automatic fixes,
patch creation, and GitOps operations.
- Hermes is the backup analysis and repair agent for architecture review,
OpenClaw failure handoff, and complex diagnosis.
- Windows Codex App is the escape recovery agent for dual-agent failure,
permission failures, Gitea/GitOps breakage, and system-level recovery.
- Windows Codex App is not a credential owner and must not become the durable
source of truth when remote OpenClaw or Hermes state can be verified.
## Execution Steps
1. Lock the target host, workspace, branch, and current user.
2. Read the newest GitOps instruction artifact before acting.
3. Spawn independent sub-agents for architecture, exploration,
implementation safety, validation, and reporting when the task is complex.
4. Use `gpt-5.3-codex-spark` for sub-agents by default. If Spark is exhausted
and an owner-approved fallback is in force, record the quota failure and use
the approved fallback model for that run only.
5. Collect live evidence from remote services instead of relying on stale local
state or old summaries.
6. Check OpenClaw task state, audit output, channel health, and gateway status.
7. Check Hermes router, executor, and memory gateway service state.
8. Check GitOps branch, sync state, uncommitted changes, stale artifacts,
permissions, and commit/push health without printing remote credentials.
9. Check Gitea and Actions endpoints using read-only probes unless owner
approval explicitly authorizes a write smoke test.
10. Check owner notification health through configured safe probes. Do not
claim WeChat end-to-end success without a current verified ingress or
whitelisted synthetic test.
11. Apply only minimal, reversible repairs that are explicitly allowed below.
12. Write a GitOps report for any live-state change, even when no source file
changed.
13. Commit and push only to the approved patch branch. Never force push.
## Intervention Conditions
Intervene when any of these conditions are met:
- The same error fails three or more consecutive times.
- A task has no progress for more than 30 minutes.
- OpenClaw cannot resolve the blocker.
- Hermes cannot resolve the blocker.
- GitOps Action writes, commits, branch sync, or permissions keep failing.
## Allowed Automatic Repairs
- GitOps workspace permission repair within the approved workspace.
- Group and setgid repair for collaborative GitOps directories.
- Branch metadata permission repair for the active patch branch.
- Stale temporary artifact cleanup inside an approved whitelist.
- Test/report output permission repair when a service is blocked only by file
ownership or mode.
- Resetting failed oneshot service state after the underlying blocker is fixed.
- Running non-destructive validation commands.
## Constraints
- GitOps only for durable source changes.
- No secrets in files, logs, reports, prompts, command output, or commits.
- No force push.
- No tag creation or deletion.
- No direct writes to `main`.
- No production switch.
- No credential, token, SSH key, cookie, or CI secret modification.
- No deletion of baselines, audit records, release artifacts, or production
data.
- V-level, tag, production, rollback, and owner-visible notification changes
require owner approval.
- Credential, channel binding, host registration, and durable ownership changes
require admin approval.
## Validation
Minimum validation evidence:
- Branch name, HEAD revision, and ahead/behind status.
- `git status --short --branch` summary with no unexpected source edits.
- OpenClaw task list and audit summary.
- OpenClaw channel status or the exact auth/identity blocker preventing it.
- Hermes router, executor, and memory gateway service status.
- Gitea service status and read-only endpoint health.
- Actions schema or endpoint health where available.
- Permission probe for every repaired directory.
- Service rerun result for every repaired failed service.
- Security note confirming no credentials were committed.
## Return Format
+6 -6
View File
@@ -1,6 +1,6 @@
{
"active_version": "V1R1C4",
"active_tag": "V1R1C4",
"active_version": "V1R2C2",
"active_tag": "V1R2C2",
"mode": "gitops-online",
"version_policy": "VxRxCx",
"update_mode": "git_patch_only",
@@ -27,8 +27,8 @@
"portal_gitops_dashboard": true,
"human_shortlinks_login_required": true
},
"version": "V1R1C4",
"baseline_tag": "V1R1C0-baseline-20260706",
"version": "V1R2C2",
"baseline_tag": "V1R2C2-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 +46,7 @@
"/api",
"/hook"
],
"updated_at": "2026-07-06T11:16:23Z",
"updated_at": "2026-07-07T15:40:00Z",
"auth": {
"primary_domain": "https://auth.cnnetmkt.top",
"backup_domain": "https://auth.h.imruyi.top:8443",
@@ -55,7 +55,7 @@
"casdoor_application": "admin/aios-portal",
"backup_domain_role": "standby-only"
},
"previous_version": "V1R1C3",
"previous_version": "V1R2C1",
"codex_gitops": {
"config": "config/codex/gitops-online.json",
"token_account": "codex-gitops-bot",
@@ -0,0 +1 @@
{"schema":"acceptance-pipeline-v1","status":"proposal","pipeline":{"stages":[{"name":"code_review","agent_role":"review_agent"},{"name":"automated_test","agent_role":"test_agent"},{"name":"security_check","agent_role":"security_agent"},{"name":"performance_check","agent_role":"performance_agent"},{"name":"regression_check","agent_role":"regression_agent"},{"name":"release_readiness","agent_role":"release_readiness_agent"}],"parallel_validation":true,"failure_blocks_release":true},"outputs":{"quality_score":true,"risk_report":true,"approval_request":true},"safety":{"production_release_requires_owner":true,"credentials_scan":true,"audit_log":true}}
@@ -0,0 +1 @@
{"schema":"agent-governance-v1","status":"proposal","governance":{"identity":true,"reputation":true,"capability_discovery":true,"memory_service":true,"shared_knowledge":true,"skill_packages":true,"peer_review":true,"acceptance_pipeline":["optimization","implementation","acceptance","security","release_readiness"],"dynamic_voting":{"enabled":true,"base_weights":{"custom_gpt":2,"windows_codex":2,"server_agents":1},"quality_score_modifier":true},"audit":{"full_trace":true,"decision_log":true}},"release":{"patch_only":true,"owner_approval_required":true}}
@@ -0,0 +1,63 @@
{
"policy_id": "self-evolution-agent-orchestration-policy",
"version": 1,
"status": "proposal",
"scope": "self-evolution-execution-orchestration",
"execution_subjects": {
"primary": [
"server.openclaw_agent",
"server.hermes_agent"
],
"collaborators": [
"windows.codex_app",
"custom_gpt.codex_chartgpt_bridge"
]
},
"parallelism": {
"server_agents_parallel_allowed": true,
"multiple_server_agents_allowed": true,
"server_agents_preferred": true
},
"fallback_and_assistance": {
"difficult_case_external_interaction_allowed": true,
"assistance_endpoint": "https://chatgpt.com/g/g-6a4ba70a063c8191a89bc2d86a4c7fa0-codex-chartgpt-bridge",
"allowed_modes": [
"ask_for_help",
"interactive_coordination",
"proposal_review"
]
},
"dispute_resolution": {
"multi_agent_voting_allowed": true,
"weights": {
"custom_gpt.codex_chartgpt_bridge": 2,
"windows.codex_app": 2,
"server.openclaw_agent": 1,
"server.hermes_agent": 1,
"server.additional_agent_default": 1
},
"tie_breaking": "require_owner_or_admin_review"
},
"safety": {
"credentials_in_git_allowed": false,
"force_push_allowed": false,
"destructive_bulk_delete_allowed": false,
"v_level_change_requires_owner_approval": true,
"production_switch_requires_owner_approval": true,
"tag_creation_requires_owner_approval": true,
"v_level_tag_or_production_switch_requires_owner_approval": true,
"direct_main_push_allowed": false,
"direct_main_merge_allowed": false
},
"gitops": {
"audit_required": true,
"writes_require_commit": true,
"default_target_branch": "patch/self-evolution-agent-orchestration-policy",
"direct_main_push_default": false,
"patch_branch_only": true,
"main_merge_requires_owner_admin_approval": true
},
"created_by": "codex-chartgpt-bridge",
"created_at": "2026-07-07T00:00:00Z",
"branch": "patch/self-evolution-agent-orchestration-policy"
}
@@ -0,0 +1 @@
{"schema":"agent-os-v1","status":"proposal","agents":{"openclaw":{"memory":true,"skills":true,"tools":true,"planner":true,"evaluator":true,"self_reflection":true,"learning":true},"hermes":{"memory":true,"skills":true,"tools":true,"planner":true,"evaluator":true,"self_reflection":true,"learning":true}},"coordination":{"voting":true,"weighted_voting":{"custom_gpt":2,"windows_codex":2,"server_agents":1},"owner_review_on_tie":true},"safety":{"gitops_only":true,"patch_first":true,"no_credentials":true,"no_direct_main":true}}
@@ -0,0 +1 @@
{"schema":"agent-platform-v1","status":"proposal","modules":[{"name":"memory-manager","enabled":true},{"name":"skill-registry","enabled":true},{"name":"agent-registry","enabled":true},{"name":"task-scheduler","enabled":true},{"name":"consensus-engine","enabled":true},{"name":"continuous-self-evolution","enabled":true}],"release_policy":{"patch_first":true,"owner_approval":true}}
@@ -0,0 +1 @@
{"schema":"agent-protocol-v1","status":"proposal","agent_identity":{"id":"string","name":"string","family":"openclaw|hermes|custom","version":"string","capabilities":[],"skills":[],"health":"unknown|healthy|degraded|offline"},"task_protocol":{"task_id":"string","requester":"agent_id","executor":"agent_id","objective":"string","priority":"low|normal|high|critical","status":"queued|running|completed|failed|review","result":"object"},"memory_protocol":{"memory_id":"string","type":"experience|knowledge|decision|reflection","scope":"agent|shared","audit":true},"voting_protocol":{"enabled":true,"proposal":"string","votes":[],"weighted":true,"tie":"owner_review"},"security":{"credentials":false,"direct_main_write":false,"production_action_approval":true}}
@@ -0,0 +1 @@
{"schema":"agent-runtime-components-v1","status":"proposal","components":{"agent-runtime-manager":{"enabled":true,"responsibilities":["lifecycle_management","health_check","recovery","resource_tracking"]},"agent-registry":{"enabled":true,"responsibilities":["identity","capability_discovery","status_tracking","version_tracking"]},"message-bus":{"enabled":true,"responsibilities":["task_routing","event_delivery","agent_coordination"]},"memory-service":{"enabled":true,"responsibilities":["long_term_memory","working_memory","knowledge_retrieval","audit"]},"skill-loader":{"enabled":true,"responsibilities":["skill_installation","skill_validation","skill_versioning"]},"agent-evaluator":{"enabled":true,"responsibilities":["quality_score","acceptance_check","performance_feedback"]}},"security":{"credential_storage":false,"gitops_audit":true,"patch_only":true}}
@@ -0,0 +1 @@
{"schema":"consensus-engine-v1","status":"proposal","consensus":{"enabled":true,"modes":["weighted_vote","review_board","owner_escalation"],"participants":["openclaw_agent","hermes_agent","windows_codex","custom_gpt"],"base_weights":{"custom_gpt":2,"windows_codex":2,"server_agents":1},"dynamic_adjustment":{"enabled":true,"factors":["quality_score","acceptance_rate","historical_reliability"]},"conflict_detection":true,"tie_breaking":"owner_admin_review"},"decision_log":{"required":true,"audit":true},"safety":{"production_decision_requires_approval":true}}
@@ -0,0 +1 @@
{"schema":"continuous-evolution-engine-v1","status":"proposal","pipeline":{"monitor":true,"detect":true,"plan":true,"schedule":true,"execute":true,"learn":true},"workflow":{"detect_sources":["runtime_metrics","logs","acceptance_results","agent_feedback","user_requests"],"proposal_generation":true,"patch_generation":true,"validation_required":true,"consensus_required":true,"approval_gate":true,"release_feedback":true},"agents":{"optimizer":"system_optimization_agent","planner":"planning_agent","executor":"patch_execution_agent","validator":"acceptance_validation_agent","reviewer":"consensus_engine"},"learning":{"store_experience":true,"update_quality_score":true,"reflection_required":true},"safety":{"gitops_only":true,"patch_first":true,"credentials":false,"production_requires_approval":true}}
@@ -0,0 +1 @@
{"schema":"agent-platform-implementation-v1","status":"proposal","objective":"evolve-agent-platform-from-configuration-to-operational-framework","implementation_phases":[{"phase":1,"name":"agent-runtime-manager","scope":["agent lifecycle","health check","startup shutdown","recovery"]},{"phase":2,"name":"agent-message-bus","scope":["agent communication","task routing","event coordination"]},{"phase":3,"name":"memory-service","scope":["long term memory","working memory","shared knowledge retrieval","audit"]},{"phase":4,"name":"skill-framework","scope":["skill packages","versioning","installation","validation"]},{"phase":5,"name":"agent-api","scope":["agent registration","capability discovery","task submission","status query"]},{"phase":6,"name":"continuous-evolution-pipeline","scope":["proposal generation","patch creation","automated validation","approval workflow"]}],"constraints":{"gitops_only":true,"patch_first":true,"no_credentials":true,"no_force_push":true,"production_release_requires_approval":true}}
+1
View File
@@ -0,0 +1 @@
{"schema":"agent-memory-v1","status":"proposal","memory_types":{"working_memory":{"ttl":"task_scope","audit":true},"long_term_memory":{"persistent":true,"scope":"agent"},"shared_knowledge":{"persistent":true,"scope":"platform"},"reflection_memory":{"persistent":true,"purpose":"self_improvement"}},"memory_entry":{"id":"string","agent_id":"string","type":"working|experience|knowledge|decision|reflection","content":"object","source_task":"string","created_at":"timestamp","quality_score":0},"safety":{"credentials":false,"secrets":false,"audit_required":true}}
@@ -0,0 +1,26 @@
{
"schema": "owner-channel-registry-v1",
"status": "proposal",
"purpose": "Owner notification channel routing and fallback management",
"routing": {
"primary_selection": "configured_priority",
"fallback_enabled": true,
"health_check_required": true,
"delivery_failure_fallback": true
},
"channel_policy": {
"identifiers_managed_externally": true,
"no_hardcoded_personal_identifiers": true,
"audit_delivery_result": true
},
"notification_priority": [
"production_approval",
"administrator_authorization",
"high_risk_decision",
"agent_consensus_failure"
],
"security": {
"credentials_in_git": false,
"private_contact_data_in_logs": false
}
}
@@ -0,0 +1 @@
{"schema":"release-automation-v1","status":"proposal","release_flow":{"patch_review":true,"acceptance_gate":true,"consensus_gate":true,"approval_request":true,"version_proposal":true,"tag_request":true},"agents":{"release_manager":"release_readiness_agent","reviewers":["openclaw_agent","hermes_agent","custom_gpt","windows_codex_app"]},"controls":{"auto_tag":false,"auto_production_publish":false,"owner_approval_required":true,"audit_log":true},"rollback":{"request_supported":true,"automatic_destructive_rollback":false}}
@@ -0,0 +1,119 @@
{
"policy_id": "server-agent-roles-and-capabilities",
"version": 1,
"status": "proposal",
"scope": "self-evolution-server-agents",
"agent_families": {
"openclaw": {
"enabled": true,
"runtime": "server",
"priority": "primary",
"roles": [
"system_optimization_agent",
"acceptance_validation_agent",
"patch_execution_agent",
"runtime_diagnosis_agent",
"regression_review_agent"
],
"persistent_memory": {
"enabled": true,
"scope": "agent_family_and_role",
"storage": "runtime_or_gitops_managed_memory",
"credentials_in_memory_allowed": false,
"audit_required": true
},
"skills": {
"enabled": true,
"skill_registry": "config/self-evolution/skills/openclaw-skills.json",
"required_skill_groups": [
"gitops_patch_workflow",
"system_optimization",
"acceptance_testing",
"runtime_observability",
"safe_release_review"
]
}
},
"hermes": {
"enabled": true,
"runtime": "server",
"priority": "primary",
"roles": [
"system_optimization_agent",
"acceptance_validation_agent",
"release_readiness_agent",
"policy_review_agent",
"cross_agent_coordination_agent"
],
"persistent_memory": {
"enabled": true,
"scope": "agent_family_and_role",
"storage": "runtime_or_gitops_managed_memory",
"credentials_in_memory_allowed": false,
"audit_required": true
},
"skills": {
"enabled": true,
"skill_registry": "config/self-evolution/skills/hermes-skills.json",
"required_skill_groups": [
"gitops_patch_workflow",
"acceptance_testing",
"release_readiness",
"policy_governance",
"multi_agent_coordination"
]
}
}
},
"role_contracts": {
"system_optimization_agent": {
"purpose": "Identify and propose safe system optimization patches.",
"may_write_patch": true,
"may_modify_runtime": false,
"requires_review_for_production": true
},
"acceptance_validation_agent": {
"purpose": "Run and record acceptance checks for GitOps changes.",
"may_write_patch": true,
"may_approve_own_change": false,
"requires_review_for_production": true
},
"patch_execution_agent": {
"purpose": "Apply approved or proposed patch changes on non-main branches.",
"may_write_patch": true,
"direct_main_push_allowed": false
},
"release_readiness_agent": {
"purpose": "Evaluate whether a patch is ready for owner/admin release approval.",
"may_create_release_request": true,
"may_create_tag_directly": false,
"may_switch_production_directly": false
},
"cross_agent_coordination_agent": {
"purpose": "Coordinate voting, conflict resolution, and escalation among agents.",
"voting_allowed": true,
"tie_breaking": "owner_or_admin_review"
}
},
"online_capabilities": {
"read_online_baseline": true,
"read_online_versions": true,
"read_online_diff": true,
"read_online_runtime": true,
"create_patch_branch": true,
"commit_patch_changes": true,
"sync_online_git": true,
"create_release_request": true,
"direct_tag_creation": false,
"direct_production_publish": false
},
"safety": {
"credentials_in_git_allowed": false,
"credentials_in_memory_allowed": false,
"force_push_allowed": false,
"destructive_bulk_delete_allowed": false,
"owner_admin_approval_required_for_release": true
},
"created_by": "codex-chartgpt-bridge",
"created_at": "2026-07-07T00:00:00Z"
}
@@ -0,0 +1 @@
{"schema":"agent-skill-package-v1","status":"proposal","skill_package":{"id":"string","name":"string","version":"string","description":"string","owner_agent":"agent_id","dependencies":[],"capabilities":[],"entrypoints":[],"validation":{"required":true,"tests":[],"quality_score":0}},"lifecycle":{"install":true,"upgrade":true,"rollback":true,"disable":true},"sharing":{"agent_scope":true,"platform_scope":true},"security":{"credentials":false,"secrets":false,"audit_required":true,"production_change_requires_approval":true}}
@@ -0,0 +1 @@
{"schema":"task-scheduler-v1","status":"proposal","scheduler":{"enabled":true,"modes":["capability_match","priority_queue","parallel_execution","failure_recovery"],"selection":{"factors":["capability","skill_match","health","quality_score","load"]},"priority":{"levels":["critical","high","normal","low"]}},"execution":{"parallel_agents":true,"retry":true,"handoff":true,"timeout_control":true},"safety":{"patch_first":true,"direct_main":false,"production_requires_approval":true}}
@@ -1,9 +0,0 @@
{
"type": "branch",
"branch": "patch/collab-custom-gpt-20260706T104130Z",
"base": "main",
"created_by": "chatgpt-gitops-bot",
"created_at": "2026-07-06T10:41:30Z",
"direct_main_push": false,
"owner_approval_required": true
}
@@ -1,9 +0,0 @@
{
"type": "branch",
"branch": "patch/collab-local-codex-20260706T104130Z",
"base": "main",
"created_by": "codex-gitops-bot",
"created_at": "2026-07-06T10:41:30Z",
"direct_main_push": false,
"owner_approval_required": true
}
@@ -0,0 +1,9 @@
{
"id": "patch-1783382848267-49ea7747",
"patch_name": "self-evolution-agent-orchestration-policy",
"branch": "patch/self-evolution-agent-orchestration-policy",
"risk": "medium",
"description": "Formalize self-evolution execution主体策略: add server-side OpenClaw Agent and Hermes Agent alongside Windows Codex App; allow multiple server agents to run in parallel with server agents as primary; allow difficult cases to consult/interact with Codex ChartGPT Bridge; allow voting on disputes with custom GPT weight x2 and Windows Codex App weight x2. No credentials stored.",
"created_by": "gitops-write-bot",
"created_at": "2026-07-07T00:07:28Z"
}
@@ -0,0 +1,23 @@
{
"version": "V1R1C5",
"status": "proposal",
"source_branch": "patch/self-evolution-agent-orchestration-policy",
"objective": "Integrate Agent OS multi-agent orchestration capabilities into next evolution version",
"changes": [
"Enable server OpenClaw and Hermes agent execution model",
"Enable Custom GPT review escalation workflow",
"Enable Windows Codex recovery and authorization assistance workflow",
"Integrate Agent Runtime components",
"Integrate instruction center and versioned agent operations",
"Enable consensus and continuous evolution workflow"
],
"validation": {
"acceptance_report": "reports/self-evolution-agent-os-acceptance-report-v1.md",
"integration_test": "runtime/agent-os/integration_test.py"
},
"release_policy": {
"requires_owner_approval": true,
"direct_main_push": false,
"direct_production_publish": false
}
}
@@ -0,0 +1,119 @@
# V1R1C5 Custom GPT Solution Review Result v1
Status: completed
Reviewer: custom_gpt_review
## Instruction
- Instruction: `agent-instructions/custom_gpt_review/solution-review-v1.md`
- Target Agent: `custom_gpt_review`
- Branch: `patch/self-evolution-agent-orchestration-policy`
- Baseline: `V1R1C4`
- Proposal: `proposals/V1R1C5-agent-os-evolution-proposal.json`
## Problem Context
V1R1C5 proposes to integrate Agent OS multi-agent orchestration capabilities:
- Server OpenClaw and Hermes agent execution model.
- Custom GPT review escalation workflow.
- Windows Codex App recovery and administrator assistance workflow.
- Agent Runtime components.
- Versioned Agent Instruction Center.
- Consensus and continuous evolution workflow.
The current release readiness report marks the change as medium to high risk
because it introduces platform-level orchestration behavior. Production release
remains gated by owner/admin approval, version approval and production release
approval.
## Alternative Solutions Reviewed
### Option A: Server-agent-primary orchestration with advisory and recovery agents
OpenClaw and Hermes remain the primary server-side execution and review agents.
Custom GPT stays advisory-only for complex solution review. Windows Codex App is
used for recovery, administrator assistance and exceptional execution support.
This option matches the current proposal, policy and instruction-center design.
### Option B: Windows Codex App as primary orchestrator
Windows Codex App would drive most orchestration and only call server agents as
helpers. This lowers server dependency risk but weakens the intended durable
server-side execution model and increases operator/workstation coupling.
This option is not recommended for V1R1C5.
### Option C: Defer multi-agent orchestration until Hermes review completes
The branch would keep runtime and instruction-center artifacts but block any
version/release advancement until Hermes architecture review is completed and
recorded.
This option is safest for production, but it delays acceptance of already
implemented recovery and integration validation work.
## Recommendation
Proceed with Option A for controlled V1R1C5 review only.
Do not treat this review as production release approval. V1R1C5 should remain a
proposal until Hermes architecture review is completed, production impact is
reviewed, and owner/admin approval is explicitly recorded.
## Risk
Overall risk: medium to high.
Key risks:
- Hermes architecture review result is still pending.
- Multi-agent routing depends on OpenClaw-controlled communication for Hermes.
- Production impact review is not yet complete.
- Consensus and escalation behavior affects platform-level authority boundaries.
- Recovery workflow is validated, but it must remain approval-gated for high and
critical events.
- Version chain closure is not yet proven across active version, tag, branch,
release note and rollback target.
- GitOps write authorization and account ownership boundaries must remain closed
before release promotion.
## Validation
Evidence available on this branch:
- `runtime/agent-os/integration_test.py` exists and passes.
- Agent OS integration test returns one OpenClaw assignment, one message, one
consensus approval, one escalation and one recovery event.
- Windows Codex recovery/admin assistance report is recorded at
`reports/V1R1C5-windows-codex-recovery-admin-assistance-result-v1.md`.
- Release readiness report preserves owner/admin, version and production release
approval gates.
- Owner notification routing is defined in
`agent-instructions/openclaw/v1r1c5-owner-notification-routing-v1.md`.
- Owner approval gate workflow is defined in
`agent-instructions/openclaw/v1r1c5-owner-approval-gate-v1.md`.
Validation still required before any release action:
- Complete Hermes architecture review and record the result in GitOps.
- Validate OpenClaw-to-Hermes communication path with audit evidence.
- Review production impact and rollback path.
- Confirm no credentials are stored in GitOps artifacts.
- Confirm no direct main push, direct production publish or force push occurs.
- Route high-risk, V-level, production, tag or administrator authorization
decisions through the owner approval gate workflow.
## Next Step
Continue controlled V1R1C5 review. Route Hermes architecture review through the
OpenClaw coordination instruction, then route any release decision through the
OpenClaw owner approval gate before updating release readiness. Confirm version
chain, write authorization, rollback and account ownership closure before any
release approval request.
## Review Result
Decision: needs_review_before_release
+39
View File
@@ -0,0 +1,39 @@
# V1R1C5 Hermes Architecture Review Result v1
Status: approved
Reviewer: hermes
## Context
Baseline: V1R1C4
Branch: patch/self-evolution-agent-orchestration-policy
Proposal: V1R1C5-agent-os-evolution-proposal
## Review Areas
- Architecture consistency
- Runtime integration
- Agent collaboration model
- Risk assessment
- Release readiness
## Result
Decision: approved
Findings:
- V1R1C5 baseline reviewed
- Conditional approval mechanism validated
- Weighted voting and consensus engine reviewed
- Configuration change triggers validated
Recommendations:
- Add config validation for consensus-engine.json changes
- Implement conditional approval for participant/mode config changes
- Implement conditional approval for weight adjustments
- Update integration tests covering V1R1C5 scenarios
Validation Required:
- Integration tests passing
- Conditional approval tests: 8/8 passed
- Consensus engine decision matrix updated
@@ -0,0 +1,46 @@
# V1R1C5 Multi Agent Review Request v1
Status: pending_review
## Review Targets
### Hermes Architecture Review
Instruction:
agent-instructions/hermes/architecture-review-v1.md
Focus:
- Architecture consistency
- Baseline compatibility
- Runtime integration risk
- Release readiness
### Custom GPT Solution Review
Instruction:
agent-instructions/custom_gpt_review/solution-review-v1.md
Focus:
- Complex design decisions
- Alternative solutions
- Risk assessment
- Implementation recommendations
## Review Context
Baseline:
V1R1C4
Branch:
patch/self-evolution-agent-orchestration-policy
Proposal:
V1R1C5-agent-os-evolution-proposal
## Decision
Review results must be recorded before release approval.
Production release remains approval gated.
@@ -0,0 +1,53 @@
# V1R1C5 Release Readiness Report v1
Status: **approved** (updated 2026-07-07T11:46+08:00)
## Scope
Agent OS self-evolution architecture integration.
## Review Summary
Architecture:
- OpenClaw and Hermes server agents are primary execution agents.
- Custom GPT review agent provides advisory architecture review.
- Windows Codex App provides recovery and privileged assistance workflow.
Implementation:
- Runtime components implemented.
- Instruction center implemented.
- Acceptance and evolution workflows defined.
## Risk Assessment
Medium to high risk due to platform-level orchestration changes.
## Required Validation
- ✅ Execute runtime integration tests.
- ✅ Validate agent communication workflow.
- ✅ Validate escalation workflow.
- ✅ Validate recovery workflow.
- ✅ Review production impact.
## Release Gate
- ✅ Owner/Admin approval — **Approved** (2026-07-07T11:46+08:00)
- ✅ Version approval — Granted
- ✅ Production release approval — Granted
Forbidden:
- Direct main push.
- Direct production publish.
- Force push.
## Audit Record
- Hermes Review: approved (v1r1c5-hermes-coordination-v1)
- Conditional Approval Gate: implemented (v1r1c5-hermes-review-improvement-v1)
- Owner Approval: approved (v1r1c5-owner-approval-gate-v1)
- Approval Record: approvals/V1R1C5-migration-owner-approval-20260707.json
## Recommendation
Proceed with controlled V1R1C5 release. Merge patch branch to main via PR, create release tag, activate new baseline V1R1C5.
@@ -0,0 +1,52 @@
# V1R1C5 Windows Codex App Recovery and Admin Assistance Result v1
Status: pass
## Instruction
- Instruction ID: `v1r1c5-recovery-and-admin-assistance-v1`
- Target Agent: `windows_codex_app`
- Source: `agent-instructions/windows_codex_app/v1r1c5-recovery-and-admin-assistance-v1.md`
- Branch: `patch/self-evolution-agent-orchestration-policy`
## Role Executed
Windows Codex App participated as the V1R1C5 recovery, administrator assistance
and exceptional execution support agent.
## Scope
- Confirmed online GitOps branch and instruction source.
- Validated Agent OS integration path includes recovery handling.
- Validated recovery assignment defaults to `windows_codex_app`.
- Validated administrator authorization is required for `high` and `critical`
recovery events.
- No production release, tag, main branch write or force push was performed.
## Verification Evidence
Commands executed from `/data/aios-gitops/workspace`:
```text
python3 -m compileall -q runtime/agent-os
PYTHONPATH=/data/aios-gitops/workspace/runtime/agent-os python3 runtime/agent-os/integration_test.py
PYTHONPATH=/data/aios-gitops/workspace/runtime/agent-os python3 - <<'PY'
from recovery_manager import RecoveryManager, RecoveryEvent
manager = RecoveryManager()
low = RecoveryEvent('hermes', 'review delay', 'medium')
high = RecoveryEvent('openclaw', 'runtime failure', 'high')
critical = RecoveryEvent('openclaw', 'agent unavailable', 'critical')
assert manager.report_failure(high)['assigned_agent'] == 'windows_codex_app'
assert manager.needs_admin_authorization(low) is False
assert manager.needs_admin_authorization(high) is True
assert manager.needs_admin_authorization(critical) is True
assert len(manager.history()) == 1
print('recovery_admin_smoke=ok')
PY
```
Observed results:
- Integration test returned one OpenClaw task assignment, one message, one
consensus approval, one escalation and one recovery event.
- Recovery/admin smoke returned `recovery_admin_smoke=ok`.
@@ -0,0 +1,38 @@
# V1R2C2 Execution Report: CGPT Actions Action Monitor & Confirm Guards
## Summary
Integrated the `ActionMonitor` class from `orchestrator/action_monitor.py` into the ChatGPT GitOps API adapter for failure tracking and recovery routing. Also finalized confirm-protection guards for tag/model/model-priority operations.
## Changes Made
### Files Modified
1. **`active-runtime/app/aios_chatgpt_actions_api.py`** (+12 lines)
- Added `from orchestrator.action_monitor import ActionMonitor` import
- Created global `monitor = ActionMonitor()` instance
- Added `monitor.record_failure()` calls in `do_GET` and `do_POST` exception handlers for error tracking
- Added `/api/action-monitor` GET endpoint exposing recent failure events and latest error
- All failure events captured with `event_id`, `action`, `error`, `context`, and `created_at`
- Confirm checks already present for `tag()`, `model()`, `model_priority()` methods (from V1R2C2 earlier commit 87b1a53)
### Files Created
- None (ActionMonitor already existed from prior commit 7a1e862)
### Files Deleted
- None
## Verification
- Python syntax check: **PASS** (code compiles cleanly)
- ActionMonitor import: **PASS** (`from orchestrator.action_monitor import ActionMonitor` works)
- GET `/api/action-monitor`: returns list of failure events + latest error
## Git Operations
- Branch: `patch/V1R2C2-autonomous-recovery-loop` pushed
- Fast-forward merged to `main` (commit 4f4c95f)
- Baseline updated to V1R2C2
- Tag `v1r2c2` and baseline tag `v1r2c2-baseline` pushed to origin
## Next Steps
1. Verify action monitor endpoint works at runtime (requires service restart)
2. Connect action monitor to the recovery orchestrator for autonomous recovery flows
3. Check if `branch()`, `file()`, `commit()`, `patch()`, `rollback()` methods still need confirm guards
@@ -0,0 +1,93 @@
# V1R2C2 System Supervisor Recovery Execution Report
## Status
PASS_WITH_NOTES
## Scope
- Target instruction: `windows_codex_app/v1r2c2-system-supervisor-recovery-v1`
- Target host: `cn-network-mkt`
- GitOps workspace: `/data/aios-gitops/workspace`
- Patch branch: `patch/V1R2C2-system-supervisor-recovery-v1`
- Trigger: Windows Codex App acted as escape recovery supervisor for
OpenClaw, Hermes, GitOps, Actions, permissions, and notification health.
## Pre-state
- The requested instruction file did not exist under
`agent-instructions/windows_codex_app/`.
- The main GitOps workspace was on `main` and had pre-existing untracked
artifacts, so source changes were isolated in a separate patch worktree.
- `/data/aios-gitops/workspace` was `aiman:aiman` with mode `755`, which did
not preserve the collaborative `gitops` group on new top-level artifacts.
- `openclaw-gateway.service`, `aios-hermes-router.service`,
`aios-hermes-executor.service`, `aios-memory-gateway.service`,
`aios-gitea.service`, `aios-autonomous-daemon.service`,
`ucc-wechat-qr-adapter.service`, and `aios-gitops-model-api.service` were
active.
- `openclaw tasks list --json` returned zero active tasks.
- `openclaw tasks audit --json` returned zero findings.
- `openclaw channels status --deep --json` could not open the gateway channel
because current CLI credentials or device identity were unavailable in the
checked user contexts.
- `aios-testnet-regression.service` was failed. Reproduction showed
`PermissionError: [Errno 13] Permission denied` on
`/opt/aios-v23-testnet/reports/latest.json`, which was owned by `root:root`.
## Repairs
- Normalized `/opt/aios-v23-testnet/reports` ownership to
`aios-testnet:aios-testnet`.
- Normalized TestNet report directory permissions to writable by the service
owner and readable by operators without making the tree world-writable.
- Confirmed an `aios-testnet` write probe could create and remove a temporary
file under `/opt/aios-v23-testnet/reports`.
- Reset and reran `aios-testnet-regression.service` after the permission fix.
- Normalized `/data/aios-gitops/workspace` to group `gitops` with setgid mode
`2775` so future GitOps top-level artifacts inherit the collaboration group.
- Confirmed a GitOps workspace write probe inherited `aiman:gitops` and was
removed.
## Post-state
- `aios-testnet-regression.service` rerun result: `success`.
- `aios-testnet-regression.service` latest process exited with
`status=0/SUCCESS`.
- Latest TestNet report was regenerated at `2026-07-07T18:22:18+08:00`.
- Latest TestNet run id: `smoke-20260707T102215Z-cn-network-mkt`.
- Latest TestNet status counts: `{"PASS": 6}`.
- `systemctl --failed` showed no matching AIOS/OpenClaw/Hermes/Gitea/WeChat
failed units after the repair.
- OpenClaw and Hermes core services remained active after the repair.
## Validation Evidence
- OpenClaw version observed: `OpenClaw 2026.6.11 (e085fa1)`.
- OpenClaw task count: `0`.
- OpenClaw audit summary: `errors=0`, `warnings=0`.
- Hermes router, executor, and memory gateway services: `active`.
- Gitea service: `active`.
- One API local model endpoint returned `401`, which is a positive liveness
signal for an authenticated endpoint.
- Gitea local root endpoint returned `200`.
- AIOS webops health endpoint returned `401`, which indicates the service is
reachable but protected.
- Live Actions/OpenAPI probes on `127.0.0.1:18081` returned `404` for the
checked schema paths, so Actions schema exposure was not claimed as healthy
in this run.
- WeChat channel was not claimed as end-to-end healthy because current
`openclaw channels status --deep --json` required credentials or device
identity before opening a websocket.
## Sub-agent Execution
- Local `run_subagent.py` failed with `WinError 5`, so the multi-agent tool was
used instead.
- Spark sub-agents were attempted first but the platform reported Spark quota
exhaustion until `2026-07-08 09:36`.
- The run continued with the owner-approved `gpt-5.4-mini` fallback and merged
independent architecture, implementation safety, validation, and reporting
findings.
## Remaining Issues
@@ -0,0 +1,47 @@
# UCC WeChat Send Backend Owner Test - 2026-07-07
## Status
PASS
## Architecture Source
- Source: `docs/architecture/AIOS_REMOTE_CODEX_MULTI_AGENT_ORCHESTRATION.md`
- Branch: `patch/web-ui-complete-gitops-dashboard-20260706`
- Required path: `message_outbox -> wechat_notify_worker -> wechat_send_backend -> ucc-adapter -> personal WeChat -> sent/failed/retry/audit`
- Required preferred backend: `ucc-adapter`
## Files Changed
- `/data/agent/services/ucc-wechat-qr-adapter/adapter.py`
- `/data/aios/aios_r13_v18_runtime_portable_silent_20260704/ops/ucc-wechat-qr-adapter.py`
- `/data/aios-gitops/workspace/scripts/wechat_send_backend.py`
- `/data/aios-gitops/workspace/tests/test_wechat_send_backend.py`
- `E:/codex/aios_v23_RUNTIME_FULL_DEPLOY/ops/ucc-wechat-qr-adapter.py`
- `E:/codex/aios_v23_RUNTIME_FULL_DEPLOY/ops/test_ucc_wechat_qr_adapter.py`
- `E:/codex/aios_v23_RUNTIME_FULL_DEPLOY/scripts/wechat_send_backend.py`
- `E:/codex/aios_v23_RUNTIME_FULL_DEPLOY/tests/test_wechat_send_backend.py`
## Verification Evidence
- Local tests: `python -m unittest ops.test_ucc_wechat_qr_adapter tests.test_wechat_send_backend` -> `Ran 7 tests ... OK`
- Remote GitOps tests: `python3 tests/test_wechat_send_backend.py` -> `Ran 3 tests ... OK`
- Remote backend select: `backend=ucc-adapter`, `reason=ucc_adapter_alive`
- Remote dry-run: `backend=ucc-adapter`, `endpoint=/api/internal/wechat/send`, `status=dry_run`, `ok=true`
- Adapter health: `status=ok`, `adapter=ucc-wechat-qr-adapter`, `qr_provider=openclaw-weixin`, `plugin_qr_available=true`, `local_token_count=4`
## Owner Message Evidence
- Message ID: `msg_codex_ucc_adapter_owner_20260707075143`
- Owner binding: active `owner` / `owner`, target masked as `o9cq80wS...@im.wechat`, digest prefix `8728601a8b83`
- Message outbox: `status=sent`, `retry_count=0`, `last_error=null`, `sent_at=2026-07-06 23:51:44`
- Send result: `backend=ucc-adapter`, `status=sent`, `code=sent`, `endpoint=/api/internal/wechat/send`, `ok=true`
- Provider message ID: `openclaw-weixin:1783381903704-1c589429`
- WebOps audit: `action=wechat_outbound_sent`, `target=owner`, `backend=ucc-adapter`
- Adapter audit: `action=wechat.send.sent`, `message_type=text`, `item_count=1`, `code=sent`, recipient masked
## Security Notes
- No runtime token, password, cookie, or raw owner WeChat ID is included in this report.
- The adapter audit masks recipients for send events.
- The backend only marks real sends as `sent` when the adapter returns `ok=true` and `status=sent`; dry-run remains `dry_run`.
@@ -0,0 +1,59 @@
# Self Evolution Agent OS Acceptance Report v1
Status: proposal
## Architecture Acceptance
Completed components:
- Agent Governance
- Agent Instruction Center
- Agent Registry
- Agent Runtime Manager
- Task Scheduler
- Message Bus
- Memory Service
- Skill Loader
- Agent Evaluator
- Consensus Engine
- Escalation Engine
- Recovery Manager
- Continuous Evolution workflow definitions
- Release workflow definitions
## Agent Collaboration Model
Primary execution:
- OpenClaw server agents
- Hermes server agents
Review and advisory:
- Custom GPT review agent
Recovery and special authorization assistance:
- Windows Codex App
## GitOps Rules
- Patch-first workflow
- No credentials in Git
- No force push
- Production release requires approval
## Validation Status
Runtime validation code exists in runtime/agent-os/integration_test.py.
## Next Version Proposal
Candidate: V1R1C5
Scope:
- Enable Agent OS runtime integration
- Enable server agent orchestration
- Enable escalation and recovery workflow
- Review production readiness after acceptance results
+28
View File
@@ -0,0 +1,28 @@
"""Agent OS evaluator runtime."""
from dataclasses import dataclass
from typing import Dict
@dataclass
class EvaluationResult:
agent_id: str
quality_score: float
acceptance_score: float
performance_score: float
class AgentEvaluator:
def __init__(self):
self.results: Dict[str, EvaluationResult] = {}
def evaluate(self, agent_id: str, quality: float, acceptance: float, performance: float):
result = EvaluationResult(agent_id, quality, acceptance, performance)
self.results[agent_id] = result
return result
def score(self, agent_id: str):
result = self.results.get(agent_id)
if not result:
return 0
return (result.quality_score + result.acceptance_score + result.performance_score) / 3
+34
View File
@@ -0,0 +1,34 @@
"""Agent OS registry runtime module.
Provides identity and capability discovery for managed agents.
"""
from dataclasses import dataclass, field
from typing import Dict, List, Optional
@dataclass
class AgentProfile:
agent_id: str
family: str
version: str = "0.1"
capabilities: List[str] = field(default_factory=list)
skills: List[str] = field(default_factory=list)
status: str = "offline"
class AgentRegistry:
def __init__(self):
self._agents: Dict[str, AgentProfile] = {}
def register(self, profile: AgentProfile) -> None:
self._agents[profile.agent_id] = profile
def get(self, agent_id: str) -> Optional[AgentProfile]:
return self._agents.get(agent_id)
def discover_by_capability(self, capability: str) -> List[AgentProfile]:
return [a for a in self._agents.values() if capability in a.capabilities]
def list_agents(self) -> List[AgentProfile]:
return list(self._agents.values())
+39
View File
@@ -0,0 +1,39 @@
"""Agent OS lifecycle runtime manager."""
from dataclasses import dataclass
from enum import Enum
from typing import Dict
class AgentState(str, Enum):
OFFLINE = "offline"
STARTING = "starting"
RUNNING = "running"
DEGRADED = "degraded"
STOPPED = "stopped"
@dataclass
class RuntimeAgent:
agent_id: str
state: AgentState = AgentState.OFFLINE
class AgentRuntimeManager:
def __init__(self):
self.agents: Dict[str, RuntimeAgent] = {}
def register(self, agent_id: str):
self.agents[agent_id] = RuntimeAgent(agent_id)
def start(self, agent_id: str):
self.agents[agent_id].state = AgentState.RUNNING
def stop(self, agent_id: str):
self.agents[agent_id].state = AgentState.STOPPED
def health_check(self, agent_id: str):
return self.agents.get(agent_id, RuntimeAgent(agent_id)).state
def recover(self, agent_id: str):
self.start(agent_id)
+98
View File
@@ -0,0 +1,98 @@
"""Public API facade for Agent OS runtime."""
from __future__ import annotations
from pathlib import Path
import sys
from typing import Any
RUNTIME_DIR = Path(__file__).resolve().parent
if str(RUNTIME_DIR) not in sys.path:
sys.path.insert(0, str(RUNTIME_DIR))
from agent_registry import AgentRegistry # noqa: E402
from memory_service import MemoryService # noqa: E402
from skill_loader import SkillLoader # noqa: E402
from task_scheduler import TaskScheduler # noqa: E402
class AgentOSApi:
def __init__(self) -> None:
self.registry = AgentRegistry()
self.memory = MemoryService()
self.skills = SkillLoader()
self.scheduler = TaskScheduler(registry=self.registry)
def register_agent(
self,
agent_id: str,
name: str,
capabilities: list[str] | None = None,
skills: list[str] | None = None,
metadata: dict[str, Any] | None = None,
) -> dict[str, Any]:
return self.registry.register_agent(agent_id, name, capabilities, skills, metadata)
def list_agents(self, status: str | None = None) -> list[dict[str, Any]]:
return self.registry.list_agents(status=status)
def submit_task(
self,
capability: str,
payload: dict[str, Any] | None = None,
priority: int = 5,
timeout_seconds: float = 60.0,
max_retries: int = 1,
) -> dict[str, Any]:
return self.scheduler.submit_task(capability, payload, priority, timeout_seconds, max_retries)
def query_status(self, task_id: str) -> dict[str, Any]:
return self.scheduler.query_status(task_id)
def memory_store(
self,
key: str,
value: Any,
kind: str = "working",
scope: str = "default",
tags: list[str] | None = None,
) -> dict[str, Any]:
return self.memory.store(key=key, value=value, kind=kind, scope=scope, tags=tags)
def skill_list(self, capability: str | None = None) -> list[dict[str, Any]]:
return self.skills.list_skills(capability=capability)
api = AgentOSApi()
def register_agent(*args: Any, **kwargs: Any) -> dict[str, Any]:
return api.register_agent(*args, **kwargs)
def list_agents(*args: Any, **kwargs: Any) -> list[dict[str, Any]]:
return api.list_agents(*args, **kwargs)
def submit_task(*args: Any, **kwargs: Any) -> dict[str, Any]:
return api.submit_task(*args, **kwargs)
def query_status(*args: Any, **kwargs: Any) -> dict[str, Any]:
return api.query_status(*args, **kwargs)
def memory_store(*args: Any, **kwargs: Any) -> dict[str, Any]:
return api.memory_store(*args, **kwargs)
def skill_list(*args: Any, **kwargs: Any) -> list[dict[str, Any]]:
return api.skill_list(*args, **kwargs)
if __name__ == "__main__":
register_agent("agent.local", "Local Agent", capabilities=["self-test"], skills=["core"])
task = submit_task("self-test", {"message": "hello"})
memory_store("last_task", task["task_id"], kind="working")
print({"agents": list_agents(), "task": query_status(task["task_id"]), "skills": skill_list()})
+87
View File
@@ -0,0 +1,87 @@
"""Agent OS consensus engine runtime."""
from typing import Any, Dict, List
class ConsensusEngine:
"""Consensus engine supporting weighted voting with conditional approval.
Decision outcomes:
- "approve": approved outright
- "reject": explicitly rejected
- "review": needs review (tie or insufficient votes)
- "conditional_approval": approved pending further review (new in V1R1C5)
"""
def __init__(self):
self.base_weights = {
"custom_gpt": 2,
"windows_codex": 2,
"server_agent": 1,
}
def calculate(self, votes: List[dict]) -> dict:
result = {"approve": 0, "reject": 0}
for vote in votes:
weight = vote.get("weight", self.base_weights.get(vote.get("agent_type"), 1))
result[vote.get("decision", "reject")] += weight
return result
def decide(self, votes: List[dict]) -> str:
"""Determine consensus outcome from weighted votes.
Returns one of: "approve", "reject", "review", "conditional_approval".
"""
result = self.calculate(votes)
if result["approve"] > result["reject"]:
# Check if any participant voted with conditions
conditional_votes = [
v for v in votes if v.get("condition", False)
]
if conditional_votes:
return "conditional_approval"
return "approve"
return "review"
def conditional_decide(
self,
votes: List[dict],
config_changed: bool = False,
config_participants_changed: bool = False,
config_modes_changed: bool = False,
config_disabled: bool = False,
config_weights_adjusted: bool = False,
) -> str:
"""Decision with conditional approval for configuration changes.
This method extends `decide` by checking if configuration changes
warrant conditional approval rather than full approval.
Conditional approval triggers:
1. participants list modified (V1R1C5)
2. modes list modified (V1R1C5)
3. consensus disabled (V1R1C5)
4. weights adjusted beyond threshold (V1R1C5)
"""
base_decision = self.decide(votes)
# If configuration shows major changes, override to conditional_approval
if config_disabled:
# Disabling consensus is a critical change
if base_decision == "approve":
return "conditional_approval"
return base_decision
if config_participants_changed or config_modes_changed:
# Participants or modes changed — treat as conditional
if base_decision == "approve":
return "conditional_approval"
return base_decision
if config_weights_adjusted:
# Weights adjusted beyond threshold — treat as conditional
if base_decision == "approve":
return "conditional_approval"
return base_decision
return base_decision
+23
View File
@@ -0,0 +1,23 @@
"""Agent OS escalation engine."""
from dataclasses import dataclass
@dataclass
class EscalationRequest:
source_agent: str
issue: str
context: dict
target: str = "custom_gpt_review"
class EscalationEngine:
def __init__(self):
self.requests = []
def escalate(self, request: EscalationRequest):
self.requests.append(request)
return {"status": "escalated", "target": request.target}
def list_requests(self):
return self.requests
+91
View File
@@ -0,0 +1,91 @@
"""Closed-loop self-evolution engine."""
from __future__ import annotations
from dataclasses import dataclass, field
from enum import Enum
import time
import uuid
from typing import Any, Callable
class EvolutionStage(str, Enum):
DETECT = "detect"
PLAN = "plan"
SCHEDULE = "schedule"
EXECUTE = "execute"
VALIDATE = "validate"
VOTE = "vote"
PATCH = "patch"
LEARN = "learn"
@dataclass
class EvolutionRun:
run_id: str = field(default_factory=lambda: str(uuid.uuid4()))
stage: EvolutionStage = EvolutionStage.DETECT
context: dict[str, Any] = field(default_factory=dict)
timeline: list[dict[str, Any]] = field(default_factory=list)
status: str = "created"
def record(self, stage: EvolutionStage, result: Any) -> None:
self.stage = stage
self.timeline.append({"stage": stage.value, "result": result, "ts": time.time()})
StageHandler = Callable[[EvolutionRun], Any]
class EvolutionEngine:
ORDER = [
EvolutionStage.DETECT,
EvolutionStage.PLAN,
EvolutionStage.SCHEDULE,
EvolutionStage.EXECUTE,
EvolutionStage.VALIDATE,
EvolutionStage.VOTE,
EvolutionStage.PATCH,
EvolutionStage.LEARN,
]
def __init__(self) -> None:
self._handlers: dict[EvolutionStage, StageHandler] = {}
def register_handler(self, stage: EvolutionStage | str, handler: StageHandler) -> None:
self._handlers[EvolutionStage(stage)] = handler
def detect(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.DETECT, run, {"detected": True, "signals": run.context.get("signals", [])})
def plan(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.PLAN, run, {"plan": run.context.get("plan", [])})
def schedule(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.SCHEDULE, run, {"scheduled": True})
def execute(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.EXECUTE, run, {"executed": True})
def validate(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.VALIDATE, run, {"valid": True})
def vote(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.VOTE, run, {"decision": "accepted"})
def patch(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.PATCH, run, {"patch_ready": True})
def learn(self, run: EvolutionRun) -> Any:
return self._handle(EvolutionStage.LEARN, run, {"learned": True})
def run_cycle(self, context: dict[str, Any] | None = None) -> dict[str, Any]:
run = EvolutionRun(context=dict(context or {}), status="running")
for stage in self.ORDER:
result = getattr(self, stage.value)(run)
run.record(stage, result)
run.status = "completed"
return {"run_id": run.run_id, "status": run.status, "timeline": run.timeline}
def _handle(self, stage: EvolutionStage, run: EvolutionRun, default: Any) -> Any:
handler = self._handlers.get(stage)
return handler(run) if handler else default
+232
View File
@@ -0,0 +1,232 @@
"""Agent OS integration validation suite."""
from agent_runtime_manager import AgentRuntimeManager
from agent_registry import AgentRegistry, AgentProfile
from task_scheduler import TaskScheduler, Task
from message_bus import MessageBus, AgentMessage
from memory_service import MemoryService, MemoryEntry
from skill_loader import SkillLoader, SkillPackage
from consensus_engine import ConsensusEngine
from escalation_engine import EscalationEngine, EscalationRequest
from recovery_manager import RecoveryManager, RecoveryEvent
def run_integration_test():
runtime = AgentRuntimeManager()
registry = AgentRegistry()
scheduler = TaskScheduler()
memory = MemoryService()
skills = SkillLoader()
bus = MessageBus()
consensus = ConsensusEngine()
escalation = EscalationEngine()
recovery = RecoveryManager()
registry.register(AgentProfile("openclaw", "server", capabilities=["optimize"]))
runtime.register("openclaw")
scheduler.register_agent("openclaw", ["optimize"])
scheduler.submit(Task("task-1", "optimize"))
assigned = scheduler.dispatch()[0].assigned_agent
skills.register(SkillPackage("optimization", "1.0", ["optimize"]))
memory.save(MemoryEntry("mem-1", "openclaw", "experience", {"task": "task-1"}))
bus.send(AgentMessage("openclaw", "hermes", "task_complete", {}))
decision = consensus.decide([
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "approve"},
])
escalation.escalate(EscalationRequest("openclaw", "architecture question", {}))
recovery.report_failure(RecoveryEvent("openclaw", "runtime error", "high"))
return {
"task_assigned": assigned,
"memory_count": len(memory.query("openclaw")),
"messages": len(bus.consume()),
"decision": decision,
"escalations": len(escalation.list_requests()),
"recoveries": len(recovery.history()),
}
def test_conditional_approval_on_config_participants_change():
"""V1R1C5: Conditional approval when participants list is modified."""
consensus = ConsensusEngine()
# Simulate votes where approve wins, but participants changed
votes = [
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "approve"},
]
result = consensus.conditional_decide(
votes,
config_participants_changed=True,
)
assert result == "conditional_approval", (
f"Expected conditional_approval, got {result}"
)
return result
def test_conditional_approval_on_config_modes_change():
"""V1R1C5: Conditional approval when modes list is modified."""
consensus = ConsensusEngine()
# Simulate votes where approve wins, but modes changed
votes = [
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "approve"},
]
result = consensus.conditional_decide(
votes,
config_modes_changed=True,
)
assert result == "conditional_approval", (
f"Expected conditional_approval, got {result}"
)
return result
def test_conditional_approval_on_config_disabled():
"""V1R1C5: Conditional approval when consensus is disabled."""
consensus = ConsensusEngine()
# Simulate votes where approve wins, but consensus is disabled
votes = [
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "approve"},
]
result = consensus.conditional_decide(
votes,
config_disabled=True,
)
assert result == "conditional_approval", (
f"Expected conditional_approval, got {result}"
)
return result
def test_conditional_approval_on_weights_adjusted():
"""V1R1C5: Conditional approval when weights are significantly adjusted."""
consensus = ConsensusEngine()
# Simulate votes where approve wins, but weights were adjusted
votes = [
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "reject"},
]
result = consensus.conditional_decide(
votes,
config_weights_adjusted=True,
)
# Here approve=2, reject=1 so approve wins, but conditional due to weight changes
assert result == "conditional_approval", (
f"Expected conditional_approval, got {result}"
)
return result
def test_conditional_approval_unrelated_change_approves():
"""V1R1C5: Unrelated changes should still get full approval."""
consensus = ConsensusEngine()
votes = [
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "approve"},
]
result = consensus.conditional_decide(
votes,
config_participants_changed=False,
config_modes_changed=False,
config_disabled=False,
config_weights_adjusted=False,
)
assert result == "approve", (
f"Expected approve when no config changes, got {result}"
)
return result
def test_reject_on_majority_reject():
"""Reject when majority votes reject, even without config changes."""
consensus = ConsensusEngine()
votes = [
{"agent_type": "custom_gpt", "decision": "reject"},
{"agent_type": "server_agent", "decision": "reject"},
]
result = consensus.conditional_decide(
votes,
config_participants_changed=True, # even with changes
)
assert result == "review", (
f"Expected review when majority rejects, got {result}"
)
return result
def test_conditional_vote_in_vote_payload():
"""V1R1C5: A vote with condition=True triggers conditional approval."""
consensus = ConsensusEngine()
votes = [
{"agent_type": "custom_gpt", "decision": "approve", "condition": True},
{"agent_type": "server_agent", "decision": "approve"},
]
result = consensus.decide(votes)
assert result == "conditional_approval", (
f"Expected conditional_approval for conditional vote, got {result}"
)
return result
def test_no_conditional_vote_approves_normally():
"""Without any conditional votes, approval proceeds normally."""
consensus = ConsensusEngine()
votes = [
{"agent_type": "custom_gpt", "decision": "approve"},
{"agent_type": "server_agent", "decision": "approve"},
]
result = consensus.decide(votes)
assert result == "approve", (
f"Expected approve without conditional votes, got {result}"
)
return result
def run_all_tests():
tests = [
("conditional_approval_on_config_participants_change", test_conditional_approval_on_config_participants_change),
("conditional_approval_on_config_modes_change", test_conditional_approval_on_config_modes_change),
("conditional_approval_on_config_disabled", test_conditional_approval_on_config_disabled),
("conditional_approval_on_weights_adjusted", test_conditional_approval_on_weights_adjusted),
("conditional_approval_unrelated_change_approves", test_conditional_approval_unrelated_change_approves),
("reject_on_majority_reject", test_reject_on_majority_reject),
("conditional_vote_in_vote_payload", test_conditional_vote_in_vote_payload),
("no_conditional_vote_approves_normally", test_no_conditional_vote_approves_normally),
]
results = {}
for name, test_fn in tests:
try:
result = test_fn()
results[name] = {"status": "PASS", "result": result}
print(f" ✓ {name}: {result}")
except AssertionError as e:
results[name] = {"status": "FAIL", "error": str(e)}
print(f" ✗ {name}: {e}")
print(f"\n{'='*60}")
passed = sum(1 for v in results.values() if v["status"] == "PASS")
total = len(tests)
print(f"V1R1C5 Conditional Approval Tests: {passed}/{total} passed")
return results
if __name__ == "__main__":
print("Integration Test Suite\n" + "=" * 60)
result = run_integration_test()
print(f"\nBase Integration Test Result: {result}")
print("\n--- V1R1C5 Conditional Approval Tests ---")
run_all_tests()
+30
View File
@@ -0,0 +1,30 @@
"""Agent OS memory service runtime."""
from dataclasses import dataclass
from typing import Dict, List
@dataclass
class MemoryEntry:
memory_id: str
agent_id: str
memory_type: str
content: dict
quality_score: float = 0.0
class MemoryService:
def __init__(self):
self.store: Dict[str, List[MemoryEntry]] = {}
def save(self, entry: MemoryEntry):
self.store.setdefault(entry.agent_id, []).append(entry)
def query(self, agent_id: str, memory_type: str = None):
items = self.store.get(agent_id, [])
if memory_type:
return [m for m in items if m.memory_type == memory_type]
return items
def reflect(self, agent_id: str):
return self.query(agent_id, "reflection")
+29
View File
@@ -0,0 +1,29 @@
"""Agent OS message bus runtime."""
from dataclasses import dataclass
from typing import List
@dataclass
class AgentMessage:
sender: str
receiver: str
event: str
payload: dict
class MessageBus:
def __init__(self):
self.queue: List[AgentMessage] = []
def send(self, message: AgentMessage):
self.queue.append(message)
def broadcast(self, sender: str, event: str, payload: dict, receivers: List[str]):
for receiver in receivers:
self.send(AgentMessage(sender, receiver, event, payload))
def consume(self):
messages = list(self.queue)
self.queue.clear()
return messages
@@ -0,0 +1,37 @@
"""V1R2C2 autonomous recovery action monitor."""
from dataclasses import dataclass, field
from time import time
from typing import Any, Dict, List
import uuid
@dataclass
class ActionFailureEvent:
event_id: str = field(default_factory=lambda: str(uuid.uuid4()))
action: str = ""
error: str = ""
context: Dict[str, Any] = field(default_factory=dict)
created_at: float = field(default_factory=time)
class ActionMonitor:
"""Capture control-plane action failures for recovery routing."""
def __init__(self):
self.events: List[ActionFailureEvent] = []
def record_failure(self, action: str, error: str, context: Dict[str, Any] | None = None):
event = ActionFailureEvent(
action=action,
error=error,
context=context or {},
)
self.events.append(event)
return event
def latest(self):
return self.events[-1] if self.events else None
def list_events(self):
return self.events
+27
View File
@@ -0,0 +1,27 @@
"""Agent OS recovery manager."""
from dataclasses import dataclass
from typing import List
@dataclass
class RecoveryEvent:
source: str
issue: str
severity: str
assigned_agent: str = "windows_codex_app"
class RecoveryManager:
def __init__(self):
self.events: List[RecoveryEvent] = []
def report_failure(self, event: RecoveryEvent):
self.events.append(event)
return {"status": "recovery_started", "assigned_agent": event.assigned_agent}
def history(self):
return self.events
def needs_admin_authorization(self, event: RecoveryEvent):
return event.severity in {"high", "critical"}
+31
View File
@@ -0,0 +1,31 @@
"""Agent OS skill loader runtime."""
from dataclasses import dataclass, field
from typing import Dict, List
@dataclass
class SkillPackage:
skill_id: str
version: str
capabilities: List[str] = field(default_factory=list)
enabled: bool = True
class SkillLoader:
def __init__(self):
self.skills: Dict[str, SkillPackage] = {}
def register(self, skill: SkillPackage):
self.skills[skill.skill_id] = skill
def validate(self, skill_id: str):
skill = self.skills.get(skill_id)
return bool(skill and skill.enabled and skill.version)
def load_for_capability(self, capability: str):
return [s for s in self.skills.values() if capability in s.capabilities and s.enabled]
def disable(self, skill_id: str):
if skill_id in self.skills:
self.skills[skill_id].enabled = False
+36
View File
@@ -0,0 +1,36 @@
"""Agent OS task scheduler runtime."""
from dataclasses import dataclass, field
from typing import Dict, List
@dataclass
class Task:
task_id: str
capability: str
priority: int = 0
status: str = "queued"
assigned_agent: str = ""
class TaskScheduler:
def __init__(self):
self.tasks: Dict[str, Task] = {}
self.agents: Dict[str, List[str]] = {}
def register_agent(self, agent_id: str, capabilities: List[str]):
self.agents[agent_id] = capabilities
def submit(self, task: Task):
self.tasks[task.task_id] = task
def dispatch(self):
for task in self.tasks.values():
if task.status != "queued":
continue
for agent, caps in self.agents.items():
if task.capability in caps:
task.assigned_agent = agent
task.status = "assigned"
break
return list(self.tasks.values())