@aipper/aiws-spec 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/docs/cli-interface.md +10 -12
  2. package/docs/opencode-autonomous-swarm.md +178 -0
  3. package/docs/opencode-omo-adapter.md +123 -4
  4. package/docs/opencode-omo-validation-checklist.md +47 -0
  5. package/docs/opencode-subagent-first.md +187 -0
  6. package/docs/workflow-delegation-context-injection.md +217 -0
  7. package/docs/workflow-delegation-contracts.json +108 -2
  8. package/docs/workflow-delegation-contracts.md +13 -0
  9. package/docs/workflow-delegation-contracts.schema.json +152 -0
  10. package/docs/workflow-governance-rules.json +47 -6
  11. package/docs/workflow-governance-rules.md +8 -7
  12. package/docs/workflow-governance-rules.schema.json +39 -1
  13. package/docs/workflow-review-gates.json +6 -0
  14. package/docs/workflow-review-gates.md +14 -5
  15. package/docs/workflow-review-gates.schema.json +4 -0
  16. package/docs/workflow-router-rules.json +72 -8
  17. package/docs/workflow-router-rules.md +21 -14
  18. package/docs/workflow-router-rules.schema.json +4 -0
  19. package/docs/workflow-stage-contracts.json +24 -5
  20. package/docs/workflow-stage-contracts.md +16 -15
  21. package/docs/workflow-stage-contracts.schema.json +12 -1
  22. package/package.json +1 -1
  23. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +16 -10
  24. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +6 -118
  25. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +6 -218
  26. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +82 -141
  27. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +9 -204
  28. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +10 -44
  29. package/templates/workspace/.agents/skills/ws-migrate/SKILL.md +6 -42
  30. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +6 -58
  31. package/templates/workspace/.agents/skills/ws-pull/SKILL.md +8 -109
  32. package/templates/workspace/.agents/skills/ws-push/SKILL.md +8 -100
  33. package/templates/workspace/.agents/skills/ws-review/SKILL.md +6 -1
  34. package/templates/workspace/.agents/skills/ws-submodule-setup/SKILL.md +10 -57
  35. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +12 -53
  36. package/templates/workspace/{changes → .aiws/changes}/README.md +20 -23
  37. package/templates/workspace/{changes → .aiws/changes}/templates/proposal.md +12 -12
  38. package/templates/workspace/{changes → .aiws/changes}/templates/tasks.md +8 -8
  39. package/templates/workspace/{issues → .aiws/issues}/problem-issues.csv +1 -1
  40. package/templates/workspace/.aiws/journal/.gitkeep +1 -0
  41. package/templates/workspace/{requirements → .aiws/requirements}/requirements-issues.csv +1 -1
  42. package/templates/workspace/.aiws/tmp/.gitkeep +0 -0
  43. package/templates/workspace/{tools → .aiws/tools}/requirements_contract.py +2 -2
  44. package/templates/workspace/{tools → .aiws/tools}/requirements_contract_sync.py +2 -2
  45. package/templates/workspace/{tools → .aiws/tools}/requirements_flow_gen.py +1 -1
  46. package/templates/workspace/{tools → .aiws/tools}/server_test_runner.py +10 -10
  47. package/templates/workspace/{tools → .aiws/tools}/ws_change_check.py +23 -23
  48. package/templates/workspace/{tools → .aiws/tools}/ws_resolve_sub_target.sh +2 -2
  49. package/templates/workspace/{tools → .aiws/tools}/ws_tasks_plan.py +3 -3
  50. package/templates/workspace/.claude/commands/ws-review.md +5 -1
  51. package/templates/workspace/.claude/settings.json.example +26 -0
  52. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +6 -118
  53. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +6 -218
  54. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +52 -141
  55. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +9 -204
  56. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +10 -44
  57. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +6 -42
  58. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +6 -49
  59. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +8 -109
  60. package/templates/workspace/.claude/skills/ws-push/SKILL.md +8 -100
  61. package/templates/workspace/.claude/skills/ws-review/SKILL.md +6 -1
  62. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +10 -57
  63. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +12 -53
  64. package/templates/workspace/.githooks/pre-commit +13 -0
  65. package/templates/workspace/.githooks/pre-push +7 -0
  66. package/templates/workspace/.opencode/command/ws-auto.md +33 -0
  67. package/templates/workspace/.opencode/command/ws-autonomy.md +25 -0
  68. package/templates/workspace/.opencode/command/ws-review.md +5 -1
  69. package/templates/workspace/.opencode/commands/ws-auto.md +33 -0
  70. package/templates/workspace/.opencode/commands/ws-autonomy.md +25 -0
  71. package/templates/workspace/.opencode/commands/ws-commit.md +4 -56
  72. package/templates/workspace/.opencode/commands/ws-deliver.md +10 -50
  73. package/templates/workspace/.opencode/commands/ws-finish.md +11 -3
  74. package/templates/workspace/.opencode/commands/ws-handoff.md +9 -17
  75. package/templates/workspace/.opencode/commands/ws-migrate.md +10 -17
  76. package/templates/workspace/.opencode/commands/ws-plan-verify.md +5 -15
  77. package/templates/workspace/.opencode/commands/ws-pull.md +6 -75
  78. package/templates/workspace/.opencode/commands/ws-push.md +7 -82
  79. package/templates/workspace/.opencode/commands/ws-review.md +5 -1
  80. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +8 -47
  81. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +10 -19
  82. package/templates/workspace/.opencode/helpers/approval-whitelist-check.sh +148 -0
  83. package/templates/workspace/.opencode/helpers/approval-whitelist-run.sh +82 -0
  84. package/templates/workspace/.opencode/helpers/approval-whitelist-watchdog.sh +144 -0
  85. package/templates/workspace/.opencode/helpers/tmux-swarm-rescue.sh +56 -0
  86. package/templates/workspace/.opencode/helpers/tmux-swarm-scan.sh +46 -0
  87. package/templates/workspace/.opencode/lib/aiws-context.js +953 -0
  88. package/templates/workspace/.opencode/oh-my-opencode.json.example +64 -4
  89. package/templates/workspace/.opencode/plugins/aiws-inject-context.js +201 -0
  90. package/templates/workspace/.opencode/plugins/aiws-session-start.js +86 -0
  91. package/templates/workspace/.opencode/plugins/aiws-workflow-state.js +116 -0
  92. package/templates/workspace/.opencode/scripts/ws-plan-gen-submodule-targets.sh +27 -0
  93. package/templates/workspace/.opencode/scripts/ws-plan-setup-worktree.sh +31 -0
  94. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +130 -77
  95. package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +1 -1
  96. package/templates/workspace/.opencode/skills/ws-auto/SKILL.md +46 -0
  97. package/templates/workspace/.opencode/skills/ws-autonomy/SKILL.md +62 -0
  98. package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +1 -1
  99. package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +6 -118
  100. package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +115 -40
  101. package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +6 -218
  102. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +105 -146
  103. package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +23 -7
  104. package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +9 -204
  105. package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +1 -1
  106. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +10 -44
  107. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +43 -4
  108. package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +6 -42
  109. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +15 -55
  110. package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +6 -49
  111. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +1 -1
  112. package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +8 -109
  113. package/templates/workspace/.opencode/skills/ws-push/SKILL.md +8 -100
  114. package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +7 -2
  115. package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +1 -1
  116. package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +1 -1
  117. package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +1 -1
  118. package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +1 -1
  119. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +1 -1
  120. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +35 -4
  121. package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +1 -1
  122. package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +1 -1
  123. package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +10 -57
  124. package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +45 -55
  125. package/templates/workspace/AGENTS.md +32 -84
  126. package/templates/workspace/AI_PROJECT.md +5 -5
  127. package/templates/workspace/AI_WORKSPACE.md +1 -1
  128. package/templates/workspace/REQUIREMENTS.md +1 -1
  129. package/templates/workspace/gitignore +1 -1
  130. package/templates/workspace/manifest.json +215 -395
  131. /package/templates/workspace/{changes → .aiws/changes}/templates/design.md +0 -0
  132. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/README.md +0 -0
  133. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/architecture.md +0 -0
  134. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/implementation-plan.md +0 -0
  135. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/progress.md +0 -0
  136. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/tech-stack.md +0 -0
  137. /package/templates/workspace/{requirements → .aiws/requirements}/CHANGELOG.md +0 -0
  138. /package/templates/workspace/{secrets → .aiws/secrets}/test-accounts.example.json +0 -0
