@fitlab-ai/agent-infra 0.9.15 → 0.10.0

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 (184) hide show
  1. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +6 -2
  2. package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +43 -3
  3. package/dist/lib/fs/durable-write.js +2 -0
  4. package/dist/lib/internal/cli-route-inventory.js +1 -1
  5. package/dist/lib/internal/manual-validation.js +17 -8
  6. package/dist/lib/internal/task-artifact.js +1 -1
  7. package/dist/lib/internal/task-lifecycle.js +2 -2
  8. package/dist/lib/internal/task-operation-registry.js +0 -1
  9. package/dist/lib/internal/task-review.js +4 -4
  10. package/dist/lib/platform/issue-comments.js +16 -10
  11. package/dist/lib/platform/issues.js +1 -1
  12. package/dist/lib/platform/pr-change-report.js +5 -4
  13. package/dist/lib/platform/pr-summary.js +64 -32
  14. package/dist/lib/platform/pull-requests.js +3 -3
  15. package/dist/lib/platform/task-identities.js +2 -9
  16. package/dist/lib/platform/verification-sync.js +6 -2
  17. package/dist/lib/pr-review/evidence-grading.js +4 -8
  18. package/dist/lib/sandbox/commands/rm.js +21 -2
  19. package/dist/lib/sandbox/control/server.js +29 -9
  20. package/dist/lib/sandbox/control/state.js +7 -1
  21. package/dist/lib/sandbox/control/workflow-executor.js +4 -14
  22. package/dist/lib/sandbox/index.js +1 -2
  23. package/dist/lib/sandbox/removal.js +116 -1011
  24. package/dist/lib/sandbox/workspace-identity.js +17 -1
  25. package/dist/lib/task/artifact-command.js +6 -28
  26. package/dist/lib/task/artifact-operations.js +16 -230
  27. package/dist/lib/task/artifact-recovery.js +430 -0
  28. package/dist/lib/task/artifact-repair-intent.js +73 -39
  29. package/dist/lib/task/commit-operation.js +31 -4
  30. package/dist/lib/task/control-authority.js +38 -7
  31. package/dist/lib/task/control-recovery.js +14 -2
  32. package/dist/lib/task/create-service.js +1 -8
  33. package/dist/lib/task/delegation-receipts.js +64 -3
  34. package/dist/lib/task/events.js +164 -22
  35. package/dist/lib/task/human-override.js +5 -8
  36. package/dist/lib/task/intermediate-cleanup.js +66 -8
  37. package/dist/lib/task/lifecycle-recovery.js +549 -0
  38. package/dist/lib/task/lifecycle.js +12 -3
  39. package/dist/lib/task/local-artifact-finalization.js +148 -123
  40. package/dist/lib/task/manual-validation-receipt.js +5 -1
  41. package/dist/lib/task/orchestration.js +52 -2
  42. package/dist/lib/task/pr-delivery-fact.js +12 -56
  43. package/dist/lib/task/recovery-warning.js +19 -0
  44. package/dist/lib/task/review-command.js +1 -0
  45. package/dist/lib/task/review-finalization.js +104 -77
  46. package/dist/lib/task/short-id.js +15 -7
  47. package/dist/lib/task/task-execution-lock.js +1 -1
  48. package/dist/lib/task/verification-engine.js +3 -14
  49. package/dist/lib/task/workflow-command.js +0 -1
  50. package/dist/lib/version.js +1 -11
  51. package/dist/lifecycle-build-manifest.json +3 -3
  52. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +7 -2
  53. package/lib/agent-clients/adapters/codex-lifecycle/store.ts +55 -3
  54. package/lib/fs/durable-write.ts +1 -0
  55. package/lib/internal/cli-route-inventory.ts +1 -1
  56. package/lib/internal/manual-validation.ts +17 -8
  57. package/lib/internal/task-artifact.ts +1 -1
  58. package/lib/internal/task-lifecycle.ts +4 -3
  59. package/lib/internal/task-operation-registry.ts +0 -1
  60. package/lib/internal/task-review.ts +4 -4
  61. package/lib/platform/issue-comments.ts +18 -10
  62. package/lib/platform/issues.ts +1 -1
  63. package/lib/platform/pr-change-report.ts +7 -5
  64. package/lib/platform/pr-summary.ts +64 -32
  65. package/lib/platform/pull-requests.ts +3 -3
  66. package/lib/platform/task-identities.ts +3 -14
  67. package/lib/platform/verification-sync.ts +6 -2
  68. package/lib/pr-review/evidence-grading.ts +4 -9
  69. package/lib/sandbox/commands/rm.ts +34 -2
  70. package/lib/sandbox/control/protocol.ts +5 -0
  71. package/lib/sandbox/control/server.ts +30 -10
  72. package/lib/sandbox/control/state.ts +9 -1
  73. package/lib/sandbox/control/workflow-executor.ts +4 -14
  74. package/lib/sandbox/index.ts +1 -2
  75. package/lib/sandbox/removal.ts +126 -1128
  76. package/lib/sandbox/workspace-identity.ts +19 -3
  77. package/lib/task/artifact-command.ts +8 -27
  78. package/lib/task/artifact-operations.ts +21 -251
  79. package/lib/task/artifact-recovery.ts +519 -0
  80. package/lib/task/artifact-repair-intent.ts +99 -51
  81. package/lib/task/commit-operation.ts +35 -4
  82. package/lib/task/control-authority.ts +47 -14
  83. package/lib/task/control-recovery.ts +13 -1
  84. package/lib/task/create-service.ts +1 -10
  85. package/lib/task/delegation-receipts.ts +73 -2
  86. package/lib/task/events.ts +187 -23
  87. package/lib/task/human-override.ts +5 -8
  88. package/lib/task/intermediate-cleanup.ts +50 -12
  89. package/lib/task/lifecycle-recovery.ts +691 -0
  90. package/lib/task/lifecycle.ts +13 -4
  91. package/lib/task/local-artifact-finalization.ts +176 -132
  92. package/lib/task/manual-validation-receipt.ts +5 -1
  93. package/lib/task/orchestration.ts +65 -0
  94. package/lib/task/pr-delivery-fact.ts +15 -62
  95. package/lib/task/recovery-warning.ts +21 -0
  96. package/lib/task/review-command.ts +1 -0
  97. package/lib/task/review-finalization.ts +106 -87
  98. package/lib/task/short-id.ts +27 -5
  99. package/lib/task/task-execution-lock.ts +1 -1
  100. package/lib/task/verification-engine.ts +3 -17
  101. package/lib/task/verification-types.ts +0 -2
  102. package/lib/task/workflow-command.ts +0 -1
  103. package/lib/version.ts +1 -15
  104. package/package.json +1 -1
  105. package/templates/.agents/rules/create-issue.en.md +1 -1
  106. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  107. package/templates/.agents/rules/issue-sync.en.md +4 -2
  108. package/templates/.agents/rules/issue-sync.zh-CN.md +4 -3
  109. package/templates/.agents/rules/local-artifact-repair.en.md +46 -39
  110. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +43 -36
  111. package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
  112. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  113. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
  114. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
  115. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  116. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  117. package/templates/.agents/skills/block-task/config/verify.json +1 -1
  118. package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
  119. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -3
  120. package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
  121. package/templates/.agents/skills/code-task/SKILL.en.md +7 -7
  122. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +7 -7
  123. package/templates/.agents/skills/code-task/config/verify.en.json +1 -1
  124. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -1
  125. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  126. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  127. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +1 -1
  128. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +1 -1
  129. package/templates/.agents/skills/complete-task/SKILL.en.md +2 -2
  130. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +2 -2
  131. package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
  132. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
  133. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +1 -1
  134. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +1 -1
  135. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  136. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  137. package/templates/.agents/skills/create-pr/config/verify.json +1 -1
  138. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +2 -2
  139. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +2 -2
  140. package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
  141. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
  142. package/templates/.agents/skills/create-task/config/verify.json +1 -1
  143. package/templates/.agents/skills/import-issue/SKILL.en.md +8 -8
  144. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +8 -8
  145. package/templates/.agents/skills/import-issue/config/verify.json +2 -2
  146. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
  147. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
  148. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
  149. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
  150. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  151. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +2 -2
  152. package/templates/.agents/skills/restore-task/config/verify.json +1 -1
  153. package/templates/.agents/skills/review-analysis/SKILL.en.md +2 -2
  154. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
  155. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -1
  156. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -1
  157. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -7
  158. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +6 -6
  159. package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
  160. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
  161. package/templates/.agents/skills/review-code/config/verify.en.json +1 -1
  162. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -1
  163. package/templates/.agents/skills/review-code/reference/report-template.en.md +12 -12
  164. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +12 -12
  165. package/templates/.agents/skills/review-plan/SKILL.en.md +2 -2
  166. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
  167. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -1
  168. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -1
  169. package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -7
  170. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -7
  171. package/templates/.agents/skills/review-pr/config/verify.en.json +1 -1
  172. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +1 -1
  173. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +3 -3
  174. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +3 -3
  175. package/templates/.agents/skills/run-manual-validation/config/verify.en.json +1 -1
  176. package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +1 -1
  177. package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
  178. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
  179. package/templates/.agents/templates/task.en.md +1 -1
  180. package/templates/.agents/templates/task.zh-CN.md +1 -1
  181. package/templates/.claude/commands/import-issue.en.md +1 -1
  182. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  183. package/templates/.claude/commands/restore-task.en.md +1 -1
  184. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
