@fitlab-ai/agent-infra 0.11.15 → 0.12.1
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/bin/cli.ts +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/bin/internal-cli.js +6 -1
- package/dist/lib/agent-clients/adapters/codex-lifecycle/recovery.js +6 -6
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +8 -18
- package/dist/lib/agent-clients/adapters/codex-orchestration.js +1 -1
- package/dist/lib/decide.js +2 -7
- package/dist/lib/internal/cli-route-inventory.js +3 -0
- package/dist/lib/internal/manual-validation.js +19 -33
- package/dist/lib/internal/platform-comment.js +59 -9
- package/dist/lib/internal/task-activity.js +1 -12
- package/dist/lib/internal/task-event.js +1 -12
- package/dist/lib/internal/task-ledger.js +1 -12
- package/dist/lib/internal/task-operation-registry.js +2 -1
- package/dist/lib/internal/task-qualification.js +6 -15
- package/dist/lib/internal/task-review.js +3 -16
- package/dist/lib/internal/task-short-id.js +2 -1
- package/dist/lib/internal/task-verify.js +1 -11
- package/dist/lib/internal/task-warning.js +1 -12
- package/dist/lib/internal/task-workspace.js +43 -0
- package/dist/lib/merge.js +4 -3
- package/dist/lib/platform/issue-comments.js +373 -267
- package/dist/lib/platform/issue-summary-content.js +112 -0
- package/dist/lib/platform/pr-change-report.js +175 -26
- package/dist/lib/platform/pr-summary-content.js +54 -0
- package/dist/lib/platform/pr-summary.js +321 -296
- package/dist/lib/platform/pull-requests.js +3 -15
- package/dist/lib/platform/summary-content-pipeline.js +18 -0
- package/dist/lib/pr-review/evidence-grading.js +3 -2
- package/dist/lib/process-data/index.js +5 -4
- package/dist/lib/process-data/sources.js +6 -0
- package/dist/lib/run/index.js +3 -2
- package/dist/lib/sandbox/commands/create.js +5 -1
- package/dist/lib/sandbox/commands/enter.js +1 -1
- package/dist/lib/sandbox/commands/list-running.js +2 -1
- package/dist/lib/sandbox/control/client.js +8 -13
- package/dist/lib/sandbox/control/completed-reentry.js +2 -1
- package/dist/lib/sandbox/control/task-view.js +4 -2
- package/dist/lib/sandbox/mounts.js +4 -4
- package/dist/lib/sandbox/recovery.js +26 -16
- package/dist/lib/sandbox/removal.js +62 -12
- package/dist/lib/sandbox/task-resolver.js +9 -6
- package/dist/lib/sandbox/workspace-identity.js +6 -5
- package/dist/lib/sandbox/workspace-view.js +29 -22
- package/dist/lib/task/activity-intent.js +2 -12
- package/dist/lib/task/artifact-lifecycle.js +17 -11
- package/dist/lib/task/artifact-operations.js +41 -49
- package/dist/lib/task/capabilities.js +2 -2
- package/dist/lib/task/commands/ls.js +4 -3
- package/dist/lib/task/commands/status.js +1 -1
- package/dist/lib/task/commit-operation.js +6 -6
- package/dist/lib/task/control-authority.js +32 -32
- package/dist/lib/task/create-service.js +2 -4
- package/dist/lib/task/create.js +12 -65
- package/dist/lib/task/delegation-receipts.js +1 -1
- package/dist/lib/task/delivery.js +2 -8
- package/dist/lib/task/events.js +5 -31
- package/dist/lib/task/finalization.js +33 -29
- package/dist/lib/task/lifecycle.js +9 -48
- package/dist/lib/task/local-artifact-finalization.js +1 -2
- package/dist/lib/task/orchestration.js +24 -57
- package/dist/lib/task/platform-operation-recovery.js +87 -88
- package/dist/lib/task/resolve-ref.js +17 -12
- package/dist/lib/task/review-finalization.js +2 -35
- package/dist/lib/task/review-identity.js +3 -1
- package/dist/lib/task/short-id.js +10 -8
- package/dist/lib/task/verification-engine.js +19 -58
- package/dist/lib/task/workspace-root.js +59 -0
- package/dist/lib/task/workspace-snapshot.js +4 -3
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-clients/adapters/codex-lifecycle/recovery.ts +6 -6
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +8 -34
- package/lib/agent-clients/adapters/codex-orchestration.ts +1 -1
- package/lib/decide.ts +2 -7
- package/lib/internal/cli-route-inventory.ts +2 -0
- package/lib/internal/manual-validation.ts +20 -37
- package/lib/internal/platform-comment.ts +49 -6
- package/lib/internal/task-activity.ts +1 -10
- package/lib/internal/task-event.ts +1 -10
- package/lib/internal/task-ledger.ts +1 -10
- package/lib/internal/task-operation-registry.ts +2 -1
- package/lib/internal/task-qualification.ts +5 -11
- package/lib/internal/task-review.ts +3 -14
- package/lib/internal/task-short-id.ts +2 -1
- package/lib/internal/task-verify.ts +1 -9
- package/lib/internal/task-warning.ts +1 -10
- package/lib/internal/task-workspace.ts +39 -0
- package/lib/merge.ts +4 -3
- package/lib/platform/issue-comments.ts +478 -280
- package/lib/platform/issue-summary-content.ts +132 -0
- package/lib/platform/pr-change-report.ts +165 -20
- package/lib/platform/pr-summary-content.ts +60 -0
- package/lib/platform/pr-summary.ts +367 -269
- package/lib/platform/pull-requests.ts +3 -24
- package/lib/platform/summary-content-pipeline.ts +23 -0
- package/lib/pr-review/evidence-grading.ts +3 -2
- package/lib/process-data/index.ts +4 -3
- package/lib/process-data/sources.ts +6 -0
- package/lib/run/index.ts +3 -2
- package/lib/sandbox/commands/create.ts +5 -1
- package/lib/sandbox/commands/enter.ts +1 -1
- package/lib/sandbox/commands/list-running.ts +2 -1
- package/lib/sandbox/control/client.ts +7 -12
- package/lib/sandbox/control/completed-reentry.ts +2 -1
- package/lib/sandbox/control/task-view.ts +4 -2
- package/lib/sandbox/mounts.ts +4 -4
- package/lib/sandbox/recovery.ts +26 -18
- package/lib/sandbox/removal.ts +60 -27
- package/lib/sandbox/task-resolver.ts +9 -6
- package/lib/sandbox/workspace-identity.ts +6 -5
- package/lib/sandbox/workspace-view.ts +28 -20
- package/lib/task/activity-intent.ts +3 -17
- package/lib/task/artifact-lifecycle.ts +39 -11
- package/lib/task/artifact-operations.ts +28 -35
- package/lib/task/capabilities.ts +2 -2
- package/lib/task/commands/ls.ts +4 -3
- package/lib/task/commands/status.ts +1 -1
- package/lib/task/commit-operation.ts +5 -6
- package/lib/task/control-authority.ts +29 -35
- package/lib/task/create-service.ts +2 -4
- package/lib/task/create.ts +10 -51
- package/lib/task/delegation-receipts.ts +1 -1
- package/lib/task/delivery.ts +2 -10
- package/lib/task/events.ts +5 -32
- package/lib/task/finalization.ts +27 -30
- package/lib/task/lifecycle.ts +9 -50
- package/lib/task/local-artifact-finalization.ts +1 -4
- package/lib/task/orchestration.ts +31 -80
- package/lib/task/platform-operation-recovery.ts +70 -82
- package/lib/task/resolve-ref.ts +18 -12
- package/lib/task/review-finalization.ts +2 -52
- package/lib/task/review-identity.ts +3 -1
- package/lib/task/short-id.ts +10 -8
- package/lib/task/verification-engine.ts +20 -62
- package/lib/task/workspace-root.ts +78 -0
- package/lib/task/workspace-snapshot.ts +4 -3
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.en.md +19 -8
- package/templates/.agents/QUICKSTART.zh-CN.md +19 -8
- package/templates/.agents/README.en.md +10 -15
- package/templates/.agents/README.zh-CN.md +9 -13
- package/templates/.agents/rules/issue-sync.en.md +1 -1
- package/templates/.agents/rules/issue-sync.zh-CN.md +1 -1
- package/templates/.agents/rules/lifecycle-orchestration.en.md +1 -1
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +1 -1
- package/templates/.agents/rules/next-step-output.en.md +2 -2
- package/templates/.agents/rules/next-step-output.zh-CN.md +2 -2
- package/templates/.agents/rules/pr-sync.en.md +5 -3
- package/templates/.agents/rules/pr-sync.zh-CN.md +7 -10
- package/templates/.agents/rules/release-commands.en.md +3 -0
- package/templates/.agents/rules/release-commands.zh-CN.md +3 -0
- package/templates/.agents/rules/task-management.en.md +0 -2
- package/templates/.agents/rules/task-management.zh-CN.md +0 -2
- package/templates/.agents/rules/task-short-id.en.md +2 -2
- package/templates/.agents/rules/task-short-id.zh-CN.md +2 -2
- package/templates/.agents/scripts/task-short-id.js +2 -8
- 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 +0 -1
- package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/archive-tasks/SKILL.en.md +5 -5
- package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +10 -2
- package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/block-task/config/verify.json +0 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +7 -7
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/cancel-task/config/verify.json +0 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/code-task/config/verify.en.json +0 -1
- package/templates/.agents/skills/code-task/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/code-task/reference/output-template.en.md +1 -1
- package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/SKILL.en.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/config/verify.json +0 -1
- package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +2 -2
- package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +2 -2
- package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +2 -2
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +2 -2
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +0 -1
- package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +3 -3
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +3 -3
- package/templates/.agents/skills/complete-task/SKILL.en.md +15 -30
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +17 -32
- package/templates/.agents/skills/complete-task/config/verify.en.json +0 -1
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +3 -3
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/create-pr/config/verify.json +0 -1
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +10 -3
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +10 -3
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +3 -3
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +3 -3
- package/templates/.agents/skills/create-release-note/SKILL.en.md +2 -2
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/create-task/SKILL.en.md +4 -22
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +4 -22
- package/templates/.agents/skills/create-task/config/verify.json +0 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-codescan/config/verify.json +0 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +3 -3
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-dependabot/config/verify.json +0 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/import-issue/config/verify.json +0 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/plan-task/config/verify.en.json +0 -1
- package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/restore-task/config/verify.json +0 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-analysis/config/verify.en.json +0 -1
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -5
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -5
- 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/reference/output-templates.en.md +4 -4
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +4 -4
- package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-plan/config/verify.en.json +0 -1
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -5
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -5
- package/templates/.agents/skills/review-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-pr/config/verify.en.json +0 -1
- package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +0 -1
- package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +1 -1
- package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +1 -1
- package/templates/.agents/skills/run-manual-validation/config/verify.en.json +0 -1
- package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +0 -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/skills/test/SKILL.en.md +0 -3
- package/templates/.agents/skills/test/SKILL.zh-CN.md +0 -3
- package/templates/.agents/skills/test-integration/SKILL.en.md +0 -3
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +0 -3
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +13 -6
- package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +0 -3
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +0 -3
- package/templates/.agents/skills/watch-pr/SKILL.en.md +4 -4
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/watch-pr/config/verify.json +0 -1
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +3 -3
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +3 -3
- package/templates/.agents/templates/handoff.en.md +1 -1
- package/templates/.agents/templates/handoff.zh-CN.md +1 -1
- package/templates/.agents/workflows/bug-fix.en.yaml +1 -1
- package/templates/.agents/workflows/feature-development.en.yaml +1 -1
- package/templates/.agents/workflows/refactoring.en.yaml +1 -1
- package/dist/lib/task/task-execution-lock.js +0 -250
- package/lib/task/task-execution-lock.ts +0 -320
|
@@ -7,16 +7,16 @@ description: >
|
|
|
7
7
|
|
|
8
8
|
# 归档已完成任务
|
|
9
9
|
|
|
10
|
-
将
|
|
11
|
-
- 根 manifest
|
|
12
|
-
- 年 manifest
|
|
13
|
-
- 月 manifest
|
|
10
|
+
将 `<task-workspace>/completed/` 中的已完成任务归档到 `<task-workspace>/archive/YYYY/MM/DD/TASK-xxx/local/`,并重建三级归档索引。TASK 本地材料位于 `local/`,含按路径排序的 `contents.sha256`;TASK 根目录不存放普通文件。
|
|
11
|
+
- 根 manifest:`<task-workspace>/archive/manifest.md`
|
|
12
|
+
- 年 manifest:`<task-workspace>/archive/YYYY/manifest.md`
|
|
13
|
+
- 月 manifest:`<task-workspace>/archive/YYYY/MM/manifest.md`
|
|
14
14
|
|
|
15
15
|
## 执行流程
|
|
16
16
|
|
|
17
17
|
### 1. 验证环境
|
|
18
18
|
|
|
19
|
-
确认
|
|
19
|
+
确认 `<task-workspace>/completed/` 存在,并根据用户输入选择以下四种调用方式之一:
|
|
20
20
|
- 无参数:归档全部已完成任务
|
|
21
21
|
- `--days N`:保留最近 `N` 天,仅归档更早的任务
|
|
22
22
|
- `--before YYYY-MM-DD`:仅归档指定日期之前的任务
|
|
@@ -4,7 +4,15 @@ set -e
|
|
|
4
4
|
|
|
5
5
|
SCRIPT_DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)
|
|
6
6
|
REPO_ROOT=$(CDPATH= cd "$SCRIPT_DIR/../../../.." && pwd)
|
|
7
|
-
|
|
7
|
+
if [ -f "$REPO_ROOT/bin/internal-cli.sh" ]; then
|
|
8
|
+
WORKSPACE_RESULT=$(CDPATH= cd "$REPO_ROOT" && sh "$REPO_ROOT/bin/internal-cli.sh" task-workspace resolve --boundary host)
|
|
9
|
+
elif command -v agent-infra-internal >/dev/null 2>&1; then
|
|
10
|
+
WORKSPACE_RESULT=$(CDPATH= cd "$REPO_ROOT" && agent-infra-internal task-workspace resolve --boundary host)
|
|
11
|
+
else
|
|
12
|
+
printf 'archive-tasks: agent-infra-internal task-workspace resolver is unavailable\n' >&2
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
WORKSPACE_ROOT=$(printf '%s' "$WORKSPACE_RESULT" | node -e 'let input="";process.stdin.setEncoding("utf8");process.stdin.on("data",chunk=>input+=chunk);process.stdin.on("end",()=>{const result=JSON.parse(input);if(result.status!=="resolved"||typeof result.root!=="string")process.exit(1);process.stdout.write(result.root);});')
|
|
8
16
|
COMPLETED_DIR="$WORKSPACE_ROOT/completed"
|
|
9
17
|
ARCHIVE_DIR="$WORKSPACE_ROOT/archive"
|
|
10
18
|
MANIFEST_PATH="$ARCHIVE_DIR/manifest.md"
|
|
@@ -586,4 +594,4 @@ echo
|
|
|
586
594
|
echo "Summary:"
|
|
587
595
|
printf -- '- Archived: %s\n' "$archived_count"
|
|
588
596
|
printf -- '- Skipped: %s\n' "$skipped_count"
|
|
589
|
-
printf -- '- Manifest: %s\n' "
|
|
597
|
+
printf -- '- Manifest: %s\n' "$ARCHIVE_DIR/manifest.md"
|
|
@@ -38,7 +38,7 @@ After prerequisites pass, Step 3 declares one lifecycle intent that atomically w
|
|
|
38
38
|
|
|
39
39
|
### 1. Verify Task Exists
|
|
40
40
|
|
|
41
|
-
Check that the task exists in
|
|
41
|
+
Check that the task exists in `<task-workspace>/active/{task-id}/`.
|
|
42
42
|
|
|
43
43
|
Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
|
|
44
44
|
|
|
@@ -68,7 +68,7 @@ Confirm `targetState=blocked`, the target path, and the committed short-id effec
|
|
|
68
68
|
### 5. Preserve Recovery Identity
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
ls
|
|
71
|
+
ls <task-workspace>/blocked/{task-id}/task.md
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
### 6. Sync to Issue (Optional)
|
|
@@ -111,7 +111,7 @@ Task {task-id} marked as blocked.
|
|
|
111
111
|
|
|
112
112
|
Blocking reason: {summary}
|
|
113
113
|
Required to unblock: {what's needed}
|
|
114
|
-
Archived to:
|
|
114
|
+
Archived to: <task-workspace>/blocked/{task-id}/
|
|
115
115
|
|
|
116
116
|
Optional: clean up this task's sandbox
|
|
117
117
|
(The task is blocked and moved to blocked/; task-bound sandboxes are protected from automatic `ai sandbox rm --unbound` cleanup. If cleanup is necessary, manually verify the container, control manifest, and worktree identity first.)
|
|
@@ -129,7 +129,7 @@ Next step - check task status after unblocking:
|
|
|
129
129
|
|
|
130
130
|
- [ ] Analyzed and documented the blocking reason
|
|
131
131
|
- [ ] Updated task.md with blocked status and blocking information
|
|
132
|
-
- [ ] Moved task directory to
|
|
132
|
+
- [ ] Moved task directory to `<task-workspace>/blocked/`
|
|
133
133
|
- [ ] Verified move succeeded
|
|
134
134
|
- [ ] Informed user how to unblock
|
|
135
135
|
|
|
@@ -37,7 +37,7 @@ description: >
|
|
|
37
37
|
## 执行步骤
|
|
38
38
|
### 1. 验证任务存在
|
|
39
39
|
|
|
40
|
-
检查任务是否存在于
|
|
40
|
+
检查任务是否存在于 `<task-workspace>/active/{task-id}/`。
|
|
41
41
|
|
|
42
42
|
注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
|
|
43
43
|
|
|
@@ -62,10 +62,10 @@ agent-infra-internal task-lifecycle {task-id} block --agent {standard-agent-toke
|
|
|
62
62
|
|
|
63
63
|
### 4. 验证本地终态
|
|
64
64
|
|
|
65
|
-
确认结构化结果的 `targetState=blocked`、目标路径为
|
|
65
|
+
确认结构化结果的 `targetState=blocked`、目标路径为 `<task-workspace>/blocked/{task-id}`、短号效果已提交,并检查:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
ls
|
|
68
|
+
ls <task-workspace>/blocked/{task-id}/task.md
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
### 5. 保留恢复身份
|
|
@@ -110,7 +110,7 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
|
|
|
110
110
|
|
|
111
111
|
阻塞原因:{摘要}
|
|
112
112
|
解除阻塞所需:{需要什么}
|
|
113
|
-
|
|
113
|
+
归档路径:<task-workspace>/blocked/{task-id}/
|
|
114
114
|
|
|
115
115
|
可选:清理本任务的沙箱
|
|
116
116
|
(任务已阻塞并移到 blocked/,task-bound 沙箱受保护,不会被 `ai sandbox rm --unbound` 自动删除;如确需清理,请先人工核对容器、控制清单和工作树身份。)
|
|
@@ -128,7 +128,7 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
|
|
|
128
128
|
|
|
129
129
|
- [ ] 分析并记录了阻塞原因
|
|
130
130
|
- [ ] 更新了 task.md 的阻塞状态和阻塞信息
|
|
131
|
-
- [ ] 将任务目录移动到
|
|
131
|
+
- [ ] 将任务目录移动到 `<task-workspace>/blocked/`
|
|
132
132
|
- [ ] 验证了移动成功
|
|
133
133
|
- [ ] 告知了用户如何解除阻塞
|
|
134
134
|
|
|
@@ -33,9 +33,9 @@ After prerequisites pass, Step 3 declares one lifecycle intent that atomically c
|
|
|
33
33
|
### 1. Verify Task Exists
|
|
34
34
|
|
|
35
35
|
Check these directories in order:
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
36
|
+
- `<task-workspace>/active/{task-id}/`
|
|
37
|
+
- `<task-workspace>/blocked/{task-id}/`
|
|
38
|
+
- `<task-workspace>/completed/{task-id}/`
|
|
39
39
|
|
|
40
40
|
Handling rules:
|
|
41
41
|
- If found in `active/` or `blocked/`: continue
|
|
@@ -69,7 +69,7 @@ Confirm `targetState=completed`, terminal fields, and the short-id effect from t
|
|
|
69
69
|
### 5. Verify the Move
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
ls
|
|
72
|
+
ls <task-workspace>/completed/{task-id}/task.md
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Confirm the task directory was moved successfully.
|
|
@@ -83,7 +83,7 @@ If a valid `platform_issue_identity` exists, require `applied` / `no-op` without
|
|
|
83
83
|
- 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}`
|
|
84
84
|
- Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
85
85
|
|
|
86
|
-
The cancellation comment must include at least:
|
|
86
|
+
The cancellation comment JSON fields are `taskId`, `title`, `outcome:"cancelled"`, `reason`, `cancelledAt`, and `lastCompletedArtifact`, sourced from task identity, task.md, the recorded cancellation reason/time, and the current artifact registry (`null` when no completed artifact exists). It must include at least:
|
|
87
87
|
- the cancellation reason
|
|
88
88
|
- the selected `status:` label
|
|
89
89
|
|
|
@@ -120,7 +120,7 @@ Task {task-id} cancelled; task directory moved to completed/.
|
|
|
120
120
|
|
|
121
121
|
Cancellation reason: {reason}
|
|
122
122
|
Status label: {status-label or skipped}
|
|
123
|
-
Target path:
|
|
123
|
+
Target path: <task-workspace>/completed/{task-id}/
|
|
124
124
|
|
|
125
125
|
Optional: clean up this task's sandbox
|
|
126
126
|
(The task is completed and archived; the sandbox container and per-branch config directory are not reclaimed automatically. Run this if you no longer need them:)
|
|
@@ -136,7 +136,7 @@ Next step - inspect the moved task:
|
|
|
136
136
|
## Completion Checklist
|
|
137
137
|
|
|
138
138
|
- [ ] Recorded the cancellation reason and updated task.md
|
|
139
|
-
- [ ] Moved the task directory into
|
|
139
|
+
- [ ] Moved the task directory into `<task-workspace>/completed/`
|
|
140
140
|
- [ ] Completed Issue sync when an Issue exists
|
|
141
141
|
- [ ] Ran and passed the verification gate
|
|
142
142
|
- [ ] Showed the full next-step command set to the user
|
|
@@ -32,9 +32,9 @@ description: >
|
|
|
32
32
|
### 1. 验证任务存在
|
|
33
33
|
|
|
34
34
|
依次检查以下目录:
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
35
|
+
- `<task-workspace>/active/{task-id}/`
|
|
36
|
+
- `<task-workspace>/blocked/{task-id}/`
|
|
37
|
+
- `<task-workspace>/completed/{task-id}/`
|
|
38
38
|
|
|
39
39
|
处理规则:
|
|
40
40
|
- 如果在 `active/` 或 `blocked/` 中找到:继续
|
|
@@ -68,7 +68,7 @@ agent-infra-internal task-lifecycle {task-id} cancel --agent {standard-agent-tok
|
|
|
68
68
|
### 5. 验证转移
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
ls
|
|
71
|
+
ls <task-workspace>/completed/{task-id}/task.md
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
确认任务目录已成功移动。
|
|
@@ -82,7 +82,7 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
82
82
|
- 将取消正文写入临时文件,调用 `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
83
83
|
- 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
取消评论 JSON 字段为 `taskId`、`title`、`outcome:"cancelled"`、`reason`、`cancelledAt`、`lastCompletedArtifact`,值来自任务身份、task.md、已记录取消原因与时间和当前 artifact registry;无已完成产物时用 `null`。取消评论至少包含:
|
|
86
86
|
- 取消原因
|
|
87
87
|
- 选定的 `status:` label
|
|
88
88
|
|
|
@@ -117,7 +117,7 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
|
|
|
117
117
|
|
|
118
118
|
取消原因:{reason}
|
|
119
119
|
状态标签:{status-label 或 skipped}
|
|
120
|
-
|
|
120
|
+
目标路径:<task-workspace>/completed/{task-id}/
|
|
121
121
|
|
|
122
122
|
可选:清理本任务的沙箱
|
|
123
123
|
(任务已完成并归档,沙箱容器和 per-branch 配置目录不会自动回收。如果不再需要可执行:)
|
|
@@ -133,7 +133,7 @@ ai sandbox rm {task-id}
|
|
|
133
133
|
## 完成检查清单
|
|
134
134
|
|
|
135
135
|
- [ ] 已记录取消原因并更新 task.md
|
|
136
|
-
- [ ] 已将任务目录移动到
|
|
136
|
+
- [ ] 已将任务目录移动到 `<task-workspace>/completed/`
|
|
137
137
|
- [ ] 已在存在 Issue 时完成 Issue 同步
|
|
138
138
|
- [ ] 已运行 gate 校验并通过
|
|
139
139
|
- [ ] 已通过统一 helper 渲染已选场景的下一步命令
|
|
@@ -126,7 +126,7 @@ agent-infra-internal task-artifact {task-id} init --family code --artifact {code
|
|
|
126
126
|
|
|
127
127
|
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. On a preflight or finalization structural error, follow `.agents/rules/local-artifact-repair.md` to correct the formal artifact directly and rerun the same entry point; current structure, qualification, and summary facts are the only gate.
|
|
128
128
|
|
|
129
|
-
Create
|
|
129
|
+
Create `<task-workspace>/active/{task-id}/{code-artifact}`.
|
|
130
130
|
|
|
131
131
|
> Read `reference/report-template.md` before writing the report.
|
|
132
132
|
|
|
@@ -75,7 +75,7 @@ agent-infra-internal task-snapshot {task-id} --format text
|
|
|
75
75
|
### 1. 验证前置条件
|
|
76
76
|
|
|
77
77
|
先检查:
|
|
78
|
-
-
|
|
78
|
+
- `<task-workspace>/active/{task-id}/task.md`
|
|
79
79
|
|
|
80
80
|
如果缺少任务文件,立即停止。生命周期输入由步骤 4 的核心查询按已选路径验证;技能不得预先固定要求方案产物。
|
|
81
81
|
|
|
@@ -165,7 +165,7 @@ agent-infra-internal task-artifact {task-id} init --family code --artifact {code
|
|
|
165
165
|
|
|
166
166
|
骨架只包含身份元数据、稳定 section marker 和必需标题;必须填入真实实现与验证内容后才能通过完成门禁。preflight 或 finalizer 返回结构错误时,按 `.agents/rules/local-artifact-repair.md` 直接修正正式产物并重跑原入口;当前结构、资格和摘要事实是唯一门禁。
|
|
167
167
|
|
|
168
|
-
创建
|
|
168
|
+
创建 `<task-workspace>/active/{task-id}/{code-artifact}`。
|
|
169
169
|
|
|
170
170
|
> 报告结构、必填章节和完整模板见 `reference/report-template.md`。写报告前先读取 `reference/report-template.md`。
|
|
171
171
|
|
|
@@ -207,7 +207,7 @@ echo "$finalizer"
|
|
|
207
207
|
|
|
208
208
|
### 11. 更新任务状态
|
|
209
209
|
|
|
210
|
-
更新
|
|
210
|
+
更新 `<task-workspace>/active/{task-id}/task.md`:
|
|
211
211
|
- 审查 `## 需求` 段落,仅把本轮已由代码实现且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
|
|
212
212
|
- 产物链接、阶段与完成日志由 completed 事件统一登记
|
|
213
213
|
- 完成业务内容更新后声明完成事件:
|
|
@@ -71,7 +71,7 @@ Example:
|
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Taskless direct mode omits `taskRef`; direct task-bound commits use push delivery.
|
|
74
|
+
Taskless direct mode omits `taskRef`; direct task-bound commits use push delivery. Both modes execute serially at the caller boundary; the core still owns path and sensitive-file checks, staged scope, HEAD/tree, branch/ref, commit, push, protected-branch policy, warnings, and idempotency.
|
|
75
75
|
|
|
76
76
|
- Create at most one local commit for explicit changes.
|
|
77
77
|
- If there are no changes but HEAD is ahead and delivery is requested, perform push-only and do not create an empty commit.
|
|
@@ -71,7 +71,7 @@ agent-infra-internal git-workflow commit --input {commit-operation.json}
|
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
taskless direct 省略 `taskRef`;direct task-bound commit 使用 push delivery
|
|
74
|
+
taskless direct 省略 `taskRef`;direct task-bound commit 使用 push delivery。两种模式都按调用方串行执行;core 仍负责路径和敏感文件、staged scope、HEAD/tree、branch/ref、commit、push、保护分支、warning 和幂等校验。
|
|
75
75
|
|
|
76
76
|
- 有明确修改时最多创建一个本地 commit。
|
|
77
77
|
- 无修改但需要交付本地领先的 HEAD 时只执行 push-only,不创建空 commit。
|
|
@@ -4,12 +4,12 @@ Commit, push, result mapping, and task finalization use one `commit-operation.ex
|
|
|
4
4
|
|
|
5
5
|
## Entry modes
|
|
6
6
|
|
|
7
|
-
- `mode=direct`: explicit user invocation is the authorization. Task-bound direct may read task facts but does not require a delegation receipt; taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and skips task facts, review,
|
|
7
|
+
- `mode=direct`: explicit user invocation is the authorization. Task-bound direct may read task facts but does not require a delegation receipt; taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and skips task facts, review, checkpoint, and task.md finalization.
|
|
8
8
|
- `mode=orchestrated` is removed: standalone commit is no longer a lifecycle delegation stage. This mode returns `ORCHESTRATED_COMMIT_REMOVED` without writing Git; the code stage closes through a local checkpoint.
|
|
9
9
|
|
|
10
10
|
## Shared order
|
|
11
11
|
|
|
12
|
-
1.
|
|
12
|
+
1. Direct commits execute serially at the caller boundary.
|
|
13
13
|
2. Validate the repository, current branch, explicit paths, sensitive paths, staged scope, expected HEAD/tree, remote, and full heads ref.
|
|
14
14
|
3. Validate direct-mode authorization.
|
|
15
15
|
4. Create at most one local commit; with no changes, allow push-only and never create an empty commit.
|
|
@@ -4,12 +4,12 @@ commit、push、结果映射和任务收尾使用同一个 `commit-operation.exe
|
|
|
4
4
|
|
|
5
5
|
## 入口模式
|
|
6
6
|
|
|
7
|
-
- `mode=direct`:用户显式调用授权。task-bound direct 可读取 task facts,但不要求 delegation receipt;taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,并跳过 task facts、review、
|
|
7
|
+
- `mode=direct`:用户显式调用授权。task-bound direct 可读取 task facts,但不要求 delegation receipt;taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,并跳过 task facts、review、checkpoint 和 task.md 收尾。
|
|
8
8
|
- `mode=orchestrated` 已移除:独立 commit 不再是生命周期 delegation stage;调用该模式返回 `ORCHESTRATED_COMMIT_REMOVED`,不写 Git。生命周期 code 阶段完成后由 local checkpoint 直接收口。
|
|
9
9
|
|
|
10
10
|
## 共享执行顺序
|
|
11
11
|
|
|
12
|
-
1.
|
|
12
|
+
1. direct commit 按调用方串行执行。
|
|
13
13
|
2. 验证 repository、当前 branch、明确 paths、敏感路径、staged scope、expected HEAD/tree、remote 和 full heads ref。
|
|
14
14
|
3. 完成 direct 模式授权校验。
|
|
15
15
|
4. 最多创建一个本地 commit;无修改时只允许 push-only,不创建空 commit。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Run only when `{task-id}` is valid and task.md has a `bound/verified` `pr_delivery_fact`.
|
|
4
4
|
|
|
5
5
|
1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain canonical inputs and report status; rebuild a stale/missing sidecar through the `change-report` flow for the current head.
|
|
6
|
-
2. Generate the
|
|
7
|
-
3. Run `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file
|
|
6
|
+
2. Generate the complete PR summary JSON payload per `.agents/rules/pr-sync.md` and write it to a temporary file.
|
|
7
|
+
3. Run `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result no_op`. The commit path only synchronizes an existing PR summary and neither creates nor reuses a PR, so `no_op` explicitly represents the unchanged PR identity.
|
|
8
8
|
|
|
9
9
|
Failure records a warning but never blocks or rolls back the completed commit. `no-op` maps to `summary skipped (no diff)`.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
仅当 `{task-id}` 有效且 `task.md` 存在 `bound/verified` 的 `pr_delivery_fact` 时执行;否则跳过。
|
|
4
4
|
|
|
5
5
|
1. 调用 `agent-infra-internal platform-pr summary-context {task-id}` 获取 canonical 聚合输入和报告状态;sidecar stale/missing 时先按 `change-report` 流程重建当前 head 报告。
|
|
6
|
-
2. 按 `.agents/rules/pr-sync.md`
|
|
7
|
-
3. 调用 `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file
|
|
6
|
+
2. 按 `.agents/rules/pr-sync.md` 生成完整 PR 摘要 JSON payload 并写入临时文件;字段和零值状态由内容合同规定。
|
|
7
|
+
3. 调用 `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result no_op`。commit 路径只同步已有 PR 摘要,不创建或复用 PR,因此固定使用 `no_op` 表示 PR 身份未变化。
|
|
8
8
|
|
|
9
9
|
同步失败只记录 warning,不阻塞或回滚已经完成的 commit。`no-op` 回传 `summary skipped (no diff)`。
|
|
@@ -59,7 +59,7 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
|
|
|
59
59
|
### 2. Verify Prerequisites
|
|
60
60
|
|
|
61
61
|
Check:
|
|
62
|
-
-
|
|
62
|
+
- `<task-workspace>/active/{task-id}/task.md`
|
|
63
63
|
- a valid PR: prefer explicit `{pr-ref}`, otherwise read verified `pr_delivery_fact.identity.number` from task.md frontmatter
|
|
64
64
|
|
|
65
65
|
Stop if the task is missing, the validation summary is missing, or no valid PR can be resolved.
|
|
@@ -96,7 +96,7 @@ Follow `reference/summary-update.md` to validate the PR binding, obtain canonica
|
|
|
96
96
|
```bash
|
|
97
97
|
agent-infra-internal manual-validation transaction {task-id} \
|
|
98
98
|
--artifact {manual-validation-artifact} \
|
|
99
|
-
--summary-file {summary-body-file} --change-report-file
|
|
99
|
+
--summary-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
|
|
100
100
|
--agent {standard-agent-token} --result no_op
|
|
101
101
|
```
|
|
102
102
|
|
|
@@ -59,7 +59,7 @@ complete-manual-validation [--task <ref> | -t <ref>] [{pr-ref}] {verification-su
|
|
|
59
59
|
### 2. 验证前置条件
|
|
60
60
|
|
|
61
61
|
检查:
|
|
62
|
-
-
|
|
62
|
+
- `<task-workspace>/active/{task-id}/task.md`
|
|
63
63
|
- 有效 PR:优先使用显式 `{pr-ref}`,否则读取 task.md frontmatter 的 verified `pr_delivery_fact.identity.number`
|
|
64
64
|
|
|
65
65
|
如果任务不存在、验证说明缺失,或无法解析有效 PR,立即停止。
|
|
@@ -96,7 +96,7 @@ prepare 必须先幂等登记 `manual-validation.started`,再写入 prepared t
|
|
|
96
96
|
```bash
|
|
97
97
|
agent-infra-internal manual-validation transaction {task-id} \
|
|
98
98
|
--artifact {manual-validation-artifact} \
|
|
99
|
-
--summary-file {summary-body-file} --change-report-file
|
|
99
|
+
--summary-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
|
|
100
100
|
--agent {standard-agent-token} --result no_op
|
|
101
101
|
```
|
|
102
102
|
|
|
@@ -4,7 +4,7 @@ Run only for a valid `{task-id}` whose task.md binds a verified `pr_delivery_fac
|
|
|
4
4
|
|
|
5
5
|
Follow `.agents/rules/pr-sync.md` for the shared summary structure and failure semantics.
|
|
6
6
|
|
|
7
|
-
1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain the
|
|
7
|
+
1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain canonical summary facts. `--summary-file` uses the complete PR summary JSON payload; the maintainer's PR validation comment and validation summary are the human-validation authority.
|
|
8
8
|
2. Before creating the canonical `manual-validation*` artifact, call the transaction coordinator in prepare mode to record `started` before writing the prepared transaction:
|
|
9
9
|
|
|
10
10
|
```bash
|
|
@@ -13,13 +13,13 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
|
|
|
13
13
|
--summary-file {summary-body-file} --agent {standard-agent-token}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
3. After prepare succeeds, write the canonical `manual-validation*` artifact,
|
|
16
|
+
3. After prepare succeeds, write the canonical `manual-validation*` artifact, set the JSON payload's `manualValidation.state` to `pending` with a non-empty explanation, and run the transaction coordinator:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
agent-infra-internal manual-validation transaction {task-id} \
|
|
20
20
|
--artifact {manual-validation-artifact} \
|
|
21
21
|
--summary-file {summary-body-file} \
|
|
22
|
-
--change-report-file
|
|
22
|
+
--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
|
|
23
23
|
--agent {standard-agent-token} --result no_op
|
|
24
24
|
```
|
|
25
25
|
|
package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
摘要结构与失败语义统一遵循 `.agents/rules/pr-sync.md`。
|
|
6
6
|
|
|
7
|
-
1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical
|
|
7
|
+
1. 调用 `agent-infra-internal platform-pr summary-context {task-id}`,取得 canonical 摘要事实;`--summary-file` 使用完整 PR 摘要 JSON payload,维护者提供的 PR 人工验证留言和验证说明作为完成人工校验依据。
|
|
8
8
|
2. 在创建 canonical `manual-validation*` artifact 前,调用 transaction coordinator 的 prepare 模式,先登记 started,再写 prepared transaction:
|
|
9
9
|
|
|
10
10
|
```bash
|
|
@@ -13,13 +13,13 @@ agent-infra-internal manual-validation transaction {task-id} --prepare \
|
|
|
13
13
|
--summary-file {summary-body-file} --agent {standard-agent-token}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
3. prepare 成功后写入 canonical `manual-validation*` artifact
|
|
16
|
+
3. prepare 成功后写入 canonical `manual-validation*` artifact,并将 JSON payload 中 `manualValidation` 设置为 `pending`、提供非空说明后写入临时文件,调用 transaction coordinator:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
agent-infra-internal manual-validation transaction {task-id} \
|
|
20
20
|
--artifact {manual-validation-artifact} \
|
|
21
21
|
--summary-file {summary-body-file} \
|
|
22
|
-
--change-report-file
|
|
22
|
+
--change-report-file <task-workspace>/active/{task-id}/pr-change-report.json \
|
|
23
23
|
--agent {standard-agent-token} --result no_op
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -18,8 +18,7 @@ Host finalization uses receipt v4 with an immutable `receiptId`, monotonic `revi
|
|
|
18
18
|
|
|
19
19
|
Before generating a completion report or synchronized content, read `.agents/rules/evidence-reporting.md`. Successful checks record the command, scope, status or structured result, actual result, and uncovered parts; failures, blocking conditions, or disputes retain a reproducible entry point, exact location, and decisive excerpt.
|
|
20
20
|
|
|
21
|
-
-
|
|
22
|
-
- Do not move a task that has incomplete workflow steps unless forced
|
|
21
|
+
- Host finalization updates task metadata and atomically moves the task directory
|
|
23
22
|
- The entry point accepts optional `--external-pr <N>` only to select among ambiguous external-delivery candidates; it never bypasses identity or platform gates
|
|
24
23
|
|
|
25
24
|
Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
|
|
@@ -50,7 +49,7 @@ On the normal path, complete business updates, platform sync, and the pre-comple
|
|
|
50
49
|
|
|
51
50
|
### 1. Verify Task Exists
|
|
52
51
|
|
|
53
|
-
Check that the task exists in
|
|
52
|
+
Check that the task exists in `<task-workspace>/active/{task-id}/`.
|
|
54
53
|
|
|
55
54
|
Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
|
|
56
55
|
|
|
@@ -102,7 +101,7 @@ Run /create-pr --task {task-ref} first, then complete; --skip-pr is not accepted
|
|
|
102
101
|
```
|
|
103
102
|
|
|
104
103
|
Before lifecycle, verify only the hard gates:
|
|
105
|
-
- [ ] Task identity, active
|
|
104
|
+
- [ ] Task identity, active-state validation, and local atomic lifecycle operations are available
|
|
106
105
|
- [ ] Required-PR delivery is satisfied when `prFlow=required`
|
|
107
106
|
- [ ] Other business evidence (workflow, review, commit, tests, disagreement ledger, manual validation, and platform sync) is recorded or can be checked after lifecycle; manual validation requires a committed transaction, receipt, current artifact digest, and an identity-bearing completion log
|
|
108
107
|
|
|
@@ -142,7 +141,7 @@ Check whether task.md has a valid `platform_issue_identity`. If it does not, ski
|
|
|
142
141
|
When a valid `platform_issue_identity` exists, execute in this exact order:
|
|
143
142
|
|
|
144
143
|
1. Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --requirements --fields`.
|
|
145
|
-
2. Write the
|
|
144
|
+
2. Write the completion summary as JSON fields `taskId`, `title`, `summary`, `artifacts`, and `verification:{state,detail}`, then run `agent-infra-internal platform-comment stage-summary {task-id} --body-file {path}`. Use the current artifact registry (`[]` when empty). If final verification has not run, use `state:"not-run"` with a non-empty explanation. The command persists the normalized payload; do not publish the summary comment in this step.
|
|
146
145
|
|
|
147
146
|
The summary body records only delivery results, the associated PR and actual merge facts, verification commands with their scope/results/uncovered areas, and known todo items supported by current task evidence. Include the related commit when it helps explain verification scope. Do not infer unsupported facts; list unfinished work as a todo. This is an Issue closeout summary, not a PR comment.
|
|
148
147
|
|
|
@@ -174,11 +173,11 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
|
|
|
174
173
|
|
|
175
174
|
Present the verification summary per `.agents/rules/validation-output.md`, retaining necessary failure, blocked, and soft-warning diagnostics.
|
|
176
175
|
|
|
177
|
-
This event runs only the required-PR delivery hard preflight; host finalization still enforces identity
|
|
176
|
+
This event runs only the required-PR delivery hard preflight; host finalization still enforces identity validation and local atomicity before lifecycle. Peripheral review/manual/platform checks run through `complete-task.completed` after lifecycle and are projected as warning/pending steps. On a hard-gate non-zero exit (fail/blocked), keep the task active, record the stable code/target, and stop.
|
|
178
177
|
|
|
179
178
|
If a summary must mirror a human-decided `post-review-commit` exemption, make a best-effort sync in Step 4 with the original failure code/message, PRC id/evidence, and ruling details. A sync failure records `SUMMARY_SYNC_FAILED` and still allows lifecycle; terminal verification decides the final state.
|
|
180
179
|
|
|
181
|
-
`--force` cannot lift identity
|
|
180
|
+
`--force` cannot lift identity validation, local atomicity, or required-PR hard gates; failures there must stop. Other review, manual-validation, and platform evidence is recorded by terminal verification as warning/pending and can be repaired by retrying.
|
|
182
181
|
|
|
183
182
|
### 6. Run the Host Finalization Entry Point
|
|
184
183
|
|
|
@@ -209,7 +208,7 @@ Task {task-id} completed; task directory moved to completed/.
|
|
|
209
208
|
Task info:
|
|
210
209
|
- Title: {title}
|
|
211
210
|
- Completed at: {timestamp}
|
|
212
|
-
- Target path:
|
|
211
|
+
- Target path: <task-workspace>/completed/{task-id}/
|
|
213
212
|
|
|
214
213
|
Deliverables:
|
|
215
214
|
- {List of key outputs: files modified, tests added, etc.}
|
|
@@ -225,32 +224,18 @@ ai sandbox rm {task-id} # or use the task's retained short id
|
|
|
225
224
|
|
|
226
225
|
## Completion Checklist
|
|
227
226
|
|
|
228
|
-
- [ ]
|
|
229
|
-
- [ ]
|
|
230
|
-
- [ ]
|
|
231
|
-
- [ ]
|
|
232
|
-
- [ ] Informed user of completion
|
|
227
|
+
- [ ] Hard prerequisites are satisfied and the pre-completion gate passes
|
|
228
|
+
- [ ] Host finalization returns `result=completed` or `result=completed_with_warnings`
|
|
229
|
+
- [ ] Completion verification passes
|
|
230
|
+
- [ ] The structured completion result and applicable warnings are reported to the user
|
|
233
231
|
|
|
234
232
|
## Notes
|
|
235
233
|
|
|
236
|
-
|
|
237
|
-
- Code is written but not committed
|
|
238
|
-
- Code is committed but not reviewed
|
|
239
|
-
- Review found blockers that haven't been fixed
|
|
240
|
-
- PR is created but not merged
|
|
241
|
-
- Manual validation items are incomplete
|
|
242
|
-
|
|
243
|
-
2. **Rollback**: If a task was incorrectly moved:
|
|
244
|
-
```bash
|
|
245
|
-
mv .agents/workspace/completed/{task-id} .agents/workspace/active/{task-id}
|
|
246
|
-
```
|
|
247
|
-
Then update task.md status back to `active`.
|
|
248
|
-
|
|
249
|
-
3. **Multiple contributors**: If multiple AI agents worked on the task, ensure all contributions are committed before completing.
|
|
234
|
+
- When multiple AI agents contributed, ensure all contributions are included in the local checkpoint.
|
|
250
235
|
|
|
251
236
|
## Error Handling
|
|
252
237
|
|
|
253
238
|
- Task not found: Prompt "Task {task-id} not found in active directory"
|
|
254
|
-
- Already completed:
|
|
255
|
-
- Task is blocked:
|
|
256
|
-
-
|
|
239
|
+
- Already completed: Enter `finalization-retry` only when a matching Complete Task Activity Log exists; otherwise report incomplete terminal identity and stop
|
|
240
|
+
- Task is blocked: Satisfy the recorded unblock condition, then reactivate it through `task-lifecycle activate` before retrying
|
|
241
|
+
- Finalization failed or blocked: Preserve source data and the receipt, then recover through the same finalization entry point using its structured error; do not manually rewrite terminal state or move the task directory
|