@@ -0,0 +1,217 @@
1
+ # Workflow Delegation Context Injection
2
+
3
+ <!-- Managed by aiws. Do not hand edit. -->
4
+
5
+ **规范 ID**: `workflow-delegation-context-injection`
6
+ **版本**: 1
7
+
8
+ ## 目的
9
+
10
+ 定义 delegation 场景下,主 agent(integrator)如何为子 agent(delegated subagent)**策划并交付上下文**,让子 agent 在第一次尝试时就能获取到正确的约束与信息,减少因遗漏关键文件导致的重试与审查循环。
11
+
12
+ 本规范的适用范围:
13
+ - 主 agent 派遣 worker / reviewer / explorer 等子 agent 前
14
+ - 需要明确告知子 agent 项目约束、委托合同、分配模块、计划文件与相关分析成果时
15
+ - 上下文超出子 agent prompt 容量时(通过 sections + priority 管理预算)
16
+
17
+ **非目标**:
18
+ - 替代子 agent 自身的代码搜索能力(grep / glob / 文件遍历)
19
+ - 保证子 agent 一定读取并理解所有注入的上下文(最终依赖 LLM 遵从度)
20
+
21
+ ## 上下文文件格式
22
+
23
+ ### 定义
24
+
25
+ 上下文信息通过一个 **JSONL(JSON Lines)** 文件传递。每行一个 JSON 对象,代表一个需要子 agent 读取的引用文件。
26
+
27
+ 文件命名约定:
28
+
29
+ ```
30
+ changes/<id>/analysis/<role>-context.jsonl
31
+ ```
32
+
33
+ 其中:
34
+ - `<id>`:当前 change 的 identifier
35
+ - `<role>`:子 agent 的角色(worker / explorer / reviewer / planner / integrator)
36
+
37
+ ### 字段定义
38
+
39
+ | 字段 | 必需 | 类型 | 描述 |
40
+ |------|------|------|------|
41
+ | `file` | ✅ | `string` | 相对于仓库根的文件路径 |
42
+ | `reason` | ✅ | `string` | **为什么此文件相关**。子 agent 通过此字段理解该文件的阅读目的与上下文锚点。应包含具体条款引用或原因说明 |
43
+ | `sections` | ❌ | `[[int,int], ...]` | 针对大文件的精确行范围(1-indexed)。缺省或 `null` 表示读取整个文件 |
44
+ | `priority` | ✅ | `"high" \| "medium" \| "low"` | 上下文预算管理。子 agent 按优先级顺序读取;窗口不足时可跳过低优先级 |
45
+ | `kind` | ❌ | `string` | 认知分类标签。帮助子 agent 理解阅读目的(约束型 vs 实现型 vs 历史型)。可选值见下方 |
46
+
47
+ ### 可选 kind 值
48
+
49
+ | kind | 含义 | 示例文件 |
50
+ |------|------|----------|
51
+ | `truth` | 项目真值、约束、规则 | `AI_PROJECT.md`, `REQUIREMENTS.md` |
52
+ | `contract` | 委托合同、角色边界 | `workflow-delegation-contracts.md` |
53
+ | `adapter` | 工具适配规则 | `opencode-omo-adapter.md` |
54
+ | `assigned` | 本次分配的模块代码 | `src/auth/login.ts` |
55
+ | `plan` | 变更计划 | `changes/<id>/plan/session-*.md` |
56
+ | `analysis` | 影响分析、方案分析 | `changes/<id>/analysis/impact.md` |
57
+ | `evidence` | 验证证据基线 | `changes/<id>/evidence/*.md` |
58
+ | `handoff` | 交接说明 | `changes/<id>/handoff.md` |
59
+
60
+ ### 完整示例
61
+
62
+ ```jsonl
63
+ {"file":"AI_PROJECT.md","reason":"第25-50行:安全与边界强制条款;第95-106行:产物与证据强制条款","sections":[[25,50],[95,106]],"priority":"high","kind":"truth"}
64
+ {"file":"packages/spec/docs/workflow-delegation-contracts.md","reason":"Worker 角色的 readScope/writeScope/artifactTargets 边界定义(第84-107行);通用规则(第236-243行)","sections":[[84,107],[236,243]],"priority":"high","kind":"contract"}
65
+ {"file":"packages/spec/docs/opencode-omo-adapter.md","reason":"委托给 oMo agent 时的回退规则与执行约定","sections":[[1,30],[245,254]],"priority":"medium","kind":"adapter"}
66
+ {"file":"src/auth/login.ts","reason":"分配的模块——身份验证核心逻辑:LoginService.login() 方法","sections":null,"priority":"high","kind":"assigned"}
67
+ {"file":"changes/demo-change/plan/session-20260515-auth-refactor.md","reason":"变更计划——目标/非目标/范围/步骤/验证命令","sections":null,"priority":"high","kind":"plan"}
68
+ {"file":"changes/demo-change/analysis/impact.md","reason":"影响分析——调用 login() 的所有函数清单及调用链","sections":null,"priority":"medium","kind":"analysis"}
69
+ {"file":"changes/demo-change/evidence/pre-refactor-test-run.md","reason":"重构前测试基线——当前测试通过状态与覆盖率","sections":null,"priority":"low","kind":"evidence"}
70
+ ```
71
+
72
+ ## OpenCode 插件集成
73
+
74
+ aiws 提供了两个 OpenCode 插件,自动实现上下文注入:
75
+
76
+ ### aiws-session-start(chat.message hook)
77
+
78
+ 每个新会话启动时,自动读取当前 change 上下文、项目真值、规范索引,并注入到第一条用户消息中。
79
+
80
+ **注入内容**:
81
+ - `<aiws-context>` 声明块
82
+ - `getContextSummary()` 输出(change ID、绑定状态等)
83
+ - `getSpecIndex()` 输出(可用的规范索引清单)
84
+ - 可用 spec discovery 提示
85
+
86
+ 当插件被激活时,主 agent 启动会话即获得项目状态概览,无需手动阅读真值文件。
87
+
88
+ ### aiws-inject-context(tool.execute.before hook)
89
+
90
+ 当 `task()` 调用且 prompt 中包含 `role: <role>` 标记时自动拦截,读取 `changes/<id>/analysis/<role>-context.jsonl` 并注入到子 agent prompt。
91
+
92
+ **自动注入内容**:
93
+ 1. JSONL 中引用的每个文件内容(按 priority 排序)
94
+ 2. `<aiws-context-injection>` 头部(含 role、context file 路径、entry 数量)
95
+ 3. 粘性指令:要求子 agent 先读上下文文件再工作
96
+
97
+ 当插件被激活时,主 agent 不需要手动粘性指令模板——插件会自动生成。
98
+
99
+ ### 配置方法
100
+
101
+ 本地插件放在 `.opencode/plugins/` 后由 OpenCode 启动时自动加载;`.opencode/opencode.json` 仅保留合法 schema 声明,若需要显式注册 npm/远程插件则使用 OpenCode 1.15 的 `plugin`(单数)字段。
102
+
103
+ ## 策展流程
104
+
105
+ 上下文文件由委托者在派遣子 agent 前通过**三层混合模式**策展:
106
+
107
+ ### 第 0 层:静态基线(合同定义)
108
+
109
+ `workflow-delegation-contracts.json` 中每个角色类型(`roleTypes[]`)可选的 `contextFiles` 属性定义了该角色**总是需要**的上下文基线。使用 glob 模式表达。
110
+
111
+ 示例(worker 角色):
112
+
113
+ ```json
114
+ "contextFiles": [
115
+ {"glob": "AI_PROJECT.md", "sections": [[25, 50], [95, 106]], "priority": "high", "kind": "truth"},
116
+ {"glob": "REQUIREMENTS.md", "sections": [[1, 100]], "priority": "high", "kind": "truth"},
117
+ {"glob": "AI_WORKSPACE.md", "priority": "medium", "kind": "truth"},
118
+ {"glob": "packages/spec/docs/workflow-delegation-contracts.md", "sections": [[84, 107], [236, 243]], "priority": "high", "kind": "contract"},
119
+ {"glob": "changes/<id>/plan/*.md", "priority": "high", "kind": "plan"},
120
+ {"glob": "changes/<id>/analysis/*.md", "priority": "medium", "kind": "analysis"},
121
+ {"glob": "changes/<id>/evidence/*.md", "priority": "low", "kind": "evidence"}
122
+ ]
123
+ ```
124
+
125
+ ### 第 1 层:自动展开(预派遣)
126
+
127
+ 在派遣子 agent 前,主 agent 或预派遣脚本执行:
128
+ 1. 读取角色的 `contextFiles` 条目
129
+ 2. 将 `<id>` 替换为实际 change-id
130
+ 3. 将 glob 模式展开为具体文件路径(使用 `glob` 工具)
131
+ 4. 从 `writeScope` / `readScope` 推导"分配的模块",添加 `kind: "assigned"` 条目
132
+ 5. 输出 JSONL 基线
133
+
134
+ ### 第 2 层:委托者覆盖(手工调整)
135
+
136
+ 主 agent(integrator)在写入前:
137
+ 1. 添加任务特定的文件(如当前 plan 文件、新影响分析)
138
+ 2. 删除不相关的条目(如旧的分析/证据文件)
139
+ 3. 重新排序或调整 priority/sections
140
+ 4. 执行预算检查(见下文)
141
+ 5. 写入 `changes/<id>/analysis/<role>-context.jsonl`
142
+
143
+ ### 策展决策记录
144
+
145
+ 当策展过程产生非平凡决策时(如删除了 3 个文件、将某个文件从 high 降为 medium),应在 JSONL 文件头部以 JSON 注释形式记录:
146
+
147
+ ```jsonl
148
+ // curation: trimmed from 8 to 5 files; excluded changes/demo/evidence/stale-test.md (unrelated)
149
+ // curation: downgraded changes/demo/analysis/impact.md from high to medium (too broad; only lines 50-70 relevant)
150
+ ```
151
+
152
+ ## 上下文预算管理
153
+
154
+ 子 agent 的上下文窗口有限。策展者必须执行预算检查:
155
+
156
+ ### 预算规则
157
+
158
+ 1. **5 文件软上限**:统计 `priority=high` + `medium` 的文件数。若超过 5 个,删除所有 `low` 条目并输出警告
159
+ 2. **4000 行硬上限**:估算每个文件的真实行数(通过 `git show HEAD:<path> \| wc -l` 或类似命令)。若总行数超过 4000:
160
+ - 优先用 `sections` 缩小范围
161
+ - 若仍超出,删除所有 `medium`,仅保留 `high`
162
+ - 若无法切分,考虑将任务拆分为更小的子任务
163
+ 3. **零文件阻断**:若最终文件数 = 0,返回 `BLOCKED`,不派遣
164
+
165
+ ### 优先级回退顺序
166
+
167
+ 子 agent 应按照 `priority` 顺序读取文件:
168
+ 1. 先读取所有 `high` 文件
169
+ 2. 若上下文窗口允许,再读取 `medium`
170
+ 3. 若窗口仍有空间,最后读取 `low`
171
+
172
+ 当文件内容超出子 agent 上下文时,子 agent 可选择:
173
+ - 仅读取指定 sections(若有提供)
174
+ - 仅读取文件的开头部分(若未指定 sections)
175
+ - 跳过 `low` 优先级并记录"上下文预算超限,已跳过下列文件:..."
176
+
177
+ ## 粘性指令模板
178
+
179
+ 当主 agent 通过 `task()` 调用派遣子 agent 时,子 agent prompt 的**第一条指令**必须包含以下内容:
180
+
181
+ ```
182
+ ## ⚠️ 上下文文件(必需——开始任何工作前执行)
183
+
184
+ 你必须首先读取 `{contextJsonlPath}`。此文件列出你必须在开始工作前了解的文件,包括项目约束、委托合同、变更计划与分配模块。
185
+
186
+ **执行步骤**:
187
+ 1. 使用 Read 工具打开 JSONL 文件
188
+ 2. 按 priority 顺序读取每个文件(high → medium → low)
189
+ 3. 若文件有 `sections` 字段且行数超过 200,仅读取指定行范围
190
+ 4. 若无法访问任何文件,返回 `NEEDS_CONTEXT`——立即停止,不要猜测内容
191
+
192
+ **确认(你的第一条回复)**:
193
+ 列出你已读取的文件及每个文件的关键要点(≤3 要点/文件)。
194
+ ```
195
+
196
+ ## 与委托合同的关系
197
+
198
+ | | 委托合同(delegation-contracts.json) | 上下文文件(<role>-context.jsonl) |
199
+ |---|---|---|
200
+ | **目的** | 定义角色的**总是需要什么**(团队共识、静态知识) | 定义**本次派遣需要什么**(任务特定、运行时) |
201
+ | **内容** | glob 模式 + 默认 sections/priority/kind | 展开的具体文件路径 + 委托者调整后的信息 |
202
+ | **生命周期** | 跨项目、跨会话不变 | 每次派遣重新生成 |
203
+ | **提交到 git?** | 是(在 `packages/spec/`) | 是(在 `changes/<id>/analysis/`) |
204
+ | **谁维护** | 项目维护者 | 委托者(主 agent) |
205
+
206
+ 委托合同定义"规则",上下文文件是规则的运行时实例化。合同中的 `contextFiles` 是**可选**字段——未填充时,系统行为与现有完全一致。
207
+
208
+ ## 安全注意事项
209
+
210
+ 1. **JSONL 不应包含 secrets 引用**——委托者策展时不能将 `secrets/`、`.env*`、token 等路径写入 JSONL
211
+ 2. **子 agent 无法访问 JSONL 时的处理**——返回 `NEEDS_CONTEXT`,后续见 Subagent Status Protocol 的 BLOCKED/NEEDS_CONTEXT 处理
212
+ 3. **JSONL 文件本身是 change 工件**——提交在 `changes/<id>/analysis/` 中,使审计者可以追溯"子 agent 被赋予了怎样的上下文"
213
+
214
+ ## 更新历史
215
+
216
+ - v1 (2026-05-15): 初版。基于 trellis 的 JSONL 上下文注入模式 + aiws delegation contract 三层策展模型设计。
217
+ - v1.1 (2026-05-15): 新增 OpenCode 插件集成描述(aiws-session-start / aiws-inject-context)并移除"不提供平台级 hooks"的约束。
@@ -22,6 +22,11 @@
22
22
  "action": "根据任务性质选择 `planner / explorer / worker / reviewer / integrator` 角色,而不是把所有子任务都视为同一种 agent。",
