@fitlab-ai/agent-infra 0.9.11 → 0.9.12

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 (193) hide show
  1. package/README.md +6 -6
  2. package/README.zh-CN.md +6 -6
  3. package/dist/bin/internal-cli.js +5 -0
  4. package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +71 -10
  5. package/dist/lib/defaults.json +4 -0
  6. package/dist/lib/git/workflow.js +43 -1
  7. package/dist/lib/init.js +1 -0
  8. package/dist/lib/internal/git-workflow.js +8 -1
  9. package/dist/lib/internal/platform-pr.js +8 -2
  10. package/dist/lib/internal/task-delivery.js +59 -0
  11. package/dist/lib/platform/github-client.js +7 -1
  12. package/dist/lib/platform/pr-checks.js +8 -5
  13. package/dist/lib/platform/pr-summary.js +12 -8
  14. package/dist/lib/platform/pull-requests.js +393 -91
  15. package/dist/lib/platform/verification-required.js +13 -2
  16. package/dist/lib/platform/verification-sync.js +9 -4
  17. package/dist/lib/pr-review/evidence-grading.js +12 -4
  18. package/dist/lib/sandbox/config.js +5 -0
  19. package/dist/lib/sandbox/control/lifecycle.js +29 -7
  20. package/dist/lib/server/process-state.js +2 -2
  21. package/dist/lib/task/artifact-lifecycle.js +2 -2
  22. package/dist/lib/task/commit-intent.js +100 -0
  23. package/dist/lib/task/commit-operation.js +195 -101
  24. package/dist/lib/task/create.js +33 -7
  25. package/dist/lib/task/decision-details.js +3 -48
  26. package/dist/lib/task/delivery-target.js +97 -0
  27. package/dist/lib/task/delivery.js +153 -0
  28. package/dist/lib/task/human-override.js +5 -2
  29. package/dist/lib/task/lifecycle.js +106 -9
  30. package/dist/lib/task/orchestration.js +55 -62
  31. package/dist/lib/task/pr-delivery-fact.js +182 -0
  32. package/dist/lib/task/review-finalization.js +4 -8
  33. package/dist/lib/task/review-fingerprint.js +8 -0
  34. package/dist/lib/task/verification-engine.js +48 -24
  35. package/dist/lib/task/verification-review.js +1 -1
  36. package/dist/lib/update.js +9 -0
  37. package/dist/lifecycle-build-manifest.json +3 -3
  38. package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +105 -10
  39. package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +12 -1
  40. package/lib/defaults.json +4 -0
  41. package/lib/git/workflow.ts +38 -1
  42. package/lib/init.ts +3 -0
  43. package/lib/internal/git-workflow.ts +7 -1
  44. package/lib/internal/platform-pr.ts +8 -1
  45. package/lib/internal/task-delivery.ts +53 -0
  46. package/lib/platform/github-client.ts +8 -1
  47. package/lib/platform/pr-checks.ts +7 -5
  48. package/lib/platform/pr-summary.ts +10 -7
  49. package/lib/platform/pull-requests.ts +425 -87
  50. package/lib/platform/verification-required.ts +12 -2
  51. package/lib/platform/verification-sync.ts +9 -4
  52. package/lib/pr-review/evidence-grading.ts +7 -4
  53. package/lib/sandbox/config.ts +7 -0
  54. package/lib/sandbox/control/lifecycle.ts +30 -8
  55. package/lib/server/process-state.ts +2 -2
  56. package/lib/task/artifact-lifecycle.ts +2 -2
  57. package/lib/task/commit-intent.ts +137 -0
  58. package/lib/task/commit-operation.ts +174 -87
  59. package/lib/task/create.ts +34 -9
  60. package/lib/task/decision-details.ts +2 -62
  61. package/lib/task/delivery-target.ts +130 -0
  62. package/lib/task/delivery.ts +160 -0
  63. package/lib/task/human-override.ts +5 -2
  64. package/lib/task/lifecycle.ts +93 -4
  65. package/lib/task/orchestration.ts +62 -65
  66. package/lib/task/pr-delivery-fact.ts +254 -0
  67. package/lib/task/review-finalization.ts +4 -14
  68. package/lib/task/review-fingerprint.ts +10 -0
  69. package/lib/task/verification-engine.ts +45 -28
  70. package/lib/task/verification-review.ts +2 -0
  71. package/lib/update.ts +10 -0
  72. package/package.json +1 -1
  73. package/templates/.agents/rules/README.en.md +4 -2
  74. package/templates/.agents/rules/README.zh-CN.md +4 -2
  75. package/templates/.agents/rules/create-issue.en.md +11 -2
  76. package/templates/.agents/rules/create-issue.zh-CN.md +24 -2
  77. package/templates/.agents/rules/issue-pr-commands.en.md +4 -17
  78. package/templates/.agents/rules/issue-sync.en.md +26 -5
  79. package/templates/.agents/rules/issue-sync.zh-CN.md +62 -5
  80. package/templates/.agents/rules/label-milestone-setup.en.md +15 -2
  81. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +15 -2
  82. package/templates/.agents/rules/local-artifact-repair.en.md +46 -0
  83. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +46 -0
  84. package/templates/.agents/rules/milestone-inference.en.md +12 -2
  85. package/templates/.agents/rules/milestone-inference.zh-CN.md +25 -3
  86. package/templates/.agents/rules/pr-sync.en.md +22 -13
  87. package/templates/.agents/rules/pr-sync.zh-CN.md +22 -1
  88. package/templates/.agents/rules/release-commands.en.md +42 -3
  89. package/templates/.agents/rules/release-commands.zh-CN.md +42 -3
  90. package/templates/.agents/rules/security-alerts.en.md +17 -2
  91. package/templates/.agents/rules/security-alerts.zh-CN.md +17 -2
  92. package/templates/.agents/rules/sync-content-generation.en.md +8 -0
  93. package/templates/.agents/rules/sync-content-generation.zh-CN.md +8 -0
  94. package/templates/.agents/rules/task-management.en.md +1 -1
  95. package/templates/.agents/rules/task-management.zh-CN.md +1 -1
  96. package/templates/.agents/scripts/security-alerts.github.sh +151 -0
  97. package/templates/.agents/scripts/security-alerts.sh +31 -0
  98. package/templates/.agents/skills/analyze-task/SKILL.en.md +1 -0
  99. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +1 -0
  100. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  101. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  102. package/templates/.agents/skills/close-dependabot/SKILL.en.md +2 -2
  103. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
  104. package/templates/.agents/skills/code-task/SKILL.en.md +5 -2
  105. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +6 -3
  106. package/templates/.agents/skills/commit/SKILL.en.md +3 -3
  107. package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -3
  108. package/templates/.agents/skills/commit/config/verify.json +1 -1
  109. package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +3 -3
  110. package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +3 -3
  111. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  112. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  113. package/templates/.agents/skills/commit/reference/task-status-update.en.md +2 -2
  114. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +2 -2
  115. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +2 -1
  116. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +2 -1
  117. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  118. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  119. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  120. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  121. package/templates/.agents/skills/complete-task/SKILL.en.md +10 -10
  122. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +10 -10
  123. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +2 -2
  124. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +2 -2
  125. package/templates/.agents/skills/create-pr/SKILL.en.md +4 -4
  126. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +4 -4
  127. package/templates/.agents/skills/create-task/SKILL.en.md +1 -0
  128. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -0
  129. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  130. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  131. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  132. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  133. package/templates/.agents/skills/init-labels/SKILL.en.md +9 -10
  134. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -10
  135. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +57 -1
  136. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +27 -1
  137. package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -5
  138. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +3 -5
  139. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -0
  140. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -0
  141. package/templates/.agents/skills/review-analysis/SKILL.en.md +4 -3
  142. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +4 -3
  143. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +18 -0
  144. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +18 -0
  145. package/templates/.agents/skills/review-code/SKILL.en.md +7 -6
  146. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +7 -6
  147. package/templates/.agents/skills/review-code/reference/output-templates.en.md +19 -1
  148. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +19 -1
  149. package/templates/.agents/skills/review-code/reference/report-template.en.md +4 -2
  150. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +4 -2
  151. package/templates/.agents/skills/review-plan/SKILL.en.md +4 -3
  152. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +4 -3
  153. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +18 -0
  154. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +18 -0
  155. package/templates/.agents/skills/review-pr/SKILL.en.md +1 -0
  156. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +1 -0
  157. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +2 -2
  158. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +2 -2
  159. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +1 -0
  160. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +1 -0
  161. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  162. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  163. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +4 -0
  164. package/templates/.agents/skills/watch-pr/SKILL.en.md +4 -4
  165. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +4 -4
  166. package/templates/.agents/templates/task.en.md +5 -1
  167. package/templates/.agents/templates/task.zh-CN.md +5 -1
  168. package/templates/.agents/workflows/bug-fix.en.yaml +9 -8
  169. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +9 -8
  170. package/templates/.agents/workflows/feature-development.en.yaml +9 -8
  171. package/templates/.agents/workflows/feature-development.zh-CN.yaml +9 -8
  172. package/templates/.agents/workflows/refactoring.en.yaml +9 -8
  173. package/templates/.agents/workflows/refactoring.zh-CN.yaml +9 -8
  174. package/templates/.agents/rules/create-issue.github.en.md +0 -14
  175. package/templates/.agents/rules/create-issue.github.zh-CN.md +0 -27
  176. package/templates/.agents/rules/issue-pr-commands.github.en.md +0 -34
  177. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +0 -49
  178. package/templates/.agents/rules/issue-sync.github.en.md +0 -40
  179. package/templates/.agents/rules/issue-sync.github.zh-CN.md +0 -76
  180. package/templates/.agents/rules/label-milestone-setup.github.en.md +0 -60
  181. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +0 -60
  182. package/templates/.agents/rules/milestone-inference.github.en.md +0 -15
  183. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +0 -27
  184. package/templates/.agents/rules/pr-checks-commands.github.en.md +0 -18
  185. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +0 -34
  186. package/templates/.agents/rules/pr-sync.github.en.md +0 -43
  187. package/templates/.agents/rules/pr-sync.github.zh-CN.md +0 -69
  188. package/templates/.agents/rules/release-commands.github.en.md +0 -44
  189. package/templates/.agents/rules/release-commands.github.zh-CN.md +0 -44
  190. package/templates/.agents/rules/security-alerts.github.en.md +0 -43
  191. package/templates/.agents/rules/security-alerts.github.zh-CN.md +0 -43
  192. /package/templates/.agents/rules/{issue-fields.github.en.md → issue-fields.en.md} +0 -0
  193. /package/templates/.agents/rules/{issue-fields.github.zh-CN.md → issue-fields.zh-CN.md} +0 -0
