@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.
- package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +6 -2
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +43 -3
- package/dist/lib/fs/durable-write.js +2 -0
- package/dist/lib/internal/cli-route-inventory.js +1 -1
- package/dist/lib/internal/manual-validation.js +17 -8
- package/dist/lib/internal/task-artifact.js +1 -1
- package/dist/lib/internal/task-lifecycle.js +2 -2
- package/dist/lib/internal/task-operation-registry.js +0 -1
- package/dist/lib/internal/task-review.js +4 -4
- package/dist/lib/platform/issue-comments.js +16 -10
- package/dist/lib/platform/issues.js +1 -1
- package/dist/lib/platform/pr-change-report.js +5 -4
- package/dist/lib/platform/pr-summary.js +64 -32
- package/dist/lib/platform/pull-requests.js +3 -3
- package/dist/lib/platform/task-identities.js +2 -9
- package/dist/lib/platform/verification-sync.js +6 -2
- package/dist/lib/pr-review/evidence-grading.js +4 -8
- package/dist/lib/sandbox/commands/rm.js +21 -2
- package/dist/lib/sandbox/control/server.js +29 -9
- package/dist/lib/sandbox/control/state.js +7 -1
- package/dist/lib/sandbox/control/workflow-executor.js +4 -14
- package/dist/lib/sandbox/index.js +1 -2
- package/dist/lib/sandbox/removal.js +116 -1011
- package/dist/lib/sandbox/workspace-identity.js +17 -1
- package/dist/lib/task/artifact-command.js +6 -28
- package/dist/lib/task/artifact-operations.js +16 -230
- package/dist/lib/task/artifact-recovery.js +430 -0
- package/dist/lib/task/artifact-repair-intent.js +73 -39
- package/dist/lib/task/commit-operation.js +31 -4
- package/dist/lib/task/control-authority.js +38 -7
- package/dist/lib/task/control-recovery.js +14 -2
- package/dist/lib/task/create-service.js +1 -8
- package/dist/lib/task/delegation-receipts.js +64 -3
- package/dist/lib/task/events.js +164 -22
- package/dist/lib/task/human-override.js +5 -8
- package/dist/lib/task/intermediate-cleanup.js +66 -8
- package/dist/lib/task/lifecycle-recovery.js +549 -0
- package/dist/lib/task/lifecycle.js +12 -3
- package/dist/lib/task/local-artifact-finalization.js +148 -123
- package/dist/lib/task/manual-validation-receipt.js +5 -1
- package/dist/lib/task/orchestration.js +52 -2
- package/dist/lib/task/pr-delivery-fact.js +12 -56
- package/dist/lib/task/recovery-warning.js +19 -0
- package/dist/lib/task/review-command.js +1 -0
- package/dist/lib/task/review-finalization.js +104 -77
- package/dist/lib/task/short-id.js +15 -7
- package/dist/lib/task/task-execution-lock.js +1 -1
- package/dist/lib/task/verification-engine.js +3 -14
- package/dist/lib/task/workflow-command.js +0 -1
- package/dist/lib/version.js +1 -11
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +7 -2
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +55 -3
- package/lib/fs/durable-write.ts +1 -0
- package/lib/internal/cli-route-inventory.ts +1 -1
- package/lib/internal/manual-validation.ts +17 -8
- package/lib/internal/task-artifact.ts +1 -1
- package/lib/internal/task-lifecycle.ts +4 -3
- package/lib/internal/task-operation-registry.ts +0 -1
- package/lib/internal/task-review.ts +4 -4
- package/lib/platform/issue-comments.ts +18 -10
- package/lib/platform/issues.ts +1 -1
- package/lib/platform/pr-change-report.ts +7 -5
- package/lib/platform/pr-summary.ts +64 -32
- package/lib/platform/pull-requests.ts +3 -3
- package/lib/platform/task-identities.ts +3 -14
- package/lib/platform/verification-sync.ts +6 -2
- package/lib/pr-review/evidence-grading.ts +4 -9
- package/lib/sandbox/commands/rm.ts +34 -2
- package/lib/sandbox/control/protocol.ts +5 -0
- package/lib/sandbox/control/server.ts +30 -10
- package/lib/sandbox/control/state.ts +9 -1
- package/lib/sandbox/control/workflow-executor.ts +4 -14
- package/lib/sandbox/index.ts +1 -2
- package/lib/sandbox/removal.ts +126 -1128
- package/lib/sandbox/workspace-identity.ts +19 -3
- package/lib/task/artifact-command.ts +8 -27
- package/lib/task/artifact-operations.ts +21 -251
- package/lib/task/artifact-recovery.ts +519 -0
- package/lib/task/artifact-repair-intent.ts +99 -51
- package/lib/task/commit-operation.ts +35 -4
- package/lib/task/control-authority.ts +47 -14
- package/lib/task/control-recovery.ts +13 -1
- package/lib/task/create-service.ts +1 -10
- package/lib/task/delegation-receipts.ts +73 -2
- package/lib/task/events.ts +187 -23
- package/lib/task/human-override.ts +5 -8
- package/lib/task/intermediate-cleanup.ts +50 -12
- package/lib/task/lifecycle-recovery.ts +691 -0
- package/lib/task/lifecycle.ts +13 -4
- package/lib/task/local-artifact-finalization.ts +176 -132
- package/lib/task/manual-validation-receipt.ts +5 -1
- package/lib/task/orchestration.ts +65 -0
- package/lib/task/pr-delivery-fact.ts +15 -62
- package/lib/task/recovery-warning.ts +21 -0
- package/lib/task/review-command.ts +1 -0
- package/lib/task/review-finalization.ts +106 -87
- package/lib/task/short-id.ts +27 -5
- package/lib/task/task-execution-lock.ts +1 -1
- package/lib/task/verification-engine.ts +3 -17
- package/lib/task/verification-types.ts +0 -2
- package/lib/task/workflow-command.ts +0 -1
- package/lib/version.ts +1 -15
- package/package.json +1 -1
- package/templates/.agents/rules/create-issue.en.md +1 -1
- package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.en.md +4 -2
- package/templates/.agents/rules/issue-sync.zh-CN.md +4 -3
- package/templates/.agents/rules/local-artifact-repair.en.md +46 -39
- package/templates/.agents/rules/local-artifact-repair.zh-CN.md +43 -36
- package/templates/.agents/skills/analyze-task/SKILL.en.md +6 -6
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
- package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/block-task/config/verify.json +1 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +7 -7
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/code-task/config/verify.en.json +1 -1
- package/templates/.agents/skills/code-task/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/complete-task/config/verify.en.json +2 -2
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -2
- package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +1 -1
- package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +1 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/create-pr/config/verify.json +1 -1
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +2 -2
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +2 -2
- package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/create-task/config/verify.json +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +8 -8
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/import-issue/config/verify.json +2 -2
- package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
- package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/restore-task/config/verify.json +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +2 -2
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -1
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -7
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +6 -6
- package/templates/.agents/skills/review-code/SKILL.en.md +2 -2
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-code/config/verify.en.json +1 -1
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/review-code/reference/report-template.en.md +12 -12
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +12 -12
- package/templates/.agents/skills/review-plan/SKILL.en.md +2 -2
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-plan/config/verify.en.json +1 -1
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -7
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -7
- package/templates/.agents/skills/review-pr/config/verify.en.json +1 -1
- package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +3 -3
- package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +3 -3
- package/templates/.agents/skills/run-manual-validation/config/verify.en.json +1 -1
- package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +1 -1
- package/templates/.agents/skills/run-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/templates/task.en.md +1 -1
- package/templates/.agents/templates/task.zh-CN.md +1 -1
- package/templates/.claude/commands/import-issue.en.md +1 -1
- package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/restore-task.en.md +1 -1
- package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
|
@@ -9,6 +9,6 @@ agent-infra-internal platform-issue create {task-id} --agent {standard-agent-tok
|
|
|
9
9
|
agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
The core reads only persisted task identity, title, type, description, and requirements, and reuses deterministic `ai task issue-body` rendering. It owns template selection, upstream/capabilities, duplicate prevention, POST outcome boundaries, response validation, and atomic `
|
|
12
|
+
The core reads only persisted task identity, title, type, description, and requirements, and reuses deterministic `ai task issue-body` rendering. It owns template selection, upstream/capabilities, duplicate prevention, POST outcome boundaries, response validation, and atomic `platform_issue_identity` binding.
|
|
13
13
|
|
|
14
14
|
`planned|applied|no-op|degraded` exit 0, `failed` exits 1, and `blocked` exits 2. Callers must not fall back to direct platform CLI or GraphQL orchestration.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
命令只从已落盘 task.md 读取身份、标题、类型、描述与需求,并复用 `ai task issue-body` 的确定性正文渲染。它负责模板选择、upstream/capability、已有绑定检查、非幂等 POST 边界、响应身份校验及通过任务写入内核回写 `
|
|
11
|
+
命令只从已落盘 task.md 读取身份、标题、类型、描述与需求,并复用 `ai task issue-body` 的确定性正文渲染。它负责模板选择、upstream/capability、已有绑定检查、非幂等 POST 边界、响应身份校验及通过任务写入内核回写 `platform_issue_identity`。
|
|
12
12
|
|
|
13
13
|
创建后的初始元数据使用同一适配层同步:
|
|
14
14
|
|
|
@@ -12,19 +12,21 @@
|
|
|
12
12
|
| `summary` | `<!-- sync-issue:{task-id}:summary -->` |
|
|
13
13
|
| `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
|
|
14
14
|
|
|
15
|
-
`pr-review` content is synced only as an Issue artifact comment (via the `artifact` / `artifactChunk` markers) and is never a `restore-task` recovery source; restore still accepts only an Issue
|
|
15
|
+
`pr-review` content is synced only as an Issue artifact comment (via the `artifact` / `artifactChunk` markers) and is never a `restore-task` recovery source; restore still accepts only an Issue token and reads only registered Issue markers, with no PR source.
|
|
16
16
|
|
|
17
17
|
Comments use `platform-comment`; Issue resources use `platform-issue`:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
agent-infra-internal platform-issue inspect {task-id}
|
|
21
21
|
agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
|
|
22
|
-
agent-infra-internal platform-issue bind {task-id} --issue {
|
|
22
|
+
agent-infra-internal platform-issue bind {task-id} --issue {issue-token} --agent {standard-agent-token}
|
|
23
23
|
agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} {desired-state-flags}
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
The core owns status/in labels, assignees, milestones, Issue Type, pinned fields, requirements, state, capabilities, dry-run, retries, errors, and idempotency. Omitted flags preserve values; `none` explicitly clears them. Status labels converge to at most one, and ambiguous requirement identity fails closed.
|
|
27
27
|
|
|
28
|
+
Task content over the platform comment byte limit is not uploaded; the core returns a skipped operation with `COMMENT_PAYLOAD_TOO_LARGE`. The local task file is unchanged, and platform verification skips the task marker/content check for the same oversized input.
|
|
29
|
+
|
|
28
30
|
PR event `in:` synchronization uses `agent-infra-internal platform-pr sync-in-labels --pr <N> [--cwd <path>]`. PR files are the event evidence; a unique closing Issue is written and re-read before the PR. Zero or multiple closing Issues update only the PR and return `degraded`; unknown side effects or failed convergence return `blocked` with `IN_LABEL_SYNC_PARTIAL`.
|
|
29
31
|
|
|
30
32
|
`planned|applied|no-op|degraded` exit 0; `failed` exits 1; `blocked` exits 2.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
`prSummary` 属于 `.agents/rules/pr-sync.md`,本规则不实现 PR 聚合。
|
|
18
18
|
|
|
19
|
-
`pr-review` 原文只通过 `artifact` / `artifactChunk` marker 同步为 Issue artifact 评论,不作为 `restore-task` 恢复来源;恢复仍只接受 Issue
|
|
19
|
+
`pr-review` 原文只通过 `artifact` / `artifactChunk` marker 同步为 Issue artifact 评论,不作为 `restore-task` 恢复来源;恢复仍只接受 Issue 原始 token 并只读注册的 Issue marker,不新增 PR 来源。
|
|
20
20
|
|
|
21
21
|
## 平台 intent
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
agent-infra-internal platform-context resolve [--cwd <path>]
|
|
27
|
-
agent-infra-internal platform-comment list --issue <
|
|
27
|
+
agent-infra-internal platform-comment list --issue <issue-token> [--cwd <path>]
|
|
28
28
|
agent-infra-internal platform-comment owner <task-ref>
|
|
29
29
|
agent-infra-internal platform-comment sync <task-ref> \
|
|
30
30
|
--kind task|artifact|summary|cancel --agent {standard-agent-token} \
|
|
@@ -33,6 +33,7 @@ agent-infra-internal platform-comment sync <task-ref> \
|
|
|
33
33
|
|
|
34
34
|
- `applied|no-op|degraded` → exit 0;`failed` → exit 1;`blocked` → exit 2。
|
|
35
35
|
- task 评论保持 `<details>` frontmatter 可逆格式;artifact 原文内联并在超过 profile 上限时使用 `artifactChunk`。
|
|
36
|
+
- task 内容超过平台评论字节上限时不上传,返回 `COMMENT_PAYLOAD_TOO_LARGE` 的 skipped 操作;本地 task 文件保持不变,platform verification 同样跳过 task marker/content 检查。
|
|
36
37
|
- 相同 intent 重放必须收敛为 `no-op`;重复 marker 返回 `COMMENT_MARKER_CONFLICT` 且不写入。
|
|
37
38
|
- 外部贡献者锁定统一使用 `platform-comment owner`;不同作者且无 triage 时返回 `COMMENT_OWNER_CONFLICT`。
|
|
38
39
|
|
|
@@ -59,7 +60,7 @@ agent-infra-internal task-warning {task-id} add \
|
|
|
59
60
|
```bash
|
|
60
61
|
agent-infra-internal platform-issue inspect {task-id}
|
|
61
62
|
agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
|
|
62
|
-
agent-infra-internal platform-issue bind {task-id} --issue {
|
|
63
|
+
agent-infra-internal platform-issue bind {task-id} --issue {issue-token} --agent {standard-agent-token}
|
|
63
64
|
agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} {desired-state-flags}
|
|
64
65
|
```
|
|
65
66
|
|
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
# General Rule - Model-Driven Local Artifact
|
|
1
|
+
# General Rule - Model-Driven Local Artifact Recovery
|
|
2
2
|
|
|
3
|
-
This rule
|
|
3
|
+
This rule covers the pre-completion gate for `analyze-task`, `plan-task`, and `code-task`, plus the summary finalizers for the three review skills. It handles one canonical artifact in the current task directory only. It does not authorize changes to `task.md`, ledgers, receipts, source code, Git, platform resources, or lifecycle state.
|
|
4
4
|
|
|
5
|
-
## Pre-completion gate
|
|
5
|
+
## Pre-completion gate
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- Run the applicable finalizer before a completed event; pass only that invocation's `artifactSha256` and `semanticDigest` to the event.
|
|
8
|
+
- When artifact content is invalid, the finalizer returns a controlled `recovery` with a `recoveryId`, `candidatePath`, and baseline digests. The formal artifact remains unchanged until recovery commit.
|
|
9
|
+
- After the mechanical safety gates pass, the model may edit only the returned `candidatePath`. After each byte-changing edit, rerun the complete finalizer with the same task, stage/family, artifact, and `--recovery-id`. Never edit the formal artifact directly and call it a candidate.
|
|
10
|
+
- A successful finalizer commits through `finalize-ready → commit-started → passed`; completed events accept only matching `passed` final digests and consume the intent under the task lock.
|
|
11
|
+
- Before `finalize-ready`, the recovery core seals the validated final bytes in the controlled `final.md`; later commit ignores the editable `candidate.md` and validates/publishes only that sealed snapshot, so a post-prepare candidate replacement cannot be published.
|
|
12
|
+
- Candidate-only is a protocol authorization boundary, not OS isolation: a same-UID process with arbitrary host filesystem write access may tamper with recovery internals. Identity, fingerprint, and state checks detect such anomalies and fail closed, but the protocol does not claim an independent security principal or cross-platform isolation.
|
|
11
13
|
|
|
12
|
-
## Authorization
|
|
14
|
+
## Authorization boundary
|
|
13
15
|
|
|
14
|
-
- The finalizer
|
|
15
|
-
- The
|
|
16
|
-
-
|
|
17
|
-
- `changed=false`, an error code, or a format shape is diagnostic evidence, not automatic authorization. The model must judge each case using the complete diagnostic, artifact content, and context.
|
|
16
|
+
- The finalizer and recovery core validate identity, state, permissions, stable reads, complete artifact semantics, and fingerprints. They do not infer repairability or expose a text-operation allow-list.
|
|
17
|
+
- The model may edit only the one ordinary artifact declared by the current skill. It must not edit `task.md`, ledgers, receipts, source code, other reports, or remote resources.
|
|
18
|
+
- `changed=false`, an error code, or a format shape is diagnostic evidence, not edit authorization. Stop on unproven human-decision semantics, concurrency, permission, I/O, identity, provenance, or unknown state.
|
|
18
19
|
|
|
19
|
-
## Non-bypassable
|
|
20
|
+
## Non-bypassable mechanical gates
|
|
20
21
|
|
|
21
|
-
Before every
|
|
22
|
+
Before every candidate edit, confirm that:
|
|
22
23
|
|
|
23
|
-
1. the finalizer
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
26
|
-
4. the
|
|
24
|
+
1. the finalizer failed with the same controlled recovery context and nothing formal was committed;
|
|
25
|
+
2. task, family/stage, round, artifact, request/authority, and baseline fingerprints still match;
|
|
26
|
+
3. `candidatePath` is the ordinary file generated by the recovery core and the formal target has not changed externally;
|
|
27
|
+
4. the edit does not change human-decision semantics, detail or ledger identity, and introduces no other side effect.
|
|
27
28
|
|
|
28
|
-
If any condition fails, stop
|
|
29
|
+
If any condition fails, stop without editing or publishing a completed event.
|
|
29
30
|
|
|
30
|
-
##
|
|
31
|
+
## Durable recovery states
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
| State | Formal artifact | Allowed action |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `awaiting-recovery` | baseline `B` | Edit only controlled candidate `S`; rerun the same finalizer |
|
|
36
|
+
| `finalize-ready` | `B` | Recovery core starts the commit under the task lock |
|
|
37
|
+
| `commit-started` | `B` or final `F` | Reconcile only; retry, confirm, or restore from verified `B/F` fingerprints |
|
|
38
|
+
| `passed` | `F` | Completed event validates the final digest and consumes the intent |
|
|
39
|
+
| `consumed` | `F` | Cleanup may reclaim the controlled staging and backup |
|
|
40
|
+
| `aborted` | verified restored `B` | Preserve diagnostics; never fabricate success |
|
|
40
41
|
|
|
41
|
-
The
|
|
42
|
+
The intent is current-only schema version 3. Legacy schemas fail closed; do not add migration, adapters, or dual writes. Candidate, baseline, and intent files live in controlled repo-local directories and use canonical recovery IDs, regular-file checks, stable reads, the task lock, and expected-value CAS. No cross-file atomicity is claimed; unknown combinations remain indeterminate and retain their evidence.
|
|
42
43
|
|
|
43
|
-
##
|
|
44
|
+
## Dynamic convergence loop
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
1. Run the finalizer with the fixed invocation.
|
|
47
|
+
2. If it fails and the gates pass, read the structured diagnostic and `candidatePath`, then make one minimal, explainable candidate edit.
|
|
48
|
+
3. Confirm byte-level progress and rerun every finalizer check with the same `--recovery-id`.
|
|
49
|
+
4. Stop on repeated diagnostics or fingerprints, no byte progress, unknown recovery state, or the eight-edit limit for the current invocation. Do not publish a completed event or generate a cross-stage next step.
|
|
46
50
|
|
|
47
|
-
##
|
|
51
|
+
## Shared entry points
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
- On failure, model stop, lack of progress, repeated diagnostics, or the emergency cap, do not publish a completed event, advance the lifecycle, generate cross-stage commands, or fabricate an approval.
|
|
51
|
-
- Stopping advancement does not discard review results. User output must show the artifact path, the last safely readable summary/findings, actual `repairAttempts`, the last structured diagnostic, and the stop reason.
|
|
52
|
-
- If the summary cannot be safely parsed, show only the artifact path and the raw structured diagnostic; do not infer counts or add a conclusion, and state that lifecycle advancement stopped while the artifact remains available.
|
|
53
|
-
- A stop path may only suggest rerunning the current review skill or handling the issue manually. It must not invoke cross-stage helpers such as `code-task` or `complete-task`.
|
|
53
|
+
The current entry points are `task-artifact ... inspect|init|finalize-local` and `task-review ... finalize-summary`. Recovery retries use the `recoveryId` returned by the finalizer, for example:
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
```text
|
|
56
|
+
agent-infra-internal task-artifact {task-id} finalize-local --family code --artifact {code-artifact} --recovery-id {recovery-id}
|
|
57
|
+
agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} --recovery-id {recovery-id}
|
|
58
|
+
```
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
There is no `task-artifact repair`, `replace-line`, `insert-section`, or `repairable` authorization. The structural engine returns diagnostics and digests only; the current skill's gates and the model decide whether and how to edit the candidate.
|
|
61
|
+
|
|
62
|
+
## Lifecycle isolation
|
|
63
|
+
|
|
64
|
+
A completed event may legitimately modify `task.md`, but only after finalizer recovery is `passed` and digest, round, request, and authority all match. If authority consumption fails after the event write, retain the formal artifact and use the existing lifecycle recovery compensation; do not replay the completed write or roll back a passed artifact.
|
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
# 通用规则 -
|
|
1
|
+
# 通用规则 - 模型驱动的本地产物恢复
|
|
2
2
|
|
|
3
|
-
本规则适用于 `analyze-task`、`plan-task`、`code-task`
|
|
3
|
+
本规则适用于 `analyze-task`、`plan-task`、`code-task` 的本地产物完成前门禁,以及三个 review skill 的 summary finalizer。它只处理当前 task 目录内的一个 canonical artifact;不适用于 `task.md`、账本、receipt、源码、Git、平台资源或生命周期状态。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 完成前门禁
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- 完成事件前必须运行对应 finalizer;只有同一次返回的 `artifactSha256` 和 `semanticDigest` 才能传给 completed event。
|
|
8
|
+
- finalizer 发现 artifact 内容错误时,返回受控 `recovery`(`recoveryId`、`candidatePath`、baseline 指纹)。正式 artifact 在 recovery commit 前必须保持不变。
|
|
9
|
+
- 只有在机械安全门通过后,模型才可编辑返回的 `candidatePath`;每次实际字节变化后,用同一 task、stage/family、artifact 和 `--recovery-id` 完整重跑 finalizer。不得直接编辑正式 artifact 后假设它属于候选。
|
|
10
|
+
- finalizer 通过后,recovery core 按 `finalize-ready → commit-started → passed` 提交候选;completed event 只接受匹配的 `passed`/final digest,并在任务锁内消费 intent。
|
|
11
|
+
- `finalize-ready` 前 recovery core 会把已校验的最终字节封存为受控 `final.md`;后续 commit 忽略可编辑的 `candidate.md`,只校验并发布该封存快照,避免候选在准备后被替换。
|
|
12
|
+
- candidate-only 是协议授权边界,不是操作系统隔离:拥有同一 UID 且可任意写入宿主文件系统的进程可能篡改 recovery 内部文件;协议会通过身份、指纹和状态校验发现异常并失败关闭,但不承诺独立权限主体或跨平台隔离。
|
|
11
13
|
|
|
12
14
|
## 授权边界
|
|
13
15
|
|
|
14
|
-
- finalizer
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- `changed=false`、错误码或某个格式形状只是诊断事实,不是自动批准。模型必须结合完整诊断、artifact 内容和上下文逐例判断。
|
|
16
|
+
- finalizer 和 recovery core 只校验身份、状态、权限、稳定读取、完整 artifact 语义和指纹;不根据错误码猜测“可修复”,也不提供文本操作白名单。
|
|
17
|
+
- 模型只能修改当前 skill 声明的一个普通 artifact。不得修改 task.md、账本、receipt、源码、其他报告或远端资源。
|
|
18
|
+
- `changed=false`、错误码和格式形状只是诊断事实,不是编辑授权。人工裁决、并发、权限、I/O、身份、provenance 或未知状态无法证明安全时,立即停止。
|
|
18
19
|
|
|
19
20
|
## 不可绕过的机械安全门
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
每次编辑候选前确认:
|
|
22
23
|
|
|
23
|
-
1. finalizer
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
26
|
-
4.
|
|
24
|
+
1. finalizer 返回失败并提供同一 recovery context,且没有正式提交;
|
|
25
|
+
2. task、family/stage、round、artifact、request/authority 和 baseline 指纹仍匹配;
|
|
26
|
+
3. `candidatePath` 是 recovery core 生成的受控普通文件,formal target 没有外部变化;
|
|
27
|
+
4. 修改不改变人工裁决语义、详情或账本身份,也不引入其他副作用。
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
任一条件不满足,停止,不编辑、不发布 completed。
|
|
29
30
|
|
|
30
|
-
##
|
|
31
|
+
## Durable recovery 状态
|
|
32
|
+
|
|
33
|
+
| 状态 | formal artifact | 允许动作 |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `awaiting-recovery` | baseline `B` | 只编辑受控 candidate `S`,重跑同一 finalizer |
|
|
36
|
+
| `finalize-ready` | `B` | recovery core 在锁内开始提交 |
|
|
37
|
+
| `commit-started` | `B` 或 final `F` | 只允许 reconcile;按 `B/F` 指纹重试、确认或回滚 |
|
|
38
|
+
| `passed` | `F` | completed event 校验 final digest 后消费 |
|
|
39
|
+
| `consumed` | `F` | 可由中间产物清理流程回收受控 staging/backup |
|
|
40
|
+
| `aborted` | 已确认恢复的 `B` | 只保留诊断,不得伪造成功 |
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
4. 模型选择继续时,只做一次最小 artifact 编辑。只有文件字节实际发生变化,才增加一次 `repairAttempts`,然后完整重跑同一个 finalizer intent。
|
|
36
|
-
5. 每次重跑都重新执行全部安全校验。修复后出现新的、独立且仍局限于该 artifact 的问题,可以再次交给模型判断;不能沿用上一次“可修复”的结论。
|
|
37
|
-
6. 模型无法证明下一步安全,或判断问题属于环境、权限、并发、身份、provenance、状态未知、人工裁决语义/详情不确定或其他非本地问题时,立即停止。已知人工裁决本身不是停止条件。
|
|
38
|
-
7. 诊断重复、artifact 指纹重复、没有实际字节进展或模型没有提出可验证的最小修改时,立即停止。
|
|
39
|
-
8. 每次 skill invocation 最多允许 8 次实际 artifact 修改作为紧急熔断。该上限只防止死循环和资源失控,不是正常业务停止条件,也不表示最多只能修复 8 个问题。达到上限时保留最后结构化诊断并停止。
|
|
42
|
+
intent 使用 current-only schema version 3。旧 schema 直接失败关闭;不添加迁移、adapter 或双写。candidate、baseline 和 intent 位于 repo-local 受控目录,使用 canonical recovery ID、普通文件检查、stable read、task lock 和 expected-value CAS。跨文件不宣称原子性;未知组合返回 indeterminate 并保留现场。
|
|
43
|
+
|
|
44
|
+
## 动态收敛循环
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
1. 用固定 invocation 运行 finalizer。
|
|
47
|
+
2. 失败且安全门通过时,读取结构化诊断和 `candidatePath`,只作一次最小、可解释的候选编辑。
|
|
48
|
+
3. 确认字节变化后,使用同一 `--recovery-id` 完整重跑全部 finalizer 校验。
|
|
49
|
+
4. 诊断或指纹重复、无字节进展、恢复状态未知或达到当前 invocation 的 8 次编辑上限时停止;不发布 completed,不生成跨阶段 next-step。
|
|
42
50
|
|
|
43
|
-
##
|
|
51
|
+
## 共享入口
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
`task-artifact ... inspect|init|finalize-local` 和 `task-review ... finalize-summary` 是当前入口。恢复重试使用 finalizer 返回的 `recoveryId`,例如:
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
```text
|
|
56
|
+
agent-infra-internal task-artifact {task-id} finalize-local --family code --artifact {code-artifact} --recovery-id {recovery-id}
|
|
57
|
+
agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact} --recovery-id {recovery-id}
|
|
58
|
+
```
|
|
48
59
|
|
|
49
|
-
-
|
|
50
|
-
- 失败、模型停止、无进展、诊断重复或紧急熔断时,不发布 completed 事件,不推进生命周期,不生成跨阶段命令,也不伪造通过结论。
|
|
51
|
-
- 停止推进不等于丢弃审查结果。用户输出必须展示 artifact 路径、已安全读取的最后有效 summary/findings、实际 `repairAttempts`、最后结构化诊断和停止原因。
|
|
52
|
-
- summary 无法安全解析时,只展示 artifact 路径和原始结构化诊断,不推算计数、不补写结论,并明确生命周期推进已停止但产物仍可查看。
|
|
53
|
-
- 停止路径只提示重新运行当前 review skill 或进行人工处理;不能调用 `code-task`、`complete-task` 等跨阶段 helper。
|
|
60
|
+
不再存在 `task-artifact repair`、`replace-line`、`insert-section` 或 `repairable` 授权。结构引擎只返回诊断和 digest;候选是否安全、如何修改以及何时停止由当前 skill 的机械门和模型逐例判断。
|
|
54
61
|
|
|
55
62
|
## 生命周期隔离
|
|
56
63
|
|
|
57
|
-
|
|
64
|
+
completed event 合法地修改 task.md,但必须发生在 finalizer recovery 已 `passed` 且 digest、round、request/authority 全部匹配之后。若 event 写入后 authority 消费失败,保留正式 artifact,使用既有 lifecycle recovery compensation;不得重放 completed 写入或回滚已通过的 artifact。
|
|
@@ -72,7 +72,7 @@ Read `task.md` carefully to understand:
|
|
|
72
72
|
- currently known affected files and constraints
|
|
73
73
|
|
|
74
74
|
If `task.md` contains these source fields, also read the corresponding source information:
|
|
75
|
-
- `
|
|
75
|
+
- `platform_issue_identity` - canonical Issue identity
|
|
76
76
|
- `codescan_alert_number` - Code Scanning alert
|
|
77
77
|
- `security_alert_number` - Dependabot alert
|
|
78
78
|
|
|
@@ -114,7 +114,7 @@ Runs after Step 0 state check and Step 3 (questioning is an external-state actio
|
|
|
114
114
|
- if a `pending_question` already exists (the previous question is still unanswered) → restate that `pending_question`, do **not** modify it and do **not** increment `question_count`;
|
|
115
115
|
- otherwise (no pending question) → pick the single highest-value question (acceptance criteria > scope > ambiguity) and write `## Brainstorming`: `status: asking`, `pending_question: <question>`, `question_count += 1`.
|
|
116
116
|
2. If `start_date` is empty, write today (`date +%F`), then run `agent-infra-internal task-event {task-id} analyze.awaiting-input --agent {standard-agent-token} --question {question_count}` so the core updates base metadata and Activity Log.
|
|
117
|
-
3. Issue sync (when `
|
|
117
|
+
3. Issue sync (when a valid `platform_issue_identity` exists, skip on any failure): run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` to update only the **task comment**; keep the `status` label at `pending-design-work`; do **not** publish an analysis artifact comment.
|
|
118
118
|
4. Verification (replaces the step 8 artifact gate): `agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text` (the early-exit set `current_step: requirement-analysis` and wrote `start_date`, so it should pass); also keep `rg -n 'Analyze Task \(Brainstorming\)' .agents/workspace/active/{task-id}/task.md` and the task-comment sync evidence. Do **not** run the artifact gate, nor `check activity-log` / `check platform-sync` (both bind to the analysis artifact path).
|
|
119
119
|
5. User output: show only the current **single question** plus how to answer/continue (re-trigger `analyze-task {task-ref}` with the answer), and append the `Completed at` line per `.agents/rules/next-step-output.md`.
|
|
120
120
|
6. **STOP** and wait for the answer. The next trigger returns to this step.
|
|
@@ -140,7 +140,7 @@ Before writing this round's `{analysis-artifact}`, create the controlled report
|
|
|
140
140
|
agent-infra-internal task-artifact {task-id} init --family analysis --artifact {analysis-artifact} --locale en
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
The skeleton contains identity metadata, stable section markers, and required headings only; real analysis content is required before the completion gate can pass. If the finalizer returns one provably safe structural error,
|
|
143
|
+
The skeleton contains identity metadata, stable section markers, and required headings only; real analysis 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 analysis --artifact {analysis-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.
|
|
144
144
|
|
|
145
145
|
> Steps 6–9 are the **Scenario A (normal output)** path. **Scenario B (ask and early-exit)** already finished its state update, task-comment sync, and verification inside step 4 and STOPped, so it does not enter these steps.
|
|
146
146
|
|
|
@@ -223,14 +223,14 @@ agent-infra-internal task-artifact {task-id} finalize-local --family analysis --
|
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
- On `status=passed`, save that result's `artifactSha256` and `semanticDigest`; the finalizer has recorded the matching one-shot local provenance intent.
|
|
226
|
-
- On `status=failed` with
|
|
227
|
-
- The
|
|
226
|
+
- On `status=failed` with recovery context, edit only the returned `candidatePath` once after the completion gates pass, then rerun the finalizer completely with the same `recoveryId`; the formal artifact must remain unchanged until commit.
|
|
227
|
+
- The recovery candidate must match the recorded task, round, artifact, baseline, and request identity. On baseline conflict, unknown state, no progress, or repeated failure, stop without publishing a completed event.
|
|
228
228
|
|
|
229
229
|
Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
|
|
230
230
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analyze Task (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
If task.md contains a valid `
|
|
233
|
+
If task.md contains a valid `platform_issue_identity`, perform these sync actions (skip and continue on any failure):
|
|
234
234
|
- Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
|
|
235
235
|
- Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
236
236
|
- Run `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {analysis-artifact} --agent {standard-agent-token}`
|
|
@@ -75,7 +75,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
|
|
|
75
75
|
- 当前已知的受影响文件和约束
|
|
76
76
|
|
|
77
77
|
如 `task.md` 包含以下来源字段,补充读取对应来源信息:
|
|
78
|
-
- `
|
|
78
|
+
- `platform_issue_identity` - Issue 的 canonical identity
|
|
79
79
|
- `codescan_alert_number` - Code Scanning 告警
|
|
80
80
|
- `security_alert_number` - Dependabot 告警
|
|
81
81
|
|
|
@@ -117,7 +117,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
|
|
|
117
117
|
- 若已存在 `pending_question`(上一问尚未得到答案)→ 复述该 `pending_question`,**不**修改它、**不**增加 `question_count`;
|
|
118
118
|
- 否则(无待答问题)→ 选最高价值的一个问题(验收标准 > 范围 > 歧义),写入 `## Brainstorming`:`status: asking`、`pending_question: <问题>`、`question_count += 1`。
|
|
119
119
|
2. 若 `start_date` 为空,写入当日日期(`date +%F`);随后执行 `agent-infra-internal task-event {task-id} analyze.awaiting-input --agent {standard-agent-token} --question {question_count}`,由核心统一更新基础 frontmatter 和 Activity Log。
|
|
120
|
-
3. Issue
|
|
120
|
+
3. Issue 同步(存在有效 `platform_issue_identity` 时,任一失败跳过):调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 更新 **task 评论**;`status` label 维持 `pending-design-work`;**不**发布分析产物评论。
|
|
121
121
|
4. 校验(替代步骤 8 的 artifact gate):`agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text`(早退已置 `current_step: requirement-analysis` 且已写入 `start_date`,预期通过);并保留 `rg -n 'Analyze Task \(Brainstorming\)' .agents/workspace/active/{task-id}/task.md` 与 task 评论同步证据。**不**跑 artifact gate,也不跑 `check activity-log` / `check platform-sync`(二者绑定分析产物路径)。
|
|
122
122
|
5. 用户输出:只展示当前**单个问题** + 如何回答/继续(再次触发 `analyze-task {task-ref}` 并附答案),并按 `.agents/rules/next-step-output.md` 在末行追加 `Completed at`。
|
|
123
123
|
6. **STOP**,等待回答。下一次触发回到本步骤。
|
|
@@ -143,7 +143,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
|
|
|
143
143
|
agent-infra-internal task-artifact {task-id} init --family analysis --artifact {analysis-artifact}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实分析内容后才能通过完成门禁。finalizer
|
|
146
|
+
骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实分析内容后才能通过完成门禁。finalizer 返回可证明的单个结构错误时,会返回受控 recovery candidate;只能编辑返回的 `candidatePath`,然后使用同一个 `recoveryId` 重跑 `task-artifact {task-id} finalize-local --family analysis --artifact {analysis-artifact} --recovery-id {recovery-id}`。candidate-only 是协议授权边界,不是操作系统隔离;同 UID 的任意宿主写入者不在本协议的防护承诺内,异常由指纹/状态校验失败关闭。
|
|
147
147
|
|
|
148
148
|
> 步骤 6–9 属**场景 A(正常产出)**路径。**场景 B(提问早退)**已在步骤 4 内完成状态更新、task 评论同步与校验并 STOP,不进入这些步骤。
|
|
149
149
|
|
|
@@ -226,11 +226,11 @@ agent-infra-internal task-artifact {task-id} init --family analysis --artifact {
|
|
|
226
226
|
agent-infra-internal task-artifact {task-id} finalize-local --family analysis --artifact {analysis-artifact}
|
|
227
227
|
```
|
|
228
228
|
- `status=passed`:保存本次返回的 `artifactSha256` 和 `semanticDigest`;finalizer 已记录对应的一次性本地 provenance intent。
|
|
229
|
-
- `status=failed`
|
|
230
|
-
-
|
|
229
|
+
- `status=failed` 且返回 recovery context:完成门禁通过后,只编辑返回的 `candidatePath` 一次,然后使用同一个 `recoveryId` 完整重跑 finalizer;formal artifact 在 commit 前必须保持不变。
|
|
230
|
+
- recovery candidate 必须与记录的任务、轮次、产物、baseline 和 request identity 匹配;基线冲突、未知状态、无进展或重复失败:停止,不发布 completed 事件。
|
|
231
231
|
- 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} {execution-flag}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
|
|
232
232
|
|
|
233
|
-
如果 task.md 中存在有效的 `
|
|
233
|
+
如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(任一失败则跳过并继续):
|
|
234
234
|
- 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
|
|
235
235
|
- 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
236
236
|
- 调用 `agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact {analysis-artifact} --agent {standard-agent-token}`
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"expected_action_pattern": "(Analyze Task|Requirement Analysis) \\(Round \\d+\\)"
|
|
25
25
|
},
|
|
26
26
|
"platform-sync": {
|
|
27
|
-
"when": "
|
|
27
|
+
"when": "platform_issue_identity_exists",
|
|
28
28
|
"expected_status_label": "status: pending-design-work",
|
|
29
29
|
"expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
|
|
30
30
|
"verify_comment_content": true,
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"expected_action_pattern": "(Analyze Task|Requirement Analysis) \\(Round \\d+\\)"
|
|
25
25
|
},
|
|
26
26
|
"platform-sync": {
|
|
27
|
-
"when": "
|
|
27
|
+
"when": "platform_issue_identity_exists",
|
|
28
28
|
"expected_status_label": "status: pending-design-work",
|
|
29
29
|
"expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
|
|
30
30
|
"verify_comment_content": true,
|
|
@@ -73,9 +73,9 @@ ls .agents/workspace/blocked/{task-id}/task.md
|
|
|
73
73
|
|
|
74
74
|
### 6. Sync to Issue (Optional)
|
|
75
75
|
|
|
76
|
-
Check whether `task.md` includes a valid `
|
|
76
|
+
Check whether `task.md` includes a valid `platform_issue_identity`. If not, skip this step.
|
|
77
77
|
|
|
78
|
-
If a valid `
|
|
78
|
+
If a valid `platform_issue_identity` exists, run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status blocked`.
|
|
79
79
|
Then run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`.
|
|
80
80
|
|
|
81
81
|
### 7. Verification Gate
|
|
@@ -74,9 +74,9 @@ ls .agents/workspace/blocked/{task-id}/task.md
|
|
|
74
74
|
|
|
75
75
|
### 6. 同步到 Issue(可选)
|
|
76
76
|
|
|
77
|
-
检查 `task.md` 中是否存在有效的 `
|
|
77
|
+
检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过。
|
|
78
78
|
|
|
79
|
-
如果存在有效的 `
|
|
79
|
+
如果存在有效的 `platform_issue_identity`,调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status blocked`。
|
|
80
80
|
随后调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 更新 task 评论。
|
|
81
81
|
|
|
82
82
|
### 7. 完成校验
|
|
@@ -14,7 +14,7 @@ description: >
|
|
|
14
14
|
|
|
15
15
|
- This command terminates a task that no longer needs to continue and moves it into `completed/`
|
|
16
16
|
- Cancel only when the task no longer needs implementation, review, or follow-up work
|
|
17
|
-
- When a valid `
|
|
17
|
+
- When a valid `platform_issue_identity` exists, Issue sync is required
|
|
18
18
|
|
|
19
19
|
Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
|
|
20
20
|
|
|
@@ -74,9 +74,9 @@ Confirm the task directory was moved successfully.
|
|
|
74
74
|
|
|
75
75
|
### 6. Sync to Issue
|
|
76
76
|
|
|
77
|
-
Check whether `task.md` contains a valid `
|
|
77
|
+
Check whether `task.md` contains a valid `platform_issue_identity`. If not, skip this step.
|
|
78
78
|
|
|
79
|
-
If a valid `
|
|
79
|
+
If a valid `platform_issue_identity` exists:
|
|
80
80
|
- Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
|
|
81
81
|
- Write the cancellation body to a temporary file and run `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
82
82
|
- Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
@@ -14,7 +14,7 @@ description: >
|
|
|
14
14
|
|
|
15
15
|
- 本命令用于终止一个不再需要继续执行的任务,并转移到 `completed/`
|
|
16
16
|
- 只有在确认该任务无需继续实现、审查或修复时才可取消
|
|
17
|
-
- 有效 `
|
|
17
|
+
- 有效 `platform_issue_identity` 存在时,Issue 同步属于必做项
|
|
18
18
|
|
|
19
19
|
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
20
20
|
|
|
@@ -73,9 +73,9 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
73
73
|
|
|
74
74
|
### 6. 同步到 Issue
|
|
75
75
|
|
|
76
|
-
检查 `task.md` 中是否存在有效的 `
|
|
76
|
+
检查 `task.md` 中是否存在有效的 `platform_issue_identity`。如果没有,跳过此步骤。
|
|
77
77
|
|
|
78
|
-
如果存在有效的 `
|
|
78
|
+
如果存在有效的 `platform_issue_identity`:
|
|
79
79
|
- 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
|
|
80
80
|
- 将取消正文写入临时文件,调用 `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
81
81
|
- 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"expected_action_pattern": "(Cancel Task|Cancelled)"
|
|
23
23
|
},
|
|
24
24
|
"platform-sync": {
|
|
25
|
-
"when": "
|
|
25
|
+
"when": "platform_issue_identity_exists",
|
|
26
26
|
"expected_comment_marker": "<!-- sync-issue:{task-id}:cancel -->",
|
|
27
27
|
"verify_task_comment_content": true,
|
|
28
28
|
"expected_comment_marker_key": "cancel"
|