23
23
  "why": "不同角色的读写权限、输出契约与收敛方式不同。"
24
24
  },
25
+ {
26
+ "step": "curate_context",
27
+ "action": "为子 agent 策划上下文文件(changes/<id>/analysis/<role>-context.jsonl),参阅 workflow-delegation-context-injection.md。",
28
+ "why": "子 agent 在第一次尝试时拿到正确的上下文,减少重试与审查循环。"
29
+ },
25
30
  {
26
31
  "step": "limit_scope",
27
32
  "action": "为每个委托声明 `readScope` / `writeScope` / `artifactTargets`,超出范围必须回退给主 agent。",
@@ -60,6 +65,13 @@
60
65
  "handoffRequirements": [
61
66
  "写明目标、非目标、范围、验证方式",
62
67
  "写明每个后续委托角色的 scope 边界"
68
+ ],
69
+ "contextFiles": [
70
+ {"glob": "AI_PROJECT.md", "priority": "high", "kind": "truth"},
71
+ {"glob": "REQUIREMENTS.md", "priority": "high", "kind": "truth"},
72
+ {"glob": "AI_WORKSPACE.md", "priority": "medium", "kind": "truth"},
73
+ {"glob": "changes/<id>/analysis/*.md", "priority": "medium", "kind": "analysis"},
74
+ {"glob": "changes/<id>/evidence/verify-before-complete.md", "priority": "low", "kind": "evidence"}
63
75
  ]
64
76
  },
