@fitlab-ai/agent-infra 0.9.9 → 0.9.11
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 +13 -3
- package/README.zh-CN.md +13 -3
- package/bin/cli.ts +17 -4
- package/dist/bin/cli.js +19 -4
- package/dist/bin/internal-cli.js +55 -4
- package/dist/lib/agent-client.js +0 -1
- package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +17 -10
- package/dist/lib/agent-clients/adapters/codex-lifecycle/controller-context.js +11 -31
- package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +15 -33
- package/dist/lib/agent-clients/adapters/codex-sandbox.js +72 -11
- package/dist/lib/agent-clients/adapters/index.js +3 -1
- package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
- package/dist/lib/agent-clients/adapters/traecli.js +65 -0
- package/dist/lib/agent-clients/config.js +14 -99
- package/dist/lib/agent-clients/reconcile.js +1 -11
- package/dist/lib/agent-clients/schema.js +5 -4
- package/dist/lib/agent-clients/tokens.js +7 -17
- package/dist/lib/agent-clients/types.js +2 -1
- package/dist/lib/decide.js +14 -30
- package/dist/lib/defaults.json +9 -0
- package/dist/lib/init.js +2 -2
- package/dist/lib/internal/codex-lifecycle.js +2 -2
- package/dist/lib/internal/codex-sandbox-controller.js +4 -3
- package/dist/lib/internal/release-workflow.js +0 -1
- package/dist/lib/internal/sandbox-control.js +2 -2
- package/dist/lib/internal/task-finalization.js +19 -9
- package/dist/lib/internal/task-ledger.js +8 -2
- package/dist/lib/internal/task-lifecycle.js +17 -93
- package/dist/lib/internal/task-orchestration.js +30 -216
- package/dist/lib/{task/commands/validate.js → internal/task-validate.js} +77 -43
- package/dist/lib/merge.js +205 -103
- package/dist/lib/process-data/normalize.js +2 -9
- package/dist/lib/run/host.js +46 -16
- package/dist/lib/run/tui.js +5 -2
- package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
- package/dist/lib/sandbox/commands/create.js +3 -3
- package/dist/lib/sandbox/commands/enter.js +18 -4
- package/dist/lib/sandbox/config.js +3 -12
- package/dist/lib/sandbox/control/controller-registration.js +4 -2
- package/dist/lib/sandbox/control/executor.js +135 -40
- package/dist/lib/sandbox/control/lifecycle.js +29 -20
- package/dist/lib/sandbox/control/server.js +18 -16
- package/dist/lib/sandbox/mounts.js +3 -2
- package/dist/lib/sandbox/recovery.js +123 -22
- package/dist/lib/sandbox/workspace-identity.js +14 -0
- package/dist/lib/sandbox/workspace-view.js +8 -9
- package/dist/lib/self-update.js +278 -0
- package/dist/lib/server/protocol.js +5 -5
- package/dist/lib/task/activity-log.js +4 -1
- package/dist/lib/task/artifact-lifecycle.js +4 -2
- package/dist/lib/task/codex-orchestration.js +32 -35
- package/dist/lib/task/command-options.js +1 -3
- package/dist/lib/task/commands/cat.js +0 -5
- package/dist/lib/task/commands/decisions.js +76 -92
- package/dist/lib/task/commands/files.js +6 -6
- package/dist/lib/task/commands/grep.js +25 -61
- package/dist/lib/task/commands/issue-body.js +6 -6
- package/dist/lib/task/commands/log.js +25 -10
- package/dist/lib/task/commands/show.js +5 -6
- package/dist/lib/task/commands/status.js +8 -8
- package/dist/lib/task/commit-operation.js +21 -25
- package/dist/lib/task/commit-policy.js +1 -1
- package/dist/lib/task/control-authority.js +431 -0
- package/dist/lib/task/create.js +6 -1
- package/dist/lib/task/current-contract.js +35 -0
- package/dist/lib/task/decision-details.js +263 -0
- package/dist/lib/task/decision-intents.js +5 -2
- package/dist/lib/task/delegation-receipts.js +8 -7
- package/dist/lib/task/events.js +11 -5
- package/dist/lib/task/finalization.js +72 -46
- package/dist/lib/task/index.js +19 -29
- package/dist/lib/task/ledger-intents.js +8 -9
- package/dist/lib/task/ledger.js +13 -6
- package/dist/lib/task/lifecycle.js +16 -0
- package/dist/lib/task/orchestration.js +51 -14
- package/dist/lib/task/review-artifacts.js +31 -12
- package/dist/lib/task/review-finalization.js +19 -6
- package/dist/lib/task/verification-engine.js +38 -18
- package/dist/lib/task/verification-review.js +1 -1
- package/dist/lib/task/workspace-snapshot.js +5 -11
- package/dist/lib/task/write.js +11 -1
- package/dist/lib/update.js +6 -37
- package/dist/lib/version.js +5 -1
- package/dist/lifecycle-build-manifest.json +3 -3
- package/lib/agent-client.ts +0 -1
- package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +25 -10
- package/lib/agent-clients/adapters/codex-lifecycle/controller-context.ts +16 -33
- package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +16 -35
- package/lib/agent-clients/adapters/codex-sandbox.ts +89 -14
- package/lib/agent-clients/adapters/index.ts +3 -1
- package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
- package/lib/agent-clients/adapters/traecli.ts +66 -0
- package/lib/agent-clients/config.ts +14 -144
- package/lib/agent-clients/reconcile.ts +1 -12
- package/lib/agent-clients/schema.ts +5 -4
- package/lib/agent-clients/tokens.ts +7 -20
- package/lib/agent-clients/types.ts +2 -1
- package/lib/decide.ts +12 -22
- package/lib/defaults.json +9 -0
- package/lib/init.ts +2 -2
- package/lib/internal/codex-lifecycle.ts +2 -2
- package/lib/internal/codex-sandbox-controller.ts +4 -3
- package/lib/internal/release-workflow.ts +0 -1
- package/lib/internal/sandbox-control.ts +2 -2
- package/lib/internal/task-finalization.ts +27 -13
- package/lib/internal/task-ledger.ts +8 -2
- package/lib/internal/task-lifecycle.ts +33 -76
- package/lib/internal/task-orchestration.ts +33 -190
- package/lib/{task/commands/validate.ts → internal/task-validate.ts} +77 -41
- package/lib/merge.ts +236 -120
- package/lib/process-data/normalize.ts +2 -8
- package/lib/run/host.ts +63 -14
- package/lib/run/tui.ts +5 -3
- package/lib/sandbox/agent-client-reconciler.ts +5 -15
- package/lib/sandbox/commands/create.ts +4 -4
- package/lib/sandbox/commands/enter.ts +24 -4
- package/lib/sandbox/config.ts +2 -14
- package/lib/sandbox/control/container-identity.ts +2 -2
- package/lib/sandbox/control/controller-registration.ts +8 -3
- package/lib/sandbox/control/executor.ts +156 -53
- package/lib/sandbox/control/lifecycle.ts +34 -28
- package/lib/sandbox/control/protocol.ts +1 -3
- package/lib/sandbox/control/server.ts +15 -12
- package/lib/sandbox/control/state.ts +7 -7
- package/lib/sandbox/mounts.ts +4 -3
- package/lib/sandbox/recovery.ts +162 -34
- package/lib/sandbox/tools.ts +1 -1
- package/lib/sandbox/workspace-identity.ts +28 -0
- package/lib/sandbox/workspace-view.ts +14 -10
- package/lib/self-update.ts +341 -0
- package/lib/server/protocol.ts +5 -5
- package/lib/task/activity-log.ts +6 -1
- package/lib/task/artifact-lifecycle.ts +5 -3
- package/lib/task/codex-orchestration.ts +40 -45
- package/lib/task/command-options.ts +1 -2
- package/lib/task/commands/cat.ts +0 -4
- package/lib/task/commands/decisions.ts +80 -75
- package/lib/task/commands/files.ts +6 -6
- package/lib/task/commands/grep.ts +23 -51
- package/lib/task/commands/issue-body.ts +6 -6
- package/lib/task/commands/log.ts +22 -10
- package/lib/task/commands/show.ts +5 -6
- package/lib/task/commands/status.ts +8 -8
- package/lib/task/commit-operation.ts +25 -30
- package/lib/task/commit-policy.ts +1 -2
- package/lib/task/control-authority.ts +563 -0
- package/lib/task/create.ts +6 -1
- package/lib/task/current-contract.ts +49 -0
- package/lib/task/decision-details.ts +340 -0
- package/lib/task/decision-intents.ts +7 -2
- package/lib/task/delegation-receipts.ts +8 -6
- package/lib/task/events.ts +10 -5
- package/lib/task/finalization.ts +84 -42
- package/lib/task/index.ts +19 -28
- package/lib/task/ledger-intents.ts +6 -8
- package/lib/task/ledger.ts +17 -7
- package/lib/task/lifecycle.ts +20 -0
- package/lib/task/orchestration.ts +42 -16
- package/lib/task/review-artifacts.ts +53 -15
- package/lib/task/review-finalization.ts +33 -7
- package/lib/task/verification-engine.ts +33 -21
- package/lib/task/verification-review.ts +1 -1
- package/lib/task/workspace-snapshot.ts +4 -13
- package/lib/task/write.ts +20 -1
- package/lib/update.ts +6 -40
- package/lib/version.ts +6 -1
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.en.md +2 -3
- package/templates/.agents/QUICKSTART.zh-CN.md +2 -3
- package/templates/.agents/README.en.md +5 -3
- package/templates/.agents/README.zh-CN.md +5 -3
- package/templates/.agents/rules/README.en.md +1 -0
- package/templates/.agents/rules/README.zh-CN.md +1 -0
- package/templates/.agents/rules/compatibility-policy.en.md +40 -0
- package/templates/.agents/rules/compatibility-policy.zh-CN.md +40 -0
- package/templates/.agents/rules/create-issue.github.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
- package/templates/.agents/rules/human-decision-context.en.md +9 -7
- package/templates/.agents/rules/human-decision-context.zh-CN.md +9 -7
- package/templates/.agents/rules/issue-fields.github.en.md +1 -1
- package/templates/.agents/rules/issue-fields.github.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.github.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.github.en.md +1 -1
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +2 -2
- package/templates/.agents/rules/lifecycle-orchestration.en.md +4 -4
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +4 -4
- package/templates/.agents/rules/milestone-inference.github.en.md +1 -1
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +1 -1
- package/templates/.agents/rules/next-step-output.en.md +3 -3
- package/templates/.agents/rules/next-step-output.zh-CN.md +3 -3
- package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -1
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -1
- package/templates/.agents/rules/pr-sync.en.md +2 -2
- package/templates/.agents/rules/pr-sync.github.en.md +3 -2
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +3 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +2 -1
- package/templates/.agents/rules/release-commands.github.en.md +6 -0
- package/templates/.agents/rules/release-commands.github.zh-CN.md +6 -0
- package/templates/.agents/rules/review-handshake.en.md +1 -1
- package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
- package/templates/.agents/rules/review-method.en.md +1 -0
- package/templates/.agents/rules/review-method.zh-CN.md +1 -0
- package/templates/.agents/rules/task-management.en.md +1 -2
- package/templates/.agents/rules/task-management.zh-CN.md +1 -2
- package/templates/.agents/skills/analyze-task/SKILL.en.md +4 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +4 -3
- package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/check-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +4 -3
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/commit/SKILL.en.md +27 -7
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -4
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +5 -5
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +15 -11
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +15 -11
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +46 -0
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +46 -0
- package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
- package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
- package/templates/.agents/skills/create-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +5 -4
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -4
- package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/review-code/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/review-code/reference/migration-risks.en.md +9 -6
- package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +9 -6
- package/templates/.agents/skills/review-plan/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/review-plan/config/verify.en.json +1 -0
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +7 -3
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +7 -3
- package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +1 -1
- package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +1 -1
- package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -2
- package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -2
- package/templates/.agents/skills/run-task/SKILL.en.md +6 -2
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +2 -2
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +2 -2
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -2
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +159 -104
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/templates/task.en.md +1 -1
- package/templates/.agents/templates/task.zh-CN.md +1 -1
- package/templates/.claude/commands/analyze-task.en.md +1 -1
- package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
- package/templates/.claude/commands/block-task.en.md +1 -1
- package/templates/.claude/commands/block-task.zh-CN.md +1 -1
- package/templates/.claude/commands/cancel-task.en.md +1 -1
- package/templates/.claude/commands/cancel-task.zh-CN.md +1 -1
- package/templates/.claude/commands/check-task.en.md +1 -1
- package/templates/.claude/commands/check-task.zh-CN.md +1 -1
- package/templates/.claude/commands/code-task.en.md +1 -1
- package/templates/.claude/commands/code-task.zh-CN.md +1 -1
- package/templates/.claude/commands/commit.en.md +1 -1
- package/templates/.claude/commands/commit.zh-CN.md +1 -1
- package/templates/.claude/commands/complete-manual-validation.en.md +1 -1
- package/templates/.claude/commands/complete-manual-validation.zh-CN.md +1 -1
- package/templates/.claude/commands/complete-task.en.md +1 -1
- package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
- package/templates/.claude/commands/create-pr.en.md +1 -1
- package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
- package/templates/.claude/commands/plan-task.en.md +1 -1
- package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
- package/templates/.claude/commands/review-analysis.en.md +1 -1
- package/templates/.claude/commands/review-analysis.zh-CN.md +1 -1
- package/templates/.claude/commands/review-code.en.md +1 -1
- package/templates/.claude/commands/review-code.zh-CN.md +1 -1
- package/templates/.claude/commands/review-plan.en.md +1 -1
- package/templates/.claude/commands/review-plan.zh-CN.md +1 -1
- package/templates/.claude/commands/run-manual-validation.en.md +1 -1
- package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
- package/templates/.claude/commands/run-task.en.md +1 -1
- package/templates/.claude/commands/run-task.zh-CN.md +1 -1
- package/templates/.claude/commands/watch-pr.en.md +1 -1
- package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
- package/templates/.traecli/commands/update-agent-infra.en.md +7 -0
- package/templates/.traecli/commands/update-agent-infra.zh-CN.md +7 -0
- package/dist/lib/builtin-tuis.js +0 -40
- package/lib/builtin-tuis.ts +0 -56
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 兼容性策略
|
|
2
|
+
|
|
3
|
+
本规则约束需求分析、方案、实现和审查中的兼容性决策。默认只支持当前契约;兼容是需要证据和退出条件的例外预算,不是稳健性的默认同义词。
|
|
4
|
+
|
|
5
|
+
## 什么属于兼容逻辑
|
|
6
|
+
|
|
7
|
+
以下任一行为都属于兼容逻辑:同时接受或写入新旧 schema、字段、状态或命令;保留旧别名、adapter、wrapper、shim;在运行主路径执行迁移;根据旧格式回退到另一套语义;为旧调用方维持并行事实源或测试矩阵。
|
|
8
|
+
|
|
9
|
+
以下行为本身不属于历史兼容:当前版本操作的幂等重试与崩溃恢复;平台、操作系统或权限能力的显式分支;对未知状态失败关闭并给出恢复提示;用户明确要求的多版本公共契约。不得用这些名义扩大成旧协议支持。
|
|
10
|
+
|
|
11
|
+
## 新增兼容的准入门槛
|
|
12
|
+
|
|
13
|
+
只有任务或既有公共契约明确要求兼容,并且产物同时记录以下四项证据时,才能新增或延长兼容逻辑:
|
|
14
|
+
|
|
15
|
+
1. **对象**:仍在使用旧契约的具体消费者、已发布版本或存量数据。
|
|
16
|
+
2. **必要性**:为何不能原子切换、一次性转换或直接失败并提示修复。
|
|
17
|
+
3. **期限**:兼容窗口的版本、日期或可验证终点。
|
|
18
|
+
4. **退出**:删除条件以及届时要删除的代码、测试和文档。
|
|
19
|
+
|
|
20
|
+
缺少任一项时,兼容属于未经授权的范围扩张:按当前契约实现;遇到旧输入时失败关闭并提供可操作提示,或在主路径之外执行一次性显式转换。
|
|
21
|
+
|
|
22
|
+
## 实现边界
|
|
23
|
+
|
|
24
|
+
- 当前契约只有一个规范写入格式和一个事实源;禁止双写、影子状态和“先试新逻辑、失败再走旧逻辑”。
|
|
25
|
+
- 兼容转换集中在单一边界,转换后立即进入当前模型;业务核心不得感知多个历史版本。
|
|
26
|
+
- 暂时保留的兼容逻辑必须在唯一兼容边界使用 `TODO(compat): Remove ... once ...` 标记要删除的对象和可验证删除条件。该 TODO 与代码同源;任务或 Issue 只用于可选排期,不作为兼容事实源或工作流门禁。
|
|
27
|
+
- warning 只用于主动作仍然正确且用户可重试的外围问题,不能掩盖身份、授权、数据解释或副作用正确性的不确定。
|
|
28
|
+
- 删除旧能力时同步删除专属 adapter、分支、fixture、测试和迁移文档;不要新增“已删除能力不存在”的反向断言。
|
|
29
|
+
- 不为兼容而猜测未知状态。无法唯一解释时保留原数据、停止写入并给出重建或人工修复提示。
|
|
30
|
+
|
|
31
|
+
## 生命周期阶段要求
|
|
32
|
+
|
|
33
|
+
- **分析**:区分用户明确兼容要求与模型自行推测;列出现存消费者和数据证据。没有证据时明确采用 current-only。
|
|
34
|
+
- **方案**:为获准兼容标出边界、唯一转换点、窗口和删除计划;不得把兼容层当作低风险默认方案。
|
|
35
|
+
- **实现**:只实现已批准的兼容预算,并在唯一兼容边界写入或随重构移动 `TODO(compat)`。方案未授权的旧分支不得“顺手保留”。
|
|
36
|
+
- **审查**:逐项核对四项准入证据、单一事实源、退出条件及就地 `TODO(compat)`。未经授权的兼容、无期限 shim、双写或主路径迁移应作为范围与维护性问题提出。
|
|
37
|
+
|
|
38
|
+
## 既有兼容逻辑
|
|
39
|
+
|
|
40
|
+
普通任务发现范围外的既有兼容逻辑时,只确保唯一边界存在 `TODO(compat)` 并记录位置和风险,不擅自删除,也不重复添加标记。专门的简化任务应先检索这些 TODO、建立消费者与存量数据视图,再按“可立即删除 → 先告警后删除 → 暂时保留”的顺序逐项处理。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue Creation
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
After `create-task` writes task.md, create and initialize the Issue through declarative internal intents:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue 创建
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
当 `create-task` 完成本地 `task.md` 落盘后,通过声明式内部命令创建 Issue:
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ This rule governs every new `[needs-human-decision]` detail block produced by an
|
|
|
4
4
|
|
|
5
5
|
## Self-contained Context
|
|
6
6
|
|
|
7
|
-
A maintainer must be able to understand the issue and choose without knowing the internal workflow or asking a model to reconstruct context.
|
|
7
|
+
A maintainer must be able to understand the issue and choose without knowing the internal workflow or asking a model to reconstruct context. In a fixed order, explain in plain language what must be chosen, why a decision is needed now, what it affects, and what could go wrong if it is wrong or postponed. Then explain each option, followed by the recommendation and its reason.
|
|
8
8
|
|
|
9
9
|
Provide at least two options with short names. For each option, explain what would actually be done, what would happen after choosing it, its benefits, and its trade-offs. Each decision must also include at least one everyday example or analogy that stays true to the real effects and helps the maintainer compare the options. Explain internal terms such as stage, severity, and evidence the first time they appear. IDs and evidence are for lookup and troubleshooting; they do not replace the plain-language explanation.
|
|
10
10
|
|
|
@@ -13,13 +13,10 @@ Provide at least two options with short names. For each option, explain what wou
|
|
|
13
13
|
```markdown
|
|
14
14
|
### {AN-N|PL-N|CD-N|HD-N}: {Title} [needs-human-decision]
|
|
15
15
|
|
|
16
|
-
- **Why a decision is needed now**: {plain-language facts, constraints, and why work cannot simply continue}
|
|
17
16
|
- **What needs a decision**: {the one choice that must be made}
|
|
18
|
-
- **
|
|
19
|
-
- **Why this choice**: {reason based on benefits, trade-offs, and current constraints}
|
|
17
|
+
- **Why a decision is needed now**: {plain-language facts, constraints, and why work cannot simply continue}
|
|
20
18
|
- **What this affects**: {affected behavior, files, users, or future practice}
|
|
21
19
|
- **What could go wrong**: {problems caused by the wrong choice or no action}
|
|
22
|
-
- **Everyday example or analogy**: {a familiar comparison that accurately reflects the real effects and helps compare the options}
|
|
23
20
|
|
|
24
21
|
#### Option A: {Name}
|
|
25
22
|
|
|
@@ -27,6 +24,7 @@ Provide at least two options with short names. For each option, explain what wou
|
|
|
27
24
|
- **What happens after choosing it**: {specific changes for users, behavior, or follow-up work}
|
|
28
25
|
- **Benefits**: {what this option provides}
|
|
29
26
|
- **Trade-offs**: {what this option costs and where it falls short}
|
|
27
|
+
- **Example or analogy**: {a plain-language example that shows this option's real effect}
|
|
30
28
|
|
|
31
29
|
#### Option B: {Name}
|
|
32
30
|
|
|
@@ -34,9 +32,13 @@ Provide at least two options with short names. For each option, explain what wou
|
|
|
34
32
|
- **What happens after choosing it**: {specific changes for users, behavior, or follow-up work}
|
|
35
33
|
- **Benefits**: {what this option provides}
|
|
36
34
|
- **Trade-offs**: {what this option costs and where it falls short}
|
|
35
|
+
- **Example or analogy**: {a plain-language example that shows this option's real effect}
|
|
36
|
+
|
|
37
|
+
- **Recommended choice**: {Option A/B/...}
|
|
38
|
+
- **Why this choice**: {reason based on benefits, trade-offs, and current constraints}
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
Option C and supporting evidence may be added, but none of the information above may be omitted or collapsed into an incomparable one-line option list.
|
|
41
|
+
Option C and supporting evidence may be added, but none of the information above may be omitted or collapsed into an incomparable one-line option list. Every option needs its own example or analogy, and it does not replace facts, concrete effects, or risks. Put the recommendation and its reason after all options. The heading ID must match the task.md Review Disagreement Ledger row. Its evidence (the reference used to find the original explanation) must point to this stable heading anchor.
|
|
40
42
|
|
|
41
43
|
## Implementation Intent Declaration
|
|
42
44
|
|
|
@@ -44,4 +46,4 @@ For the code stage, the author must add `**Implementation required**: yes/no` af
|
|
|
44
46
|
|
|
45
47
|
## Decision Closure
|
|
46
48
|
|
|
47
|
-
Use `ai task decisions <
|
|
49
|
+
Use `ai task decisions [--task <ref> | -t <ref>] [--item <ordinal|ledger-id> | -i <ordinal|ledger-id>]` to inspect full context and `ai decide [--task <ref> | -t <ref>] (--item <ordinal|ledger-id> | -i <ordinal|ledger-id>) <decision>` to record the ruling. `ai decide` updates the row to `human-decided`, creates an independent `HDR-N` record, and updates evidence and the activity log; do not manually imitate only part of that transaction.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 自足性要求
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
详情必须让维护者不需要了解内部流程,也不需要再问模型,就能看懂并做选择。按固定顺序先用大白话说明要决定什么、为什么现在需要决定、会影响什么以及选错或暂不处理会怎样;再分别说明方案 A/B/...,最后给出建议选哪个及原因。
|
|
8
8
|
|
|
9
9
|
每项至少提供两个有简短名称的方案,并分别写清实际会怎么做、选了以后会怎样、好处和代价。每项还必须提供至少一个贴近日常、且不歪曲事实的例子或类比,帮助维护者比较方案。第一次出现 stage、severity、evidence 等内部术语时,必须顺手解释它们的意思;ID 和 evidence 只用于后续查找和排查,不能代替问题说明。
|
|
10
10
|
|
|
@@ -13,13 +13,10 @@
|
|
|
13
13
|
```markdown
|
|
14
14
|
### {AN-N|PL-N|CD-N|HD-N}:{标题} [needs-human-decision]
|
|
15
15
|
|
|
16
|
-
- **为什么现在要决定**:{用大白话说明已知情况、限制,以及为什么不能直接继续}
|
|
17
16
|
- **要决定什么**:{本次只需要选定的一件事}
|
|
18
|
-
-
|
|
19
|
-
- **为什么这样建议**:{结合好处、代价和现有限制说明原因}
|
|
17
|
+
- **为什么现在要决定**:{用大白话说明已知情况、限制,以及为什么不能直接继续}
|
|
20
18
|
- **会影响什么**:{会受影响的功能、文件、用户或后续做法}
|
|
21
19
|
- **如果选错或暂不处理**:{可能出现的问题}
|
|
22
|
-
- **打个比方**:{用一个贴近日常且符合真实影响的例子或类比,帮助比较方案}
|
|
23
20
|
|
|
24
21
|
#### 方案 A:{名称}
|
|
25
22
|
|
|
@@ -27,6 +24,7 @@
|
|
|
27
24
|
- **选了以后会怎样**:{用户、功能或后续工作会发生什么具体变化}
|
|
28
25
|
- **好处**:{选择该方案能得到什么}
|
|
29
26
|
- **代价**:{选择该方案要付出什么、有哪些局限}
|
|
27
|
+
- **例子/类比**:{用大白话举一个能说明该方案实际效果的例子}
|
|
30
28
|
|
|
31
29
|
#### 方案 B:{名称}
|
|
32
30
|
|
|
@@ -34,9 +32,13 @@
|
|
|
34
32
|
- **选了以后会怎样**:{用户、功能或后续工作会发生什么具体变化}
|
|
35
33
|
- **好处**:{选择该方案能得到什么}
|
|
36
34
|
- **代价**:{选择该方案要付出什么、有哪些局限}
|
|
35
|
+
- **例子/类比**:{用大白话举一个能说明该方案实际效果的例子}
|
|
36
|
+
|
|
37
|
+
- **建议选哪个**:{方案 A/B/...}
|
|
38
|
+
- **为什么这样建议**:{结合好处、代价和现有限制说明原因}
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
可增加方案 C
|
|
41
|
+
可增加方案 C 或补充证据,但不得省略上述信息或把多个方案压缩为无法分别比较的一行。每个方案都要有自己的例子或类比,且不能替代事实、实际影响和风险说明。建议和建议原因放在所有方案之后。标题 ID 必须与 task.md `## 审查分歧账本` 行一致;evidence(用于定位原始说明的引用)必须指向该标题的稳定锚点。
|
|
40
42
|
|
|
41
43
|
## 实现意图声明
|
|
42
44
|
|
|
@@ -44,4 +46,4 @@ code 阶段的提出者必须在详情块的方案说明后另写 `**是否需
|
|
|
44
46
|
|
|
45
47
|
## 裁决闭环
|
|
46
48
|
|
|
47
|
-
使用 `ai task decisions <
|
|
49
|
+
使用 `ai task decisions [--task <ref> | -t <ref>] [--item <序号|账本ID> | -i <序号|账本ID>]` 查看完整详情,使用 `ai decide [--task <ref> | -t <ref>] (--item <序号|账本ID> | -i <序号|账本ID>) <裁决内容>` 写入裁决。`ai decide` 负责把目标行更新为 `human-decided`、创建独立 `HDR-N` 记录、更新 evidence 与活动日志;不得手工模拟其中一部分写入。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue Fields
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
Synchronize Issue Type and pinned fields through one intent:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue 字段
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
Issue Type 与 pinned fields 统一由 `platform-issue` intent 动态读取组织 schema 并同步:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Platform Intents
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Platform Intents
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 平台意图命令
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 平台意图命令
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue Sync
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
## Marker Registry
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Issue 同步规则
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
## Marker 注册表
|
|
6
6
|
|
|
@@ -27,7 +27,7 @@ agent-infra-internal platform-context resolve [--cwd <path>]
|
|
|
27
27
|
agent-infra-internal platform-comment list --issue <N> [--cwd <path>]
|
|
28
28
|
agent-infra-internal platform-comment owner <task-ref>
|
|
29
29
|
agent-infra-internal platform-comment sync <task-ref> \
|
|
30
|
-
--kind task|artifact|summary|cancel --agent
|
|
30
|
+
--kind task|artifact|summary|cancel --agent {standard-agent-token} \
|
|
31
31
|
[--artifact <canonical.md>] [--body-file <path|->] [--backfill]
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
- The orchestrator only routes and delegates. Stage skills remain the single source of truth for behavior and artifacts.
|
|
6
6
|
- Every stage and rework round uses a fresh executor. Every review uses a fresh reviewer; follow-up reuse is forbidden.
|
|
7
7
|
- A reviewer may only write its review artifact and core-generated task metadata. Business-code, HEAD, or index changes invalidate the receipt.
|
|
8
|
-
- An active run has one pending delegation. The child must pass the activation barrier before any stage side effect. Missing, late, mismatched, forked, replayed, hook-less, or drifted evidence pauses the run (on the claude-code path, missing or mismatched model/effort evidence, and fork/spawn-mode evidence this host structurally does not provide, follow the recording rules in `.agents/skills/run-task/reference/host-validation.md` instead and are exempt from this; missing or mismatched `parentId`/`childId` still pauses).
|
|
8
|
+
- An active run has one pending delegation. The child must pass the activation barrier before any stage side effect. Missing, late, mismatched, forked, replayed, hook-less, or drifted evidence pauses the run (on the claude-code path, missing or mismatched model/effort evidence, and fork/spawn-mode evidence this host structurally does not provide, follow the recording rules in `.agents/skills/run-task/reference/host-validation.md` instead and are exempt from this; missing or mismatched `parentId`/`childId` still pauses). Cross-root package/build/contract or hook/profile content drift is a deliverable warning; the current receipt's hook/evidence binding remains hard.
|
|
9
9
|
- The first release ends after one existing safely gated `commit`; it does not create a PR, monitor checks, or complete the task.
|
|
10
10
|
|
|
11
11
|
## Recovery
|
|
12
12
|
|
|
13
|
-
`orchestration.json` is the detailed state source. A current run persists complete policy, append-only recovery, build/contract/hook-source/controller provenance, and activation monotonic timestamps. Readers accept only the complete structure emitted by the current writer; unknown fields, missing fields, invalid provenance, and old runs fail closed without rewriting. Finish or clear every active run before upgrading agent-infra. An expired prepared orphan may be explicitly recovered only with the exact task fingerprint, no consumed authorization, and no matching unconsumed active lifecycle evidence.
|
|
13
|
+
`orchestration.json` is the detailed state source. A current run persists complete policy, append-only recovery, build/contract/hook-source/controller provenance, and activation monotonic timestamps. Readers accept only the complete structure emitted by the current writer; unknown fields, missing fields, invalid provenance, and old runs fail closed without rewriting. If the state cannot be recognized, preserve the file, advise rebuilding the sandbox or manually repairing it, do not migrate it, and do not create a follow-up task. Finish or clear every active run before upgrading agent-infra. An expired prepared orphan may be explicitly recovered only with the exact task fingerprint, no consumed authorization, and no matching unconsumed active lifecycle evidence.
|
|
14
14
|
|
|
15
15
|
## Codex Host and Capability
|
|
16
16
|
|
|
17
|
-
- Direct-host accepts only trusted project or managed lifecycle hooks. A task-bound sandbox requires a controlled nested controller and isolated `CODEX_HOME`; only user hooks bound to that controller context are accepted. Ordinary user/plugin hooks are not evidence.
|
|
18
|
-
- The controller starts a nested loop only after control generation, task binding,
|
|
17
|
+
- Direct-host accepts only trusted project or managed lifecycle hooks. A task-bound sandbox requires a controlled nested controller and isolated `CODEX_HOME`; only user hooks bound to that controller context are accepted. Ordinary user/plugin hooks are not evidence. The actual hook/profile used by the run is the source of record; content drift is reported as a warning with rebuild guidance.
|
|
18
|
+
- The controller starts a nested loop only after control generation, task binding, protocol version, profiles, and hook discovery pass. Build/contract and content drift is reported as a structured warning with rebuild guidance instead of blocking natural evolution. Both bypass flags are restricted to this task-bound launch path.
|
|
19
19
|
- Every prepare arms a one-use capability attested by the current loop's real PostToolUse. Atomic consumption binds task/session/build/controller and retains only a redacted tombstone.
|
|
20
20
|
|
|
21
21
|
## Model Policy
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
- 总控只路由和委派;阶段技能仍是业务规则与产物格式的单一事实源。
|
|
6
6
|
- 每个阶段和每轮返工都创建 fresh executor;每轮审查创建 fresh reviewer,禁止 follow-up 复用。
|
|
7
7
|
- reviewer 只能写当前审查产物和核心生成的任务元数据。业务代码、HEAD 或暂存区变化会使 receipt 失效。
|
|
8
|
-
- active run 中只有一个 pending delegation。child 必须在任何阶段副作用前通过 activation barrier;缺失、超时、错配、fork、重放、hook 不可用或工作区漂移一律暂停(claude-code 路径下 model/effort 证据的缺失或错配、以及该宿主结构上不提供的 fork/spawn-mode 证据,按 `.agents/skills/run-task/reference/host-validation.md` 的记录规则处理,不在此列;`parentId`/`childId`
|
|
8
|
+
- active run 中只有一个 pending delegation。child 必须在任何阶段副作用前通过 activation barrier;缺失、超时、错配、fork、重放、hook 不可用或工作区漂移一律暂停(claude-code 路径下 model/effort 证据的缺失或错配、以及该宿主结构上不提供的 fork/spawn-mode 证据,按 `.agents/skills/run-task/reference/host-validation.md` 的记录规则处理,不在此列;`parentId`/`childId` 的缺失或错配仍然暂停)。跨根 package/build/contract 或 hook/profile 内容漂移只输出可交付 warning;本轮 receipt 的 hook/evidence 绑定仍硬校验。
|
|
9
9
|
- 首版成功终点是一次通过既有安全门禁的 `commit`;不创建 PR、不监控 checks、不执行 `complete-task`。
|
|
10
10
|
|
|
11
11
|
## 恢复语义
|
|
12
12
|
|
|
13
|
-
`orchestration.json` 是详细状态源。current run 保存完整策略、append-only 恢复历史、build/contract/hook source/controller provenance 与 activation 单调时钟。读取时只接受当前 writer 的完整结构;未知字段、缺失字段、非法 provenance 或旧 run
|
|
13
|
+
`orchestration.json` 是详细状态源。current run 保存完整策略、append-only 恢复历史、build/contract/hook source/controller provenance 与 activation 单调时钟。读取时只接受当前 writer 的完整结构;未知字段、缺失字段、非法 provenance 或旧 run 一律失败关闭且不改写。遇到无法识别的 `orchestration.json`,保留原文件并提示重建 sandbox 或人工修复后重试,不做 schema 迁移,也不创建 follow-up task。升级 agent-infra 前必须完成或清空所有 active run。prepared orphan 只允许在 deadline 已过、task fingerprint 精确不变、无 authorization 消耗且无匹配的未消费 active lifecycle evidence 时显式恢复。
|
|
14
14
|
|
|
15
15
|
## Codex 宿主与 capability
|
|
16
16
|
|
|
17
|
-
- direct-host 只接受 trusted project 或 managed lifecycle hooks。task-bound sandbox 必须由受控 nested controller 建立隔离 `CODEX_HOME`,仅接受绑定 controller context 的 user hooks;普通 user/plugin hook
|
|
18
|
-
- controller 只有在 control generation、task binding
|
|
17
|
+
- direct-host 只接受 trusted project 或 managed lifecycle hooks。task-bound sandbox 必须由受控 nested controller 建立隔离 `CODEX_HOME`,仅接受绑定 controller context 的 user hooks;普通 user/plugin hook 不得成为证据源。使用本轮实际加载的 hook/profile,内容漂移只记录 warning 并提示重建 sandbox。
|
|
18
|
+
- controller 只有在 control generation、task binding、协议版本、profile 与 hook discovery 全部通过后才能启动 nested loop;build/contract 及内容漂移通过结构化 warning 告知并建议重建 sandbox,不阻塞自然演进。两个 bypass 参数只允许出现在该 task-bound 启动路径。
|
|
19
19
|
- 每次 prepare 前必须 arm 一次性 capability,并由同一当前 loop 的真实 PostToolUse attestation;token 原子消费后保留去敏 tombstone,不能重放或跨 task/session/build/controller 使用。
|
|
20
20
|
|
|
21
21
|
## 模型策略
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Milestone Inference
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
Milestones narrow through declarative Issue intents:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Milestone 推断规则
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
Milestone 继续按生命周期逐步收窄,但候选读取、分支判断、权限降级和写入统一由 `platform-issue` 处理。
|
|
6
6
|
|
|
@@ -110,11 +110,11 @@ This section is a **third standalone rule, co-equal with the two above**, used o
|
|
|
110
110
|
…(one entry per status=needs-human-decision row of this stage in task.md `## 审查分歧账本`)
|
|
111
111
|
|
|
112
112
|
View details:
|
|
113
|
-
- All pending decisions: ai task decisions {task-ref}
|
|
114
|
-
- A single item's full background/options/impact/recommendation: ai task decisions {task-ref} <ordinal|ledger-id>
|
|
113
|
+
- All pending decisions: ai task decisions --task {task-ref}
|
|
114
|
+
- A single item's full background/options/impact/recommendation: ai task decisions --task {task-ref} --item <ordinal|ledger-id>
|
|
115
115
|
|
|
116
116
|
To resolve:
|
|
117
|
-
- ai decide {task-ref} <ordinal|ledger-id> <decision and rationale>
|
|
117
|
+
- ai decide --task {task-ref} --item <ordinal|ledger-id> <decision and rationale>
|
|
118
118
|
|
|
119
119
|
This command atomically creates the `HDR-N` ruling record, flips the target ledger row to `human-decided`, and updates evidence and the activity log; do not manually edit only part of the transaction.
|
|
120
120
|
|
|
@@ -110,11 +110,11 @@ Completed at: YYYY-MM-DD HH:mm:ss
|
|
|
110
110
|
…(task.md `## 审查分歧账本` 中本阶段每个 status=needs-human-decision 行一条)
|
|
111
111
|
|
|
112
112
|
查看详情:
|
|
113
|
-
- 全部待裁决项:ai task decisions {task-ref}
|
|
114
|
-
- 单项完整背景/选项/影响/建议:ai task decisions {task-ref} <序号|账本ID>
|
|
113
|
+
- 全部待裁决项:ai task decisions --task {task-ref}
|
|
114
|
+
- 单项完整背景/选项/影响/建议:ai task decisions --task {task-ref} --item <序号|账本ID>
|
|
115
115
|
|
|
116
116
|
完成裁决:
|
|
117
|
-
- ai decide {task-ref} <序号|账本ID> <裁决内容与理由>
|
|
117
|
+
- ai decide --task {task-ref} --item <序号|账本ID> <裁决内容与理由>
|
|
118
118
|
|
|
119
119
|
该命令原子写入 `HDR-N` 裁定记录、把目标账本行翻为 `human-decided`、更新 evidence 与活动日志;不要手工只修改其中一部分。
|
|
120
120
|
|
|
@@ -85,7 +85,7 @@ Use these checks together:
|
|
|
85
85
|
- **Small-impact exemption**: if it is only a local, reversible, low-cost execution detail, record it under `## Assumptions` instead of upgrading it to a human ruling.
|
|
86
86
|
- **Fallback**: when unsure whether it is key, treat it as key; `review-*` must check whether the executor missed any `[needs-human-decision]` markings that should have been upgraded.
|
|
87
87
|
|
|
88
|
-
> Use `ai task decisions <
|
|
88
|
+
> Use `ai task decisions [--task <ref> | -t <ref>]` to view all pending decisions of a task and their detail blocks.
|
|
89
89
|
|
|
90
90
|
## Human Review Checkpoint Semantics
|
|
91
91
|
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
- **小影响豁免**:若它只是局部、可逆、低成本的执行细节,写入 `## 假设` 即可,不升级为人工裁决。
|
|
86
86
|
- **兜底**:无法判断是否关键时按关键处理;`review-*` 需要复核执行方是否漏标应升级的 `[needs-human-decision]`。
|
|
87
87
|
|
|
88
|
-
> 用户可用 `ai task decisions <
|
|
88
|
+
> 用户可用 `ai task decisions [--task <ref> | -t <ref>]` 查看某任务全部待裁决项及其详情块。
|
|
89
89
|
|
|
90
90
|
## 人工审查检查点语义
|
|
91
91
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Summary Synchronization
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, the marker, current HEAD, paginated comment lookup, and create/update/no-op reconciliation.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ The model writes the semantic reviewer summary. Typed core owns canonical artifa
|
|
|
10
10
|
agent-infra-internal platform-pr summary-context {task-id}
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Use only the returned latest canonical `plan*`, `review-plan*`, `code*`, `review-code*`, and `manual-validation
|
|
13
|
+
Use only the returned latest canonical `plan*`, `review-plan*`, `code*`, `review-code*`, and `manual-validation*` for lifecycle claims. The summary covers scope, tests, review history, and exactly one manual-validation state. It also includes a `### PR Code Changes` section based on authoritative base/head facts from `platform-pr inspect` and the complete `git diff --find-renames --numstat base...head`, with reconciled runtime, test, skill/rule, template, documentation, and other categories plus rename, mechanical-mirror, and unnecessary-change analysis.
|
|
14
14
|
|
|
15
15
|
## Publish
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR Summary Synchronization
|
|
2
2
|
|
|
3
|
-
> `--agent` values
|
|
3
|
+
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
4
4
|
|
|
5
5
|
The model writes the semantic reviewer summary. Typed core owns canonical artifact selection, marker/HEAD wrapping, paginated comment lookup, and reconciliation.
|
|
6
6
|
|
|
@@ -31,9 +31,10 @@ The canonical comment envelope produced by the core is:
|
|
|
31
31
|
### Key Technical Decisions
|
|
32
32
|
### Review History
|
|
33
33
|
### Test Results
|
|
34
|
+
### PR Code Changes
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
Canonical inputs include `manual-validation.md`. The manual-validation section is one of `### ✅ Manual Validation Passed`, `### ⚠️ Manual Verification Required`, or `### ✅ No Manual Verification Needed`; `complete-manual-validation` refreshes the same summary in place.
|
|
37
|
+
Canonical inputs include `manual-validation.md`. The manual-validation section is one of `### ✅ Manual Validation Passed`, `### ⚠️ Manual Verification Required`, or `### ✅ No Manual Verification Needed`; `complete-manual-validation` refreshes the same summary in place. The PR code-change section uses authoritative base/head facts from `platform-pr inspect` and the complete `git diff --find-renames --numstat base...head`, reconciles runtime, test, skill/rule, template, documentation, and other categories, and explains renames, mechanical mirrors, and potentially unnecessary changes.
|
|
37
38
|
|
|
38
39
|
```bash
|
|
39
40
|
agent-infra-internal task-warning {task-id} add --step {step} --severity WARNING \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 摘要同步
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 摘要的语义聚合由模型完成;canonical 产物选择、marker、当前 HEAD、分页评论查找和 create/update/no-op 由 typed core 负责。
|
|
6
6
|
|
|
@@ -24,6 +24,7 @@ agent-infra-internal platform-pr summary-context {task-id}
|
|
|
24
24
|
- 测试结果
|
|
25
25
|
- 审查历程与当前结论
|
|
26
26
|
- 人工校验三态:`### ⚠️ 需人工校验`、`### ✅ 人工验证已通过` 或 `### ✅ 无需人工校验`
|
|
27
|
+
- `### PR 代码增减`:基于 `platform-pr inspect` 的权威 base/head 和完整 `git diff --find-renames --numstat base...head`,按运行时代码、测试、Skill/规则、模板、文档及其他分类核算,并说明 rename、机械镜像与疑似不必要变化
|
|
27
28
|
|
|
28
29
|
保留人工校验项时,每条写明校验内容、定位和只能人工完成的原因。
|
|
29
30
|
|
|
@@ -37,6 +38,7 @@ core 最终包装出的 canonical 评论结构为:
|
|
|
37
38
|
### 关键技术决策
|
|
38
39
|
### 审查历程
|
|
39
40
|
### 测试结果
|
|
41
|
+
### PR 代码增减
|
|
40
42
|
```
|
|
41
43
|
|
|
42
44
|
## 发布
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PR 摘要同步
|
|
2
2
|
|
|
3
|
-
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token
|
|
3
|
+
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
4
4
|
|
|
5
5
|
PR 摘要的语义聚合由模型完成;canonical 产物选择、marker、当前 HEAD、分页评论查找和 create/update/no-op 由 typed core 负责。
|
|
6
6
|
|
|
@@ -16,6 +16,7 @@ agent-infra-internal platform-pr summary-context {task-id}
|
|
|
16
16
|
- 测试结果
|
|
17
17
|
- 审查历程与当前结论
|
|
18
18
|
- 人工校验三态:`### ⚠️ 需人工校验`、`### ✅ 人工验证已通过` 或 `### ✅ 无需人工校验`
|
|
19
|
+
- `### PR 代码增减`:基于 `platform-pr inspect` 的权威 base/head 和完整 `git diff --find-renames --numstat base...head`,按运行时代码、测试、Skill/规则、模板、文档及其他分类核算,并说明 rename、机械镜像与疑似不必要变化
|
|
19
20
|
|
|
20
21
|
保留人工校验项时,每条写明校验内容、定位和只能人工完成的原因。
|
|
21
22
|
|
|
@@ -14,6 +14,12 @@ agent-infra-internal platform-release-notes context \
|
|
|
14
14
|
|
|
15
15
|
The result contains `history`, `pullRequests`, `closingIssues`, and commit `authors` with normalized `login` / `resolution` values. `status: no-op` with error code `PLATFORM_RELEASE_NOTES_UNSUPPORTED` means the current platform does not support remote release-note operations.
|
|
16
16
|
|
|
17
|
+
### Identity Safety Boundary
|
|
18
|
+
|
|
19
|
+
- Render an identity as `@login` only when `resolution` is `platform-user` or `platform-noreply` and `login` is non-empty.
|
|
20
|
+
- Exclude `resolution: unresolved` identities from the release-note contributor list. Never infer a login from a name, email address, domain, brand, or same-named platform account, and never substitute a guessed personal or organization account.
|
|
21
|
+
- Do not publish unresolved identity emails or identity-verification TODOs in Release notes. Record any required investigation outside the release workflow without creating a platform mention.
|
|
22
|
+
|
|
17
23
|
## Stage Release Notes
|
|
18
24
|
|
|
19
25
|
```bash
|
|
@@ -14,6 +14,12 @@ agent-infra-internal platform-release-notes context \
|
|
|
14
14
|
|
|
15
15
|
结果包含 `history`、`pullRequests`、`closingIssues` 和带规范化 `login` / `resolution` 的 commit `authors`。`status: no-op` 且错误码为 `PLATFORM_RELEASE_NOTES_UNSUPPORTED` 表示当前平台不支持远端发布说明能力。
|
|
16
16
|
|
|
17
|
+
### 身份安全边界
|
|
18
|
+
|
|
19
|
+
- 只有 `resolution` 为 `platform-user` 或 `platform-noreply` 且 `login` 非空的身份可以渲染为 `@login`。
|
|
20
|
+
- `resolution: unresolved` 的身份不得进入发布说明的贡献者列表;不得从 Name、邮箱、域名、品牌或同名平台账号推断 login,也不得替换成推测的个人或组织账号。
|
|
21
|
+
- 不得把未解析身份的邮箱或身份确认 TODO 写入可发布的 Release notes。需要调查时仅在发布流程外记录,不得产生平台 mention。
|
|
22
|
+
|
|
17
23
|
## Stage Release notes
|
|
18
24
|
|
|
19
25
|
```bash
|
|
@@ -82,7 +82,7 @@ When an executor judges an item to be a key design decision that needs human rul
|
|
|
82
82
|
- `severity` is always `decision`.
|
|
83
83
|
- `status` starts as `needs-human-decision`, so the existing gate blocks it.
|
|
84
84
|
- `evidence` points to the stable anchor `<artifact>#HD-N` (e.g. `plan-r2.md#HD-1`), not a drift-prone line number.
|
|
85
|
-
- A human records the ruling with `ai decide <
|
|
85
|
+
- A human records the ruling with `ai decide [--task <ref> | -t <ref>] (--item <ordinal|ledger-id> | -i <ordinal|ledger-id>) <decision>`; the command flips the target row to `human-decided` and points `evidence` to an independent `HDR-N` ruling record.
|
|
86
86
|
|
|
87
87
|
> Viewing, deciding, and typed verification share the `lib/task/ledger.ts` domain semantics; no second parser is maintained.
|
|
88
88
|
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
- `severity` 固定填 `decision`。
|
|
83
83
|
- `status` 初始填 `needs-human-decision`,因此会被现有 gate 阻塞。
|
|
84
84
|
- `evidence` 指向稳定锚点 `<artifact>#HD-N`(如 `plan-r2.md#HD-1`),不依赖易漂移的行号。
|
|
85
|
-
- 人工使用 `ai decide <
|
|
85
|
+
- 人工使用 `ai decide [--task <ref> | -t <ref>] (--item <序号|账本ID> | -i <序号|账本ID>) <裁决内容>` 记录裁定;命令把目标行翻为 `human-decided`,并让 `evidence` 指向独立 `HDR-N` 裁定记录。
|
|
86
86
|
|
|
87
87
|
> 查看、裁决与 typed verification 共用 `lib/task/ledger.ts` 的领域语义,不维护第二 parser。
|
|
88
88
|
|
|
@@ -43,6 +43,7 @@ mandatory when matched, and `report_evidence` defines the audit trail.
|
|
|
43
43
|
|
|
44
44
|
| lens_id | stages | observable_trigger | required_reference | report_evidence |
|
|
45
45
|
|---------|--------|--------------------|--------------------|-----------------|
|
|
46
|
+
| compatibility-budget | analysis, plan, code | Requirements, plans, or implementation add, extend, migrate, or remove old behavior, schemas, entry points, aliases, adapters, wrappers, shims, dual writes, or compatibility reads | `.agents/rules/compatibility-policy.md` | Record the subject, necessity, window, and exit condition, or confirm current-only |
|
|
46
47
|
| documentation-antipatterns | code | The complete change context touches Markdown, rules, skills, CLI help, or user documentation that describes current behavior | `.agents/skills/review-code/reference/documentation-antipatterns.md` | Record triggering files, `loaded=yes`, and the lens result |
|
|
47
48
|
| testing-discipline | code | The complete change context touches tests, fixtures, snapshots, or test helpers | `.agents/rules/testing-discipline.md` | Record triggering files, `loaded=yes`, and the test-discipline result |
|
|
48
49
|
| security-risks | code | Authentication, authorization, untrusted input, sensitive data, credentials, cryptography, dependencies, or system boundaries change | `.agents/skills/review-code/reference/security-risks.md` | Record the changed security boundary, `loaded=yes`, and the lens result |
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
| lens_id | stages | observable_trigger | required_reference | report_evidence |
|
|
37
37
|
|---------|--------|--------------------|--------------------|-----------------|
|
|
38
|
+
| compatibility-budget | analysis, plan, code | 需求、方案或实现新增、延长、迁移或删除旧行为、旧 schema、旧入口、alias、adapter、wrapper、shim、双写或兼容读取 | `.agents/rules/compatibility-policy.md` | 记录兼容对象、必要性、期限、退出条件,或确认 current-only |
|
|
38
39
|
| documentation-antipatterns | code | 完整变更上下文触及描述当前行为的 Markdown、规则、skill、CLI 帮助或用户文档 | `.agents/skills/review-code/reference/documentation-antipatterns.md` | 记录触发文件、`loaded=yes` 与检视结果 |
|
|
39
40
|
| testing-discipline | code | 完整变更上下文触及测试、fixture、snapshot 或测试 helper | `.agents/rules/testing-discipline.md` | 记录触发文件、`loaded=yes` 与测试纪律结论 |
|
|
40
41
|
| security-risks | code | 认证授权、非可信输入、敏感数据、凭据、加密、依赖或系统边界发生变化 | `.agents/skills/review-code/reference/security-risks.md` | 记录安全边界变化、`loaded=yes` 与检视结果 |
|
|
@@ -23,9 +23,8 @@ Map user intent to the corresponding workflow command:
|
|
|
23
23
|
|
|
24
24
|
`--agent` values must converge on the standard AI collaborator tokens; OS usernames (e.g. `devuser`) and git usernames (e.g. a human name) are forbidden. The standard set (short tokens are the single source of truth for the activity log):
|
|
25
25
|
|
|
26
|
-
- AI short tokens: `claude` / `codex` / `antigravity` / `opencode` / `cursor`
|
|
26
|
+
- AI short tokens: `claude` / `codex` / `antigravity` / `opencode` / `cursor` / `traecli`
|
|
27
27
|
- Long-name mapping (normalized to the short token before writing): `claude-code` -> `claude`, `antigravity-cli` -> `antigravity`
|
|
28
|
-
- Historical `gemini` / `gemini-cli` remain read-only for `ai task log` rendering and are not writable
|
|
29
28
|
- Manual-step exception: no matter which agent is used, a human-made decision is always declared as `human`
|
|
30
29
|
|
|
31
30
|
The seven internal commands (`task-event` / `task-lifecycle` / `task-finalization` / `platform-issue` / `platform-comment` / `platform-pr` / `task-orchestration`) hard-validate `--agent` against a whitelist: they accept a short token, a long name, or `human`, and reject non-standard values with the matching `*_PAYLOAD_INVALID` error; long names are normalized to the short token before being persisted or forwarded. The `ai task log` renderer keeps unknown tokens grouped as `human` but appends a visible `(unknown)` marker.
|
|
@@ -23,9 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
`--agent` 取值必须收敛到标准 AI 合作者 token,禁止填入 OS 系统用户名(如 `devuser`)或 git 用户名(如 `季聿阶`)。标准集合(短名为活动日志唯一事实来源):
|
|
25
25
|
|
|
26
|
-
- AI 短名:`claude` / `codex` / `antigravity` / `opencode` / `cursor`
|
|
26
|
+
- AI 短名:`claude` / `codex` / `antigravity` / `opencode` / `cursor` / `traecli`
|
|
27
27
|
- 长名映射(写入前归一化为短名):`claude-code` → `claude`、`antigravity-cli` → `antigravity`
|
|
28
|
-
- 历史 `gemini` / `gemini-cli` 仅保留 `ai task log` 渲染兼容,不接受写入
|
|
29
28
|
- 人工步骤例外:无论使用哪个 Agent,只要是人做的决定,统一声明 `human`
|
|
30
29
|
|
|
31
30
|
七个内部命令(`task-event` / `task-lifecycle` / `task-finalization` / `platform-issue` / `platform-comment` / `platform-pr` / `task-orchestration`)对 `--agent` 做白名单硬校验:接受短名、长名或 `human`,非标准值返回对应 `*_PAYLOAD_INVALID` 错误;长名在落库/透传前归一化为短名。渲染端 `ai task log` 对无法识别的 token 保留 `human` 归类并附加 `(unknown)` 标记。
|