@@ -24,7 +24,7 @@ Before generating the implementation report, read `.agents/rules/evidence-report
24
24
  - 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
25
25
  - Read `.agents/rules/compatibility-policy.md` before implementation. Implement only the compatibility budget explicitly approved by the plan; never retain old branches, result contracts, or migration shims merely to be “safe”
26
26
  - Fix mode verifies each finding of the latest `review-code` one by one: fix it if it holds, or rebut it and record it under unresolved if it is unfounded/hallucinated; do not expand to issues the review did not list; manual-validation items are out of scope
27
- - Before `code.completed`, the implementation report must pass `task-artifact ... finalize-local --family code`; follow `.agents/rules/local-artifact-repair.md` for any provably safe minimal structural repair in that same report, and pass only that successful call's digests to the completion event
27
+ - Before `code.completed`, the implementation report must pass `task-artifact ... finalize-local --family code`; follow `.agents/rules/local-artifact-repair.md` for controlled recovery candidates in that same report, and pass only that successful call's digests to the completion event
28
28
  - If implementation encounters a key design decision not covered by the plan, run `agent-infra-internal task-ledger {task-id} decision-next-id`, write the returned `HD-N` detail block per `.agents/rules/human-decision-context.md` and determine whether implementation is required, then run `decision-upsert --id {HD-N} --stage code --artifact {code-artifact} --needs-implementation {true|false}`. Do not scan ids, assemble ledger rows, ask mid-flow, or silently expand scope
29
29
  - Do not invoke the `commit` skill or push to a remote; after tests pass, call the shared commit core with `delivery: { mode: 'local' }` to create the local checkpoint. The durable intent must close only after the checkpoint and task state sync succeed; only then emit `code.completed`
30
30
  - Create a new code artifact for each round and never overwrite an older one
@@ -64,7 +64,7 @@ Read `reference/branch-management.md`, ensure the current branch matches the tas
64
64
 
65
65
  ### 3. Narrow the Milestone
66
66
 
67
- **Mandatory; do not skip.** If task.md has a valid `issue_number`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`.
67
+ **Mandatory; do not skip.** If task.md has a valid `platform_issue_identity`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`.
68
68
 
69
69
  > If the milestone remains `X.Y.x`, step 12 `task-verify code.completed` blocks through the typed milestone check.
70
70
 
@@ -112,7 +112,7 @@ When triaging a test failure or unexpected behavior, first read `.agents/rules/d
112
112
 
113
113
  After tests pass, call the shared commit core with `agent-infra-internal git-workflow commit --input {checkpoint-input}`. Pass `delivery: { "mode": "local" }`, explicit paths, expected HEAD/tree, task ref, agent, and the code round. This creates only a local checkpoint and does not contact a remote. The core writes a durable intent before committing and removes it after task-writer synchronization; do not emit `code.completed` if either checkpoint or task synchronization fails.
114
114
 
