@fitlab-ai/agent-infra 0.9.12 → 0.9.14

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 (402) hide show
  1. package/README.md +11 -11
  2. package/README.zh-CN.md +11 -11
  3. package/bin/cli.ts +26 -9
  4. package/dist/bin/cli.js +173 -157
  5. package/dist/bin/internal-cli.js +66 -40
  6. package/dist/lib/agent-client.js +5 -0
  7. package/dist/lib/agent-clients/next-steps.js +6 -1
  8. package/dist/lib/decide.js +3 -3
  9. package/dist/lib/internal/agent-client.js +5 -2
  10. package/dist/lib/internal/cli-route-inventory.js +152 -0
  11. package/dist/lib/internal/codex-lifecycle.js +9 -6
  12. package/dist/lib/internal/codex-sandbox-controller.js +8 -2
  13. package/dist/lib/internal/git-workflow.js +10 -6
  14. package/dist/lib/internal/platform-checks.js +19 -7
  15. package/dist/lib/internal/platform-comment.js +25 -13
  16. package/dist/lib/internal/platform-context.js +6 -3
  17. package/dist/lib/internal/platform-issue.js +20 -13
  18. package/dist/lib/internal/platform-metadata.js +88 -0
  19. package/dist/lib/internal/platform-pr-review.js +26 -13
  20. package/dist/lib/internal/platform-pr.js +84 -31
  21. package/dist/lib/internal/platform-release-notes.js +9 -6
  22. package/dist/lib/internal/platform-security.js +93 -0
  23. package/dist/lib/internal/pr-review-grade.js +25 -12
  24. package/dist/lib/internal/release-workflow.js +23 -9
  25. package/dist/lib/internal/sandbox-control.js +50 -7
  26. package/dist/lib/internal/task-activity.js +16 -7
  27. package/dist/lib/internal/task-artifact.js +235 -24
  28. package/dist/lib/internal/task-context.js +4 -1
  29. package/dist/lib/internal/task-create.js +50 -17
  30. package/dist/lib/internal/task-delivery.js +4 -1
  31. package/dist/lib/internal/task-event.js +10 -4
  32. package/dist/lib/internal/task-finalization.js +6 -3
  33. package/dist/lib/internal/task-invalidation.js +63 -0
  34. package/dist/lib/internal/task-ledger.js +20 -6
  35. package/dist/lib/internal/task-lifecycle.js +6 -3
  36. package/dist/lib/internal/task-operation-registry.js +421 -0
  37. package/dist/lib/internal/task-orchestration.js +12 -0
  38. package/dist/lib/internal/task-override.js +14 -7
  39. package/dist/lib/internal/task-qualification.js +90 -0
  40. package/dist/lib/internal/task-review.js +7 -4
  41. package/dist/lib/internal/task-short-id.js +11 -1
  42. package/dist/lib/internal/task-snapshot.js +4 -1
  43. package/dist/lib/internal/task-validate.js +7 -2
  44. package/dist/lib/internal/task-verify.js +11 -7
  45. package/dist/lib/internal/task-warning.js +11 -4
  46. package/dist/lib/platform/adapters.js +1 -3
  47. package/dist/lib/platform/change-request-git-evidence.js +27 -7
  48. package/dist/lib/platform/comment-safety.js +226 -0
  49. package/dist/lib/platform/completion-backfill.js +6 -5
  50. package/dist/lib/platform/context.js +70 -130
  51. package/dist/lib/platform/github-client.js +1 -1
  52. package/dist/lib/platform/github-provider.js +1130 -0
  53. package/dist/lib/platform/in-label-sync.js +143 -0
  54. package/dist/lib/platform/issue-comments.js +237 -72
  55. package/dist/lib/platform/issues.js +335 -189
  56. package/dist/lib/platform/metadata-labels.js +6 -2
  57. package/dist/lib/platform/none-provider.js +28 -0
  58. package/dist/lib/platform/pr-change-report.js +545 -0
  59. package/dist/lib/platform/pr-checks.js +119 -104
  60. package/dist/lib/platform/pr-review.js +88 -72
  61. package/dist/lib/platform/pr-summary.js +541 -50
  62. package/dist/lib/platform/provider-bridge.js +45 -0
  63. package/dist/lib/platform/provider-contract.d.ts +553 -0
  64. package/dist/lib/platform/provider-contract.js +99 -0
  65. package/dist/lib/platform/provider-loader.js +251 -0
  66. package/dist/lib/platform/provider-validation.js +577 -0
  67. package/dist/lib/platform/pull-request-metadata.js +8 -6
  68. package/dist/lib/platform/pull-requests.js +734 -543
  69. package/dist/lib/platform/release-notes.js +78 -55
  70. package/dist/lib/platform/releases.js +79 -50
  71. package/dist/lib/platform/repository-metadata.js +377 -0
  72. package/dist/lib/platform/resource-identity.d.ts +26 -0
  73. package/dist/lib/platform/resource-identity.js +92 -0
  74. package/dist/lib/platform/security-alerts.js +155 -0
  75. package/dist/lib/platform/task-identities.js +31 -0
  76. package/dist/lib/platform/verification-required.js +11 -12
  77. package/dist/lib/platform/verification-sync.js +129 -248
  78. package/dist/lib/pr-review/evidence-grading.js +19 -6
  79. package/dist/lib/process-data/index.js +7 -0
  80. package/dist/lib/run/index.js +68 -23
  81. package/dist/lib/sandbox/commands/control-status.js +22 -0
  82. package/dist/lib/sandbox/commands/create.js +32 -6
  83. package/dist/lib/sandbox/commands/ls.js +5 -0
  84. package/dist/lib/sandbox/commands/rm.js +827 -120
  85. package/dist/lib/sandbox/commands/show.js +16 -0
  86. package/dist/lib/sandbox/control/client.js +174 -19
  87. package/dist/lib/sandbox/control/completed-reentry.js +85 -0
  88. package/dist/lib/sandbox/control/container-identity.js +28 -31
  89. package/dist/lib/sandbox/control/executor.js +151 -16
  90. package/dist/lib/sandbox/control/lifecycle.js +621 -127
  91. package/dist/lib/sandbox/control/native-file-lock.js +177 -0
  92. package/dist/lib/sandbox/control/protocol.js +77 -0
  93. package/dist/lib/sandbox/control/server.js +677 -34
  94. package/dist/lib/sandbox/control/state.js +209 -4
  95. package/dist/lib/sandbox/control/task-view.js +183 -0
  96. package/dist/lib/sandbox/engines/authority.js +289 -0
  97. package/dist/lib/sandbox/engines/docker-exact-discovery.js +97 -0
  98. package/dist/lib/sandbox/index.js +5 -0
  99. package/dist/lib/sandbox/recovery.js +21 -1
  100. package/dist/lib/sandbox/workspace-view.js +2 -1
  101. package/dist/lib/sandbox/worktree-safety.js +4 -1
  102. package/dist/lib/server/index.js +8 -0
  103. package/dist/lib/server/protocol.js +38 -1
  104. package/dist/lib/task/activity-log.js +8 -1
  105. package/dist/lib/task/artifact-lifecycle.js +75 -18
  106. package/dist/lib/task/artifact-operations.js +520 -0
  107. package/dist/lib/task/artifact-repair-intent.js +59 -0
  108. package/dist/lib/task/artifact-schema.js +135 -0
  109. package/dist/lib/task/capabilities.js +310 -0
  110. package/dist/lib/task/commands/status.js +32 -0
  111. package/dist/lib/task/commit-operation.js +12 -1
  112. package/dist/lib/task/control-authority.js +12 -5
  113. package/dist/lib/task/create-service.js +111 -12
  114. package/dist/lib/task/create.js +25 -0
  115. package/dist/lib/task/current-contract.js +5 -1
  116. package/dist/lib/task/decision-details.js +1 -1
  117. package/dist/lib/task/events.js +416 -17
  118. package/dist/lib/task/finalization.js +37 -13
  119. package/dist/lib/task/human-override.js +58 -36
  120. package/dist/lib/task/index.js +11 -3
  121. package/dist/lib/task/invalidation-command.js +86 -0
  122. package/dist/lib/task/invalidation.js +260 -0
  123. package/dist/lib/task/ledger-intents.js +37 -0
  124. package/dist/lib/task/local-artifact-finalization.js +299 -0
  125. package/dist/lib/task/orchestration.js +240 -144
  126. package/dist/lib/task/pr-delivery-fact.js +102 -101
  127. package/dist/lib/task/qualification-audit.js +490 -0
  128. package/dist/lib/task/qualification-confirmation.js +109 -0
  129. package/dist/lib/task/qualification-intents.js +148 -0
  130. package/dist/lib/task/review-artifacts.js +22 -23
  131. package/dist/lib/task/review-finalization.js +121 -4
  132. package/dist/lib/task/review-fingerprint.js +24 -2
  133. package/dist/lib/task/rework-intent.js +138 -0
  134. package/dist/lib/task/sections.js +6 -4
  135. package/dist/lib/task/skill-scope.js +23 -0
  136. package/dist/lib/task/task-execution-lock.js +27 -17
  137. package/dist/lib/task/verification-config.js +11 -0
  138. package/dist/lib/task/verification-engine.js +93 -16
  139. package/dist/lib/task/verification.js +3 -3
  140. package/dist/lib/task/workflow-warning-intents.js +1 -1
  141. package/dist/lib/task/write.js +11 -0
  142. package/dist/lib/version.js +11 -1
  143. package/dist/lifecycle-build-manifest.json +3 -3
  144. package/lib/agent-client.ts +9 -0
  145. package/lib/agent-clients/next-steps.ts +6 -1
  146. package/lib/decide.ts +3 -3
  147. package/lib/init.ts +1 -1
  148. package/lib/internal/agent-client.ts +4 -2
  149. package/lib/internal/cli-route-inventory.ts +140 -0
  150. package/lib/internal/codex-lifecycle.ts +8 -6
  151. package/lib/internal/codex-sandbox-controller.ts +7 -2
  152. package/lib/internal/git-workflow.ts +9 -6
  153. package/lib/internal/platform-checks.ts +14 -6
  154. package/lib/internal/platform-comment.ts +20 -12
  155. package/lib/internal/platform-context.ts +5 -3
  156. package/lib/internal/platform-issue.ts +17 -11
  157. package/lib/internal/platform-metadata.ts +70 -0
  158. package/lib/internal/platform-pr-review.ts +23 -12
  159. package/lib/internal/platform-pr.ts +65 -27
  160. package/lib/internal/platform-release-notes.ts +8 -6
  161. package/lib/internal/platform-security.ts +83 -0
  162. package/lib/internal/pr-review-grade.ts +20 -11
  163. package/lib/internal/release-workflow.ts +21 -9
  164. package/lib/internal/sandbox-control.ts +44 -6
  165. package/lib/internal/task-activity.ts +15 -7
  166. package/lib/internal/task-artifact.ts +204 -22
  167. package/lib/internal/task-context.ts +3 -1
  168. package/lib/internal/task-create.ts +78 -17
  169. package/lib/internal/task-delivery.ts +3 -1
  170. package/lib/internal/task-event.ts +9 -4
  171. package/lib/internal/task-finalization.ts +6 -4
  172. package/lib/internal/task-invalidation.ts +41 -0
  173. package/lib/internal/task-ledger.ts +21 -8
  174. package/lib/internal/task-lifecycle.ts +5 -3
  175. package/lib/internal/task-operation-registry.ts +482 -0
  176. package/lib/internal/task-orchestration.ts +12 -0
  177. package/lib/internal/task-override.ts +15 -9
  178. package/lib/internal/task-qualification.ts +61 -0
  179. package/lib/internal/task-review.ts +6 -4
  180. package/lib/internal/task-short-id.ts +10 -1
  181. package/lib/internal/task-snapshot.ts +3 -1
  182. package/lib/internal/task-validate.ts +6 -2
  183. package/lib/internal/task-verify.ts +10 -7
  184. package/lib/internal/task-warning.ts +10 -4
  185. package/lib/platform/adapters.ts +3 -2
  186. package/lib/platform/change-request-git-evidence.ts +36 -9
  187. package/lib/platform/comment-safety.ts +250 -0
  188. package/lib/platform/completion-backfill.ts +9 -8
  189. package/lib/platform/context.ts +97 -134
  190. package/lib/platform/github-client.ts +2 -2
  191. package/lib/platform/github-provider.ts +1132 -0
  192. package/lib/platform/in-label-sync.ts +208 -0
  193. package/lib/platform/issue-comments.ts +255 -80
  194. package/lib/platform/issues.ts +344 -174
  195. package/lib/platform/metadata-labels.ts +5 -2
  196. package/lib/platform/none-provider.ts +35 -0
  197. package/lib/platform/pr-change-report.ts +639 -0
  198. package/lib/platform/pr-checks.ts +126 -106
  199. package/lib/platform/pr-review.ts +88 -85
  200. package/lib/platform/pr-summary.ts +581 -53
  201. package/lib/platform/provider-bridge.ts +82 -0
  202. package/lib/platform/provider-contract.ts +611 -0
  203. package/lib/platform/provider-loader.ts +307 -0
  204. package/lib/platform/provider-validation.ts +611 -0
  205. package/lib/platform/pull-request-metadata.ts +10 -7
  206. package/lib/platform/pull-requests.ts +781 -550
  207. package/lib/platform/release-notes.ts +76 -59
  208. package/lib/platform/releases.ts +77 -43
  209. package/lib/platform/repository-metadata.ts +453 -0
  210. package/lib/platform/resource-identity.ts +121 -0
  211. package/lib/platform/security-alerts.ts +191 -0
  212. package/lib/platform/task-identities.ts +40 -0
  213. package/lib/platform/types.ts +4 -2
  214. package/lib/platform/verification-required.ts +11 -13
  215. package/lib/platform/verification-sync.ts +128 -304
  216. package/lib/pr-review/evidence-grading.ts +25 -8
  217. package/lib/process-data/index.ts +7 -0
  218. package/lib/run/index.ts +62 -22
  219. package/lib/sandbox/commands/control-status.ts +26 -0
  220. package/lib/sandbox/commands/create.ts +46 -6
  221. package/lib/sandbox/commands/ls.ts +7 -0
  222. package/lib/sandbox/commands/rm.ts +1000 -87
  223. package/lib/sandbox/commands/show.ts +16 -0
  224. package/lib/sandbox/control/client.ts +203 -19
  225. package/lib/sandbox/control/completed-reentry.ts +98 -0
  226. package/lib/sandbox/control/container-identity.ts +27 -43
  227. package/lib/sandbox/control/executor.ts +180 -15
  228. package/lib/sandbox/control/lifecycle.ts +629 -17
  229. package/lib/sandbox/control/native-file-lock.ts +209 -0
  230. package/lib/sandbox/control/protocol.ts +118 -2
  231. package/lib/sandbox/control/server.ts +724 -34
  232. package/lib/sandbox/control/state.ts +257 -4
  233. package/lib/sandbox/control/task-view.ts +240 -0
  234. package/lib/sandbox/engines/authority.ts +365 -0
  235. package/lib/sandbox/engines/docker-exact-discovery.ts +132 -0
  236. package/lib/sandbox/index.ts +7 -0
  237. package/lib/sandbox/recovery.ts +21 -1
  238. package/lib/sandbox/workspace-view.ts +9 -3
  239. package/lib/sandbox/worktree-safety.ts +4 -1
  240. package/lib/server/index.ts +10 -0
  241. package/lib/server/protocol.ts +36 -1
  242. package/lib/task/activity-log.ts +8 -0
  243. package/lib/task/artifact-lifecycle.ts +70 -22
  244. package/lib/task/artifact-operations.ts +626 -0
  245. package/lib/task/artifact-repair-intent.ts +71 -0
  246. package/lib/task/artifact-schema.ts +192 -0
  247. package/lib/task/capabilities.ts +331 -0
  248. package/lib/task/commands/status.ts +38 -0
  249. package/lib/task/commit-operation.ts +12 -1
  250. package/lib/task/control-authority.ts +22 -9
  251. package/lib/task/create-service.ts +139 -14
  252. package/lib/task/create.ts +27 -0
  253. package/lib/task/current-contract.ts +6 -1
  254. package/lib/task/decision-details.ts +6 -2
  255. package/lib/task/events.ts +392 -16
  256. package/lib/task/finalization.ts +50 -14
  257. package/lib/task/human-override.ts +70 -46
  258. package/lib/task/index.ts +16 -3
  259. package/lib/task/invalidation-command.ts +86 -0
  260. package/lib/task/invalidation.ts +332 -0
  261. package/lib/task/ledger-intents.ts +35 -1
  262. package/lib/task/local-artifact-finalization.ts +432 -0
  263. package/lib/task/orchestration.ts +223 -133
  264. package/lib/task/pr-delivery-fact.ts +131 -148
  265. package/lib/task/qualification-audit.ts +599 -0
  266. package/lib/task/qualification-confirmation.ts +117 -0
  267. package/lib/task/qualification-intents.ts +150 -0
  268. package/lib/task/review-artifacts.ts +21 -22
  269. package/lib/task/review-finalization.ts +133 -4
  270. package/lib/task/review-fingerprint.ts +23 -2
  271. package/lib/task/rework-intent.ts +165 -0
  272. package/lib/task/sections.ts +6 -4
  273. package/lib/task/skill-scope.ts +24 -0
  274. package/lib/task/task-execution-lock.ts +23 -14
  275. package/lib/task/verification-config.ts +12 -0
  276. package/lib/task/verification-engine.ts +103 -17
  277. package/lib/task/verification.ts +4 -4
  278. package/lib/task/workflow-warning-intents.ts +1 -1
  279. package/lib/task/write.ts +19 -0
  280. package/lib/update.ts +1 -1
  281. package/lib/version.ts +15 -1
  282. package/package.json +12 -1
  283. package/templates/.agents/rules/README.en.md +3 -1
  284. package/templates/.agents/rules/README.zh-CN.md +3 -1
  285. package/templates/.agents/rules/decision-qualification.en.md +22 -0
  286. package/templates/.agents/rules/decision-qualification.zh-CN.md +22 -0
  287. package/templates/.agents/rules/evidence-reporting.en.md +28 -0
  288. package/templates/.agents/rules/evidence-reporting.zh-CN.md +28 -0
  289. package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
  290. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
  291. package/templates/.agents/rules/issue-sync.en.md +2 -0
  292. package/templates/.agents/rules/issue-sync.zh-CN.md +2 -0
  293. package/templates/.agents/rules/label-milestone-setup.en.md +7 -7
  294. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +7 -7
  295. package/templates/.agents/rules/local-artifact-repair.en.md +13 -2
  296. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +13 -2
  297. package/templates/.agents/rules/pr-sync.en.md +10 -4
  298. package/templates/.agents/rules/pr-sync.zh-CN.md +17 -4
  299. package/templates/.agents/rules/security-alerts.en.md +8 -8
  300. package/templates/.agents/rules/security-alerts.zh-CN.md +8 -8
  301. package/templates/.agents/rules/task-short-id.en.md +1 -4
  302. package/templates/.agents/rules/task-short-id.zh-CN.md +1 -3
  303. package/templates/.agents/skills/analyze-task/SKILL.en.md +28 -5
  304. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +29 -5
  305. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -12
  306. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -12
  307. package/templates/.agents/skills/check-task/SKILL.en.md +16 -37
  308. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -37
  309. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  310. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  311. package/templates/.agents/skills/close-dependabot/SKILL.en.md +2 -2
  312. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
  313. package/templates/.agents/skills/code-task/SKILL.en.md +41 -9
  314. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +43 -11
  315. package/templates/.agents/skills/code-task/config/verify.en.json +6 -14
  316. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +6 -14
  317. package/templates/.agents/skills/code-task/reference/code-rules.en.md +5 -4
  318. package/templates/.agents/skills/code-task/reference/code-rules.zh-CN.md +5 -4
  319. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +1 -1
  320. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +1 -1
  321. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +3 -1
  322. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +3 -1
  323. package/templates/.agents/skills/code-task/reference/report-template.en.md +42 -15
  324. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +39 -12
  325. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +2 -0
  326. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +2 -0
  327. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +3 -3
  328. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +3 -3
  329. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +10 -4
  330. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +10 -4
  331. package/templates/.agents/skills/complete-manual-validation/reference/report-template.en.md +2 -0
  332. package/templates/.agents/skills/complete-manual-validation/reference/report-template.zh-CN.md +2 -0
  333. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +4 -3
  334. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +4 -3
  335. package/templates/.agents/skills/complete-task/SKILL.en.md +26 -21
  336. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +25 -21
  337. package/templates/.agents/skills/create-pr/SKILL.en.md +7 -6
  338. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +7 -7
  339. package/templates/.agents/skills/create-pr/config/verify.json +1 -0
  340. package/templates/.agents/skills/create-pr/reference/change-report.en.md +16 -4
  341. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +16 -4
  342. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +5 -3
  343. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +5 -3
  344. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +1 -1
  345. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +1 -1
  346. package/templates/.agents/skills/create-pr/scripts/change-report.mjs +3 -0
  347. package/templates/.agents/skills/create-task/SKILL.en.md +8 -0
  348. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +7 -0
  349. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  350. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  351. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  352. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  353. package/templates/.agents/skills/init-labels/SKILL.en.md +8 -8
  354. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -8
  355. package/templates/.agents/skills/init-milestones/SKILL.en.md +9 -11
  356. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +9 -11
  357. package/templates/.agents/skills/plan-task/SKILL.en.md +27 -4
  358. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +26 -4
  359. package/templates/.agents/skills/plan-task/config/verify.en.json +4 -14
  360. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +4 -14
  361. package/templates/.agents/skills/review-analysis/SKILL.en.md +17 -4
  362. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +17 -4
  363. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -18
  364. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -18
  365. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +50 -23
  366. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +45 -18
  367. package/templates/.agents/skills/review-code/SKILL.en.md +18 -5
  368. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +18 -5
  369. package/templates/.agents/skills/review-code/config/verify.en.json +1 -23
  370. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -23
  371. package/templates/.agents/skills/review-code/reference/report-template.en.md +49 -22
  372. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +45 -18
  373. package/templates/.agents/skills/review-plan/SKILL.en.md +17 -4
  374. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +17 -4
  375. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -18
  376. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -18
  377. package/templates/.agents/skills/review-plan/reference/report-template.en.md +49 -22
  378. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +45 -18
  379. package/templates/.agents/skills/review-pr/SKILL.en.md +5 -1
  380. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +5 -1
  381. package/templates/.agents/skills/review-pr/reference/report-template.en.md +4 -3
  382. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +4 -3
  383. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +9 -3
  384. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +9 -3
  385. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +3 -1
  386. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +3 -1
  387. package/templates/.agents/skills/test/SKILL.en.md +13 -2
  388. package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -2
  389. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +14 -0
  390. package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
  391. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
  392. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +6 -0
  393. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +6 -0
  394. package/templates/.agents/templates/task.en.md +24 -1
  395. package/templates/.agents/templates/task.zh-CN.md +24 -1
  396. package/templates/.github/workflows/pr-label.yml +7 -26
  397. package/templates/.agents/scripts/security-alerts.github.sh +0 -151
  398. package/templates/.agents/scripts/security-alerts.sh +0 -31
  399. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +0 -146
  400. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +0 -32
  401. package/templates/.agents/skills/init-milestones/scripts/init-milestones.github.sh +0 -294
  402. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +0 -6