65
77
  {
@@ -79,6 +91,11 @@
79
91
  "handoffRequirements": [
80
92
  "结论必须附来源文件或路径",
81
93
  "对不确定项要显式标注风险或缺口"
94
+ ],
95
+ "contextFiles": [
96
+ {"glob": "AI_PROJECT.md", "sections": [[25, 50], [95, 106]], "priority": "high", "kind": "truth"},
97
+ {"glob": "changes/<id>/plan/*.md", "priority": "high", "kind": "plan"},
98
+ {"glob": "changes/<id>/analysis/*.md", "priority": "medium", "kind": "analysis"}
82
99
  ]
83
100
  },
84
101
  {
@@ -104,6 +121,16 @@
104
121
  "handoffRequirements": [
105
122
  "写清改动文件、验证命令、未完成项",
106
123
  "不得越过显式授权的写入范围"
124
+ ],
125
+ "contextFiles": [
126
+ {"glob": "AI_PROJECT.md", "sections": [[25, 50], [95, 106]], "priority": "high", "kind": "truth"},
127
+ {"glob": "REQUIREMENTS.md", "sections": [[1, 100]], "priority": "high", "kind": "truth"},
128
+ {"glob": "AI_WORKSPACE.md", "priority": "medium", "kind": "truth"},
129
+ {"glob": "packages/spec/docs/workflow-delegation-contracts.md", "sections": [[84, 107], [236, 243]], "priority": "high", "kind": "contract"},
130
+ {"glob": "packages/spec/docs/workflow-delegation-context-injection.md", "priority": "high", "kind": "contract"},
131
+ {"glob": "changes/<id>/plan/*.md", "priority": "high", "kind": "plan"},
132
+ {"glob": "changes/<id>/analysis/*.md", "priority": "medium", "kind": "analysis"},
133
+ {"glob": "changes/<id>/evidence/*.md", "priority": "low", "kind": "evidence"}
107
134
  ]
108
135
  },