@@ -0,0 +1,46 @@
1
+ # 通用规则 - 模型驱动的本地产物修复
2
+
3
+ 本规则只适用于 `review-analysis`、`review-plan`、`review-code` 在 finalizer 失败后处理**同一个受控 review artifact** 的场景。它不适用于 task.md、账本、receipt、源码、Git、平台资源或生命周期状态。
4
+
5
+ ## 授权边界
6
+
7
+ - finalizer 只负责读取事实、校验状态、规范化成功结果和原子写入;它不维护可修复错误码白名单,不推断 repairability,也不自动选择要删除的报告内容。
8
+ - 首次 finalizer 调用不计入修复次数。只有在机械安全门通过后,模型明确判断当前问题能通过最小、可解释的 artifact 修改解决时,才允许编辑。
9
+ - 模型只能修改当前 review skill 声明的一个普通 review artifact,且该文件必须位于当前 task 目录。不得修改 task.md、审查分歧账本、receipt、源码、其他报告或远端资源。
10
+ - `changed=false`、错误码或某个格式形状只是诊断事实,不是自动批准。模型必须结合完整诊断、artifact 内容和上下文逐例判断。
11
+
12
+ ## 不可绕过的机械安全门
13
+
14
+ 在每次模型编辑前确认:
15
+
16
+ 1. finalizer 返回失败,且没有已提交的 artifact operation;
17
+ 2. 任务、stage、artifact、review round、身份和 provenance 仍然一致;
18
+ 3. 目标是当前 task 目录内的普通文件,没有并发冲突、权限错误、I/O 不确定性或目标被替换;
19
+ 4. 不改变人工裁决语义、裁决详情或账本身份,也不涉及任务状态、receipt、Git、平台或其他外部副作用;已知且可核验的 pending 人工裁决可以保留,但模型必须证明本次修改与该裁决无关。
20
+
21
+ 任一条件不满足,立即停止,不调用模型编辑。安全门不能被模型的语义判断绕过。
22
+
23
+ ## 动态收敛循环
24
+
25
+ 1. 使用固定的 task、stage、artifact 和 orchestrated intent 执行首次 finalizer。
26
+ 2. 成功时使用这一次完整结果进入既有完成前门禁;不得重新扫描账本或手工补写摘要。
27
+ 3. 失败且安全门通过时,模型读取结构化诊断、当前 artifact 和必要上下文,决定继续修复或停止,并说明修改范围和理由。
28
+ 4. 模型选择继续时,只做一次最小 artifact 编辑。只有文件字节实际发生变化,才增加一次 `repairAttempts`,然后完整重跑同一个 finalizer intent。
29
+ 5. 每次重跑都重新执行全部安全校验。修复后出现新的、独立且仍局限于该 artifact 的问题,可以再次交给模型判断;不能沿用上一次“可修复”的结论。
30
+ 6. 模型无法证明下一步安全,或判断问题属于环境、权限、并发、身份、provenance、状态未知、人工裁决语义/详情不确定或其他非本地问题时,立即停止。已知人工裁决本身不是停止条件。
31
+ 7. 诊断重复、artifact 指纹重复、没有实际字节进展或模型没有提出可验证的最小修改时,立即停止。
32
+ 8. 每次 skill invocation 最多允许 8 次实际 artifact 修改作为紧急熔断。该上限只防止死循环和资源失控,不是正常业务停止条件,也不表示最多只能修复 8 个问题。达到上限时保留最后结构化诊断并停止。
33
+
34
+ 修复次数只存在于当前 skill invocation 的内存上下文,不写入 task.md、ledger 或公共 receipt。不得按错误码、技能或问题类型设置不同的正常预算。
35
+
36
+ ## 完成事件与用户输出
37
+
38
+ - 最终一次完整 finalizer 成功后,必须使用同一次返回的 provenance、账本状态、verdict 和计数发布 review completed 事件;`stageStatus.canAdvance=true` 且结论为 Approved 时才可生成跨阶段 next-step 命令,`canAdvance=false` 时仍须登记结果并路由到同阶段修订/复审。
39
+ - 失败、模型停止、无进展、诊断重复或紧急熔断时,不发布 completed 事件,不推进生命周期,不生成跨阶段命令,也不伪造通过结论。
40
+ - 停止推进不等于丢弃审查结果。用户输出必须展示 artifact 路径、已安全读取的最后有效 summary/findings、实际 `repairAttempts`、最后结构化诊断和停止原因。
41
+ - summary 无法安全解析时,只展示 artifact 路径和原始结构化诊断,不推算计数、不补写结论,并明确生命周期推进已停止但产物仍可查看。
42
+ - 停止路径只提示重新运行当前 review skill 或进行人工处理;不能调用 `code-task`、`complete-task` 等跨阶段 helper。
43
+
44
+ ## 生命周期隔离
45
+
46
+ `complete-task`、告警关闭、恢复任务和其他 task-lifecycle/task-finalization 入口涉及任务状态、receipt、远端结果或归档副作用,不消费本规则。它们继续使用各自的硬失败、同一 intent 重试和状态未知语义。
@@ -1,5 +1,15 @@
1
1
  # Milestone Inference