@@ -8,12 +8,18 @@ description: >
8
8
 
9
9
  # 运行人工校验
10
10
 
11
+ 生命周期事件必须携带显式触发信息:编排调用使用 `{trigger-initiator}=orchestrator`,否则使用 `model`;`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `validation-rerun`;started 与 completed 使用同一组值。
12
+
11
13
  ## 任务上下文解析
12
14
 
13
15
  入口可省略 task ref;显式 task scope 仅接受 `--task <ref>` 或 `-t <ref>`,不再解释位置 task ref。先解析 `--scope`、`--timeout`、`--format`,在 `--` 后原样保留用户命令,再调用 `agent-infra-internal task-context resolve {task-scope}`。解析失败时透传非零退出码,不自行扫描任务。内部 `task-validate` 协议仍使用位置 task ref。
14
16
 
15
17
  ## 行为边界
16
18
 
19
+ ### 持久化报告证据
20
+
21
+ 生成验证报告时,先读取 `.agents/rules/evidence-reporting.md`。只记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得记录完整 argv、环境变量、token、绝对路径或原始敏感 transcript。
22
+
17
23
  - 本技能负责选择校验模式、调用唯一机械入口并记录证据;不把 PR 人工校验标为完成。
18
24
  - `complete-manual-validation` 仍是维护者确认覆盖充分后的最终登记入口。
19
25
  - 禁止直接操作临时 worktree、lease 或 container;只调用 `agent-infra-internal task-validate`。
@@ -22,7 +28,7 @@ description: >
22
28
 
23
29
  ## 第 0 步:状态核对(执行前硬约束)
24
30
 
25
- 解析任务引用后运行,并把原文写入产物:
31
+ 解析任务引用后运行,并在产物中记录任务/产物范围、关键结果和未覆盖部分;正常成功不粘贴完整目录清单或 `task.md` 尾部,失败、阻塞、身份不一致或争议时附决定性原文行:
26
32
 
27
33
  ```bash