109
136
  {
@@ -125,7 +152,16 @@
125
152
  ],
126
153
  "handoffRequirements": [
127
154
  "先列 findings,再给假设或残余风险",
155
+ "产出结构化 findings:[Critical] 阻塞问题;[Warning] 应修复项;[Info] 建议改进(对齐 reworkLoopProtocol.findingSeverities)",
128
156
  "明确这是 spec review、quality review 还是交付前验证"
157
+ ],
158
+ "contextFiles": [
159
+ {"glob": "AI_PROJECT.md", "sections": [[25, 50], [95, 106]], "priority": "high", "kind": "truth"},
160
+ {"glob": "REQUIREMENTS.md", "priority": "high", "kind": "truth"},
161
+ {"glob": "changes/<id>/plan/*.md", "priority": "high", "kind": "plan"},
162
+ {"glob": "changes/<id>/analysis/*.md", "priority": "medium", "kind": "analysis"},
163
+ {"glob": "changes/<id>/patches/*.patch", "priority": "high", "kind": "assigned"},
164
+ {"glob": "changes/<id>/evidence/*.md", "priority": "medium", "kind": "evidence"}
129
165
  ]
130
166
  },
131
167
  {
@@ -152,7 +188,8 @@
152
188
  ],
153
189
  "handoffRequirements": [
154
190
  "收敛 delegated outputs,给出最终结论与残余风险",
155
- "确认验证、review gate 与 artifact 状态"
191
+ "确认验证、review gate 与 artifact 状态",
192
+ "记录每轮 rework 回合数、已修复/剩余 Critical 与 Warning 数量(对齐 reworkLoopProtocol.handoffRecording)"
156
193
  ]
157
194
  }
158
195
  ],
@@ -207,6 +244,46 @@
207
244
  "changes/<id>/evidence/verify-before-complete.md"
208
245
  ]
209
246
  },