2
2
 
3
- This code platform does not provide milestone inference; `platform-issue sync --milestone ...` returns a structured no-op/degraded result.
3
+ > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
4
4
 
5
- Milestone narrowing and reuse are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates. Do not block task progress when no platform-specific milestone implementation is available.
5
+ Milestones narrow through declarative Issue intents:
6
+
7
+ ```bash
8
+ # create/import phase
9
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone initial
10
+
11
+ # code phase
12
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific
13
+ ```
14
+
15
+ `initial` prefers a valid task milestone, otherwise the lowest open `X.Y.x`, then `General Backlog`. `specific` narrows a release line to the highest open patch version using main/release-line ancestry. Missing facts or triage permission preserve the remote value and return skipped/degraded. `create-pr` reuses the Issue milestone in the 09/10 PR adapter.
@@ -1,5 +1,27 @@
1
- # Milestone 推断
1
+ # Milestone 推断规则
2
2
 
3
- 当前代码平台未提供里程碑推断;`platform-issue sync --milestone ...` 返回结构化 no-op/degraded 结果。
3
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
4
4
 
5
- 自定义平台会跳过里程碑收窄和复用逻辑,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板。没有平台专属里程碑实现时,不要阻塞任务推进。
5
+ Milestone 继续按生命周期逐步收窄,但候选读取、分支判断、权限降级和写入统一由 `platform-issue` 处理。
6
+
7
+ ## 阶段 1:创建或导入
8
+
9
+ ```bash
10
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone initial
11
+ ```
12
+
13
+ 优先使用 task.md 中存在且有效的显式 milestone;否则从 open milestones 选择最低 `X.Y.x` 版本线,最后回退 `General Backlog`。`triage=false` 或外部事实不足时保持远端值并返回 skipped/degraded。
14
+
15
+ ## 阶段 2:`code-task`
16
+
17
+ ```bash
18
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific
19
+ ```
20
+
21
+ 版本线收窄规则保持不变:主干模式在当前版本线取最高 patch;多版本分支模式依据 release-line/main 祖先关系选择版本线。无法可靠判断时保持原值。完成门禁仍拒绝 `X.Y.x`。
22
+
23
+ ## 阶段 3:`create-pr`
24
+
25
+ PR 只复用关联 Issue 的具体 milestone;该 PR 资源写入属于 09/10,不在 `platform-issue` 中实现。
26
+
27
+ 调用方不得重新实现 milestone 列表、排序、分支祖先或平台写入逻辑。
@@ -2,30 +2,39 @@
2
2
 