28
34
  agent-infra-internal task-snapshot {task-id} --format text
@@ -32,10 +38,10 @@ agent-infra-internal task-snapshot {task-id} --format text
32
38
 
33
39
  1. 读取 `reference/discovery-and-execution.md`,解析输入模式;非法或半截输入在 started 前停止,不写产物。
34
40
  2. 运行 `agent-infra-internal task-artifact {task-id} inspect --family validation-run`,读取最新 review-code 人工校验项;再运行 `agent-infra-internal platform-pr inspect {task-id}`,按 reference 的状态矩阵发现、归并并编号。仅在自动模式下,可靠来源无项或唯一可能来源不可读时才在 started 前停止;合法显式模式始终以用户命令作为有效工作继续。
35
- 3. 从核心结果取得轮次和产物名;确认存在有效显式工作或非空发现清单后,运行 `agent-infra-internal task-event {task-id} validation-run.started --agent {standard-agent-token}`,并逐项分类为 `executable|unavailable|unknown|unsafe|unresolved`。
41
+ 3. 从核心结果取得轮次和产物名;确认存在有效显式工作或非空发现清单后,运行 `agent-infra-internal task-event {task-id} validation-run.started --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code}`,并逐项分类为 `executable|unavailable|unknown|unsafe|unresolved`。
36
42
  4. 每个可执行项分别调用 `agent-infra-internal task-validate {task-ref} --scope snapshot --format json -- {command...}`;只有证据表明必须原位时才对该项进行第二次显式 inplace 调用。零项可执行时不运行伪造命令,但仍继续产出覆盖缺口证据。