115
- After the checkpoint succeeds, when task.md has an `issue_number`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`. The task-bound `delivery_base_ref` is the only source for Issue `in:` evidence; record a warning and stop this round without emitting `code.completed` if this sync fails.
115
+ After the checkpoint succeeds, when task.md has a `platform_issue_identity`, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`. The task-bound `delivery_base_ref` is the only source for Issue `in:` evidence; record a warning and stop this round without emitting `code.completed` if this sync fails.
116
116
 
117
117
  ### 9. Write the Code Report
118
118
 
@@ -122,7 +122,7 @@ Before writing this round's `{code-artifact}`, create the controlled report skel
122
122
  agent-infra-internal task-artifact {task-id} init --family code --artifact {code-artifact} --locale en
123
123
  ```
124
124
 
125
- The skeleton contains identity metadata, stable section markers, and required headings only; real implementation and verification content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, call `task-artifact {task-id} repair --family code --artifact {code-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`, then rerun the same finalizer.
125
+ The skeleton contains identity metadata, stable section markers, and required headings only; real implementation and verification content is required before the completion gate can pass. If the finalizer returns one provably safe structural error, it returns a controlled recovery candidate; edit only its `candidatePath`, then rerun `task-artifact {task-id} finalize-local --family code --artifact {code-artifact} --recovery-id {recovery-id}` with the same `recoveryId`. Candidate-only is a protocol authorization boundary, not OS isolation; arbitrary same-UID host writers are outside the protocol's protection claim, and fingerprint/state checks fail closed on anomalies.
126
126
 
127
127
  Create `.agents/workspace/active/{task-id}/{code-artifact}`.
128
128
 
@@ -139,8 +139,8 @@ echo "$finalizer"
139
139
  ```
140
140
 
141
141
  - `status=0` with `finalizer.status="passed"`: bind `{artifact-sha256}` and `{semantic-digest}` from this result.
142
- - `status=1` with `repairable=true` and a diagnostic explicitly describing a one-line replacement: confirm task, round, artifact, and provenance are unchanged; edit only that `code*.md` once, confirm the bytes changed, then rerun the same command completely.
143
- - For any other failure, lack of progress, repeated diagnostic, or eight actual report edits, stop without publishing `code.completed`.
142
+ - `status=1` with recovery context: confirm task, round, artifact, baseline, and request identity are unchanged; edit only the returned `candidatePath` once, confirm the bytes changed, then rerun the same finalizer completely with the same `recoveryId`; `baseline`, `final`, `publish`, and `intent` remain framework-internal state and must not be edited.
143
+ - For any other failure, external formal-artifact change, lack of progress, or recovery identity mismatch, stop without publishing `code.completed`.
144
144
 
145
145
  Do not rescan or manually write digest data; the completion event must include `--artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}` from the successful finalizer result.
146
146
 
@@ -148,7 +148,7 @@ Do not rescan or manually write digest data; the completion event must include `
148
148
 
149
149
  After requirement checkboxes are updated, run the initial event `agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --files-modified {n} --tests-passed {n} {execution-flag}`; in fix mode add `--fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n} {execution-flag}` instead; in decision mode add `--implementation-input {input-id}` to the initial counts. The core atomically records the artifact link, stage, metadata, done log, and decision-input consumption.
150
150
 
151
- If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, then (status/comment failures follow the warning rules; an Issue `in:` evidence failure must not emit `code.completed`):
151
+ If task.md has a valid `platform_issue_identity`, read `.agents/rules/issue-sync.md`, then (status/comment failures follow the warning rules; an Issue `in:` evidence failure must not emit `code.completed`):
152
152
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status in-progress`
153
153
  - Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
154
154
  - Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {code-artifact} --agent {standard-agent-token}`
@@ -24,7 +24,7 @@ description: >
24
24
  - 生成会同步到 Issue 的任务或生命周期 Markdown 前,先读取 `.agents/rules/sync-content-generation.md` 并遵循其中的生成端约束;同步端不解析或改写正文
25
25
  - 实现前读取 `.agents/rules/compatibility-policy.md`;只实现方案明确批准的兼容预算,不以“稳妥”为由保留旧分支、旧结果契约或迁移 shim
26
26
  - 修复模式逐条核实最新 `review-code` 的发现:成立则修复,判定为不成立/幻觉则在报告中反驳并记入 unresolved;不擅自扩大到审查未列出的问题;manual-validation 项不在修复范围
27
- - 实现报告在 `code.completed` 前必须通过 `task-artifact ... finalize-local --family code`;按 `.agents/rules/local-artifact-repair.md` 处理同一报告内可证明安全的最小结构修复,并只把同一次通过结果的摘要传给完成事件
27
+ - 实现报告在 `code.completed` 前必须通过 `task-artifact ... finalize-local --family code`;按 `.agents/rules/local-artifact-repair.md` 使用受控 recovery candidate 处理同一报告内可证明安全的结构修复,并只把同一次通过结果的摘要传给完成事件
28
28
  - 实现中遇到方案未覆盖的关键设计决策时,先调用 `agent-infra-internal task-ledger {task-id} decision-next-id` 取得 `HD-N`,按 `.agents/rules/human-decision-context.md` 写入实现报告的 `## 人工裁决待办` 详情块并判断是否需要实现,再调用 `decision-upsert --id {HD-N} --stage code --artifact {code-artifact} --needs-implementation {true|false}`;不得扫描编号、手写账本行、中途提问或擅自扩范围
29
29
  - 不调用 `commit` 技能,也不推送远端;测试通过后直接调用共享 commit core 的 `delivery: { mode: 'local' }` 创建本地 checkpoint。checkpoint 使用 durable intent,只有 checkpoint 与 task 状态同步成功后才发送 `code.completed`
30
30
  - 每轮实现都创建新的实现产物,不覆盖旧文件
@@ -91,7 +91,7 @@ agent-infra-internal task-snapshot {task-id} --format text
91
91
 
92
92
  ### 3. 收窄里程碑
93
93
 
94
- **必须执行,不得跳过。** 如果 task.md 中存在有效的 `issue_number`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`;里程碑推断、权限降级与幂等写入由 internal core 处理。
94
+ **必须执行,不得跳过。** 如果 task.md 中存在有效的 `platform_issue_identity`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --milestone specific`;里程碑推断、权限降级与幂等写入由 internal core 处理。
95
95
 
96
96
  > 若跳过或收窄后仍为 `X.Y.x`,步骤 12 的 `task-verify code.completed` 会通过 typed milestone check 截停本轮。