247
+ "subagentStatusProtocol": {
248
+ "title": "Subagent Status Protocol",
249
+ "description": "四状态返回协议:定义 subagent 完成后返回的状态值及主 agent 的处理动作。",
250
+ "states": [
251
+ { "status": "DONE", "meaning": "任务完成 + 验证通过 + 证据路径有效", "allowedNextRoles": ["reviewer", "integrator"] },
252
+ { "status": "DONE_WITH_CONCERNS", "meaning": "实现完成但边角情况未全覆盖 / 质量有残余风险", "allowedNextRoles": ["reviewer"] },
253
+ { "status": "NEEDS_CONTEXT", "meaning": "subagent 从给定 scope 无法继续,缺关键上下文", "allowedNextRoles": ["planner", "explorer"] },
254
+ { "status": "BLOCKED", "meaning": "治理规则阻断(缺工件、dirty 工作区、validate 失败等)", "allowedNextRoles": ["integrator"] }
255
+ ],
256
+ "handlerResponses": [
257
+ { "forStatus": "DONE", "response": "进入 ws-review; 若已过 review 则准备 ws-finish" },
258
+ { "forStatus": "DONE_WITH_CONCERNS", "response": "先执行 ws-quality-review,根据残余风险决定是否阻断 ws-finish" },
259
+ { "forStatus": "NEEDS_CONTEXT", "response": "主 agent 补充缺失上下文后重新委托同一 subagent(最多 2 次);若仍 NEEDS_CONTEXT → 回退单 agent" },
260
+ { "forStatus": "BLOCKED", "response": "停止委托流程;输出 blocker 详情;主 agent 解 blocker 后重试" }
261
+ ]
262
+ },
263
+ "reworkLoopProtocol": {
264
+ "title": "Rework Loop Protocol",
265
+ "description": "结构化反馈环:reviewer findings → worker fix → re-review,最多 2 轮",
266
+ "maxRounds": 2,
267
+ "findingSeverities": ["Critical", "Warning", "Info"],
268
+ "workerFixContract": "worker 接收结构化 fix list,只修 Critical + Warning;info 由 integrator 处理",
269
+ "handoffRecording": "每轮结束后 handoff.md 必须记录 roundNumber、criticalFixed、criticalRemaining、warningFixed、warningRemaining、infoCount",
270
+ "escalationRule": "2 轮后仍有 Critical → 升级给 integrator 做人类决策,不得无限循环",
271
+ "mainSessionRule": "即使是 review 建议的小修,也应由 worker subagent 执行;例外:用户明确说'你直接改'"
272
+ },
273
+ "workflowPatterns": [
274
+ {
275
+ "id": "worker_reviewer_loop",
276
+ "description": "默认实现审查闭环:worker dispatch → status check → reviewer dispatch → pass/fail → loop back to worker if fail",
277
+ "steps": [
278
+ { "step": "dispatch_worker", "action": "主 session 策展上下文后派发 aiws-worker", "input": "curated JSONL context + plan", "output": "worker status + patches/ + evidence/" },
279
+ { "step": "check_worker_status", "action": "检查 worker 返回状态", "condition": "DONE → 进入 dispatch_reviewer; DONE_WITH_CONCERNS → 先 ws-quality-review; NEEDS_CONTEXT → 补充上下文重试; BLOCKED → 升级给人类" },
280
+ { "step": "dispatch_reviewer", "action": "派发 aiws-reviewer 审查实现", "input": "patches/ + analysis/ + evidence/", "output": "reviewer findings + pass/fail" },
281
+ { "step": "check_reviewer_result", "action": "审查结果判定", "condition": "pass → 主 session 收敛准备 ws-finish; fail → 返回 worker 修复(最多 3 次循环)" },
282
+ { "step": "loop_back_worker", "action": "reviewer fail 后返回 worker 修复", "maxRetries": 3, "fallback": "升级给人类决策" },
283
+ { "step": "converge", "action": "主 session 收敛最终 patch + evidence + review 到 changes/<id>/", "output": "changes/<id>/evidence/*.md + changes/<id>/review/*.md" }
284
+ ]
285
+ }
286
+ ],
210
287
  "fallbackMode": {
211
288
  "default": "single_agent_with_artifacts",
212
289
  "triggers": [
@@ -262,13 +339,42 @@
262
339
  "universalRules": [
263
340
  "delegation 必须先绑定 `Req_ID` / change / Verify 入口,不能绕过真值文件。",
264
341
  "主 agent 必须显式说明每个 sub-task 的角色、scope、产物目标与收敛方式。",
342
+ "主 agent 必须在派遣前执行上下文策展并写入 JSONL 上下文文件。",
265
343
  "除显式授权的 worker/integrator 外,delegated agent 默认不直接写业务文件。",
266
344
  "任何 native multi-agent 结果都必须能回收到 `analysis/patches/review/evidence` 约定路径。",
267
345
  "native delegation 是可选执行策略,不是 workflow 的必需前提。"
268
346
  ],
347
+ "standardRoles": {
348
+ "title": "Standard Roles (Recommended)",
349
+ "description": "推荐的标准角色定义,供 delegation 场景使用。每个角色有明确的读写权限和产物目标。",
350
+ "roles": [
351
+ {
352
+ "id": "implementer",
353
+ "description": "在授权范围内实现代码改动,补齐测试与验证证据",
354
+ "readAccess": ["AI_PROJECT.md", "REQUIREMENTS.md", "AI_WORKSPACE.md", "changes/<id>/plan/", "changes/<id>/analysis/"],
355
+ "writeAccess": ["assigned source files", "assigned test files", "changes/<id>/evidence/"],
356
+ "artifacts": ["code files", "test files", "changes/<id>/evidence/*.md"]
357
+ },
358
+ {
359
+ "id": "reviewer",
360
+ "description": "从需求、实现质量、回归风险角度独立审查,产出结构化 findings",
361
+ "readAccess": ["AI_PROJECT.md", "REQUIREMENTS.md", "git diff", "changes/<id>/evidence/"],
362
+ "writeAccess": ["changes/<id>/review/"],
363
+ "artifacts": ["changes/<id>/review/*.md"]
364
+ },
365
+ {
366
+ "id": "researcher",
367
+ "description": "只读探索代码库与外部文档,输出分析笔记与影响面评估",
368
+ "readAccess": ["AI_PROJECT.md", "REQUIREMENTS.md", "AI_WORKSPACE.md", "repo source files", "external docs"],
369
+ "writeAccess": ["changes/<id>/analysis/"],
370
+ "artifacts": ["changes/<id>/analysis/*.md"]
371
+ }
372
+ ]
373
+ },
269
374
  "notes": [
270
375
  "`aiws` 的价值在于治理内核和合同层,不在于成为统一 runtime。",
271
376
  "这一版先把 contract 写清,再决定哪些入口需要在模板里显式投影。",
272
- "后续若工具原生能力变化,只需要更新 capability matrix 与适配策略,不需要重写 workflow 真值。"
377
+ "后续若工具原生能力变化,只需要更新 capability matrix 与适配策略,不需要重写 workflow 真值。",
378
+ "v1.1: 新增 curate_context 流程步骤 + roleTypes[].contextFiles 基线 + 上下文策展 universal 规则。"
273
379
  ]
274
380
  }
@@ -22,6 +22,7 @@ delegation contract 在做任何角色拆分或原生多 agent 调用前,必
22
22
  | --- | --- | --- |
23
23
  | `bind_task` | 先把任务绑定到 `Req_ID` / change / Verify 入口,再决定是否允许委托。 | 没有绑定的委托只会扩大漂移;delegation 不能绕过真值入口。 |
24
24
  | `select_role` | 根据任务性质选择 `planner / explorer / worker / reviewer / integrator` 角色,而不是把所有子任务都视为同一种 agent。 | 不同角色的读写权限、输出契约与收敛方式不同。 |
25
+ | `curate_context` | 为子 agent 策划上下文文件(changes/<id>/analysis/<role>-context.jsonl),参阅 workflow-delegation-context-injection.md。 | 子 agent 在第一次尝试时拿到正确的上下文,减少重试与审查循环。 |
25
26
  | `limit_scope` | 为每个委托声明 `readScope` / `writeScope` / `artifactTargets`,超出范围必须回退给主 agent。 | native 多 agent 的最大风险是越界写盘;scope 必须先于执行。 |
26
27
  | `converge_outputs` | 把委托结果统一收敛到 `analysis/`、`patches/`、`review/`、`evidence/` 或明确允许的代码写入范围。 | 即使执行方式不同,交付证据与审计路径必须一致。 |
27
28
  | `fallback_or_integrate` | 原生能力不可用、权限不满足或结果不可靠时,回退到单 agent / 手工委托;由主 agent 负责最终整合。 | `aiws` 的职责是治理和降级,不是保证每个工具都支持同一套运行时。 |
@@ -131,6 +132,7 @@ delegation contract 在做任何角色拆分或原生多 agent 调用前,必
131
132
  **Handoff Requirements**
132
133
 
133
134
  - 先列 findings,再给假设或残余风险
135
+ - 产出结构化 findings:[Critical] 阻塞问题;[Warning] 应修复项;[Info] 建议改进(对齐 reworkLoopProtocol.findingSeverities)
134
136
  - 明确这是 spec review、quality review 还是交付前验证
135
137
 
136
138
  ### `integrator`
@@ -163,6 +165,15 @@ delegation contract 在做任何角色拆分或原生多 agent 调用前,必
163
165
 
164
166
  - 收敛 delegated outputs,给出最终结论与残余风险
165
167
  - 确认验证、review gate 与 artifact 状态
168
+ - 记录每轮 rework 回合数、已修复/剩余 Critical 与 Warning 数量(对齐 reworkLoopProtocol.handoffRecording)
169
+
170
+ ## Standard Roles (Recommended)
171
+
172
+ | Role | Description | Read | Write | Artifacts |
173
+ | --- | --- | --- | --- | --- |
174
+ | `implementer` | 在授权范围内实现代码改动,补齐测试与验证证据 | `AI_PROJECT.md`, `REQUIREMENTS.md`, `AI_WORKSPACE.md`, `changes/<id>/plan/`, `changes/<id>/analysis/` | `assigned source files`, `assigned test files`, `changes/<id>/evidence/` | `code files`, `test files`, `changes/<id>/evidence/*.md` |
175
+ | `reviewer` | 从需求、实现质量、回归风险角度独立审查,产出结构化 findings | `AI_PROJECT.md`, `REQUIREMENTS.md`, `git diff`, `changes/<id>/evidence/` | `changes/<id>/review/` | `changes/<id>/review/*.md` |
176
+ | `researcher` | 只读探索代码库与外部文档,输出分析笔记与影响面评估 | `AI_PROJECT.md`, `REQUIREMENTS.md`, `AI_WORKSPACE.md`, `repo source files`, `external docs` | `changes/<id>/analysis/` | `changes/<id>/analysis/*.md` |
166
177
 
167
178
  ## Artifact Targets
168
179
 
@@ -237,6 +248,7 @@ delegation contract 在做任何角色拆分或原生多 agent 调用前,必
237
248
 
238
249
  - delegation 必须先绑定 `Req_ID` / change / Verify 入口,不能绕过真值文件。
239
250
  - 主 agent 必须显式说明每个 sub-task 的角色、scope、产物目标与收敛方式。
251
+ - 主 agent 必须在派遣前执行上下文策展并写入 JSONL 上下文文件。
240
252
  - 除显式授权的 worker/integrator 外,delegated agent 默认不直接写业务文件。
241
253
  - 任何 native multi-agent 结果都必须能回收到 `analysis/patches/review/evidence` 约定路径。
242
254
  - native delegation 是可选执行策略,不是 workflow 的必需前提。
@@ -246,3 +258,4 @@ delegation contract 在做任何角色拆分或原生多 agent 调用前,必
246
258
  - `aiws` 的价值在于治理内核和合同层,不在于成为统一 runtime。
247
259
  - 这一版先把 contract 写清,再决定哪些入口需要在模板里显式投影。
248
260
  - 后续若工具原生能力变化,只需要更新 capability matrix 与适配策略,不需要重写 workflow 真值。
261
+ - v1.1: 新增 curate_context 流程步骤 + roleTypes[].contextFiles 基线 + 上下文策展 universal 规则。
@@ -10,6 +10,8 @@
10
10
  "roleTypes",
11
11
  "artifactTargets",
12
12
  "reviewConvergence",
13
+ "subagentStatusProtocol",
14
+ "reworkLoopProtocol",
13
15
  "fallbackMode",
14
16
  "toolCapabilityMatrix",
15
17
  "universalRules",
@@ -71,6 +73,30 @@
71
73
  "type": "array",
72
74
  "minItems": 1,
73
75
  "items": { "type": "string", "minLength": 1 }
76
+ },
77
+ "contextFiles": {
78
+ "type": "array",
79
+ "minItems": 1,
80
+ "items": {
81
+ "type": "object",
82
+ "required": ["glob", "priority", "kind"],
83
+ "properties": {
84
+ "glob": { "type": "string", "minLength": 1 },
85
+ "sections": {
86
+ "type": "array",
87
+ "minItems": 1,
88
+ "items": {
89
+ "type": "array",
90
+ "minItems": 2,
91
+ "maxItems": 2,
92
+ "items": { "type": "integer", "minimum": 1 }
93
+ }
94
+ },
95
+ "priority": { "type": "string", "enum": ["high", "medium", "low"] },
96
+ "kind": { "type": "string", "minLength": 1 }
97
+ },
98
+ "additionalProperties": false
99
+ }
74
100
  }