37
43
  5. 读取 `reference/report-template.md`,创建 `validation-run.md|validation-run-r{N}.md`;记录输入模式、发现清单、逐项结果、CLI JSON allowlist 与去敏摘要。
38
- 6. 运行 `agent-infra-internal task-event {task-id} validation-run.completed --agent {standard-agent-token} --artifact {artifact}`。存在 Issue 时依次运行 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 和 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {standard-agent-token}`。
44
+ 6. 运行 `agent-infra-internal task-event {task-id} validation-run.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {artifact}`。存在 Issue 时依次运行 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 和 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {artifact} --agent {standard-agent-token}`。
39
45
  7. 运行 `agent-infra-internal task-verify {task-id} validation-run.completed --artifact {artifact} --format text`;未通过则修复后重跑。
40
46
  8. 告知用户证据路径、覆盖缺口和验证结果;明确仍需维护者判断是否执行 `complete-manual-validation`。读取 `.agents/rules/next-step-output.md`,最后一行输出 `Completed at`。
41
47
 
@@ -10,8 +10,9 @@
10
10
 
11
11
  ```text
12
12
  $ agent-infra-internal task-snapshot {task-id} --format text
13
- {raw-output}
13
+ {command-summary-and-key-result}
14
14
  ```
15
+ > Follow `.agents/rules/evidence-reporting.md`: record command name, target scope, exit status, sanitized result, and coverage gap; do not paste complete argv or sensitive transcripts.
15
16
 