97
97
 
@@ -150,7 +150,7 @@ echo "$result"
150
150
 
151
151
  测试通过后,通过 `agent-infra-internal git-workflow commit --input {checkpoint-input}` 调用共享 commit core,输入 `delivery: { "mode": "local" }`、明确 paths、expected HEAD/tree、task ref、agent 和 code round。该调用只创建本地 checkpoint,不访问远端;core 会在 commit 前写入 durable intent,并在 task writer 成功后清理 intent。checkpoint 失败或 task 状态未闭合时,不得发送 `code.completed`。
152
152
 
153
- checkpoint 成功后,若任务存在 `issue_number`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`,由 task-bound `delivery_base_ref` 产生 Issue 的 `in:` target;该同步失败时记录 warning 并停止本轮,不发送 `code.completed`。
153
+ checkpoint 成功后,若任务存在 `platform_issue_identity`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --in-labels from-diff --base {delivery-base-ref}`,由 task-bound `delivery_base_ref` 产生 Issue 的 `in:` target;该同步失败时记录 warning 并停止本轮,不发送 `code.completed`。
154
154
 
155
155
  排查测试失败或行为不符合预期时,先读取 `.agents/rules/debugging-guide.md`,按其四阶段流程定位根因,禁止盲目改代码重试。
156
156
 
@@ -162,7 +162,7 @@ checkpoint 成功后,若任务存在 `issue_number`,调用 `agent-infra-inte
162
162
  agent-infra-internal task-artifact {task-id} init --family code --artifact {code-artifact}
163
163
  ```
164
164
 
165
- 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实实现与验证内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,使用其 SHA 和 semantic digest 调用 `task-artifact {task-id} repair --family code --artifact {code-artifact} --expected-sha256 {artifact-sha256} --expected-semantic-digest {semantic-digest}`,然后完整重跑 finalizer。
165
+ 骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实实现与验证内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑 `task-artifact {task-id} finalize-local --family code --artifact {code-artifact} --recovery-id {recovery-id}`。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
166
166
 
167
167
  创建 `.agents/workspace/active/{task-id}/{code-artifact}`。
168
168
 
@@ -179,8 +179,8 @@ echo "$finalizer"
179
179
  ```
180
180
 
181
181
  - `status=0` 且 `finalizer.status="passed"`:绑定这一次返回的 `{artifact-sha256}` 和 `{semantic-digest}`。
182
- - `status=1` 且返回 `repairable=true`、诊断明确为当前报告中的单行替换:确认任务、轮次、产物和 provenance 未变化后,只编辑该 `code*.md` 一次,确认字节确实变化,再完整重跑同一命令。
183
- - 其他失败、无进展、诊断重复或达到 8 次实际报告编辑:停止,不发布 `code.completed`。
182
+ - `status=1` 且返回 recovery context:确认任务、轮次、产物、baseline 和 request identity 未变化后,只编辑返回的 `candidatePath` 一次,确认字节确实变化,再使用同一个 `recoveryId` 完整重跑同一 finalizer;baseline、final、publish 和 intent 均属于框架内部状态,不得编辑。
183
+ - 其他失败、formal artifact 外部变化、无进展或 recovery identity 不匹配:停止,不发布 `code.completed`。
184
184
 
185
185
  不得重新扫描或手工补写摘要;完成事件必须携带本次 `passed` 结果的 `--artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}`。
186
186
 
@@ -194,7 +194,7 @@ echo "$finalizer"
194
194
  - 修复模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n} {execution-flag}`
195
195
  - 裁决模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --implementation-input {input-id} --files-modified {n} --tests-passed {n} {execution-flag}`
196
196
 
197
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(状态/评论失败按规则记录 warning;Issue `in:` evidence 同步失败不得发送 `code.completed`;边界见 `.agents/rules/issue-sync.md`):
197
+ 如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(状态/评论失败按规则记录 warning;Issue `in:` evidence 同步失败不得发送 `code.completed`;边界见 `.agents/rules/issue-sync.md`):
198
198
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status in-progress`
199
199
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
200
200
  - 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {code-artifact} --agent {standard-agent-token}`
@@ -30,7 +30,7 @@
30
30
  ]
31
31
  },
32
32
  "platform-sync": {
33
- "when": "issue_number_exists",
33
+ "when": "platform_issue_identity_exists",
34
34
  "expected_status_label": "status: in-progress",
35
35
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
36
36
  "verify_comment_content": true,
@@ -30,7 +30,7 @@
30
30
  ]
31
31
  },
32
32
  "platform-sync": {
33
- "when": "issue_number_exists",
33
+ "when": "platform_issue_identity_exists",
34
34
  "expected_status_label": "status: in-progress",
35
35
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
36
36
  "verify_comment_content": true,
@@ -4,7 +4,7 @@
4
4
 
5
5
  Run this step only when all of the following are true:
6
6
  - `{task-id}` is valid
7
- - `task.md` frontmatter contains a valid `issue_number`
7
+ - `task.md` frontmatter contains a valid `platform_issue_identity`
8
8
 
9
9
  If either condition is missing, skip this step.
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  仅当以下条件同时满足时执行:
6
6
  - `{task-id}` 有效
7
- - `task.md` frontmatter 中存在有效 `issue_number`
7
+ - `task.md` frontmatter 中存在有效 `platform_issue_identity`
8
8
 
9
9
  任一条件不满足时,跳过本步骤。
10
10
 
@@ -106,7 +106,7 @@ The coordinator owns pending summary, receipt, completion log, final promotion,
106
106
 
107
107
  After the transaction coordinator succeeds, the core has atomically recorded `manual-validation.completed` with the same transaction/receipt/head identity. Do not append the Activity Log manually.
108
108
 
109
- If the task has a valid `issue_number`, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`, then `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {manual-validation-artifact} --agent {standard-agent-token}`.
109
+ If the task has a valid `platform_issue_identity`, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`, then `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {manual-validation-artifact} --agent {standard-agent-token}`.
110
110
 
111
111
  ### 8. Verification Gate
112
112
 
@@ -106,7 +106,7 @@ coordinator 负责 pending summary、receipt、通过日志、final promotion
106
106
 
107
107
  transaction coordinator 成功后,核心已使用同一 transaction/receipt/head identity 原子登记 `manual-validation.completed`;不要手工补写 Activity Log。
108
108
 
109
- 如任务存在有效 `issue_number`,调用 `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 {manual-validation-artifact} --agent {standard-agent-token}`。
109
+ 如任务存在有效 `platform_issue_identity`,调用 `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 {manual-validation-artifact} --agent {standard-agent-token}`。
110
110
 
111
111
  ### 8. 完成校验
112
112
 
@@ -135,11 +135,11 @@ Do not write `status/current_step/completed_at/updated_at/agent_infra_version`,
135
135
 
136
136
  ### 4. Sync the Platform While Active
137
137
 
138
- Check whether task.md has a valid `issue_number`. If it does not, skip this step without output.
138
+ Check whether task.md has a valid `platform_issue_identity`. If it does not, skip this step without output.
139
139
 
140
140
  > Issue metadata boundaries live in `.agents/rules/issue-sync.md`; comments use internal platform intents.
141
141
 
142
- When an `issue_number` exists, execute in this exact order:
142
+ When a valid `platform_issue_identity` exists, execute in this exact order:
143
143
 
144
144
  1. Run `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}` so core publishes only the completion canonical inventory in fixed order and resolves matching historical warnings only after full success.
145
145
  2. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
@@ -134,11 +134,11 @@ Please satisfy the hard prerequisite first, then retry complete-task.
134
134
 
135
135
  ### 4. 在 active 阶段同步平台
136
136
 
137
- 检查 `task.md` 中是否存在有效的 `issue_number`。如果没有,跳过本步骤且不输出任何内容。
137
+ 检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过本步骤且不输出任何内容。
138
138
 
139
139
  > Issue 元数据边界见 `.agents/rules/issue-sync.md`;评论同步统一调用 internal platform intent。
140
140
 
141
- 如果存在有效的 `issue_number`,严格按以下顺序执行:
141
+ 如果存在有效的 `platform_issue_identity`,严格按以下顺序执行:
142
142
 
143
143
  1. 调用 `agent-infra-internal platform-comment backfill {task-id} --agent {standard-agent-token}`,由 core 仅按 completion canonical inventory 固定顺序补发产物并在全部成功后精确恢复目标历史告警。
144
144
  2. 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`。