3
3
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
4
4
 
5
- The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, the marker, current HEAD, paginated comment lookup, and create/update/no-op reconciliation.
5
+ The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, marker/HEAD wrapping, paginated comment lookup, and reconciliation.
6
6
 
7
- ## Inputs
7
+ ## Three-Layer Isolation
8
8
 
9
- ```bash
10
- agent-infra-internal platform-pr summary-context {task-id}
11
- ```
12
-
13
- Use only the returned latest canonical `plan*`, `review-plan*`, `code*`, `review-code*`, and `manual-validation*` for lifecycle claims. The summary covers scope, tests, review history, and exactly one manual-validation state. It also includes a `### PR Code Changes` section based on authoritative base/head facts from `platform-pr inspect` and the complete `git diff --find-renames --numstat base...head`, with reconciled runtime, test, skill/rule, template, documentation, and other categories plus rename, mechanical-mirror, and unnecessary-change analysis.
14
-
15
- ## Publish
9
+ - `sync-pr:{task-id}:summary` (`platform-pr summary-sync`) is an updatable reviewer summary; it is neither a process copy nor a formal Review.
10
+ - The full `pr-review*` process copy lives in the Issue artifact comment (`platform-comment sync --kind artifact`) and is restored by `restore-task` under its Issue-only contract.
11
+ - A formal PR Review (`platform-pr-review publish`) is the only formal conclusion carrier published to the PR, bound to the reviewed head SHA, and includes conclusion, findings, receipt, and the Issue artifact link.
16
12
 
17
- Write only the summary body to a file, without marker or SHA:
13
+ The three never cross: a regular PR comment does not carry the full process copy; an Issue artifact comment is not treated as a formal Review; a summary is not presented as a formal Review.
18
14
 
19
15
  ```bash
16
+ agent-infra-internal platform-pr summary-context {task-id}
17
+
20
18
  agent-infra-internal platform-pr summary-sync {task-id} \
21
19
  --agent {standard-agent-token} --body-file {summary-body-file}
22
20
  ```
23
21
 
24
- The core wraps `<!-- sync-pr:{task-id}:summary -->` and current `<!-- last-commit: ... -->`, then creates, updates in place, or returns no-op. Duplicate markers fail deterministically. Callers never assemble shell/heredoc comment commands.
22
+ Use only canonical inputs returned by the context command. Write the plain body without marker or SHA. The core owns `<!-- sync-pr:{task-id}:summary -->`, current `<!-- last-commit: ... -->`, create/update/no-op behavior, and duplicate-marker conflicts. Summary failure never rolls back a PR or commit.
25
23
 
26
- `create-pr` does not roll back the PR on summary failure; `commit` records a warning without rolling back; manual validation refreshes after its canonical artifact is written.
24
+ The canonical comment envelope produced by the core is:
25
+
26
+ ```markdown
27
+ <!-- sync-pr:{task-id}:summary -->
28
+ <!-- last-commit: {git-head-sha} -->
29
+ ## Review Summary
30
+ {manual-validation-section}
31
+ ### Key Technical Decisions
32
+ ### Review History
33
+ ### Test Results
34
+ ### PR Code Changes
35
+ ```
27
36
 
28
- For a linked task, the caller records a structured warning:
37
+ Canonical inputs include `manual-validation.md`. The manual-validation section is one of `### ✅ Manual Validation Passed`, `### ⚠️ Manual Verification Required`, or `### ✅ No Manual Verification Needed`; `complete-manual-validation` refreshes the same summary in place. The PR code-change section uses authoritative base/head facts from `platform-pr inspect` and the complete `git diff --find-renames --numstat base...head`, reconciles runtime, test, skill/rule, template, documentation, and other categories, and explains renames, mechanical mirrors, and potentially unnecessary changes.
29
38
 
30
39
  ```bash
31
40
  agent-infra-internal task-warning {task-id} add --step {step} --severity WARNING \
@@ -4,13 +4,21 @@
4
4
 
5
5
  PR 摘要的语义聚合由模型完成;canonical 产物选择、marker、当前 HEAD、分页评论查找和 create/update/no-op 由 typed core 负责。
6
6
 
7
+ ## 三层隔离
8
+
9
+ - `sync-pr:{task-id}:summary`(`platform-pr summary-sync`)是可更新的 reviewer 摘要,不是过程原文,也不是正式 Review。
10
+ - `pr-review*` 完整过程原文在 Issue artifact 评论(`platform-comment sync --kind artifact`),由 `restore-task` 按 Issue-only 契约恢复。
11
+ - 正式 PR Review(`platform-pr-review publish`)是唯一发布到 PR 的正式结论载体,绑定被审 head SHA,含结论、finding、receipt 与 Issue artifact 链接。
12
+
13
+ 三者不串用:PR 普通评论不承载完整过程原文;Issue artifact 评论不当作正式 Review;摘要不冒充正式 Review。
14
+
7
15
  ## 聚合输入
8
16
 
9
17
  ```bash
10
18
  agent-infra-internal platform-pr summary-context {task-id}