16
17
  ## Validation Target
17
18
 
@@ -67,3 +68,4 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
68
  $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
68
69
  {sanitized-result}
69
70
  ```
71
+ > Keep only the allowed public command and sanitized structured result; complete successful stdout is not default report content.
@@ -10,8 +10,9 @@
10
10
 
11
11
  ```text
12
12
  $ agent-infra-internal task-snapshot {task-id} --format text
13
- {raw-output}
13
+ {command-summary-and-key-result}
14
14
  ```
15
+ > 按 `.agents/rules/evidence-reporting.md` 记录命令名称、目标范围、退出状态、sanitized result 和覆盖缺口;不得粘贴完整 argv 或敏感 transcript。
15
16
 
16
17
  ## 验证目标
17
18
 
@@ -67,3 +68,4 @@ $ agent-infra-internal task-snapshot {task-id} --format text
67
68
  $ agent-infra-internal task-validate {task-ref} --scope {scope} --format json -- {redacted-command}
68
69
  {sanitized-result}
69
70
  ```
71
+ > 仅保留允许公开的命令与脱敏结构化结果;完整成功 stdout 不属于默认报告内容。
@@ -27,6 +27,17 @@ Confirm no compilation errors.
27
27
 
28
28
  This project uses three test layers as an optional optimization; if the test suite is small, all layers may map to the same full test command.
29
29
 
