@fitlab-ai/agent-infra 0.12.1 → 0.12.2
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/README.md +0 -2
- package/README.zh-CN.md +0 -2
- package/dist/bin/internal-cli.js +2 -17
- package/dist/lib/agent-clients/adapter.js +0 -13
- package/dist/lib/agent-clients/adapters/antigravity-cli.js +0 -5
- package/dist/lib/agent-clients/adapters/claude-code-credentials.js +0 -17
- package/dist/lib/agent-clients/adapters/claude-code.js +0 -9
- package/dist/lib/agent-clients/adapters/codex.js +0 -52
- package/dist/lib/agent-clients/adapters/opencode.js +0 -5
- package/dist/lib/agent-clients/adapters/traecli.js +0 -5
- package/dist/lib/agent-clients/config.js +19 -54
- package/dist/lib/agent-clients/registry.js +1 -12
- package/dist/lib/agent-clients/schema.js +0 -18
- package/dist/lib/agent-clients/tokens.js +1 -2
- package/dist/lib/agent-clients/types.js +0 -1
- package/dist/lib/decide.js +2 -0
- package/dist/lib/git/worktree-identity.js +1 -9
- package/dist/lib/internal/agent-client.js +2 -62
- package/dist/lib/internal/cli-route-inventory.js +1 -5
- package/dist/lib/internal/manual-validation.js +18 -10
- package/dist/lib/internal/task-create.js +1 -1
- package/dist/lib/internal/task-event.js +1 -8
- package/dist/lib/internal/task-finalization.js +0 -1
- package/dist/lib/internal/task-lifecycle.js +2 -2
- package/dist/lib/internal/task-operation-registry.js +4 -20
- package/dist/lib/internal/task-review.js +4 -4
- package/dist/lib/platform/comment-safety.js +1 -7
- package/dist/lib/platform/in-label-sync.js +1 -14
- package/dist/lib/platform/issue-comments.js +1 -16
- package/dist/lib/platform/issues.js +1 -1
- package/dist/lib/platform/operation-coordinator.js +4 -2
- package/dist/lib/platform/pr-change-report.js +1 -4
- package/dist/lib/platform/pr-checks.js +2 -8
- package/dist/lib/platform/provider-validation.js +0 -20
- package/dist/lib/platform/pull-requests.js +73 -84
- package/dist/lib/platform/releases.js +1 -43
- package/dist/lib/platform/verification-required.js +0 -2
- package/dist/lib/platform/verification-sync.js +1 -79
- package/dist/lib/process-data/normalize.js +1 -185
- package/dist/lib/process-data/privacy.js +1 -16
- package/dist/lib/process-data/sources.js +2 -279
- package/dist/lib/render.js +0 -12
- package/dist/lib/run/index.js +15 -10
- package/dist/lib/run/skills.js +0 -3
- package/dist/lib/sandbox/commands/create.js +40 -53
- package/dist/lib/sandbox/commands/list-running.js +0 -18
- package/dist/lib/sandbox/commands/start.js +7 -8
- package/dist/lib/sandbox/constants.js +0 -6
- package/dist/lib/sandbox/control/client.js +0 -1
- package/dist/lib/sandbox/control/container-identity.js +1 -16
- package/dist/lib/sandbox/control/executor.js +0 -4
- package/dist/lib/sandbox/control/identity-sentinel.js +0 -7
- package/dist/lib/sandbox/control/lifecycle.js +21 -37
- package/dist/lib/sandbox/control/native-file-lock.js +0 -3
- package/dist/lib/sandbox/control/server.js +18 -38
- package/dist/lib/sandbox/control/state.js +1 -9
- package/dist/lib/sandbox/dockerfile.js +0 -6
- package/dist/lib/sandbox/engine.js +0 -14
- package/dist/lib/sandbox/engines/docker-exact-discovery.js +1 -4
- package/dist/lib/sandbox/engines/wsl2-paths.js +0 -3
- package/dist/lib/sandbox/recovery.js +24 -26
- package/dist/lib/sandbox/removal.js +11 -519
- package/dist/lib/sandbox/task-resolver.js +0 -41
- package/dist/lib/sandbox/tools.js +1 -4
- package/dist/lib/sandbox/workspace-view.js +1 -2
- package/dist/lib/server/display.js +0 -6
- package/dist/lib/task/activity-intent.js +45 -40
- package/dist/lib/task/activity-log.js +9 -16
- package/dist/lib/task/artifact-command.js +1 -1
- package/dist/lib/task/artifact-lifecycle.js +61 -63
- package/dist/lib/task/artifact-name.js +0 -6
- package/dist/lib/task/artifact-operations.js +3 -3
- package/dist/lib/task/capabilities.js +4 -5
- package/dist/lib/task/commands/log.js +0 -6
- package/dist/lib/task/commands/status.js +17 -60
- package/dist/lib/task/commit-operation.js +28 -39
- package/dist/lib/task/completion-facts.js +56 -43
- package/dist/lib/task/control-authority.js +23 -256
- package/dist/lib/task/control-recovery.js +3 -5
- package/dist/lib/task/create.js +2 -4
- package/dist/lib/task/decision-intents.js +8 -9
- package/dist/lib/task/delivery-target.js +1 -40
- package/dist/lib/task/events.js +84 -107
- package/dist/lib/task/finalization.js +44 -8
- package/dist/lib/task/ledger-intents.js +1 -1
- package/dist/lib/task/lifecycle-execution.js +38 -33
- package/dist/lib/task/lifecycle.js +49 -41
- package/dist/lib/task/local-artifact-finalization.js +1 -4
- package/dist/lib/task/manual-validation-evidence.js +1 -37
- package/dist/lib/task/platform-operation-recovery.js +67 -24
- package/dist/lib/task/pr-delivery-fact.js +2 -5
- package/dist/lib/task/qualification-confirmation.js +5 -7
- package/dist/lib/task/resolve-ref.js +1 -25
- package/dist/lib/task/review-command.js +2 -2
- package/dist/lib/task/review-finalization.js +1 -21
- package/dist/lib/task/review-fingerprint.js +0 -4
- package/dist/lib/task/secure-fs.js +0 -56
- package/dist/lib/task/short-id.js +1 -39
- package/dist/lib/task/skill-scope.js +0 -1
- package/dist/lib/task/verification-engine.js +58 -282
- package/dist/lib/task/verification.js +6 -3
- package/dist/lib/task/write.js +11 -1
- package/lib/agent-clients/adapter.ts +0 -76
- package/lib/agent-clients/adapters/antigravity-cli.ts +0 -5
- package/lib/agent-clients/adapters/claude-code-credentials.ts +0 -19
- package/lib/agent-clients/adapters/claude-code.ts +0 -9
- package/lib/agent-clients/adapters/codex.ts +0 -56
- package/lib/agent-clients/adapters/opencode.ts +0 -5
- package/lib/agent-clients/adapters/traecli.ts +0 -5
- package/lib/agent-clients/config.ts +20 -61
- package/lib/agent-clients/registry.ts +1 -34
- package/lib/agent-clients/schema.ts +0 -18
- package/lib/agent-clients/tokens.ts +1 -2
- package/lib/agent-clients/types.ts +0 -15
- package/lib/decide.ts +1 -0
- package/lib/git/worktree-identity.ts +0 -10
- package/lib/internal/agent-client.ts +2 -70
- package/lib/internal/cli-route-inventory.ts +1 -4
- package/lib/internal/manual-validation.ts +16 -9
- package/lib/internal/task-create.ts +0 -1
- package/lib/internal/task-event.ts +1 -5
- package/lib/internal/task-finalization.ts +0 -1
- package/lib/internal/task-lifecycle.ts +3 -5
- package/lib/internal/task-operation-registry.ts +3 -19
- package/lib/internal/task-review.ts +4 -4
- package/lib/platform/comment-safety.ts +0 -10
- package/lib/platform/github-provider.ts +0 -2
- package/lib/platform/in-label-sync.ts +0 -16
- package/lib/platform/issue-comments.ts +0 -21
- package/lib/platform/issues.ts +0 -2
- package/lib/platform/operation-coordinator.ts +4 -2
- package/lib/platform/pr-change-report.ts +0 -5
- package/lib/platform/pr-checks.ts +1 -10
- package/lib/platform/pr-review.ts +1 -1
- package/lib/platform/provider-bridge.ts +0 -1
- package/lib/platform/provider-loader.ts +1 -5
- package/lib/platform/provider-validation.ts +1 -49
- package/lib/platform/pull-requests.ts +64 -99
- package/lib/platform/releases.ts +1 -40
- package/lib/platform/verification-required.ts +0 -2
- package/lib/platform/verification-sync.ts +0 -94
- package/lib/process-data/normalize.ts +1 -186
- package/lib/process-data/privacy.ts +2 -19
- package/lib/process-data/sources.ts +3 -283
- package/lib/render.ts +0 -15
- package/lib/run/index.ts +13 -7
- package/lib/run/skills.ts +0 -4
- package/lib/sandbox/commands/create.ts +37 -74
- package/lib/sandbox/commands/list-running.ts +0 -19
- package/lib/sandbox/commands/start.ts +7 -10
- package/lib/sandbox/constants.ts +0 -8
- package/lib/sandbox/control/client.ts +0 -1
- package/lib/sandbox/control/container-identity.ts +1 -16
- package/lib/sandbox/control/executor.ts +1 -5
- package/lib/sandbox/control/identity-sentinel.ts +0 -8
- package/lib/sandbox/control/lifecycle.ts +18 -51
- package/lib/sandbox/control/native-file-lock.ts +0 -8
- package/lib/sandbox/control/protocol.ts +0 -2
- package/lib/sandbox/control/server.ts +13 -39
- package/lib/sandbox/control/state.ts +1 -10
- package/lib/sandbox/dockerfile.ts +0 -11
- package/lib/sandbox/engine.ts +0 -17
- package/lib/sandbox/engines/docker-exact-discovery.ts +1 -5
- package/lib/sandbox/engines/wsl2-paths.ts +0 -4
- package/lib/sandbox/recovery.ts +24 -26
- package/lib/sandbox/removal.ts +11 -696
- package/lib/sandbox/shell.ts +1 -1
- package/lib/sandbox/task-resolver.ts +0 -48
- package/lib/sandbox/tools.ts +1 -5
- package/lib/sandbox/workspace-view.ts +2 -4
- package/lib/server/display.ts +0 -14
- package/lib/server/process-control.ts +1 -1
- package/lib/task/activity-intent.ts +36 -44
- package/lib/task/activity-log.ts +9 -22
- package/lib/task/artifact-command.ts +1 -1
- package/lib/task/artifact-lifecycle.ts +58 -67
- package/lib/task/artifact-name.ts +0 -7
- package/lib/task/artifact-operations.ts +3 -3
- package/lib/task/capabilities.ts +5 -6
- package/lib/task/commands/log.ts +0 -7
- package/lib/task/commands/status.ts +14 -79
- package/lib/task/commit-operation.ts +29 -51
- package/lib/task/completion-facts.ts +45 -42
- package/lib/task/control-authority.ts +27 -317
- package/lib/task/control-recovery.ts +2 -5
- package/lib/task/create.ts +2 -5
- package/lib/task/decision-intents.ts +5 -5
- package/lib/task/delivery-target.ts +0 -40
- package/lib/task/events.ts +89 -123
- package/lib/task/finalization.ts +41 -9
- package/lib/task/ledger-intents.ts +1 -1
- package/lib/task/lifecycle-execution.ts +37 -89
- package/lib/task/lifecycle.ts +48 -44
- package/lib/task/local-artifact-finalization.ts +0 -7
- package/lib/task/manual-validation-evidence.ts +1 -47
- package/lib/task/platform-operation-recovery.ts +50 -26
- package/lib/task/pr-delivery-fact.ts +2 -11
- package/lib/task/qualification-confirmation.ts +6 -6
- package/lib/task/resolve-ref.ts +0 -23
- package/lib/task/review-command.ts +2 -2
- package/lib/task/review-finalization.ts +1 -27
- package/lib/task/review-fingerprint.ts +0 -8
- package/lib/task/secure-fs.ts +0 -42
- package/lib/task/short-id.ts +0 -43
- package/lib/task/skill-scope.ts +0 -1
- package/lib/task/verification-engine.ts +56 -287
- package/lib/task/verification.ts +5 -5
- package/lib/task/write.ts +12 -1
- package/package.json +2 -2
- package/templates/.agents/README.en.md +1 -3
- package/templates/.agents/README.zh-CN.md +0 -2
- package/templates/.agents/rules/README.en.md +0 -1
- package/templates/.agents/rules/README.zh-CN.md +0 -1
- package/templates/.agents/rules/commit-and-pr.en.md +1 -1
- package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -1
- package/templates/.agents/rules/no-mid-flow-questions.en.md +0 -10
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +0 -10
- package/templates/.agents/rules/pr-sync.en.md +1 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +1 -1
- package/templates/.agents/rules/task-management.en.md +3 -3
- package/templates/.agents/rules/task-management.zh-CN.md +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/code-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/commit/SKILL.en.md +2 -2
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +6 -6
- package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +6 -6
- package/templates/.agents/skills/plan-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-analysis/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/review-code/SKILL.en.md +5 -5
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/review-plan/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/review-pr/SKILL.en.md +4 -4
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +3 -75
- package/templates/.agents/templates/task.en.md +1 -0
- package/templates/.agents/templates/task.zh-CN.md +1 -0
- package/templates/.claude/settings.json +0 -24
- package/templates/.codex/hooks.json +0 -50
- package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +0 -582
- package/dist/lib/agent-clients/adapters/codex-lifecycle/binding.js +0 -114
- package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +0 -237
- package/dist/lib/agent-clients/adapters/codex-lifecycle/cli.js +0 -443
- package/dist/lib/agent-clients/adapters/codex-lifecycle/evidence.js +0 -236
- package/dist/lib/agent-clients/adapters/codex-lifecycle/recovery.js +0 -292
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +0 -267
- package/dist/lib/agent-clients/adapters/codex-orchestration.js +0 -466
- package/dist/lib/internal/task-orchestration.js +0 -71
- package/dist/lib/platform/verification.js +0 -6
- package/dist/lib/run/prompt.js +0 -2
- package/dist/lib/sandbox/engines/authority.js +0 -289
- package/dist/lib/task/delegation-receipts.js +0 -410
- package/dist/lib/task/orchestration.js +0 -1233
- package/dist/lib/task/verification-checks.js +0 -9
- package/dist/lib/task/workspace-snapshot.js +0 -121
- package/dist/lifecycle-build-manifest.json +0 -6
- package/lib/agent-clients/adapters/codex-lifecycle/app-server.ts +0 -688
- package/lib/agent-clients/adapters/codex-lifecycle/binding.ts +0 -147
- package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +0 -349
- package/lib/agent-clients/adapters/codex-lifecycle/cli.ts +0 -506
- package/lib/agent-clients/adapters/codex-lifecycle/evidence.ts +0 -385
- package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +0 -41
- package/lib/agent-clients/adapters/codex-lifecycle/recovery.ts +0 -418
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +0 -354
- package/lib/agent-clients/adapters/codex-orchestration.ts +0 -630
- package/lib/internal/task-orchestration.ts +0 -74
- package/lib/platform/verification.ts +0 -11
- package/lib/run/prompt.ts +0 -1
- package/lib/sandbox/engines/authority.ts +0 -365
- package/lib/task/delegation-receipts.ts +0 -547
- package/lib/task/orchestration.ts +0 -1651
- package/lib/task/verification-checks.ts +0 -10
- package/lib/task/workspace-snapshot.ts +0 -144
- package/templates/.agents/hooks/lifecycle-delegation.js +0 -140
- package/templates/.agents/rules/lifecycle-orchestration.en.md +0 -44
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +0 -44
- package/templates/.agents/skills/run-task/SKILL.en.md +0 -29
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +0 -29
- package/templates/.agents/skills/run-task/config/verify.en.json +0 -10
- package/templates/.agents/skills/run-task/config/verify.zh-CN.json +0 -10
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +0 -24
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +0 -24
- package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +0 -6
- package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +0 -6
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +0 -6
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +0 -6
- package/templates/.claude/commands/run-task.en.md +0 -8
- package/templates/.claude/commands/run-task.zh-CN.md +0 -8
- package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +0 -3
- package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +0 -3
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +0 -3
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +0 -3
- package/templates/.opencode/commands/run-task.en.md +0 -11
- package/templates/.opencode/commands/run-task.zh-CN.md +0 -11
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# 代码审查
|
|
10
10
|
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
生命周期事件必须携带显式触发信息:普通调用使用 `model`;仅用户明确要求补充审查时,使用 `--initiator human --reason-code manual-review-supplement`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 普通审查使用 `user-request` 或 `review-finding`;started 与 completed 使用同一组值。
|
|
13
13
|
|
|
14
14
|
审查最新代码轮次,并产出 `review-code.md` 或 `review-code-r{N}.md`。
|
|
15
15
|
|
|
@@ -112,9 +112,9 @@ agent-infra-internal task-artifact {task-id} init --family review-code --artifac
|
|
|
112
112
|
|
|
113
113
|
### 6. 更新任务状态
|
|
114
114
|
|
|
115
|
-
- 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact}
|
|
115
|
+
- 报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage code --artifact {review-artifact}`,不得先写入账本。失败后直接修正正式产物并重跑。
|
|
116
116
|
- 只有 preflight 通过后,新 finding 才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage code --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`;复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。升级为 `needs-human-decision` 时,按详情块中的判断追加 `--needs-implementation true|false`。不得扫描编号或手写账本行
|
|
117
|
-
- 全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact}
|
|
117
|
+
- 全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage code --artifact {review-artifact}`;不能把失败类型或 `changed=false` 当作自动授权
|
|
118
118
|
|
|
119
119
|
从该次返回值绑定并复用以下结构化映射:
|
|
120
120
|
|
|
@@ -124,10 +124,10 @@ agent-infra-internal task-artifact {task-id} init --family review-code --artifac
|
|
|
124
124
|
{unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}
|
|
127
|
+
该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`,使用 `changes-requested` 并路由到同阶段修订/复审(报告明确拒绝时使用 `rejected`)。失败、模型停止、无进展或紧急熔断时,不发布完成事件或跨阶段命令,但必须按 `reference/output-templates.md` 的 `repair-stop` 场景展示已有 summary/findings、artifact、实际修复次数、最后诊断和停止原因
|
|
128
128
|
- 仅当 `canAdvance=true`、本轮结论为 Approved 且 `T == R^{tree}` 时写入 `last_reviewed_commit: {R}`;Approved 快照包含未提交差异时清除旧值。否则保留既有值,不得推进或清空
|
|
129
129
|
- Approved 出口按 `reference/output-templates.md` 选择唯一场景,并使用对应的 `agent-client next-steps` helper 生成下一步命令。
|
|
130
|
-
- 完成 `last_reviewed_commit` 处理后执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}
|
|
130
|
+
- 完成 `last_reviewed_commit` 处理后执行 `agent-infra-internal task-event {task-id} review-code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`
|
|
131
131
|
|
|
132
132
|
完成日志必须始终写入 `Manual-validation: {n}` 字段,0 也保留。
|
|
133
133
|
`manual-validation` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-validation`)计数的数据源;不要新增并行人工验证字段。
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# Technical Plan Review
|
|
10
10
|
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request` or `review-finding`. Reuse the same values for started and completed.
|
|
13
13
|
|
|
14
14
|
Review the latest plan artifact and produce `review-plan.md` or `review-plan-r{N}.md`.
|
|
15
15
|
|
|
@@ -87,7 +87,7 @@ Create `<task-workspace>/active/{task-id}/{review-artifact}`.
|
|
|
87
87
|
|
|
88
88
|
### 6. Update Task Status
|
|
89
89
|
|
|
90
|
-
After the report, call `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact}
|
|
90
|
+
After the report, call `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact}` before any ledger write. On failure, correct the formal artifact directly and rerun it. Only after preflight passes, submit each new finding with `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}` or prior-response dispositions with `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {evidence}`. Do not scan ids or edit ledger rows. After all ledger writes, call `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact}`; never treat an error type or `changed=false` as automatic authorization.
|
|
91
91
|
|
|
92
92
|
Bind and reuse this structured mapping from that one response:
|
|
93
93
|
|
|
@@ -97,7 +97,7 @@ Bind and reuse this structured mapping from that one response:
|
|
|
97
97
|
{unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
The intent atomically finalizes the report summary and returns the same ledger snapshot. Do not call `stage-status`, replace placeholders manually, or rescan the finding list. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}
|
|
100
|
+
The intent atomically finalizes the report summary and returns the same ledger snapshot. Do not call `stage-status`, replace placeholders manually, or rescan the finding list. After a failure, the model may edit the same controlled artifact and rerun the same intent only when the shared rule's mechanical gates pass; reassess convergence after every failure. The final complete result determines the verdict and counts from that same snapshot: `stageStatus.canAdvance=true` with an Approved conclusion permits cross-stage advancement; `stageStatus.canAdvance=false` still requires `agent-infra-internal task-event {task-id} review-plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`, using `changes-requested` and routing to same-stage revision/review (use `rejected` when the report explicitly rejects). On failure, model stop, lack of progress, or the emergency cap, do not publish a completion event or cross-stage command; use the `repair-stop` scenario in `reference/output-templates.md` to show existing summary/findings, the artifact, actual repair attempts, the last diagnostic, and the stop reason.
|
|
101
101
|
|
|
102
102
|
`manual-validation` is the data source for the `Manual-validation` count folded into review rows in `ai task log`; do not add a parallel manual-verification field.
|
|
103
103
|
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# 技术方案审查
|
|
10
10
|
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `review-finding`;started 与 completed 使用同一组值。
|
|
13
13
|
|
|
14
14
|
审查最新技术方案产物,并产出 `review-plan.md` 或 `review-plan-r{N}.md`。
|
|
15
15
|
|
|
@@ -90,7 +90,7 @@ agent-infra-internal task-artifact {task-id} init --family review-plan --artifac
|
|
|
90
90
|
|
|
91
91
|
### 6. 更新任务状态
|
|
92
92
|
|
|
93
|
-
报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact}
|
|
93
|
+
报告完成后,先调用 `agent-infra-internal task-review {task-id} preflight --stage plan --artifact {review-artifact}`,不得先写入账本。失败后直接修正正式产物并重跑;只有 preflight 通过后,才逐条调用 `agent-infra-internal task-ledger {task-id} finding-upsert --stage plan --review-artifact {review-artifact} --ordinal {n} --severity {blocker|major|minor} --evidence {review-artifact}#{anchor}`,或复核上一轮响应时调用 `finding-review --id {ledger-id} --status {confirmed|closed|open|needs-human-decision} --evidence {相称证据}`。不得扫描编号或手写账本行。全部账本写入完成后调用 `agent-infra-internal task-review {task-id} finalize-summary --stage plan --artifact {review-artifact}`;不能把失败类型或 `changed=false` 当作自动授权。
|
|
94
94
|
|
|
95
95
|
从该次返回值绑定并复用以下结构化映射:
|
|
96
96
|
|
|
@@ -100,7 +100,7 @@ agent-infra-internal task-artifact {task-id} init --family review-plan --artifac
|
|
|
100
100
|
{unresolved-minor} = stageStatus.unresolvedFindingCounts.minor
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}
|
|
103
|
+
该 intent 原子最终化报告摘要并返回同一次账本快照;不得再调用 `stage-status`、手工替换占位符或扫描问题清单。失败后,模型只能在共享规则的机械安全门通过时修改同一个受控 artifact,并完整重跑相同 intent;每次失败都重新判断是否收敛。最终一次完整成功返回决定同一快照的 verdict 和计数:`stageStatus.canAdvance=true` 且结论为 Approved 时允许跨阶段推进;`stageStatus.canAdvance=false` 时仍须执行 `agent-infra-internal task-event {task-id} review-plan.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {review-artifact} --verdict {approved|changes-requested|rejected} --blockers {unresolved-blockers} --major {unresolved-major} --minor {unresolved-minor} --manual-validation {n}`,使用 `changes-requested` 并路由到同阶段修订/复审(报告明确拒绝时使用 `rejected`)。失败、模型停止、无进展或紧急熔断时,不发布完成事件或跨阶段命令,但必须按 `reference/output-templates.md` 的 `repair-stop` 场景展示已有 summary/findings、artifact、实际修复次数、最后诊断和停止原因。
|
|
104
104
|
|
|
105
105
|
`manual-validation` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-validation`)计数的数据源;不要新增并行人工验证字段。
|
|
106
106
|
|
|
@@ -135,7 +135,7 @@ After closure, re-run step 1 for the next canonical round; never start the new r
|
|
|
135
135
|
|
|
136
136
|
### 6. Write back the publication result and task state
|
|
137
137
|
|
|
138
|
-
- **Task-anchored path**: write the actual publication status in the `pr-review-rN.md` "Publication Result" section. Record the Review ID/URL for `applied` / `no-op`; for a failed write with a durable journal entry, record `blocked` / `failed`, the error code, and recovery action. Then close the local
|
|
138
|
+
- **Task-anchored path**: write the actual publication status in the `pr-review-rN.md` "Publication Result" section. Record the Review ID/URL for `applied` / `no-op`; for a failed write with a durable journal entry, record `blocked` / `failed`, the error code, and recovery action. Then close the local review state with the verdict/counts frozen in step 3:
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
agent-infra-internal task-activity {task-id} pr-review-complete --agent {agent} \
|
|
@@ -143,13 +143,13 @@ After closure, re-run step 1 for the next canonical round; never start the new r
|
|
|
143
143
|
--blockers {blockers} --major {major} --minor {minor}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
`task-activity` generates `Verdict: <result>, blockers: N, major: N, minor: N → {pr-review-artifact}` from the typed payload and atomically writes the
|
|
146
|
+
`task-activity` generates `Verdict: <result>, blockers: N, major: N, minor: N → {pr-review-artifact}` from the typed payload and atomically writes the structured review state, `## Review Feedback` link, and version stamp through `writeTask`. It appends the log when safe and otherwise returns a diagnostic. It never changes `current_step` or puts receipt/head/Review URL into the NOTE.
|
|
147
147
|
|
|
148
148
|
- **One-shot path (no task)**: record the actual publication status in the `pr-review-rN.md` "Publication Result" section. Record the Review ID/URL on success, or the error and lack of automatic recovery on failure. Do not call `task-activity`.
|
|
149
149
|
|
|
150
150
|
### 7. Re-sync after write-back (task-anchored path)
|
|
151
151
|
|
|
152
|
-
Step 6 rewrote the local `pr-review-rN.md` "Publication Result" section and task.md (
|
|
152
|
+
Step 6 rewrote the local `pr-review-rN.md` "Publication Result" section and task.md (review state and available log), while step 4 synced the older snapshot. Attempt the syncs again in order; record failures as warnings for `complete-task` to restore before archiving:
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
155
|
agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}
|
|
@@ -186,7 +186,7 @@ Pick the single exit branch per `reference/output-guidance.md` (local review com
|
|
|
186
186
|
- [ ] Published the formal Review, durably recorded its pending publication, or accurately recorded a one-shot publication failure
|
|
187
187
|
- [ ] Synced the Issue artifact/task comments or recorded their pending recovery on the task-anchored path
|
|
188
188
|
- [ ] Ran the completion verification (`task-verify` or `verify-artifact`)
|
|
189
|
-
- [ ] Updated task.md
|
|
189
|
+
- [ ] Updated task.md review state and recorded log diagnostics when applicable
|
|
190
190
|
|
|
191
191
|
## Stop
|
|
192
192
|
|
|
@@ -135,7 +135,7 @@ agent-infra-internal task-activity {task-id} pr-review-terminate --agent {agent}
|
|
|
135
135
|
|
|
136
136
|
### 6. 回写发布结果与任务状态
|
|
137
137
|
|
|
138
|
-
- **任务锚定路径**:把 publish 的实际状态写入 `pr-review-rN.md`「发布结果」段。`applied` / `no-op` 时记录 Review ID/URL;写入失败且已有任务账本记录时写 `blocked` / `failed`、错误码和恢复动作。随后以步骤 3 冻结的同一组 verdict/counts
|
|
138
|
+
- **任务锚定路径**:把 publish 的实际状态写入 `pr-review-rN.md`「发布结果」段。`applied` / `no-op` 时记录 Review ID/URL;写入失败且已有任务账本记录时写 `blocked` / `failed`、错误码和恢复动作。随后以步骤 3 冻结的同一组 verdict/counts 闭合本地审查状态:
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
agent-infra-internal task-activity {task-id} pr-review-complete --agent {agent} \
|
|
@@ -143,13 +143,13 @@ agent-infra-internal task-activity {task-id} pr-review-terminate --agent {agent}
|
|
|
143
143
|
--blockers {blockers} --major {major} --minor {minor}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
`task-activity` 由 typed payload 生成 `Verdict: <结论>, blockers: N, major: N, minor: N → {pr-review-artifact}`,并经 `writeTask`
|
|
146
|
+
`task-activity` 由 typed payload 生成 `Verdict: <结论>, blockers: N, major: N, minor: N → {pr-review-artifact}`,并经 `writeTask` 原子完成结构化审查状态、`## 审查反馈` 链接与版本戳刷新;日志可安全追加时一并写入,否则返回诊断;不改 `current_step`,也不把 receipt/head/Review URL 写入 NOTE。
|
|
147
147
|
|
|
148
148
|
- **一次性路径(无任务)**:把实际发布状态写入 `pr-review-rN.md`「发布结果」段;成功时记录 Review ID/URL,失败时记录错误与不可自动恢复的限制。不调用 `task-activity`。
|
|
149
149
|
|
|
150
150
|
### 7. 发布后回写再同步(任务锚定路径)
|
|
151
151
|
|
|
152
|
-
步骤 6 已改写本地 `pr-review-rN.md`「发布结果」段与 task.md
|
|
152
|
+
步骤 6 已改写本地 `pr-review-rN.md`「发布结果」段与 task.md(审查状态及可用日志),而步骤 4 同步的是旧快照。依次尝试再同步;失败记录 warning,由 `complete-task` 在归档前补齐:
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
155
|
agent-infra-internal platform-comment sync {task-id} --kind task --agent {agent}
|
|
@@ -186,7 +186,7 @@ agent-infra-internal platform-comment sync {task-id} --kind artifact --artifact
|
|
|
186
186
|
- [ ] 正式 Review 已发布、任务账本已记录待恢复操作,或一次性路径已如实记录发布失败
|
|
187
187
|
- [ ] 任务锚定路径的 Issue artifact/task 评论已同步,或失败已记录待恢复
|
|
188
188
|
- [ ] 已完成校验(`task-verify` 或 `verify-artifact`)
|
|
189
|
-
- [ ] 已更新 task.md
|
|
189
|
+
- [ ] 已更新 task.md 中的审查状态并记录日志诊断(如适用)
|
|
190
190
|
|
|
191
191
|
## 停止
|
|
192
192
|
|
|
@@ -8,7 +8,7 @@ description: >
|
|
|
8
8
|
|
|
9
9
|
# Run Manual Validation
|
|
10
10
|
|
|
11
|
-
Lifecycle events require explicit trigger data: use `
|
|
11
|
+
Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request` or `validation-rerun`. Reuse the same values for started and completed.
|
|
12
12
|
|
|
13
13
|
## Task Context Resolution
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ description: >
|
|
|
8
8
|
|
|
9
9
|
# 运行人工校验
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request` 或 `validation-rerun`;started 与 completed 使用同一组值。
|
|
12
12
|
|
|
13
13
|
## 任务上下文解析
|
|
14
14
|
|
|
@@ -251,11 +251,10 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
251
251
|
}
|
|
252
252
|
const keys = Object.keys(candidate);
|
|
253
253
|
if (
|
|
254
|
-
|
|
254
|
+
keys.length !== 3
|
|
255
255
|
|| !own(candidate, 'id')
|
|
256
256
|
|| !own(candidate, 'enabled')
|
|
257
257
|
|| !own(candidate, 'installInSandbox')
|
|
258
|
-
|| (keys.length === 4 && !own(candidate, 'orchestration'))
|
|
259
258
|
) {
|
|
260
259
|
return failure('INVALID_AGENT_CLIENTS', entryPath);
|
|
261
260
|
}
|
|
@@ -266,52 +265,9 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
266
265
|
if (typeof candidate.enabled !== 'boolean' || typeof candidate.installInSandbox !== 'boolean') {
|
|
267
266
|
return failure('INVALID_AGENT_CLIENTS', entryPath);
|
|
268
267
|
}
|
|
269
|
-
let orchestration;
|
|
270
|
-
if (own(candidate, 'orchestration')) {
|
|
271
|
-
const policy = candidate.orchestration;
|
|
272
|
-
if (
|
|
273
|
-
!policy
|
|
274
|
-
|| typeof policy !== 'object'
|
|
275
|
-
|| Array.isArray(policy)
|
|
276
|
-
|| Object.keys(policy).length !== 2
|
|
277
|
-
|| !own(policy, 'executor')
|
|
278
|
-
|| !own(policy, 'reviewer')
|
|
279
|
-
) {
|
|
280
|
-
return failure('INVALID_AGENT_CLIENTS', `${entryPath}.orchestration`);
|
|
281
|
-
}
|
|
282
|
-
const parseExact = (value, path) => {
|
|
283
|
-
if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) {
|
|
284
|
-
return failure('INVALID_AGENT_CLIENTS', path);
|
|
285
|
-
}
|
|
286
|
-
return value;
|
|
287
|
-
};
|
|
288
|
-
const parseRole = (role, rolePath) => {
|
|
289
|
-
if (
|
|
290
|
-
!role
|
|
291
|
-
|| typeof role !== 'object'
|
|
292
|
-
|| Array.isArray(role)
|
|
293
|
-
|| Object.keys(role).length !== 2
|
|
294
|
-
|| !own(role, 'model')
|
|
295
|
-
|| !own(role, 'reasoningEffort')
|
|
296
|
-
) {
|
|
297
|
-
return failure('INVALID_AGENT_CLIENTS', rolePath);
|
|
298
|
-
}
|
|
299
|
-
const model = parseExact(role.model, `${rolePath}.model`);
|
|
300
|
-
if (typeof model !== 'string') return model;
|
|
301
|
-
const reasoningEffort = parseExact(role.reasoningEffort, `${rolePath}.reasoningEffort`);
|
|
302
|
-
if (typeof reasoningEffort !== 'string') return reasoningEffort;
|
|
303
|
-
return { model, reasoningEffort };
|
|
304
|
-
};
|
|
305
|
-
const executor = parseRole(policy.executor, `${entryPath}.orchestration.executor`);
|
|
306
|
-
if (executor.errorCode) return executor;
|
|
307
|
-
const reviewer = parseRole(policy.reviewer, `${entryPath}.orchestration.reviewer`);
|
|
308
|
-
if (reviewer.errorCode) return reviewer;
|
|
309
|
-
orchestration = { executor, reviewer };
|
|
310
|
-
}
|
|
311
268
|
entries.set(candidate.id, {
|
|
312
269
|
enabled: candidate.enabled,
|
|
313
|
-
installInSandbox: candidate.installInSandbox
|
|
314
|
-
...(orchestration ? { orchestration } : {})
|
|
270
|
+
installInSandbox: candidate.installInSandbox
|
|
315
271
|
});
|
|
316
272
|
}
|
|
317
273
|
if (AGENT_CLIENT_IDS.some((id) => !entries.has(id))) {
|
|
@@ -676,22 +632,6 @@ function mergeTemplateSources(baseRoot, sources, report) {
|
|
|
676
632
|
};
|
|
677
633
|
}
|
|
678
634
|
|
|
679
|
-
function writeIfChanged(projectRoot, targetPath, content, reportBucket) {
|
|
680
|
-
const fullPath = path.join(projectRoot, targetPath);
|
|
681
|
-
const exists = fs.existsSync(fullPath);
|
|
682
|
-
|
|
683
|
-
if (exists && fs.readFileSync(fullPath, 'utf8') === content) {
|
|
684
|
-
reportBucket.unchanged.push(targetPath);
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
const dir = path.dirname(fullPath);
|
|
689
|
-
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
690
|
-
fs.writeFileSync(fullPath, content, 'utf8');
|
|
691
|
-
|
|
692
|
-
(exists ? reportBucket.updated : reportBucket.generated).push(targetPath);
|
|
693
|
-
}
|
|
694
|
-
|
|
695
635
|
function syncCustomSkillSources(projectRoot, sources, report, templateSkillNames) {
|
|
696
636
|
const skillsDir = path.join(projectRoot, '.agents/skills');
|
|
697
637
|
const syncedSkills = new Map();
|
|
@@ -1102,7 +1042,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1102
1042
|
&& !Array.isArray(cfg.files.managedBaselines)
|
|
1103
1043
|
? { ...cfg.files.managedBaselines }
|
|
1104
1044
|
: {};
|
|
1105
|
-
|
|
1045
|
+
|
|
1106
1046
|
|
|
1107
1047
|
for (const target of Object.keys(managedBaselines)) {
|
|
1108
1048
|
if (
|
|
@@ -1111,7 +1051,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1111
1051
|
&& !allClientManaged.some((entry) => assetMatches(entry, target))
|
|
1112
1052
|
) {
|
|
1113
1053
|
delete managedBaselines[target];
|
|
1114
|
-
baselinesChanged = true;
|
|
1115
1054
|
}
|
|
1116
1055
|
}
|
|
1117
1056
|
|
|
@@ -1206,7 +1145,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1206
1145
|
if (!fs.existsSync(candidatePath)) {
|
|
1207
1146
|
if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
|
|
1208
1147
|
delete managedBaselines[candidate];
|
|
1209
|
-
baselinesChanged = true;
|
|
1210
1148
|
}
|
|
1211
1149
|
continue;
|
|
1212
1150
|
}
|
|
@@ -1232,7 +1170,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1232
1170
|
}
|
|
1233
1171
|
if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
|
|
1234
1172
|
delete managedBaselines[candidate];
|
|
1235
|
-
baselinesChanged = true;
|
|
1236
1173
|
}
|
|
1237
1174
|
}
|
|
1238
1175
|
removeEmptyDirs(target);
|
|
@@ -1252,7 +1189,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1252
1189
|
report.managed.removed.push(entry);
|
|
1253
1190
|
if (Object.prototype.hasOwnProperty.call(managedBaselines, entry)) {
|
|
1254
1191
|
delete managedBaselines[entry];
|
|
1255
|
-
baselinesChanged = true;
|
|
1256
1192
|
}
|
|
1257
1193
|
} else {
|
|
1258
1194
|
report.managed.protected.push({
|
|
@@ -1321,7 +1257,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1321
1257
|
|
|
1322
1258
|
if (rawBaseline !== undefined && baseline === null) {
|
|
1323
1259
|
delete managedBaselines[target];
|
|
1324
|
-
baselinesChanged = true;
|
|
1325
1260
|
}
|
|
1326
1261
|
if (baseline === null && localHash !== null && localHash !== templateHash) {
|
|
1327
1262
|
report.managed.conflicts.push({
|
|
@@ -1362,7 +1297,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1362
1297
|
bucket.unchanged.push(target);
|
|
1363
1298
|
if (managedBaselines[target] !== templateHash) {
|
|
1364
1299
|
managedBaselines[target] = templateHash;
|
|
1365
|
-
baselinesChanged = true;
|
|
1366
1300
|
}
|
|
1367
1301
|
return false;
|
|
1368
1302
|
}
|
|
@@ -1371,7 +1305,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1371
1305
|
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
1372
1306
|
fs.writeFileSync(dstFull, content);
|
|
1373
1307
|
managedBaselines[target] = templateHash;
|
|
1374
|
-
baselinesChanged = true;
|
|
1375
1308
|
if (Object.prototype.hasOwnProperty.call(bucket, 'written')) {
|
|
1376
1309
|
(exists ? bucket.written : bucket.created).push(target);
|
|
1377
1310
|
} else {
|
|
@@ -1417,7 +1350,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1417
1350
|
report.managed.removed.push(renderedTarget);
|
|
1418
1351
|
if (Object.prototype.hasOwnProperty.call(managedBaselines, renderedTarget)) {
|
|
1419
1352
|
delete managedBaselines[renderedTarget];
|
|
1420
|
-
baselinesChanged = true;
|
|
1421
1353
|
}
|
|
1422
1354
|
continue;
|
|
1423
1355
|
}
|
|
@@ -1479,7 +1411,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1479
1411
|
if (localHash === null) {
|
|
1480
1412
|
if (Object.prototype.hasOwnProperty.call(managedBaselines, target)) {
|
|
1481
1413
|
delete managedBaselines[target];
|
|
1482
|
-
baselinesChanged = true;
|
|
1483
1414
|
}
|
|
1484
1415
|
continue;
|
|
1485
1416
|
}
|
|
@@ -1492,7 +1423,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1492
1423
|
report.managed.removed.push(target);
|
|
1493
1424
|
if (Object.prototype.hasOwnProperty.call(managedBaselines, target)) {
|
|
1494
1425
|
delete managedBaselines[target];
|
|
1495
|
-
baselinesChanged = true;
|
|
1496
1426
|
}
|
|
1497
1427
|
removeEmptyDirs(path.dirname(dstFull));
|
|
1498
1428
|
continue;
|
|
@@ -1608,7 +1538,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1608
1538
|
if (baseline !== null && localHash === baseline) {
|
|
1609
1539
|
fs.unlinkSync(path.join(projectRoot, projFile));
|
|
1610
1540
|
delete managedBaselines[projFile];
|
|
1611
|
-
baselinesChanged = true;
|
|
1612
1541
|
report.managed.removed.push(projFile);
|
|
1613
1542
|
} else {
|
|
1614
1543
|
report.managed.protected.push({
|
|
@@ -1715,7 +1644,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1715
1644
|
if (Object.keys(managedBaselines).length > 0) {
|
|
1716
1645
|
cfg.files.managedBaselines = managedBaselines;
|
|
1717
1646
|
} else {
|
|
1718
|
-
if (Object.prototype.hasOwnProperty.call(cfg.files, 'managedBaselines')) baselinesChanged = true;
|
|
1719
1647
|
delete cfg.files.managedBaselines;
|
|
1720
1648
|
}
|
|
1721
1649
|
cfg.templateVersion = version;
|
|
@@ -13,6 +13,7 @@ start_date: # Optional Issue field for Feature: YYYY-MM-DD
|
|
|
13
13
|
target_date: # Optional Issue field for Feature: YYYY-MM-DD
|
|
14
14
|
current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
|
|
15
15
|
assigned_to: # claude | codex | antigravity | opencode | human
|
|
16
|
+
lifecycle_execution: '{"version":1,"open":[],"prReview":{"open":null,"terminals":[]}}'
|
|
16
17
|
pr_delivery_fact: '{"version":2,"state":"unbound","reason":"initial"}'
|
|
17
18
|
delivery_remote: origin # Git remote used to deliver the task branch
|
|
18
19
|
delivery_base_ref: main # Target branch for the task PR
|
|
@@ -13,6 +13,7 @@ start_date: # Feature 可选 Issue 字段:YYYY-MM-DD
|
|
|
13
13
|
target_date: # Feature 可选 Issue 字段:YYYY-MM-DD
|
|
14
14
|
current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
|
|
15
15
|
assigned_to: # claude | codex | antigravity | opencode | human
|
|
16
|
+
lifecycle_execution: '{"version":1,"open":[],"prReview":{"open":null,"terminals":[]}}'
|
|
16
17
|
pr_delivery_fact: '{"version":2,"state":"unbound","reason":"initial"}'
|
|
17
18
|
delivery_remote: origin # 任务分支交付使用的 Git remote
|
|
18
19
|
delivery_base_ref: main # 任务 PR 的目标分支
|
|
@@ -30,30 +30,6 @@
|
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
|
-
"SubagentStart": [
|
|
34
|
-
{
|
|
35
|
-
"matcher": "agent-infra-lifecycle-(executor|reviewer)",
|
|
36
|
-
"hooks": [
|
|
37
|
-
{
|
|
38
|
-
"type": "command",
|
|
39
|
-
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client claude-code",
|
|
40
|
-
"timeout": 10
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"SubagentStop": [
|
|
46
|
-
{
|
|
47
|
-
"matcher": "agent-infra-lifecycle-(executor|reviewer)",
|
|
48
|
-
"hooks": [
|
|
49
|
-
{
|
|
50
|
-
"type": "command",
|
|
51
|
-
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client claude-code",
|
|
52
|
-
"timeout": 10
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
33
|
"StopFailure": [
|
|
58
34
|
{
|
|
59
35
|
"matcher": "",
|
|
@@ -11,56 +11,6 @@
|
|
|
11
11
|
"statusMessage": "Checking template version before git commit"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"matcher": "^collaborationspawn_agent$",
|
|
17
|
-
"hooks": [
|
|
18
|
-
{
|
|
19
|
-
"type": "command",
|
|
20
|
-
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event pre-tool",
|
|
21
|
-
"timeout": 30,
|
|
22
|
-
"statusMessage": "Recording Codex lifecycle spawn evidence"
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"PostToolUse": [
|
|
28
|
-
{
|
|
29
|
-
"matcher": "",
|
|
30
|
-
"hooks": [
|
|
31
|
-
{
|
|
32
|
-
"type": "command",
|
|
33
|
-
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event post-tool",
|
|
34
|
-
"timeout": 30,
|
|
35
|
-
"statusMessage": "Recording Codex lifecycle tool completion"
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"SubagentStart": [
|
|
41
|
-
{
|
|
42
|
-
"matcher": "",
|
|
43
|
-
"hooks": [
|
|
44
|
-
{
|
|
45
|
-
"type": "command",
|
|
46
|
-
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event subagent-start",
|
|
47
|
-
"timeout": 30,
|
|
48
|
-
"statusMessage": "Recording Codex child identity"
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"SubagentStop": [
|
|
54
|
-
{
|
|
55
|
-
"matcher": "",
|
|
56
|
-
"hooks": [
|
|
57
|
-
{
|
|
58
|
-
"type": "command",
|
|
59
|
-
"command": "node \"$(git rev-parse --show-toplevel)/.agents/hooks/lifecycle-delegation.js\" --client codex --event subagent-stop",
|
|
60
|
-
"timeout": 30,
|
|
61
|
-
"statusMessage": "Recording Codex child stop evidence"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
14
|
}
|
|
65
15
|
]
|
|
66
16
|
}
|