11
19
  ```
12
20
 
13
- 只使用返回的 canonical latest `plan*`、`review-plan*`、`code*`、`review-code*`、`manual-validation*`。模型据此生成 reviewer 摘要正文,至少包含:
21
+ 只使用返回的 canonical latest `plan*`、`review-plan*`、`code*`、`review-code*`、`manual-validation*`(包括 `manual-validation.md`)。模型据此生成 reviewer 摘要正文,至少包含:
14
22
 
15
23
  - 变更摘要与实现范围
16
24
  - 测试结果
@@ -20,6 +28,19 @@ agent-infra-internal platform-pr summary-context {task-id}
20
28
 
21
29
  保留人工校验项时,每条写明校验内容、定位和只能人工完成的原因。
22
30
 
31
+ core 最终包装出的 canonical 评论结构为:
32
+
33
+ ```markdown
34
+ <!-- sync-pr:{task-id}:summary -->
35
+ <!-- last-commit: {git-head-sha} -->
36
+ ## 审查摘要
37
+ {manual-validation-section}
38
+ ### 关键技术决策
39
+ ### 审查历程
40
+ ### 测试结果
41
+ ### PR 代码增减
42
+ ```
43
+
23
44
  ## 发布
24
45
 
25
46
  把聚合后的纯正文写入 `{summary-body-file}`,不要自行添加 marker 或 commit SHA:
@@ -1,5 +1,44 @@
1
- # Release Commands
1
+ # Release Platform Commands
2
2
 
3
- This code platform does not provide a release-note adapter.
3
+ Release-note platform operations use a typed internal intent. Callers consume structured JSON and do not interpret platform commands, raw fields, identity email rules, or authentication errors.
4
4
 
5
- Local `agent-infra-internal platform-release-notes stage --notes-file "{notes-file}"` still normalizes an external file and returns its digest. Use `context` to receive a structured `PLATFORM_RELEASE_NOTES_UNSUPPORTED` no-op and do not probe another platform client. Publish with `--expected-sha256` remains a no-op until an adapter is provided.
5
+ ## Collect Release-note Context
6
+
7
+ ```bash
8
+ agent-infra-internal platform-release-notes context \
9
+ --from-tag "v{prev-version}" \
10
+ --to-tag "v{version}" \
11
+ --branch "{branch}" \
12
+ --history-limit 3
13
+ ```
14
+
15
+ The result contains `history`, `pullRequests`, `closingIssues`, and commit `authors` with normalized `login` / `resolution` values. `status: no-op` with error code `PLATFORM_RELEASE_NOTES_UNSUPPORTED` means the current platform does not support remote release-note operations.
16
+
17
+ ### Identity Safety Boundary
18
+
19
+ - Render an identity as `@login` only when `resolution` is `platform-user` or `platform-noreply` and `login` is non-empty.
20
+ - Exclude `resolution: unresolved` identities from the release-note contributor list. Never infer a login from a name, email address, domain, brand, or same-named platform account, and never substitute a guessed personal or organization account.
21
+ - Do not publish unresolved identity emails or identity-verification TODOs in Release notes. Record any required investigation outside the release workflow without creating a platform mention.
22
+
23
+ ## Stage Release Notes
24
+
25
+ ```bash
26
+ agent-infra-internal platform-release-notes stage \
27
+ --notes-file "{notes-file}"
28
+ ```
29
+
30
+ The command accepts only an external regular file, normalizes it atomically, and returns SHA-256 for its exact bytes.
31
+
32
+ ## Publish Release Notes
33
+
34
+ Call this only after user confirmation:
35
+
36
+ ```bash
37
+ agent-infra-internal platform-release-notes publish \
38
+ --tag "v{version}" \
39
+ --title "v{version}" \
40
+ --notes-file "{notes-file}" \
41
+ --expected-sha256 "{preview-sha256}"
42
+ ```
43
+
44
+ The command recomputes the digest before platform access and performs no platform write on mismatch. On a match it updates an existing Release or creates it when missing; `--dry-run` returns only the planned operation. Exit code `0` means success, `1` means a stable failure, and `2` means a network or platform block.
@@ -1,5 +1,44 @@
1
- # Release 命令
1
+ # Release 平台命令
2
2
 
3
- 当前代码平台未提供发布说明 adapter。
3
+ 发布说明平台操作统一使用 typed internal intent。调用方只解释结构化 JSON,不解析平台命令、原始字段、身份邮箱规则或认证错误。
4
4
 
5
- 本地 `agent-infra-internal platform-release-notes stage --notes-file "{notes-file}"` 仍可规范化工作树外文件并返回摘要。调用 `context` 会返回结构化的 `PLATFORM_RELEASE_NOTES_UNSUPPORTED` no-op,不得探测其他平台 client;提供 adapter 前,带 `--expected-sha256` 的 publish 同样保持 no-op。
5
+ ## 收集发布说明上下文
6
+
7
+ ```bash
8
+ agent-infra-internal platform-release-notes context \
9
+ --from-tag "v{prev-version}" \
10
+ --to-tag "v{version}" \
11
+ --branch "{branch}" \
12
+ --history-limit 3
13
+ ```
14
+
15
+ 结果包含 `history`、`pullRequests`、`closingIssues` 和带规范化 `login` / `resolution` 的 commit `authors`。`status: no-op` 且错误码为 `PLATFORM_RELEASE_NOTES_UNSUPPORTED` 表示当前平台不支持远端发布说明能力。
16
+
17
+ ### 身份安全边界
18
+
19
+ - 只有 `resolution` 为 `platform-user` 或 `platform-noreply` 且 `login` 非空的身份可以渲染为 `@login`。
20
+ - `resolution: unresolved` 的身份不得进入发布说明的贡献者列表;不得从 Name、邮箱、域名、品牌或同名平台账号推断 login,也不得替换成推测的个人或组织账号。
21
+ - 不得把未解析身份的邮箱或身份确认 TODO 写入可发布的 Release notes。需要调查时仅在发布流程外记录,不得产生平台 mention。
22
+
23
+ ## Stage Release notes
24
+
25
+ ```bash
26
+ agent-infra-internal platform-release-notes stage \
27
+ --notes-file "{notes-file}"
28
+ ```
29
+
30
+ 命令只接受工作树外普通文件,原子规范化并返回精确 bytes 的 SHA-256。
31
+
32
+ ## 发布 Release notes
33
+
34
+ 用户确认后调用:
35
+
36
+ ```bash
37
+ agent-infra-internal platform-release-notes publish \
38
+ --tag "v{version}" \
39
+ --title "v{version}" \
40
+ --notes-file "{notes-file}" \
41
+ --expected-sha256 "{preview-sha256}"
42
+ ```
43
+
44
+ 命令在平台访问前复算摘要,不匹配时零写入;匹配时更新已有 Release,缺失时创建。`--dry-run` 只返回 planned operation。退出码为 `0` 时成功,`1` 表示稳定失败,`2` 表示网络或平台阻塞。
@@ -1,5 +1,20 @@
1
1
  # Security Alerts
2
2
 
3
- This code platform does not provide built-in security alert integration.
3
+ Read this rule before importing or dismissing dependency or code-scanning alerts.
4
4
 
5
- Code scanning and dependency alert import or close actions are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and adapters. Track security work through local task artifacts or a platform-specific integration.
5
+ ## Shared entry point
6
+
7
+ All callers use the shared security script and parse its single JSON result:
8
+
9
+ ```text
10
+ bash .agents/scripts/security-alerts.sh read-dependabot --number {number}
11
+ bash .agents/scripts/security-alerts.sh dismiss-dependabot --number {number} --reason {api-reason} --comment-file {file}
12
+ bash .agents/scripts/security-alerts.sh read-codescan --number {number}
13
+ bash .agents/scripts/security-alerts.sh dismiss-codescan --number {number} --reason {api-reason} --comment-file {file}
14
+ ```
15
+
16
+ The result contains `status`, `operation`, and either `data` or `error.code` plus `error.message`. The status is one of `applied`, `no-op`, `degraded`, or `failed`. Diagnostics belong on stderr; stdout must contain exactly one JSON object.
17
+
18
+ Read the current alert before any dismiss operation. A dismiss reason must use the provider API reason value, and the generated task or Issue comment must be passed through `--comment-file`.
19
+
20
+ Do not invoke a provider CLI directly from a SKILL. A degraded or failed result must be reported accurately, and cancelled or failed operations must not be recorded as successful.
@@ -1,5 +1,20 @@
1
1
  # 安全告警
2
2
 
3
- 当前代码平台未内置安全告警集成。
3
+ 在导入或关闭依赖告警、代码扫描告警前,先阅读本规则。
4
4
 
5
- 自定义平台会跳过代码扫描和依赖告警的导入或关闭操作,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和适配器。请通过本地任务产物或平台专属集成跟踪安全工作。
5
+ ## 共享入口
6
+
7
+ 所有调用方都使用共享安全脚本,并解析其单个 JSON 结果:
8
+
9
+ ```text
10
+ bash .agents/scripts/security-alerts.sh read-dependabot --number {number}
11
+ bash .agents/scripts/security-alerts.sh dismiss-dependabot --number {number} --reason {api-reason} --comment-file {file}
12
+ bash .agents/scripts/security-alerts.sh read-codescan --number {number}
13
+ bash .agents/scripts/security-alerts.sh dismiss-codescan --number {number} --reason {api-reason} --comment-file {file}
14
+ ```
15
+
16
+ 结果包含 `status`、`operation`,以及 `data` 或 `error.code` 与 `error.message`。`status` 只能是 `applied`、`no-op`、`degraded` 或 `failed`。诊断信息写入 stderr;stdout 必须只包含一个 JSON 对象。
17
+
18
+ 任何关闭操作前都必须先读取当前告警。关闭原因必须使用 provider API 的 reason 值,生成的任务或 Issue 评论必须通过 `--comment-file` 传入。
19
+
20
+ SKILL 不得直接调用 provider CLI。degraded 或 failed 结果必须如实报告,取消或失败的操作不得记录为成功。
@@ -0,0 +1,8 @@
1
+ # Synchronized Content Generation Rules
2
+
3
+ This rule applies to controlled generators that write `task.md` or lifecycle artifacts which are synchronized to an Issue. It constrains model output only; it does not parse, rewrite, or block hand-written or external content.
4
+
5
+ - Render local, workspace, and temporary task-file references as inline code, such as `analysis.md` or `/workspace/file.md`; do not write them as Markdown links.
6
+ - Render non-user-semantic `@` text, such as `@2x`, as inline code; preserve real user mentions, `@` inside email addresses, and fixed release-log formats according to their meaning.
7
+ - Formal Issue, PR, commit, and external links may remain Markdown links.
8
+ - When uncertain, keep ordinary text and do not guess a link target; do not introduce a runtime Markdown parser for this purpose.
@@ -0,0 +1,8 @@
1
+ # 同步内容生成规则
2
+
3
+ 本规则适用于会写入 `task.md` 或生命周期产物并同步到 Issue 的受控生成端。它只约束模型生成,不解析、改写或阻断手写和外部正文。
4
+
5
+ - 本地、工作区和临时任务文件引用使用行内代码文本,例如 `analysis.md`、`/workspace/file.md`;不要把它们写成 Markdown 链接。
6
+ - 非用户语义的 `@` 文本(例如 `@2x`)使用行内代码文本;真实用户 mention、邮箱地址中的 `@` 和固定发布格式按语义保留。
7
+ - 正式的 Issue、PR、commit 和外部链接可以保持 Markdown 链接。
8
+ - 不确定时保留普通文本,不猜测链接目标;不要为此引入运行时 Markdown 解析器。
@@ -49,7 +49,7 @@ The seven internal commands (`task-event` / `task-lifecycle` / `task-finalizatio
49
49
  - `review-plan`: update `current_step`, `updated_at`, `agent_infra_version`