30
+ ### fast smoke (target <5s)
31
+
32
+ ```bash
33
+ # TODO: Replace with this project's fast smoke subset command
34
+ # npm run test:smoke:fast (Node.js)
35
+ # pytest -m "not slow" (Python)
36
+ # go test -short ./... (Go)
37
+ ```
38
+
39
+ Use for code-task inner loops when the project provides a build-free fast path. It should cover the same tests as smoke while skipping redundant compilation or generation.
40
+
30
41
  ### smoke (target <5s)
31
42
 
32
43
  ```bash
@@ -37,8 +48,8 @@ This project uses three test layers as an optional optimization; if the test sui
37
48
  ```
38
49
 
39
50
  Use for:
40
- - code-task inner loops
41
- - save-and-run / frequent feedback
51
+ - after completing an implementation step
52
+ - save-and-run / frequent feedback when no fast path exists
42
53
  - project structure, configuration, and template contract checks
43
54
 
44
55
  ### core (target <15s)
@@ -25,6 +25,17 @@ description: >
25
25
 
26
26
  三层测试是可选的反馈速度优化;如果测试套件较小,所有层级都可以映射到同一个完整测试命令。
27
27
 
28
+ ### fast smoke(目标 <5s)
29
+
30
+ ```bash
31
+ # TODO:替换为项目的 fast smoke 子集命令
32
+ # npm run test:smoke:fast (Node.js)
33
+ # pytest -m "not slow" (Python)
34
+ # go test -short ./... (Go)
35
+ ```
36
+
37
+ 当项目提供不重复构建的快速路径时,用于 code-task 内循环。它应覆盖与 smoke 相同的测试,同时跳过重复的编译或生成步骤。
38
+
28
39
  ### smoke(目标 <5s)
29
40
 
30
41
  ```bash
@@ -35,8 +46,8 @@ description: >
35
46
  ```
36
47
 
37
48
  适用场景:
38
- - code-task 内循环
39
- - 保存即跑 / 频繁反馈
49
+ - 完成一个实施步骤后
50
+ - 项目没有 fast 路径时的保存即跑 / 频繁反馈
40
51
  - 仅断言项目结构、配置、模板契约
41
52
 
42
53
  ### core(目标 <15s)
@@ -1269,6 +1269,9 @@ function syncTemplates(projectRoot, templateRootOverride) {
1269
1269
  }
1270
1270
  }
1271
1271
  const version = resolveVersionFromTemplateRoot(templateRoot);
1272
+ const projectTemplateRoot = path.join(projectRoot, 'templates');
1273
+ const sourceRepositoryTemplate = fs.existsSync(projectTemplateRoot)
1274
+ && fs.realpathSync(templateRoot) === fs.realpathSync(projectTemplateRoot);
1272
1275
 
1273
1276
  const { project, org, language: lang = 'en' } = cfg;
1274
1277
  const platformType = cfg.platform?.type || DEFAULTS.platform.type;
