SCSAI Governance Module Deployment Guide (V2.0)
Prerequisites
- SCSAI Agent Management Console Access
- Server https://ylxt.chat/scplm
- Database SCPLM
- Administrator account (default admin / gyc123456;)
Step 1: Run the Automatic Configuration Script
cd D:\openclaw\bossagents
node server/scripts/phase3-governance-setup.js
该脚本自动完成:
- Create 10 asset attributes on the 8 ItemTypes (Part/BOM/Process/Document/ECR/ECN/Product/Model)
- Create the GovernanceLog ItemType and its 12 attributes
- Create 8 RelationshipTypes ({Type} Governance Log)
Verification:
node server/scripts/phase3-verify.js
步骤 2: 上传 C# 方法
在 SCSAI 管理台操作:
- Admin → Methods → New
- Method Name: OnGovernanceTrigger
- Type: Server Method (C#)
- Paste the entire content of server/scripts/methods/OnGovernanceTrigger.cs
- Save
Repeat the above steps for BatchGovernance.cs.
Step 3: Bind the OnAfterUpdate Event
For each of the following 8 ItemTypes, navigate to its Events tab:
| ItemType | Operation Location |
|----------|----------|
| Part | Admin → ItemTypes → Part → Events |
| BOM | Admin → ItemTypes → BOM → Events |
| Process | Admin → ItemTypes → Process → Events |
| Document | Admin → ItemTypes → Document → Events |
| ECR | Admin → ItemTypes → ECR → Events |
| ECN | Admin → ItemTypes → ECN → Events |
| Product | Management → ItemTypes → Product → Events |
| Model | Management → ItemTypes → Model → Events |
For each ItemType:
- Click Add
- Event Type: OnAfterUpdate
- Method: Select OnGovernanceTrigger
- Save
Step 4: Verify Deployment
node server/scripts/phase3-verify.js
预期输出:All 40+ 项检查通过。
Manual Verification:
- Create a Part, edit and save it, then check if the quality_score / valuation / governance_status / gov_* attributes are automatically populated.
- Check if there are corresponding records in the GovernanceLog.
Step 5: Restart the Server
# 重启 BossAgents 应用
node server.js
# 或重启 IIS 应用池(SCSAI 端)
启动后自进化治理管道自动运行(巡检间隔 30 分钟,蒸馏间隔 1 小时)。
Quick Reference
| Command | Purpose | |
|---|---|---|
| node server/scripts/phase3-governance-setup.js | SCSAI auto-configuration | |
| node server/scripts/phase3-verify.js | Deployment verification | |
| node server/self-evolving-pipeline.js | Run pipeline independently | |
| node server/self-evolving-pipeline.js --one-shot | Single inspection run | |
| node server/self-evolving-pipeline.js --distill | Rules distillation only | |
| Environment Variable | Default Value | Description |
| ---------- | -------- | ------ |
| GOV_PIPELINE_INTERVAL | 1800000 (30min) | Inspection interval |
| GOV_DISTILL_INTERVAL | 3600000 (1h) | Distillation interval |
BossAgents