75
101
  },
76
102
  "additionalProperties": false
@@ -121,6 +147,65 @@
121
147
  },
122
148
  "additionalProperties": false
123
149
  },
150
+ "subagentStatusProtocol": {
151
+ "type": "object",
152
+ "required": ["title", "description", "states", "handlerResponses"],
153
+ "properties": {
154
+ "title": { "type": "string", "minLength": 1 },
155
+ "description": { "type": "string", "minLength": 1 },
156
+ "states": {
157
+ "type": "array",
158
+ "minItems": 4,
159
+ "items": {
160
+ "type": "object",
161
+ "required": ["status", "meaning", "allowedNextRoles"],
162
+ "properties": {
163
+ "status": { "type": "string", "pattern": "^(DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED)$" },
164
+ "meaning": { "type": "string", "minLength": 1 },
165
+ "allowedNextRoles": {
166
+ "type": "array",
167
+ "minItems": 1,
168
+ "items": { "type": "string", "minLength": 1 }
169
+ }
170
+ },
171
+ "additionalProperties": false
172
+ }
173
+ },
174
+ "handlerResponses": {
175
+ "type": "array",
176
+ "minItems": 4,
177
+ "items": {
178
+ "type": "object",
179
+ "required": ["forStatus", "response"],
180
+ "properties": {
181
+ "forStatus": { "type": "string", "pattern": "^(DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED)$" },
182
+ "response": { "type": "string", "minLength": 1 }
183
+ },
184
+ "additionalProperties": false
185
+ }
186
+ }
187
+ },
188
+ "additionalProperties": false
189
+ },
190
+ "reworkLoopProtocol": {
191
+ "type": "object",
192
+ "required": ["title", "description", "maxRounds", "findingSeverities", "escalationRule", "workerFixContract", "handoffRecording", "mainSessionRule"],
193
+ "properties": {
194
+ "title": { "type": "string", "minLength": 1 },
195
+ "description": { "type": "string", "minLength": 1 },
196
+ "maxRounds": { "type": "integer", "minimum": 1, "maximum": 10 },
197
+ "findingSeverities": {
198
+ "type": "array",
199
+ "minItems": 1,
200
+ "items": { "type": "string", "minLength": 1 }
201
+ },
202
+ "escalationRule": { "type": "string", "minLength": 1 },
203
+ "workerFixContract": { "type": "string", "minLength": 1 },
204
+ "handoffRecording": { "type": "string", "minLength": 1 },
205
+ "mainSessionRule": { "type": "string", "minLength": 1 }
206
+ },
207
+ "additionalProperties": false
208
+ },
124
209
  "fallbackMode": {
125
210
  "type": "object",
126
211
  "required": ["default", "triggers", "requiredBehavior"],
@@ -161,6 +246,36 @@
161
246
  "additionalProperties": false
162
247
  }