50
50
  - `code-task`: update `current_step`, `updated_at`, `agent_infra_version`
51
51
  - `review-code`: update `current_step`, `updated_at`, `agent_infra_version`
52
- - `create-pr`: update `pr_number`, `updated_at`, `agent_infra_version`
52
+ - `create-pr`: update the verified `pr_delivery_fact`, `updated_at`, `agent_infra_version`
53
53
  - `commit`: update `updated_at`, `agent_infra_version`; update `current_step` when needed (see `commit/reference/task-status-update.md`)
54
54
  - `complete-task`: update `status`, `current_step`, `completed_at`, `updated_at`, `agent_infra_version`
55
55
  - `block-task`: update `status`, `blocked_at`, `updated_at`, `agent_infra_version`
@@ -49,7 +49,7 @@
49
49
  - `review-plan`:更新 `current_step`、`updated_at`、`agent_infra_version`
50
50
  - `code-task`:更新 `current_step`、`updated_at`、`agent_infra_version`
51
51
  - `review-code`:更新 `current_step`、`updated_at`、`agent_infra_version`
52
- - `create-pr`:更新 `pr_number`、`updated_at`、`agent_infra_version`
52
+ - `create-pr`:通过 `pr_delivery_fact` writer 更新 PR 绑定事实、`updated_at`、`agent_infra_version`
53
53
  - `commit`:更新 `updated_at`、`agent_infra_version`;必要时更新 `current_step`(详见 `commit/reference/task-status-update.md`)
