auto-sync: 2026-05-15 21:28:02
This commit is contained in:
@@ -315,42 +315,46 @@ research 任务:working → [庞统确认] → review → done
|
||||
|
||||
```yaml
|
||||
# guardrails.yaml
|
||||
#
|
||||
# L1 check 用 assert 字段(Python 表达式,Daemon eval 执行)
|
||||
# L2 check 用 prompt 字段(传给 subagent 的检查指令)
|
||||
|
||||
task_types:
|
||||
coding:
|
||||
output_guardrails:
|
||||
- name: file_exists
|
||||
check: "output.files | length > 0"
|
||||
assert: "len(output.get('files', [])) > 0"
|
||||
severity: blocking
|
||||
layer: L1 # Daemon 直接操作
|
||||
layer: L1
|
||||
- name: json_valid
|
||||
check: "output.json_schema_valid"
|
||||
assert: "output.get('json_schema_valid', False) == True"
|
||||
severity: blocking
|
||||
layer: L1
|
||||
- name: artifacts_exist
|
||||
check: "output.artifacts_paths all exist"
|
||||
assert: "all(os.path.exists(p) for p in output.get('artifacts_paths', []))"
|
||||
severity: blocking
|
||||
layer: L1 # CLI 附加校验
|
||||
- name: code_quality
|
||||
check: "scope_declaration vs task.truths"
|
||||
layer: L1
|
||||
- name: scope_alignment
|
||||
prompt: "Compare the agent's scope_declaration against task truths. Check: is every truth covered? Are there deviations not declared?"
|
||||
severity: warning
|
||||
layer: L2 # spawn sub 检查
|
||||
layer: L2
|
||||
output_review:
|
||||
required: true
|
||||
mode: single_reviewer # 单审
|
||||
mode: single_reviewer
|
||||
max_rounds: 3
|
||||
|
||||
deploy:
|
||||
plan_review:
|
||||
required: true
|
||||
mode: debate # 对抗辩论
|
||||
mode: debate
|
||||
max_rounds: 5
|
||||
output_guardrails:
|
||||
- name: no_direct_production
|
||||
check: "output.target_env != 'production'"
|
||||
severity: tripwire # 立即中断
|
||||
assert: "output.get('target_env') != 'production'"
|
||||
severity: tripwire
|
||||
layer: L1
|
||||
- name: rollback_plan_exists
|
||||
check: "output.rollback_plan != null"
|
||||
assert: "output.get('rollback_plan') is not None"
|
||||
severity: blocking
|
||||
layer: L1
|
||||
output_review:
|
||||
@@ -361,11 +365,11 @@ task_types:
|
||||
data:
|
||||
output_guardrails:
|
||||
- name: format_check
|
||||
check: "output.format in ['csv', 'parquet', 'json']"
|
||||
assert: "output.get('format') in ['csv', 'parquet', 'json']"
|
||||
severity: blocking
|
||||
layer: L1
|
||||
output_review:
|
||||
required: false # 低风险,Guardrail 自动检查
|
||||
required: false
|
||||
|
||||
research:
|
||||
output_review:
|
||||
@@ -523,7 +527,7 @@ adversarial_instructions:
|
||||
|
||||
```yaml
|
||||
output_schema: "schemas/review-output.schema.json"
|
||||
verdict_options: ["approved", "rejected", "needs_revision", "approved_with_reservations"]
|
||||
verdict_options: ["approved", "rejected", "needs_revision"]
|
||||
|
||||
required_fields:
|
||||
- verdict
|
||||
|
||||
Reference in New Issue
Block a user