163
248
  },
249
+ "workflowPatterns": {
250
+ "type": "array",
251
+ "items": {
252
+ "type": "object",
253
+ "required": ["id", "description", "steps"],
254
+ "properties": {
255
+ "id": { "type": "string", "pattern": "^[a-z0-9_]+$", "minLength": 1 },
256
+ "description": { "type": "string", "minLength": 1 },
257
+ "steps": {
258
+ "type": "array",
259
+ "minItems": 1,
260
+ "items": {
261
+ "type": "object",
262
+ "required": ["step", "action"],
263
+ "properties": {
264
+ "step": { "type": "string", "pattern": "^[a-z0-9_]+$", "minLength": 1 },
265
+ "action": { "type": "string", "minLength": 1 },
266
+ "condition": { "type": "string" },
267
+ "input": { "type": "string" },
268
+ "output": { "type": "string" },
269
+ "maxRetries": { "type": "integer", "minimum": 1 },
270
+ "fallback": { "type": "string" }
271
+ },
272
+ "additionalProperties": false
273
+ }
274
+ }
275
+ },
276
+ "additionalProperties": false
277
+ }
278
+ },
164
279
  "universalRules": {
165
280
  "type": "array",
166
281
  "minItems": 1,
@@ -170,6 +285,43 @@
170
285
  "type": "array",
171
286
  "minItems": 1,
172
287
  "items": { "type": "string", "minLength": 1 }
288
+ },
289
+ "standardRoles": {
290
+ "type": "object",
291
+ "required": ["title", "description", "roles"],
292
+ "properties": {
293
+ "title": { "type": "string", "minLength": 1 },
294
+ "description": { "type": "string", "minLength": 1 },
295
+ "roles": {
296
+ "type": "array",
297
+ "minItems": 1,
298
+ "items": {
299
+ "type": "object",
300
+ "required": ["id", "description", "readAccess", "writeAccess", "artifacts"],
301
+ "properties": {
302
+ "id": { "type": "string", "minLength": 1, "pattern": "^[a-z0-9_]+$" },
303
+ "description": { "type": "string", "minLength": 1 },
304
+ "readAccess": {
305
+ "type": "array",
306
+ "minItems": 1,
307
+ "items": { "type": "string", "minLength": 1 }
308
+ },
309
+ "writeAccess": {
310
+ "type": "array",
311
+ "minItems": 1,
312
+ "items": { "type": "string", "minLength": 1 }
313
+ },
314
+ "artifacts": {
315
+ "type": "array",
316
+ "minItems": 1,
317
+ "items": { "type": "string", "minLength": 1 }
318
+ }
319
+ },
320
+ "additionalProperties": false
321
+ }
322
+ }
323
+ },
324
+ "additionalProperties": false
173
325
  }
174
326
  },
175
327
  "additionalProperties": false