54
54
  - `complete-task`:更新 `status`、`current_step`、`completed_at`、`updated_at`、`agent_infra_version`
55
55
  - `block-task`:更新 `status`、`blocked_at`、`updated_at`、`agent_infra_version`
@@ -0,0 +1,151 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ operation="${1:-}"
6
+ shift || true
7
+ number=""
8
+ reason=""
9
+ comment_file=""
10
+
11
+ while [ "$#" -gt 0 ]; do
12
+ case "$1" in
13
+ --number)
14
+ number="${2:-}"
15
+ shift
16
+ ;;
17
+ --reason)
18
+ reason="${2:-}"
19
+ shift
20
+ ;;
21
+ --comment-file)
22
+ comment_file="${2:-}"
23
+ shift
24
+ ;;
25
+ *)
26
+ echo "Unknown option: $1" >&2
27
+ exit 2
28
+ ;;
29
+ esac
30
+ shift
31
+ done
32
+
33
+ emit_error() {
34
+ code="$1"
35
+ message="$2"
36
+ node - "$operation" "$code" "$message" <<'NODE'
37
+ const [operation, code, message] = process.argv.slice(2);
38
+ process.stdout.write(`${JSON.stringify({ status: "failed", operation, error: { code, message } })}\n`);
39
+ NODE
40
+ }
41
+
42
+ case "$operation" in
43
+ read-dependabot|dismiss-dependabot|read-codescan|dismiss-codescan) ;;
44
+ *)
45
+ emit_error "SECURITY_OPERATION_INVALID" "Unknown security alert operation."
46
+ exit 1
47
+ ;;
48
+ esac
49
+
50
+ case "$number" in
51
+ ''|*[!0-9]*)
52
+ emit_error "SECURITY_NUMBER_INVALID" "Alert number must be a positive integer."
53
+ exit 1
54
+ ;;
55
+ esac
56
+
57
+ if ! command -v gh >/dev/null 2>&1; then
58
+ emit_error "PLATFORM_CLI_MISSING" "The platform CLI is not installed."
59
+ exit 1
60
+ fi
61
+ if ! gh auth token >/dev/null 2>&1; then
62
+ emit_error "PLATFORM_NOT_AUTHENTICATED" "The platform CLI is not authenticated."
63
+ exit 1
64
+ fi
65
+ repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')" || {
66
+ emit_error "PLATFORM_REPOSITORY_UNAVAILABLE" "Unable to access the current repository."
67
+ exit 1
68
+ }
69
+
70
+ case "$operation" in
71
+ *dependabot*) endpoint="repos/$repo/dependabot/alerts/$number" ;;
72
+ *codescan*) endpoint="repos/$repo/code-scanning/alerts/$number" ;;
73
+ esac
74
+
75
+ tmpdir="$(mktemp -d)"
76
+ trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
77
+
78
+ if [ "$operation" = "read-dependabot" ] || [ "$operation" = "read-codescan" ]; then
79
+ if ! gh api "$endpoint" > "$tmpdir/response.json" 2> "$tmpdir/error.txt"; then
80
+ emit_error "SECURITY_API_FAILED" "Unable to read the security alert."
81
+ exit 2
82
+ fi
83
+ else
84
+ if [ -z "$reason" ] || [ -z "$comment_file" ] || [ ! -f "$comment_file" ]; then
85
+ emit_error "SECURITY_DISMISS_INPUT_INVALID" "Dismissal reason and comment file are required."
86
+ exit 1
87
+ fi
88
+ if ! gh api "$endpoint" > "$tmpdir/current.json" 2> "$tmpdir/error.txt"; then
89
+ emit_error "SECURITY_API_FAILED" "Unable to read the security alert before dismissal."
90
+ exit 2
91
+ fi
92
+ state="$(node - "$tmpdir/current.json" <<'NODE'
93
+ const fs = require("node:fs");
94
+ try {
95
+ const alert = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
96
+ process.stdout.write(typeof alert.state === "string" ? alert.state : "invalid");
97
+ } catch {
98
+ process.stdout.write("invalid");
99
+ }
100
+ NODE
101
+ )"
102
+ case "$state" in
103
+ open) ;;
104
+ dismissed|fixed)
105
+ node - "$operation" "$tmpdir/current.json" <<'NODE'
106
+ const fs = require("node:fs");
107
+ const [operation, responsePath] = process.argv.slice(2);
108
+ const data = JSON.parse(fs.readFileSync(responsePath, "utf8"));
109
+ process.stdout.write(`${JSON.stringify({ status: "no-op", operation, data })}\n`);
110
+ NODE
111
+ exit 0
112
+ ;;
113
+ *)
114
+ emit_error "SECURITY_RESPONSE_INVALID" "The platform returned an alert without a valid state."
115
+ exit 1
116
+ ;;
117
+ esac
118
+ node - "$reason" "$comment_file" > "$tmpdir/payload.json" <<'NODE'
119
+ const fs = require("node:fs");
120
+ const [reason, commentFile] = process.argv.slice(2);
121
+ process.stdout.write(JSON.stringify({
122
+ state: "dismissed",
123
+ dismissed_reason: reason,
124
+ dismissed_comment: fs.readFileSync(commentFile, "utf8")
125
+ }));
126
+ NODE
127
+ if ! gh api --method PATCH "$endpoint" --input "$tmpdir/payload.json" > "$tmpdir/response.json" 2> "$tmpdir/error.txt"; then
128
+ emit_error "SECURITY_API_FAILED" "Unable to dismiss the security alert."
129
+ exit 2
130
+ fi
131
+ fi
132
+
133
+ node - "$operation" "$tmpdir/response.json" <<'NODE'
134
+ const fs = require("node:fs");
135
+ const [operation, responsePath] = process.argv.slice(2);
136
+ const raw = fs.readFileSync(responsePath, "utf8").trim();
137
+ let data = null;
138
+ if (raw) {
139
+ try {
140
+ data = JSON.parse(raw);
141
+ } catch {
142
+ process.stdout.write(`${JSON.stringify({
143
+ status: "failed",
144
+ operation,
145
+ error: { code: "SECURITY_RESPONSE_INVALID", message: "The platform returned invalid JSON." }
146
+ })}\n`);
147
+ process.exit(1);
148
+ }
149
+ }
150
+ process.stdout.write(`${JSON.stringify({ status: "applied", operation, data })}\n`);
151
+ NODE
@@ -0,0 +1,31 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ operation="${1:-}"
6
+
7
+ node - "$operation" <<'NODE'
8
+ const operation = process.argv[2] || "";
9
+ const known = new Set([
10
+ "read-dependabot",
11
+ "dismiss-dependabot",
12
+ "read-codescan",
13
+ "dismiss-codescan"
14
+ ]);
15
+ const payload = known.has(operation)
16
+ ? {
17
+ status: "degraded",
18
+ operation,
19
+ error: {
20
+ code: "PLATFORM_SECURITY_UNSUPPORTED",
21
+ message: "The current platform does not provide a security alert adapter."
22
+ }
23
+ }
24
+ : {
25
+ status: "failed",
26
+ operation,
27
+ error: { code: "SECURITY_OPERATION_INVALID", message: "Unknown security alert operation." }
28
+ };
29
+ process.stdout.write(`${JSON.stringify(payload)}\n`);
30
+ process.exit(known.has(operation) ? 0 : 1);
31
+ NODE
@@ -15,6 +15,7 @@ If the entry operands contain `--orchestrated`, bind `{execution-flag}` to `--or
15
15
 
16
16
  - This skill only outputs a requirements analysis document (`analysis.md` or `analysis-r{N}.md`) and does not modify any business code
17
17
  - Base the analysis strictly on the existing task input, requirements, context, and source information in `task.md`
18
+ - Before generating task or lifecycle Markdown that will be synchronized to an Issue, read `.agents/rules/sync-content-generation.md` and apply its producer-side constraints; the sync path does not parse or rewrite the body
18
19
  - When old behavior, data, schemas, or callers are involved, read `.agents/rules/compatibility-policy.md` first. State current-only when admission evidence is absent; do not turn speculation into a requirement
19
20
  - After executing this skill, you **must** immediately update task status in task.md
20
21
 
@@ -15,6 +15,7 @@ description: >
15
15
 
16
16
  - 本技能仅产出需求分析文档(`analysis.md` 或 `analysis-r{N}.md`)—— 不修改任何业务代码
17
17
  - 严格基于 `task.md` 中已有的任务输入、需求、上下文和来源信息展开分析
18
+ - 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
18
19
  - 涉及旧行为、旧数据、旧 schema 或旧调用方时,先读取 `.agents/rules/compatibility-policy.md`;没有兼容准入证据时明确采用 current-only,不把推测写成需求
19
20
  - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
20
21
 
@@ -23,7 +23,7 @@ The skill still owns the security-alert API. When a related task exists, Step 7
23
23
 
24
24
  ### 1. Retrieve Alert Information
25
25
 
26
- Read `.agents/rules/security-alerts.md` before this step, then use its Code Scanning alert read command to fetch the alert details.
26
+ Read `.agents/rules/security-alerts.md` before this step, then run `bash .agents/scripts/security-alerts.sh read-codescan --number {alert-number}` and parse its JSON result to fetch the alert details.
27
27
 
28
28
  Verify that the alert is in the `open` state. If it is already dismissed or fixed, inform the user and exit.
29
29
 
@@ -71,7 +71,7 @@ Confirm? (y/N)
71
71
 
72
72
  ### 6. Execute the Dismissal
73
73
 
74
- Dismiss the alert by following the Code Scanning dismiss command in `.agents/rules/security-alerts.md`, passing the mapped `{api-reason}` and the user's explanation.
74
+ Write the user's explanation to `{comment-file}`, then run `bash .agents/scripts/security-alerts.sh dismiss-codescan --number {alert-number} --reason {api-reason} --comment-file {comment-file}`. Parse the JSON result and continue only when the dismissal is `applied` or `no-op`.
75
75
 
76
76
  **API reason mapping** (per the Code Scanning API):
77
77
  - False Positive -> `false positive`
@@ -23,7 +23,7 @@ description: >
23
23
 
24
24
  ### 1. 获取告警信息
25
25
 
26
- 执行前先读取 `.agents/rules/security-alerts.md`,并按其中的 Code Scanning 告警读取命令获取告警详情。
26
+ 执行前先读取 `.agents/rules/security-alerts.md`,然后运行 `bash .agents/scripts/security-alerts.sh read-codescan --number {alert-number}`,解析其 JSON 结果获取告警详情。
27
27
 
28
28
  验证告警处于 `open` 状态。如果已被关闭/修复,告知用户并退出。
29
29
 
@@ -71,7 +71,7 @@ Code Scanning 告警 #{alert-number}
71
71
 
72
72
  ### 6. 执行关闭
73
73
 
74
- 按 `.agents/rules/security-alerts.md` 中的 Code Scanning 告警关闭命令执行关闭操作,并传入映射后的 `{api-reason}` 与用户说明。
74
+ 将用户说明写入 `{comment-file}`,然后运行 `bash .agents/scripts/security-alerts.sh dismiss-codescan --number {alert-number} --reason {api-reason} --comment-file {comment-file}`。解析 JSON 结果,仅当关闭状态为 `applied` 或 `no-op` 时继续。
75
75
 
76
76
  **API reason 映射**(按 Code Scanning API):
77
77
  - 误报 -> `false positive`