risk-classification
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTable of Contents
目录
Risk Classification
风险分类
Overview
概述
Provides inline risk classification for agent tasks using a 4-tier model (GREEN/YELLOW/RED/CRITICAL). Uses fast heuristic file-pattern matching for low-risk tiers and delegates to for high-risk tiers requiring full reversibility scoring.
Skill(attune:war-room-checkpoint)基于4级模型(GREEN/YELLOW/RED/CRITICAL)为Agent任务提供内联风险分类。低风险等级采用快速启发式文件模式匹配,高风险等级则委托给进行完整可逆性评分。
Skill(attune:war-room-checkpoint)When To Use
适用场景
- Assessing risk of tasks before agent assignment
- Determining verification requirements for task completion
- Deciding parallel execution safety between tasks
- Adding risk markers to task checklists
- 分配Agent任务前评估风险
- 确定任务完成的验证要求
- 判断任务间并行执行的安全性
- 为任务清单添加风险标记
When NOT To Use
不适用场景
- Single-file trivial changes (assume GREEN)
- Strategic architecture decisions (use full instead)
Skill(attune:war-room) - Non-code tasks (documentation-only, configuration comments)
- 单文件的微小变更(默认设为GREEN)
- 战略架构决策(改用完整的)
Skill(attune:war-room) - 非代码任务(仅文档、配置注释类)
4-Tier Risk Model
4级风险模型
| Tier | Color | Scope | Example | Verification |
|---|---|---|---|---|
| GREEN | Safe | Single file, trivial revert | Test files, docs, utils | None required |
| YELLOW | Caution | Module-level, user-visible | Components, routes, views | Conflict check + test pass |
| RED | Danger | Cross-module, security/data | Migrations, auth, database schema | War-room RS + full test + review |
| CRITICAL | Stop | Irreversible, regulated | Data deletion, production deploy | War-room RS + human approval |
| 等级 | 颜色 | 范围 | 示例 | 验证要求 |
|---|---|---|---|---|
| GREEN | 安全 | 单文件,可轻松回滚 | 测试文件、文档、工具类代码 | 无需验证 |
| YELLOW | 需注意 | 模块级,用户可见 | 组件、路由、视图 | 冲突检查 + 测试通过 |
| RED | 危险 | 跨模块,涉及安全/数据 | 迁移脚本、认证模块、数据库 schema | War-room可逆性评分(RS)+ 完整测试 + 审核 |
| CRITICAL | 禁止 | 不可回滚,受监管 | 数据删除、生产环境部署 | War-room可逆性评分(RS)+ 人工审批 |
Hybrid Routing
混合路由
Task received
|
v
Heuristic classifier (file patterns)
|
├── GREEN/YELLOW → Apply tier, continue
|
└── RED/CRITICAL → Invoke Skill(attune:war-room-checkpoint)
for reversibility scoring (RS)
|
└── RS confirms or adjusts tierWhy hybrid: GREEN/YELLOW classification is fast and deterministic (file pattern matching). RED/CRITICAL tasks warrant the overhead of full reversibility analysis because the cost of getting them wrong is high.
Task received
|
v
Heuristic classifier (file patterns)
|
├── GREEN/YELLOW → Apply tier, continue
|
└── RED/CRITICAL → Invoke Skill(attune:war-room-checkpoint)
for reversibility scoring (RS)
|
└── RS confirms or adjusts tier混合机制的优势:GREEN/YELLOW等级的分类快速且确定(基于文件模式)。RED/CRITICAL任务由于出错成本极高,值得投入资源进行完整可逆性分析。
Task Metadata Extension
任务元数据扩展
Add risk tier to task metadata for downstream consumption:
json
{
"id": "5",
"subject": "Add user authentication",
"metadata": {
"risk_tier": "YELLOW",
"risk_reason": "Modifies src/components/LoginForm.tsx (user-visible component)",
"classified_at": "2026-02-07T22:00:00Z"
}
}Tasks without metadata default to GREEN (backward compatible).
risk_tier为任务元数据添加风险等级,供下游流程使用:
json
{
"id": "5",
"subject": "添加用户认证功能",
"metadata": {
"risk_tier": "YELLOW",
"risk_reason": "修改了src/components/LoginForm.tsx(用户可见组件)",
"classified_at": "2026-02-07T22:00:00Z"
}
}未包含元数据的任务默认设为GREEN(向后兼容)。
risk_tierModule Reference
模块参考
- tier-definitions.md: Detailed tier criteria, boundaries, and override mechanism
- heuristic-classifier.md: File-pattern rules for automated classification
- verification-gates.md: Per-tier verification requirements and parallel safety matrix
- tier-definitions.md:详细的等级标准、边界及覆盖机制
- heuristic-classifier.md:用于自动分类的文件模式规则
- verification-gates.md:各等级的验证要求及并行安全矩阵
Integration Pattern
集成模式
yaml
undefinedyaml
undefinedIn your skill's frontmatter
在你的Skill前置声明中
dependencies: [leyline:risk-classification]
undefineddependencies: [leyline:risk-classification]
undefinedFor Task Generators
针对任务生成器
Append marker to task format:
[R:TIER]markdown
- [ ] T012 [P] [US1] [R:YELLOW] Create LoginForm component in src/components/LoginForm.tsx在任务格式中追加标记:
[R:TIER]markdown
- [ ] T012 [P] [US1] [R:YELLOW] 在src/components/LoginForm.tsx中创建LoginForm组件For Orchestrators
针对编排器
Check risk tier before task assignment:
if task.risk_tier in ["RED", "CRITICAL"]:
invoke Skill(attune:war-room-checkpoint) for RS scoring
if CRITICAL: require human approval before proceeding分配任务前检查风险等级:
if task.risk_tier in ["RED", "CRITICAL"]:
invoke Skill(attune:war-room-checkpoint) for RS scoring
if CRITICAL: require human approval before proceedingExit Criteria
退出标准
- Every task has a risk tier assigned (explicit or default GREEN)
- RED/CRITICAL tasks have war-room-checkpoint RS scores
- Verification gates passed for the assigned tier
- No parallel execution of prohibited tier combinations
- 所有任务均已分配风险等级(显式设置或默认GREEN)
- RED/CRITICAL任务已获得war-room-checkpoint的RS评分
- 已通过对应等级的验证关卡
- 不存在被禁止的等级组合并行执行情况