@@ -28,7 +28,7 @@
28
28
  "manual-validation": {},
29
29
  "post-review-commit": {},
30
30
  "platform-sync-preflight": {
31
- "when": "issue_number_exists",
31
+ "when": "platform_issue_identity_exists",
32
32
  "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
33
33
  "verify_task_comment_content": false,
34
34
  "sync_checked_requirements": true,
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "required-pr-delivery": {},
42
42
  "platform-sync": {
43
- "when": "issue_number_exists",
43
+ "when": "platform_issue_identity_exists",
44
44
  "verify_task_comment_content": true,
45
45
  "verify_closed_issue_has_no_status_labels": true
46
46
  },
@@ -28,7 +28,7 @@
28
28
  "manual-validation": {},
29
29
  "post-review-commit": {},
30
30
  "platform-sync-preflight": {
31
- "when": "issue_number_exists",
31
+ "when": "platform_issue_identity_exists",
32
32
  "expected_comment_marker": "<!-- sync-issue:{task-id}:summary -->",
33
33
  "verify_task_comment_content": false,
34
34
  "sync_checked_requirements": true,
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "required-pr-delivery": {},
42
42
  "platform-sync": {
43
- "when": "issue_number_exists",
43
+ "when": "platform_issue_identity_exists",
44
44
  "verify_task_comment_content": true,
45
45
  "verify_closed_issue_has_no_status_labels": true
46
46
  },
@@ -4,7 +4,7 @@ This scenario applies only to an active task whose completion canonical inventor
4
4
 
5
5
  ## Typed State Machine
6
6
 
7
- Run `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`. Core checks the completion inventory first. A non-empty inventory returns `mode=normal`, and supplying `--pr` then fails. An empty inventory requires a positive `issue_number`; otherwise core returns `EXTERNAL_DELIVERY_ISSUE_REQUIRED`.
7
+ Run `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`. Core checks the completion inventory first. A non-empty inventory returns `mode=normal`, and supplying `--pr` then fails. An empty inventory requires a valid `platform_issue_identity`; otherwise core returns `EXTERNAL_DELIVERY_ISSUE_REQUIRED`.
8
8
 
9
9
  The platform adapter supplies authoritative Issue closing change requests across all pages. Only candidates with a matching base repository, complete identity, and merge evidence are eligible. One candidate is selected automatically; ambiguity, conflicts, and missing evidence fail closed. `--pr` may only select an authoritative eligible closing candidate and cannot bypass repository, Issue, merge, or identity validation.
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Typed 状态机
6
6
 
7
- 调用 `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`。core 先检查 completion inventory;非空时返回 `mode=normal`,且显式 `--pr` 会失败。空 inventory 必须有正整数 `issue_number`,否则返回 `EXTERNAL_DELIVERY_ISSUE_REQUIRED`。
7
+ 调用 `agent-infra-internal platform-pr resolve-external {task-id} --agent {agent} [--pr {N}]`。core 先检查 completion inventory;非空时返回 `mode=normal`,且显式 `--pr` 会失败。空 inventory 必须有有效 `platform_issue_identity`,否则返回 `EXTERNAL_DELIVERY_ISSUE_REQUIRED`。
8
8
 
9
9
  core 通过平台 adapter 读取 Issue 的权威 closing change requests,穷尽分页后只把 base 仓库匹配任务仓库且已经合并、身份字段完整的候选视为 eligible。唯一候选自动选择;多候选、身份冲突或证据缺失均 fail closed。`--pr` 只能从权威 closing eligible 集合中显式选择,不能绕过仓库、Issue、合并或身份校验。
10
10
 
@@ -47,7 +47,7 @@ No Pull Request is required; run instead:
47
47
 
48
48
  Parse the task scope first: an optional `--task <ref>` or `-t <ref>` selects `{task-id}`; a positional task ref is not interpreted. The remaining positional argument, when present, is `{target-branch}`.
49
49
 
50
- If `{task-id}` is provided, read `.agents/workspace/active/{task-id}/task.md` to load task metadata such as `issue_number` and `type`.
50
+ If `{task-id}` is provided, read `.agents/workspace/active/{task-id}/task.md` to load task metadata such as `platform_issue_identity` and `type`.
51
51
  If `{task-id}` is omitted, try to resolve it from the current session context; if it still cannot be determined, skip task-association logic in later steps.
52
52
 
53
53
  ### 2. Determine the Target Branch
@@ -70,7 +70,7 @@ Run `agent-infra-internal task-delivery {task-id} deliver --agent {standard-agen
70
70
 
71
71
  Read `.agents/rules/issue-pr-commands.md`, write the title and body to temporary files, then invoke its `platform-pr create` intent. Under the task lock, core uses remote branch and exact head/base/PR identity facts: one existing PR is reused and bound, zero creates, and multiple matches fail deterministically. Review artifacts and task sync records are not create-pr prerequisites, and replays must not create duplicate PRs.
72
72
 
73
- If `{task-id}` is available and the related task provides `issue_number`, keep `Closes #{issue-number}` in the PR body.
73
+ If `{task-id}` is available and the related task provides `platform_issue_identity`, keep `Closes #{issue-number}` or the provider-equivalent closing keyword in the PR body when supported.
74
74
 
75
75
  ### 6. Sync PR Metadata
76
76
 
@@ -47,7 +47,7 @@ description: >
47
47
 
48
48
  先解析 task scope:可选的 `--task <ref>` 或 `-t <ref>` 绑定 `{task-id}`;位置 task ref 不再解释。剩余的可选位置参数绑定为 `{target-branch}`。
49
49
 
50
- 如果提供了 `{task-id}`,读取 `.agents/workspace/active/{task-id}/task.md` 获取任务信息(例如 `issue_number`、`type` 等)。
50
+ 如果提供了 `{task-id}`,读取 `.agents/workspace/active/{task-id}/task.md` 获取任务信息(例如 `platform_issue_identity`、`type` 等)。
51
51
  如果未提供,可从当前 session 上下文获取;仍无法确定 `{task-id}` 时,后续步骤中的任务关联逻辑跳过。
52
52
 
53
53
  ### 2. 确定目标分支
@@ -70,7 +70,7 @@ description: >
70
70
 
71
71
  执行前先读取 `.agents/rules/issue-pr-commands.md`,把标题和正文写入临时文件,并调用其中的 `platform-pr create` intent。core 在任务锁内按 remote branch、head/base 和 PR 身份事实执行:唯一既有 PR 会复用并绑定,零个才创建,多个稳定失败;review 或 task sync 记录不作为创建 PR 的前置门禁,重放不得产生重复 PR。
72
72
 
73
- 如果获取到 `{task-id}` 且对应任务提供了 `issue_number`,必须在 PR 正文中保留 `Closes #{issue-number}`。
73
+ 如果获取到 `{task-id}` 且对应任务提供了 `platform_issue_identity`,在 provider 支持 numeric closing reference 时必须在 PR 正文中保留 `Closes #{issue-number}` 或 provider 等价关闭关键字。
74
74
 
75
75
  ### 6. 同步 PR 元数据
76
76
 
@@ -18,7 +18,7 @@
18
18
  "expected_action_pattern": "(Create PR|PR Created)"
19
19
  },
20
20
  "platform-sync": {
21
- "when": "issue_number_exists",
21
+ "when": "platform_issue_identity_exists",
22
22
  "expected_pr_comment_marker": "<!-- sync-pr:{task-id}:summary -->",
23
23
  "verify_in_labels_match_pr": true,
24
24
  "verify_in_labels_computed": true,
@@ -55,8 +55,8 @@ Milestone rule:
55
55
 
56
56
  ## Create the PR
57
57
 
58
- - Extract `issue_number` from task.md when this work belongs to an active task
59
- - If `issue_number` exists, complete the prerequisite code-hosting platform detection steps first, then query the Issue via `.agents/rules/issue-pr-commands.md`
58
+ - Extract `platform_issue_identity` from task.md when this work belongs to an active task
59
+ - If `platform_issue_identity` exists, complete the prerequisite code-hosting platform detection steps first, then query the Issue via `.agents/rules/issue-pr-commands.md`
60
60
  - Before calling the PR creation command, check whether the current branch already has a PR. If it does, report the PR URL and state, then stop without repeating metadata sync or summary publication
61
61
  - Use HEREDOC to pass the PR body
62
62
  - Replace `{$IssueNumber}` in the template when present
@@ -55,8 +55,8 @@ Milestone 规则:
55
55
 
56
56
  ## 创建 PR
57
57
 
58
- - 当前工作属于 active task 时,从 task.md 提取 `issue_number`
59
- - 如果存在 `issue_number`,先完成代码托管平台检测,再通过 `.agents/rules/issue-pr-commands.md` 查询 Issue
58
+ - 当前工作属于 active task 时,从 task.md 提取 `platform_issue_identity`
59
+ - 如果存在 `platform_issue_identity`,先完成代码托管平台检测,再通过 `.agents/rules/issue-pr-commands.md` 查询 Issue
60
60
  - 调用 PR 创建命令前,先检查当前分支是否已有 PR;若已有,报告 PR URL 和状态后停止,不重复执行元数据同步或 summary 发布
61
61
  - 使用 HEREDOC 传入 PR 正文
62
62
  - 模板中存在 `{$IssueNumber}` 时进行替换
@@ -139,7 +139,7 @@ automatically. Recover with the original request or inspect host task state firs
139
139
  The host service owns platform cascading. The compatibility recovery commands remain visible in the host warning and are not run from the sandbox:
140
140
 
141
141
  ```bash
142
- agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and write issue_number"
142
+ agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and run platform-issue bind"
143
143
  agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}
144
144
  ```
145
145
 
@@ -177,7 +177,7 @@ Task information:
177
177
  - Title: {title}
178
178
  - Type: {type}
179
179
  - Workflow: {workflow}
180
- - Issue: #{issue_number} {issue_url}
180
+ - Issue: #{issue-number} {issue_url}
181
181
 
182
182
  Output file:
183
183
  - Task file: .agents/workspace/active/{task-id}/task.md
@@ -228,10 +228,10 @@ Output file:
228
228
  Next step - run requirements analysis:
229
229
  {next-step-commands}
230
230
 
231
- For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and write `issue_number` into task.md so later skills can take over cascade sync.
231
+ For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and run `platform-issue bind`, which resolves the token through the provider and writes `platform_issue_identity` so later skills can take over cascade sync.
232
232
 
233
233
  [ACTION REQUIRED] Workflow warnings are open:
234
- - WW-N ISSUE_CREATE_FAILED (issue): Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and write issue_number
234
+ - WW-N ISSUE_CREATE_FAILED (issue): Fix auth/network/template issues and manually retry Issue creation, or create/find an Issue and run `platform-issue bind`
235
235
  ```
236
236
 
237
237
 
@@ -256,7 +256,7 @@ Wait for the user to run the `analyze-task` skill.
256
256
  1. **Clarity**: if the user description is vague or missing key information, ask for clarification first
257
257
  2. **Difference from `import-issue`**: `import-issue` imports from an Issue; `create-task` creates from a free-form description
258
258
  3. **Workflow order**: after creating a task, typically run `analyze-task` before `plan-task`
259
- 4. **Issue cascade failure**: if the rule fails, task.md remains; when platform sync is needed later, manually write `issue_number` and continue the workflow
259
+ 4. **Issue cascade failure**: if the rule fails, task.md remains; when platform sync is needed later, run `platform-issue bind` and do not hand-write the legacy Issue field
260
260
 
261
261
  ## Error Handling
262
262
 
@@ -137,7 +137,7 @@ candidate 和新的 outer request ID 重试;`recovery: same-request-id` 或
137
137
  平台级联由宿主服务完成。兼容的人工恢复命令仍由宿主 warning 指引,不在沙箱内执行:
138
138
 
139
139
  ```bash
140
- agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后写入 issue_number"
140
+ agent-infra-internal task-warning {task-id} add --step create-task --severity ACTION_REQUIRED --code ISSUE_CREATE_FAILED --target issue --message "{error_code}: {error_message}" --action "修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后执行 platform-issue bind"
141
141
  agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}
142
142
  ```
143
143
 
@@ -175,7 +175,7 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
175
175
  - 标题:{title}
176
176
  - 类型:{type}
177
177
  - 工作流:{workflow}
178
- - Issue:#{issue_number} {issue_url}
178
+ - Issue:#{issue-number} {issue_url}
179
179
 
180
180
  产出文件:
181
181
  - 任务文件:.agents/workspace/active/{task-id}/task.md
@@ -226,10 +226,10 @@ Issue 创建失败:
226
226
  下一步 - 执行需求分析:
227
227
  {next-step-commands}
228
228
 
229
- 后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
229
+ 后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue 后执行 `platform-issue bind`,由 provider 解析 token 并写入 `platform_issue_identity`,后续技能会接管级联同步。
230
230
 
231
231
  [ACTION REQUIRED] Workflow warnings are open:
232
- - WW-N ISSUE_CREATE_FAILED (issue): 修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后写入 issue_number
232
+ - WW-N ISSUE_CREATE_FAILED (issue): 修复认证/网络/模板问题后手动重试 Issue 创建,或手动创建/找到 Issue 后执行 `platform-issue bind`
233
233
  ```
234
234
 
235
235
 
@@ -254,7 +254,7 @@ Issue 创建失败:
254
254
  1. **清晰度**:如果用户描述模糊或缺少关键信息,先要求澄清
255
255
  2. **与 import-issue 的区别**:`import-issue` 从 Issue 导入任务;`create-task` 从自由描述创建
256
256
  3. **工作流顺序**:创建任务后,通常先执行 `analyze-task` 再进入 `plan-task`
257
- 4. **Issue 级联失败**:如果规则执行失败,task.md 仍保留;需要后续平台同步时,可手动写入 `issue_number` 后继续执行工作流
257
+ 4. **Issue 级联失败**:如果规则执行失败,task.md 仍保留;需要后续平台同步时,可手动执行 `platform-issue bind`,不得手工写入旧的 Issue 字段
258
258
 
259
259
  ## 错误处理
260
260
 
@@ -21,7 +21,7 @@
21
21
  "expected_action_pattern": "(Create Task|Task Created)"
22
22
  },