@@ -1771,6 +1774,17 @@ function syncTemplates(projectRoot, templateRootOverride) {
1771
1774
  for (const [tgt, src] of selected) {
1772
1775
  if (expectedTargets) expectedTargets.add(tgt);
1773
1776
 
1777
+ if (sourceRepositoryTemplate && tgt === '.github/workflows/pr-label.yml') {
1778
+ report.managed.protected.push({
1779
+ target: tgt,
1780
+ reason: 'source-repository',
1781
+ baseline: trustedBaseline(managedBaselines[tgt]),
1782
+ local: fs.existsSync(path.join(projectRoot, tgt)) ? sha256(fs.readFileSync(path.join(projectRoot, tgt))) : null,
1783
+ template: sha256(renderContent(fs.readFileSync(path.join(templateRoot, src), 'utf8'), vars))
1784
+ });
1785
+ continue;
1786
+ }
1787
+
1774
1788
  if (matchesAny(tgt, merged) || matchesAny(tgt, ejected)) {
1775
1789
  report.managed.skippedMerged.push(tgt);
1776
1790
  continue;
@@ -48,13 +48,13 @@ Resolve the target PR number `{pr#}` and an optional `{task-id}` via these deter
48
48
 
49
49
  Before running this step, read `reference/monitor-and-heal.md` and `.agents/rules/pr-checks-commands.md`.
50
50
 
51
- Initialize `repairCommits=[]` and `rebaseAttempts=0`. Run `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`, then route only by `readiness.state`: `ready` to step 7, `conflicting|checks-failed` to step 3, and `pending|timed-out|cancelled` to step 4.
51
+ Initialize `repairCommits=[]` and `rebaseAttempts=0`. Before readiness in every round, run `platform-pr summary-context`, rebuild the task-bound `pr-change-report.json` for the authoritative PR head using the shared PR change-report contract, and refresh the single summary with a body containing one `<!-- canonical-pr-change-report -->` placeholder via `summary-sync --change-report-file ... --result no_op --strict`. `--strict` preserves report or summary refresh failures as `failed/blocked` instead of treating warnings as success. A report or summary refresh failure must not enter the ready/complete exit; use step 4. After the refresh, run `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`, then route only by `readiness.state`: `ready` to step 7, `conflicting|checks-failed` to step 3, and `pending|timed-out|cancelled` to step 4.
52
52
 
53
53
  ### 3. Self-Heal Loop
54
54
 
55
55
  Before running this step, read the "Self-Heal Decision Tree" of `reference/monitor-and-heal.md` and "Resolve a Failing Run id and Pull Logs" of `.agents/rules/pr-checks-commands.md`.
56
56
 
57
- For `checks-failed`, minimally fix a locatable code-layer failure, test, and publish through the existing commit/push intents. For `conflicting`, follow the reference's same-repository, clean-tree, head/base identity, rebase, full-test, and `git-workflow push-rebased` exact-lease flow, capped at two attempts. Append only remotely verified SHAs, then watch the new head again; any failed safety check goes to step 4.
57
+ For `checks-failed`, minimally fix a locatable code-layer failure, test, and publish through the existing commit/push intents. For `conflicting`, follow the reference's same-repository, clean-tree, head/base identity, rebase, full-test, and `git-workflow push-rebased` exact-lease flow, capped at two attempts. Append only remotely verified SHAs; after any external push, self-heal commit, or rebase changes the head, refresh the report and summary before watching the new head again; any failed safety check goes to step 4.
58
58
 
59
59
  ### 4. Help Exit (Produce-Then-Stop)
60
60
 
@@ -48,13 +48,13 @@ description: >
48
48
 
49
49
  执行此步骤前,先读取 `reference/monitor-and-heal.md` 与 `.agents/rules/pr-checks-commands.md`。
50
50
 
51
- 进入本轮时初始化 `repairCommits=[]` 与 `rebaseAttempts=0`。调用 `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`,只按结构化 `readiness.state` 分流:`ready` 进入步骤 7,`conflicting` 或 `checks-failed` 进入步骤 3,`pending|timed-out|cancelled` 进入步骤 4。
51
+ 进入本轮时初始化 `repairCommits=[]` 与 `rebaseAttempts=0`。每轮 readiness 前先调用 `platform-pr summary-context`,按共享 PR change-report contract 以当前权威 PR head 重建任务绑定的 `pr-change-report.json`,再用含唯一 `<!-- canonical-pr-change-report -->` 占位符的正文调用 `summary-sync --change-report-file ... --result no_op --strict` 刷新同一条摘要。`--strict` 将报告或摘要刷新失败保留为 `failed/blocked`,不得把 warning 当作成功;刷新失败时不得进入 ready/complete 出口,按步骤 4 记录阻塞。刷新完成后调用 `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`,只按结构化 `readiness.state` 分流:`ready` 进入步骤 7,`conflicting` 或 `checks-failed` 进入步骤 3,`pending|timed-out|cancelled` 进入步骤 4。
52
52
 
53
53
  ### 3. 自愈循环
54
54
 
55
55
  执行此步骤前,先读取 `reference/monitor-and-heal.md` 的「自愈决策树」与 `.agents/rules/pr-checks-commands.md` 的「解析失败 run id 并拉日志」。
56
56
 
57
- `checks-failed` 只对可定位代码层失败做最小修复和测试,再用既有 commit/push intent 发布。`conflicting` 严格执行 reference 的同仓库、干净工作树、head/base 身份、rebase、完整测试与 `git-workflow push-rebased` 精确 lease 流程;上限 2 次。仅记录远端复核成功的 SHA,随后重新监控新 head;任一安全检查失败转步骤 4。
57
+ `checks-failed` 只对可定位代码层失败做最小修复和测试,再用既有 commit/push intent 发布。`conflicting` 严格执行 reference 的同仓库、干净工作树、head/base 身份、rebase、完整测试与 `git-workflow push-rebased` 精确 lease 流程;上限 2 次。仅记录远端复核成功的 SHA;任何外部 push、自愈 commit 或 rebase 改变 head 后,先按本轮报告→摘要顺序刷新,再重新监控新 head;任一安全检查失败转步骤 4。
58
58
 
59
59
  ### 4. 求助出口(产出后停止)
60
60
 
@@ -11,6 +11,12 @@ After the watch command, route by structured `readiness.state`:
11
11
  - `conflicting`: the platform explicitly reports a head/base conflict → rebase healing in SKILL step 3.
12
12
  - `pending|timed-out|cancelled`: no reliable success fact exists → SKILL step 4.
13
13
 
14
+ ## Summary Refresh Boundary
15
+
16
+ Before readiness in every round, and after an external push, self-heal commit, or successful rebase changes the PR head, rerun `summary-context` → mechanical report and six-check precheck → `platform-pr change-report` → `summary-sync --change-report-file ... --result no_op --strict` with exactly one `<!-- canonical-pr-change-report -->` placeholder. `--strict` preserves report or summary refresh failures as `failed/blocked` so warnings cannot reach the ready/complete route. The core revalidates the sidecar against the authoritative PR snapshot, task-intent digest, and complete patch; missing, stale, invalid, bypassed, or raced publication must not continue to a ready/complete route and must enter the help exit with a warning.
17
+
18
+ When rebuilding the precheck, each of the six `rationale` fields must state the corresponding high-level finding and include at least one path, line range, and concise `detail` as evidence. `change-composition` must describe where responsibilities are concentrated; compatibility, legacy-path, redundancy, and scope checks must state their actual results separately, without reused generic boilerplate. Use the deployed skill's language for rationales and evidence details; Chinese skill deployments must use Chinese.
19
+
14
20
  ## Self-Heal Decision Tree
15
21
 
16
22
  ```text
@@ -11,6 +11,12 @@
11
11
  - `conflicting`:平台明确当前 head 与 base 冲突 → SKILL 步骤 3 的 rebase 自愈。
12
12
  - `pending|timed-out|cancelled`:mergeability/checks 未形成可靠成功事实 → SKILL 步骤 4。
13
13
 
14
+ ## 摘要刷新边界
15
+
16
+ 每轮 readiness 之前,以及外部 push、自愈 commit 或 rebase 成功改变 PR head 之后,必须重新执行 `summary-context` → 机械报告与六项 precheck → `platform-pr change-report` → 含一次 `<!-- canonical-pr-change-report -->` 的 `summary-sync --change-report-file ... --result no_op --strict`。`--strict` 将报告或摘要刷新失败保留为 `failed/blocked`,不允许 warning 穿透到 ready/complete 路由。core 以权威 PR snapshot、任务意图 digest 和完整 patch 重新校验 sidecar;报告缺失、stale、invalid、占位符绕过或发布竞态时,不得继续 ready/complete 路由,转入求助出口并登记 warning。
17
+
18
+ 每轮重建 precheck 时,六项 `rationale` 都必须是对应检查的实际高层结论,并各带至少一条路径、行号和简短 `detail` 证据;`change-composition` 要说明职责集中位置,兼容、旧路径、冗余和范围检查要分别说明实际结果,禁止复用泛化套话。理由和证据详情遵循当前已部署技能的语言,中文技能必须使用中文。
19
+
14
20
  ## 自愈决策树
15
21
 
16
22
  ```text
@@ -36,10 +36,16 @@ delivery_remote_head: # Most recent successfully delivered task branch
36
36
 
37
37
  ### Constraints
38
38
 
39
+ | constraint_id | statement | status | authority | source | evidence | derived_from | approval_evidence |
40
+ | --- | --- | --- | --- | --- | --- | --- | --- |
41
+
39
42
  ### Confirmed Decisions
40
43
 
41
44
  ### Candidate and Rejected Options
42
45
 
46
+ | candidate_id | statement | status | constraint_ids | impact | evidence |
47
+ | --- | --- | --- | --- | --- | --- |
48
+
43
49
  ### Acceptance Criteria
44
50
 
45
51
  ### Open Questions
@@ -96,7 +102,24 @@ delivery_remote_head: # Most recent successfully delivered task branch
96
102
  <!-- Workflow degradation, platform sync failures, permission gaps, and related events. Keep the header when empty. -->
97
103
 
98
104
  | id | time | step | severity | code | status | target | message | action | resolved_at | resolution |
99
- |----|------|------|----------|------|--------|--------|---------|--------|-------------|------------|
105
+ |----|------|------|----------|------|--------|---------|--------|-------------|------------|------------|
106
+
107
+ ## Rework Intent
108
+
109
+ | intent_id | finding_id | source_artifact | source_sha256 | target | status | declared_at | consumed_at |
110
+ |-----------|------------|----------------|---------------|--------|--------|-------------|-------------|
111
+
112
+ ## Artifact Invalidation
113
+
114
+ ### Operations
115
+
116
+ | operation_id | source_family | source_artifact | source_round | source_sha256 | status | processed | total | created_at | updated_at | completed_at | error |
117
+ |--------------|---------------|-----------------|--------------|---------------|--------|-----------|-------|------------|------------|--------------|-------|
118
+
119
+ ### Targets
120
+
121
+ | target_id | operation_id | target_kind | target_family | target_artifact | target_round | target_sha256 | status | reason_code | updated_at |
122
+ |-----------|--------------|-------------|---------------|-----------------|--------------|---------------|--------|-------------|------------|
100
123
 
101
124
  ## Activity Log
102
125
 
@@ -36,10 +36,16 @@ delivery_remote_head: # 最近一次成功交付到 remote 的任务分
36
36
 
37
37
  ### 约束
38
38
 
39
+ | constraint_id | statement | status | authority | source | evidence | derived_from | approval_evidence |
40
+ | --- | --- | --- | --- | --- | --- | --- | --- |
41
+
39
42
  ### 已确认决策
40
43
 
41
44
  ### 候选与否决方案
42
45
 
46
+ | candidate_id | statement | status | constraint_ids | impact | evidence |
47
+ | --- | --- | --- | --- | --- | --- |
48
+
43
49
  ### 验收标准
44
50
 
45
51
  ### 未决事项
@@ -96,7 +102,24 @@ delivery_remote_head: # 最近一次成功交付到 remote 的任务分
96
102
  <!-- 工作流降级、平台同步失败、权限不足等需要后续注意的事件写入此段。无告警时保留表头即可。 -->
97
103
 
98
104
  | id | time | step | severity | code | status | target | message | action | resolved_at | resolution |
99
- |----|------|------|----------|------|--------|--------|---------|--------|-------------|------------|
105
+ |----|------|------|----------|------|--------|---------|--------|-------------|------------|------------|
106
+
107
+ ## 返工意图
108
+
109
+ | intent_id | finding_id | source_artifact | source_sha256 | target | status | declared_at | consumed_at |
110
+ |-----------|------------|----------------|---------------|--------|--------|-------------|-------------|
111
+
112
+ ## 产物失效记录
113
+
114
+ ### Operations
115
+
116
+ | operation_id | source_family | source_artifact | source_round | source_sha256 | status | processed | total | created_at | updated_at | completed_at | error |
117
+ |--------------|---------------|-----------------|--------------|---------------|--------|-----------|-------|------------|------------|--------------|-------|
118
+
119
+ ### Targets
120
+
121
+ | target_id | operation_id | target_kind | target_family | target_artifact | target_round | target_sha256 | status | reason_code | updated_at |
122
+ |-----------|--------------|-------------|---------------|-----------------|--------------|---------------|--------|-------------|------------|
100
123
 
101
124
  ## 活动日志
102
125
 
@@ -20,36 +20,17 @@ jobs:
20
20
  - name: Checkout base branch
21
21
  uses: actions/checkout@v7
22
22
 
23
+ - name: Set up Node.js
24
+ uses: actions/setup-node@v7
25
+ with:
26
+ node-version: 22.9.0
27
+
23
28
  - name: Sync in-labels
24
29
  env:
25
30
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26
31
  PR_NUMBER: ${{ github.event.pull_request.number }}
27
- run: |
28
- changed_files=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files" \
29
- --paginate --jq '.[].filename' | jq -Rn '[inputs]')
30
-
31
- should_labels=$(jq -rn \
32
- --argjson files "$changed_files" \
33
- --argjson mapping "$(jq '.labels.in // {}' .agents/.airc.json)" \
34
- '$mapping
35
- | to_entries
36
- | map(select(.value | any(. as $prefix | $files | any(startswith($prefix)))))
37
- | map("in: " + .key)
38
- | .[]?')
39
-
40
- set -- \
41
- --repo "$GITHUB_REPOSITORY" \
42
- --pr "$PR_NUMBER" \
43
- --prefix "in: "
44
-
45
- while IFS= read -r label; do
46
- [ -z "$label" ] && continue
47
- set -- "$@" --target "$label"
48
- done <<EOF
49
- $should_labels
50
- EOF
51
-
52
- .github/scripts/sync-labels-to-set.sh "$@"
32
+ AGENT_INFRA_VERSION: 0.9.13-alpha.0
33
+ run: npm exec --yes --package="@fitlab-ai/agent-infra@$AGENT_INFRA_VERSION" -- agent-infra-internal platform-pr sync-in-labels --pr "$PR_NUMBER" --cwd "$GITHUB_WORKSPACE"
53
34
 
54
35
  - name: Assign PR creator if unassigned
55
36
  env:
@@ -1,151 +0,0 @@
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
@@ -1,31 +0,0 @@
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