23
23
  "platform-sync": {
24
- "when": "issue_number_exists",
24
+ "when": "platform_issue_identity_exists",
25
25
  "issue_must_exist": true,
26
26
  "verify_task_comment_content": true,
27
27
  "verify_milestone": true,
@@ -9,7 +9,7 @@ description: >
9
9
  > `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
10
10
 
11
11
 
12
- Import the specified Issue and create a task. Argument: issue number.
12
+ Import the specified Issue and create a task. Argument: a raw Issue token, parsed after the provider is selected.
13
13
 
14
14
  ## Boundary / Critical Rules
15
15
 
@@ -43,7 +43,7 @@ This skill **creates** task.md, so there is no file to write at the start. Captu
43
43
 
44
44
  Read `.agents/rules/issue-pr-commands.md` first, follow its prerequisite steps to complete authentication and code-hosting platform detection, then load the Issue data with its "Read an Issue" command.
45
45
 
46
- Extract: issue number, title, description, and labels.
46
+ Extract: Issue identity, title, description, and labels.
47
47
 
48
48
  Derive the task title from the Issue title by stripping an optional single leading Conventional Commits prefix, following the contract below; preserve the rest of the description verbatim and in its original language. This fenced contract is the authoritative, language-neutral rule — keep it byte-for-byte identical across every `import-issue` variant:
49
49
 
@@ -67,7 +67,7 @@ Strip only the first layer, and only when the leading token is a `prefix-types`
67
67
  - If found, **reuse the existing task by default** (Scenario A); do not ask the user. State clearly in the final notice: "Reused existing task `{task-id}`; not re-imported." If the user wants to re-import, they must first archive or delete the existing task and run this skill again
68
68
  - If not found, continue to 2.2
69
69
 
70
- 2.2 Run `agent-infra-internal platform-comment list --issue {issue-number}` to scan registered markers for a recoverable historical task ID.
70
+ 2.2 Run `agent-infra-internal platform-comment list --issue {issue-token}` to scan registered markers for a recoverable historical task ID.
71
71
 
72
72
  This command depends on `$upstream_repo` being set in step 1.
73
73
 
@@ -101,7 +101,7 @@ date +%Y%m%d-%H%M%S
101
101
  Task metadata:
102
102
  ```yaml
103
103
  id: {task-id}
104
- issue_number: <issue-number>
104
+ platform_issue_identity: <canonical identity JSON string returned by the provider>
105
105
  type: feature|bugfix|refactor|docs|chore
106
106
  branch: <project>-<type>-<slug>
107
107
  workflow: feature-development|bug-fix|refactoring
@@ -146,8 +146,8 @@ Update `.agents/workspace/active/{task-id}/task.md`:
146
146
 
147
147
  ### 5. Bind and Sync the Issue
148
148
 
149
- If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
150
- - Run `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {standard-agent-token}`
149
+ After creating task.md, always perform the following binding and sync actions (skip and continue on any platform failure):
150
+ - Run `agent-infra-internal platform-issue bind {task-id} --issue {issue-token} --agent {standard-agent-token}`; the provider parses the token and atomically writes `platform_issue_identity`
151
151
  - Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --assignees current --milestone initial`
152
152
  - After every scenario, run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
153
153
 
@@ -202,7 +202,7 @@ Next step - run requirements analysis:
202
202
  ## Completion Checklist
203
203
 
204
204
  - [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
205
- - [ ] Recorded `issue_number` in task.md
205
+ - [ ] Provider wrote the Issue identity to `platform_issue_identity` in task.md
206
206
  - [ ] Updated `current_step` to requirement-analysis
207
207
  - [ ] Updated `updated_at` to the current time
208
208
  - [ ] Appended an Activity Log entry to task.md
@@ -224,6 +224,6 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
224
224
 
225
225
  ## Error Handling
226
226
 
227
- - Issue not found: output "Issue #{number} not found, please check the issue number"
227
+ - Issue not found: output "Issue {issue-token} not found, please check the Issue token"
228
228
  - Network error: output "Cannot connect to the platform, please check network"
229
229
  - Permission error: output "No access to this repository"
@@ -9,7 +9,7 @@ description: >
9
9
  > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
10
10
 
11
11
 
12
- 导入指定的 Issue 并创建任务。参数:issue 编号。
12
+ 导入指定的 Issue 并创建任务。参数:Issue 原始 token,由选定 provider 解析。
13
13
 
14
14
  ## 行为边界 / 关键规则
15
15
 
@@ -43,7 +43,7 @@ description: >
43
43
 
44
44
  执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的前置步骤完成认证和代码托管平台检测;随后按其中的 “读取 Issue” 命令获取 Issue 信息。
45
45
 
46
- 提取:issue 编号、标题、描述、标签。
46
+ 提取:Issue identity、标题、描述、标签。
47
47
 
48
48
  从 Issue 标题派生任务标题:按下方契约剥掉可选的单层前导 Conventional Commits 前缀,其余描述原文与原始语言保持不变。下方 fenced 契约是权威的、与语言无关的规则——在所有 `import-issue` 变体中保持逐字节一致:
49
49
 
@@ -67,7 +67,7 @@ example-single-layer: "feat: add A: B" => "add A: B"
67
67
  - 如果找到,**默认复用现有任务**(场景 A),不询问用户;在最终告知中明确「已复用现有任务 `{task-id}`,未重新导入」。若用户希望重新导入,需要先手动归档/删除已有任务再次执行本技能
68
68
  - 如果未找到,继续执行 2.2
69
69
 
70
- 2.2 调用 `agent-infra-internal platform-comment list --issue {issue-number}` 扫描注册 marker,查找可恢复的历史任务 ID。
70
+ 2.2 调用 `agent-infra-internal platform-comment list --issue {issue-token}` 扫描注册 marker,查找可恢复的历史任务 ID。
71
71
 
72
72
  该命令内部解析 upstream、认证与分页。
73
73
 
@@ -101,7 +101,7 @@ date +%Y%m%d-%H%M%S
101
101
  任务元数据:
102
102
  ```yaml
103
103
  id: {task-id}
104
- issue_number: <issue-number>
104
+ platform_issue_identity: <provider 返回的 canonical identity JSON 字符串>
105
105
  type: feature|bugfix|refactor|docs|chore
106
106
  branch: <project>-<type>-<slug>
107
107
  workflow: feature-development|bug-fix|refactoring
@@ -146,8 +146,8 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
146
146
 
147
147
  ### 5. 绑定并同步 Issue
148
148
 
149
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
150
- - 调用 `agent-infra-internal platform-issue bind {task-id} --issue {issue-number} --agent {standard-agent-token}` 校验并原子绑定
149
+ 创建 task.md 后始终执行以下绑定和同步操作(任一平台失败则跳过并继续):
150
+ - 调用 `agent-infra-internal platform-issue bind {task-id} --issue {issue-token} --agent {standard-agent-token}`,由 provider 解析并原子写入 `platform_issue_identity`
151
151
  - 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --assignees current --milestone initial`
152
152
  - 所有场景结束后,必须调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
153
153
 
@@ -202,7 +202,7 @@ Issue #{number} 已导入。
202
202
  ## 完成检查清单
203
203
 
204
204
  - [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
205
- - [ ] 在 task.md 中记录了 issue_number
205
+ - [ ] 已由 provider 将 Issue identity 写入 task.md 的 `platform_issue_identity`
206
206
  - [ ] 更新了 `current_step` 为 requirement-analysis
207
207
  - [ ] 更新了 `updated_at` 为当前时间
208
208
  - [ ] 追加了 Activity Log 条目到 task.md
@@ -224,6 +224,6 @@ Issue #{number} 已导入。
224
224
 
225
225
  ## 错误处理
226
226
 
227
- - Issue 未找到:提示 "Issue #{number} not found, please check the issue number"
227
+ - Issue 未找到:提示 "Issue {issue-token} not found, please check the Issue token"
228
228
  - 网络错误:提示 "Cannot connect to the platform, please check network"
229
229
  - 权限错误:提示 "No access to this repository"
@@ -15,13 +15,13 @@
15
15
  "assigned_to"
16
16
  ],
17
17
  "expected_step": "requirement-analysis",
18
- "require_issue_number": true
18
+ "require_platform_issue_identity": true
19
19
  },
20
20
  "activity-log": {
21
21
  "expected_action_pattern": "Import Issue"
22
22
  },
23
23
  "platform-sync": {
24
- "when": "issue_number_exists",
24
+ "when": "platform_issue_identity_exists",
25
25
  "issue_must_exist": true,
26
26
  "verify_task_comment_content": true
27
27
  }