@wnlen/agent-execution-template 0.8.20 → 0.8.22
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 +25 -2
- package/README.zh-CN.md +18 -0
- package/bin/agent-execution-template.js +129 -63
- package/docs/SPEC.md +65 -12
- package/package.json +1 -1
- package/template/en/ai/README.md +4 -1
- package/template/en/ai/project/task.md +13 -53
- package/template/en/ai/template/VERSION +1 -1
- package/template/en/ai/template/bootstrap.md +4 -1
- package/template/en/ai/template/execution-policy.md +28 -1
- package/template/en/ai/template/prompt.md +20 -11
- package/template/en/ai/template/protocol.md +16 -3
- package/template/zh/ai/README.md +2 -0
- package/template/zh/ai/project/task.md +8 -52
- package/template/zh/ai/template/VERSION +1 -1
- package/template/zh/ai/template/bootstrap.md +3 -1
- package/template/zh/ai/template/execution-policy.md +25 -2
- package/template/zh/ai/template/prompt.md +16 -9
- package/template/zh/ai/template/protocol.md +9 -0
- package/test/selftest.js +94 -22
|
@@ -7,61 +7,11 @@ readiness: "draft_for_confirmation | ready_to_execute | blocked"
|
|
|
7
7
|
depends_on_previous_result: false
|
|
8
8
|
execution_policy:
|
|
9
9
|
mode: "auto | normal | bounded_continuous"
|
|
10
|
-
activation_rule: "auto_enable_when_l1_count_gte_2"
|
|
11
|
-
max_depth: 3
|
|
12
|
-
allow_depth_4_when_needed: true
|
|
13
|
-
progress_unit: "vertical_slice"
|
|
14
|
-
l1_granularity: "independently_acceptable_vertical_slice"
|
|
15
|
-
write_back_policy: "l1_start_done_red_blocked_scope_change_final"
|
|
16
10
|
task_tree:
|
|
17
11
|
- id: "L1-1"
|
|
18
12
|
title: ""
|
|
19
13
|
risk: "Green | Yellow | Red"
|
|
20
14
|
status: "pending | running | done | blocked"
|
|
21
|
-
scope:
|
|
22
|
-
allowed: []
|
|
23
|
-
denied: []
|
|
24
|
-
acceptance: []
|
|
25
|
-
evidence: []
|
|
26
|
-
children: []
|
|
27
|
-
checkpoint_budget:
|
|
28
|
-
l1: 0
|
|
29
|
-
l2: 0
|
|
30
|
-
l3: 0
|
|
31
|
-
l4: 0
|
|
32
|
-
checkpoint_triggers:
|
|
33
|
-
- before_crossing_boundary
|
|
34
|
-
- after_vertical_slice
|
|
35
|
-
- before_final_review
|
|
36
|
-
auto_continue:
|
|
37
|
-
green: true
|
|
38
|
-
yellow: "low_risk_only"
|
|
39
|
-
red: false
|
|
40
|
-
risk_gate:
|
|
41
|
-
green: "continue"
|
|
42
|
-
yellow: "continue_with_local_fix"
|
|
43
|
-
red: "stop_for_human"
|
|
44
|
-
evidence_required: true
|
|
45
|
-
model_policy:
|
|
46
|
-
default_tier: "cheap"
|
|
47
|
-
allowed_tiers:
|
|
48
|
-
- cheap
|
|
49
|
-
- standard
|
|
50
|
-
- strong
|
|
51
|
-
escalation_allowed: true
|
|
52
|
-
escalation_triggers:
|
|
53
|
-
- ambiguous_goal
|
|
54
|
-
- ambiguous_acceptance
|
|
55
|
-
- high_risk_change
|
|
56
|
-
- architecture_boundary
|
|
57
|
-
- repeated_failure
|
|
58
|
-
- verification_dispute
|
|
59
|
-
strong_model_roles:
|
|
60
|
-
- planning
|
|
61
|
-
- risk_judgment
|
|
62
|
-
- architecture_review
|
|
63
|
-
- failure_review
|
|
64
|
-
- acceptance_judgment
|
|
65
15
|
refs:
|
|
66
16
|
required: []
|
|
67
17
|
optional: []
|
|
@@ -92,6 +42,13 @@ If this run creates or rewrites the task contract, keep
|
|
|
92
42
|
`readiness = draft_for_confirmation` by default and stop at the handoff. Enter
|
|
93
43
|
execution only when an existing task is explicitly `ready_to_execute`.
|
|
94
44
|
|
|
45
|
+
Default to a compact task contract. A single-L1, Green, low-risk task should
|
|
46
|
+
write only the goal, scope, acceptance, permissions, verification commands, and
|
|
47
|
+
minimal `execution_policy.task_tree`. Multi-L1, Yellow/Red, cross-module,
|
|
48
|
+
continuously executed, or highly uncertain tasks may expand checkpoint, model
|
|
49
|
+
policy, risk gate, and fuller task-tree fields as needed. The complete default
|
|
50
|
+
rules live in `ai/template/execution-policy.md`.
|
|
51
|
+
|
|
95
52
|
## Goal
|
|
96
53
|
|
|
97
54
|
Describe the exact goal of this task. If generated from a short human request,
|
|
@@ -135,7 +92,8 @@ The task is complete when:
|
|
|
135
92
|
Default to `auto`. The AI decides during pre-execution planning whether to use
|
|
136
93
|
continuous execution; it does not wait for a human keyword. If planning finds
|
|
137
94
|
fewer than 2 L1 tasks, use `normal`; if it finds 2 or more L1 tasks, use
|
|
138
|
-
`bounded_continuous` automatically.
|
|
95
|
+
`bounded_continuous` automatically. Each L1 must be an independently acceptable
|
|
96
|
+
vertical slice.
|
|
139
97
|
|
|
140
98
|
`bounded_continuous` means bounded continuous execution:
|
|
141
99
|
|
|
@@ -167,8 +125,10 @@ fewer than 2 L1 tasks, use `normal`; if it finds 2 or more L1 tasks, use
|
|
|
167
125
|
architecture direction, or acceptance.
|
|
168
126
|
- `progress_unit` defaults to `vertical_slice`: each work loop should produce
|
|
169
127
|
a reviewable increment.
|
|
170
|
-
-
|
|
171
|
-
|
|
128
|
+
- Compact tasks should not expand internal control fields such as
|
|
129
|
+
`checkpoint_budget` or `model_policy`.
|
|
130
|
+
- Expanded tasks may add checkpoint budgets, model policy, risk gates, and
|
|
131
|
+
fuller node fields as needed.
|
|
172
132
|
- Emit checkpoints only when risk changes from Green to Yellow/Red, scope or
|
|
173
133
|
permission is about to expand, an L1 vertical slice is complete, verification
|
|
174
134
|
failed but execution is about to continue, or final wrap-up is about to start.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.8.
|
|
1
|
+
0.8.22
|
|
@@ -44,7 +44,7 @@ runtime files, result files, or metrics files during bootstrap.
|
|
|
44
44
|
|
|
45
45
|
Read high-signal project evidence in this order:
|
|
46
46
|
|
|
47
|
-
1. Root docs: `README*`, `
|
|
47
|
+
1. Root docs: `README*`, `CONTRIBUTING*`, `CHANGELOG*`
|
|
48
48
|
2. Manifests: `package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`,
|
|
49
49
|
`pom.xml`, `build.gradle*`, `Makefile`
|
|
50
50
|
3. Project docs: `docs/**`, preferring overview, architecture, setup, testing,
|
|
@@ -62,6 +62,9 @@ bounded read:
|
|
|
62
62
|
project purpose, module boundaries, commands, and constraints;
|
|
63
63
|
- do not read the whole codebase unless the human explicitly authorizes it.
|
|
64
64
|
|
|
65
|
+
Do not treat `AGENTS.md` or `CLAUDE.md` as project business evidence; they are
|
|
66
|
+
AI entrypoint routing files only.
|
|
67
|
+
|
|
65
68
|
Do not read dependency folders, build outputs, coverage outputs, lockfiles
|
|
66
69
|
except to infer package manager, secret files, environment files, or archives
|
|
67
70
|
unless the human explicitly references them.
|
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
Do not summarize this file.
|
|
4
4
|
During task execution, use this file to choose `normal` or `bounded_continuous`.
|
|
5
5
|
|
|
6
|
+
## Task Contract Shapes
|
|
7
|
+
|
|
8
|
+
`ai/project/task.md` has two valid shapes:
|
|
9
|
+
|
|
10
|
+
- Compact task contract: for single-L1, Green, low-risk tasks. Write only the
|
|
11
|
+
goal, scope, acceptance, permissions, verification commands, and minimal
|
|
12
|
+
`execution_policy.task_tree`; do not expand internal control fields such as
|
|
13
|
+
`checkpoint_budget` or `model_policy`.
|
|
14
|
+
- Expanded task contract: for multi-L1, Yellow/Red, cross-module, continuously
|
|
15
|
+
executed, highly uncertain, or high-risk tasks. Expand checkpoint, model
|
|
16
|
+
policy, risk gate, and fuller task-tree fields only when needed.
|
|
17
|
+
|
|
18
|
+
Prefer compact by default. Upgrade to expanded only when complexity, risk, or
|
|
19
|
+
auditability makes the extra structure worthwhile. The complete execution rules
|
|
20
|
+
live in this file and do not need to be repeated in every task draft.
|
|
21
|
+
|
|
6
22
|
## Default Policy
|
|
7
23
|
|
|
8
24
|
The default execution policy is `auto`: before each execution, the AI first
|
|
@@ -25,6 +41,8 @@ Pre-execution planning must:
|
|
|
25
41
|
- Stop for human confirmation first if any L1 is Red; Green and Yellow do not
|
|
26
42
|
block startup.
|
|
27
43
|
- Write the task tree to `execution_policy.task_tree` in `ai/project/task.md`.
|
|
44
|
+
Simple tasks should write only minimal L1 nodes; complex tasks can add
|
|
45
|
+
`scope`, `acceptance`, `evidence`, `children`, and related fields.
|
|
28
46
|
|
|
29
47
|
## Task Tree
|
|
30
48
|
|
|
@@ -48,7 +66,16 @@ Execute the task tree in L1 -> L2 -> L3 order.
|
|
|
48
66
|
- During execution, use `pending`, `running`, `done`, or `blocked` for node
|
|
49
67
|
status.
|
|
50
68
|
|
|
51
|
-
|
|
69
|
+
Minimal node shape:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
id: "L1-1"
|
|
73
|
+
title: ""
|
|
74
|
+
risk: "Green | Yellow | Red"
|
|
75
|
+
status: "pending | running | done | blocked"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Recommended node shape for complex tasks:
|
|
52
79
|
|
|
53
80
|
```yaml
|
|
54
81
|
id: "L1-1"
|
|
@@ -5,23 +5,25 @@ Execute the workflow below.
|
|
|
5
5
|
|
|
6
6
|
You are operating inside an Agent Execution Template workspace.
|
|
7
7
|
|
|
8
|
-
First read:
|
|
8
|
+
This file only routes the workflow. First read minimal state:
|
|
9
9
|
|
|
10
|
-
1. `ai/
|
|
11
|
-
2. `ai/
|
|
12
|
-
3. `ai/
|
|
10
|
+
1. `ai/project/project.md` if present
|
|
11
|
+
2. `ai/project/task.md` if present
|
|
12
|
+
3. Shallow listings of `ai/project/inbox/`, `ai/project/inbox/ideas/`, and `ai/project/proposals/final-shape-updates/`
|
|
13
13
|
|
|
14
14
|
Then choose the mode:
|
|
15
15
|
|
|
16
16
|
- If the user asks to update the North Star, final shape, product constitution,
|
|
17
17
|
module map, roadmap, or project direction, or if
|
|
18
18
|
`ai/project/inbox/ideas/` contains non-`.gitkeep` ideas waiting for
|
|
19
|
-
evaluation,
|
|
20
|
-
then
|
|
19
|
+
evaluation, read `ai/template/protocol.md`, `ai/template/rules/core.md`, and
|
|
20
|
+
relevant direction refs, then draft a `strategy_update` task or produce the
|
|
21
|
+
proposal directly, then stop for human confirmation.
|
|
21
22
|
- If the user explicitly confirms that a proposal under
|
|
22
23
|
`ai/project/proposals/final-shape-updates/*.md` may be merged, draft or
|
|
23
|
-
execute an `apply_strategy_update` task
|
|
24
|
-
`
|
|
24
|
+
execute an `apply_strategy_update` task after reading
|
|
25
|
+
`ai/template/protocol.md` and `ai/template/rules/core.md`. If the proposal is
|
|
26
|
+
still `proposed`, update it to `accepted` based on that explicit confirmation.
|
|
25
27
|
- If the user says "Start initializing this project and absorb the material in ai/project/inbox/",
|
|
26
28
|
or asks to initialize while also absorbing material from
|
|
27
29
|
`ai/project/inbox/`, inspect `ai/project/project.md` first. If it already
|
|
@@ -54,7 +56,8 @@ Then choose the mode:
|
|
|
54
56
|
the human hunt through files for gaps.
|
|
55
57
|
- Use Execution Mode only after `ai/project/project.md` and
|
|
56
58
|
`ai/project/task.md` are ready enough to define identity, goal, scope,
|
|
57
|
-
permission, and acceptance.
|
|
59
|
+
permission, and acceptance. Only then read `ai/template/protocol.md`,
|
|
60
|
+
`ai/template/rules/core.md`, and `ai/template/execution-policy.md`.
|
|
58
61
|
|
|
59
62
|
## Task Draft Handoff
|
|
60
63
|
|
|
@@ -64,11 +67,17 @@ In Task Draft Mode:
|
|
|
64
67
|
2. Infer goal, scope, acceptance, permissions, verification method, and initial
|
|
65
68
|
risk from the user's current goal, project context, and repository facts; do
|
|
66
69
|
not require the human to provide each field upfront.
|
|
67
|
-
3. Draft `ai/project/task.md
|
|
70
|
+
3. Draft `ai/project/task.md`. For a single-L1, Green, low-risk task, default to
|
|
71
|
+
a compact task contract: write only the goal, scope, acceptance, permissions,
|
|
72
|
+
verification commands, and minimal `execution_policy.task_tree`. Use an
|
|
73
|
+
expanded task contract only for multi-L1, Yellow/Red, cross-module,
|
|
74
|
+
continuously executed, or highly uncertain tasks.
|
|
68
75
|
4. Before execution, list the L1 checklist, mark each L1 Green / Yellow / Red,
|
|
69
76
|
and write it to `execution_policy.task_tree`. Use `normal` if there are
|
|
70
77
|
fewer than 2 L1 tasks; automatically use `bounded_continuous` if there are 2
|
|
71
|
-
or more L1 tasks.
|
|
78
|
+
or more L1 tasks. The complete default rules live in
|
|
79
|
+
`ai/template/execution-policy.md`; do not mechanically copy internal control
|
|
80
|
+
fields such as `checkpoint_budget` or `model_policy` into simple task drafts.
|
|
72
81
|
5. If this run creates or rewrites `ai/project/task.md`, set `readiness` to
|
|
73
82
|
`draft_for_confirmation` and stop at the handoff; do not execute while the
|
|
74
83
|
task is still a draft.
|
|
@@ -5,12 +5,18 @@ execution context.
|
|
|
5
5
|
|
|
6
6
|
```text
|
|
7
7
|
ai/template/ = reusable execution protocol
|
|
8
|
-
ai/project/ = current
|
|
8
|
+
ai/project/ = current repo execution context
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Template is protocol. Project is
|
|
11
|
+
Template is protocol. Project is repo-local context.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Here, "repo execution context" means the repo-local `ai/project/**` context,
|
|
14
|
+
not an external workspace / session / sandbox runtime. An external
|
|
15
|
+
runtime may enter the repository and read this protocol, but should not replace
|
|
16
|
+
`task.md`, file modification rules, acceptance criteria, or concrete coding
|
|
17
|
+
context.
|
|
18
|
+
|
|
19
|
+
The repo-local context stores both execution state and direction. The direction
|
|
14
20
|
layer answers "why is this worth doing and where should the project grow"; the
|
|
15
21
|
execution layer answers "what is this task and how will it be accepted."
|
|
16
22
|
|
|
@@ -61,6 +67,13 @@ rewrites the task contract, stop at the confirmation handoff. Only Red stops for
|
|
|
61
67
|
human confirmation, and Yellow only permits local low-risk correction inside the
|
|
62
68
|
current L1/L2.
|
|
63
69
|
|
|
70
|
+
Task contracts are layered by complexity. A single-L1, Green, low-risk task uses
|
|
71
|
+
a compact task contract with only the goal, scope, acceptance, permissions,
|
|
72
|
+
verification commands, and minimal `execution_policy.task_tree`. Multi-L1,
|
|
73
|
+
Yellow/Red, cross-module, continuously executed, or highly uncertain tasks use
|
|
74
|
+
an expanded task contract and may include checkpoint, model policy, and fuller
|
|
75
|
+
task-tree fields as needed.
|
|
76
|
+
|
|
64
77
|
Task tree, risk rubric, checkpoint evidence, and `task_tree` write-back rules
|
|
65
78
|
are defined in `ai/template/execution-policy.md`.
|
|
66
79
|
|
package/template/zh/ai/README.md
CHANGED
|
@@ -7,61 +7,11 @@ readiness: "draft_for_confirmation | ready_to_execute | blocked"
|
|
|
7
7
|
depends_on_previous_result: false
|
|
8
8
|
execution_policy:
|
|
9
9
|
mode: "auto | normal | bounded_continuous"
|
|
10
|
-
activation_rule: "auto_enable_when_l1_count_gte_2"
|
|
11
|
-
max_depth: 3
|
|
12
|
-
allow_depth_4_when_needed: true
|
|
13
|
-
progress_unit: "vertical_slice"
|
|
14
|
-
l1_granularity: "independently_acceptable_vertical_slice"
|
|
15
|
-
write_back_policy: "l1_start_done_red_blocked_scope_change_final"
|
|
16
10
|
task_tree:
|
|
17
11
|
- id: "L1-1"
|
|
18
12
|
title: ""
|
|
19
13
|
risk: "Green | Yellow | Red"
|
|
20
14
|
status: "pending | running | done | blocked"
|
|
21
|
-
scope:
|
|
22
|
-
allowed: []
|
|
23
|
-
denied: []
|
|
24
|
-
acceptance: []
|
|
25
|
-
evidence: []
|
|
26
|
-
children: []
|
|
27
|
-
checkpoint_budget:
|
|
28
|
-
l1: 0
|
|
29
|
-
l2: 0
|
|
30
|
-
l3: 0
|
|
31
|
-
l4: 0
|
|
32
|
-
checkpoint_triggers:
|
|
33
|
-
- before_crossing_boundary
|
|
34
|
-
- after_vertical_slice
|
|
35
|
-
- before_final_review
|
|
36
|
-
auto_continue:
|
|
37
|
-
green: true
|
|
38
|
-
yellow: "low_risk_only"
|
|
39
|
-
red: false
|
|
40
|
-
risk_gate:
|
|
41
|
-
green: "continue"
|
|
42
|
-
yellow: "continue_with_local_fix"
|
|
43
|
-
red: "stop_for_human"
|
|
44
|
-
evidence_required: true
|
|
45
|
-
model_policy:
|
|
46
|
-
default_tier: "cheap"
|
|
47
|
-
allowed_tiers:
|
|
48
|
-
- cheap
|
|
49
|
-
- standard
|
|
50
|
-
- strong
|
|
51
|
-
escalation_allowed: true
|
|
52
|
-
escalation_triggers:
|
|
53
|
-
- ambiguous_goal
|
|
54
|
-
- ambiguous_acceptance
|
|
55
|
-
- high_risk_change
|
|
56
|
-
- architecture_boundary
|
|
57
|
-
- repeated_failure
|
|
58
|
-
- verification_dispute
|
|
59
|
-
strong_model_roles:
|
|
60
|
-
- planning
|
|
61
|
-
- risk_judgment
|
|
62
|
-
- architecture_review
|
|
63
|
-
- failure_review
|
|
64
|
-
- acceptance_judgment
|
|
65
15
|
refs:
|
|
66
16
|
required: []
|
|
67
17
|
optional: []
|
|
@@ -86,6 +36,11 @@ permission:
|
|
|
86
36
|
`Red`,等待确认。本轮新建或重写任务契约时,默认保持 `draft_for_confirmation` 并停下交接;
|
|
87
37
|
只有既有任务为 `ready_to_execute` 时才执行。
|
|
88
38
|
|
|
39
|
+
默认使用 compact task contract。单 L1、Green、低风险任务只写目标、范围、验收、
|
|
40
|
+
权限、验证命令和最小 `execution_policy.task_tree`。多 L1、Yellow/Red、跨模块、
|
|
41
|
+
连续执行或高不确定任务才按需展开 checkpoint、模型策略、风险门和更完整任务树字段。
|
|
42
|
+
完整默认规则见 `ai/template/execution-policy.md`。
|
|
43
|
+
|
|
89
44
|
## 目标
|
|
90
45
|
|
|
91
46
|
描述这个任务的准确目标。如果由简短人类请求生成,保留用户意图并明确写出假设。
|
|
@@ -124,7 +79,7 @@ permission:
|
|
|
124
79
|
## 执行策略
|
|
125
80
|
|
|
126
81
|
默认 `auto`:AI 执行前规划并决定是否连续执行,不等用户口令。L1 < 2 用 `normal`;
|
|
127
|
-
L1 >= 2 自动用 `bounded_continuous`。
|
|
82
|
+
L1 >= 2 自动用 `bounded_continuous`。L1 必须是可独立验收的垂直切片。
|
|
128
83
|
|
|
129
84
|
`bounded_continuous` 表示边界内连续执行:
|
|
130
85
|
|
|
@@ -143,7 +98,8 @@ L1 >= 2 自动用 `bounded_continuous`。
|
|
|
143
98
|
- 只有 Red 停下来让人类确认;Green 自动继续,Yellow 只允许当前 L1/L2 内的局部
|
|
144
99
|
低风险修正,不能改变公共接口、数据模型、权限、安全、架构方向或验收标准。
|
|
145
100
|
- `progress_unit` 默认为 `vertical_slice`:每轮都应产生可检查增量。
|
|
146
|
-
- `checkpoint_budget`
|
|
101
|
+
- compact 任务不要展开 `checkpoint_budget`、`model_policy` 等内部控制字段。
|
|
102
|
+
- expanded 任务可以按需增加 checkpoint 预算、模型策略、风险门和更完整节点字段。
|
|
147
103
|
- 只有在风险从 Green 变 Yellow/Red、即将扩大范围或权限、完成 L1 垂直切片、
|
|
148
104
|
验证失败后准备继续、准备最终收尾时才输出 Checkpoint。
|
|
149
105
|
- 每个 Checkpoint 必须包含证据:已改文件、已运行命令、验证结果或无法验证的原因。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.8.
|
|
1
|
+
0.8.22
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
按下面顺序读取高价值项目证据:
|
|
38
38
|
|
|
39
|
-
1. 根目录文档:`README*`、`
|
|
39
|
+
1. 根目录文档:`README*`、`CONTRIBUTING*`、`CHANGELOG*`
|
|
40
40
|
2. 清单文件:`package.json`、`pyproject.toml`、`Cargo.toml`、`go.mod`、
|
|
41
41
|
`pom.xml`、`build.gradle*`、`Makefile`
|
|
42
42
|
3. 项目文档:`docs/**`,优先阅读概览、架构、安装、测试、部署、API、ADR 和决策文件
|
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
- 只读取足够识别目的、模块边界、命令和约束的路由、模块、配置和测试文件;
|
|
52
52
|
- 除非人类明确授权,不要读取整个代码库。
|
|
53
53
|
|
|
54
|
+
不要把 `AGENTS.md` 或 `CLAUDE.md` 当作项目业务证据;它们只是 AI 入口路由文件。
|
|
55
|
+
|
|
54
56
|
除非人类明确引用或授权,不要读取依赖目录、构建产物、覆盖率输出、锁文件
|
|
55
57
|
(推断包管理器除外)、密钥文件、环境文件或归档目录。
|
|
56
58
|
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
不要总结这个文件。
|
|
4
4
|
任务执行时按本文件选择 `normal` 或 `bounded_continuous`。
|
|
5
5
|
|
|
6
|
+
## 任务契约形态
|
|
7
|
+
|
|
8
|
+
`ai/project/task.md` 有两种合法形态:
|
|
9
|
+
|
|
10
|
+
- compact task contract:用于单 L1、Green、低风险任务。只写目标、范围、验收、
|
|
11
|
+
权限、验证命令和最小 `execution_policy.task_tree`;不要展开
|
|
12
|
+
`checkpoint_budget`、`model_policy` 等内部控制字段。
|
|
13
|
+
- expanded task contract:用于多 L1、Yellow/Red、跨模块、连续执行、高不确定或
|
|
14
|
+
高风险任务。需要时可展开 checkpoint、模型策略、风险门和更完整的任务树字段。
|
|
15
|
+
|
|
16
|
+
默认优先 compact。只有复杂度、风险或审计需要证明它有价值时,才升级到 expanded。
|
|
17
|
+
完整执行规则由本文件承载,不需要在每个任务草稿里重复。
|
|
18
|
+
|
|
6
19
|
## 默认策略
|
|
7
20
|
|
|
8
21
|
默认执行策略是 `auto`:AI 在每次执行前先做任务分解和风险判断,再决定使用
|
|
@@ -19,7 +32,8 @@
|
|
|
19
32
|
- 如果 L1 少于 2 个,使用 `normal`。
|
|
20
33
|
- 如果 L1 为 2 个或更多,自动启用 `bounded_continuous`。
|
|
21
34
|
- 如果任一 L1 为 Red,先停止并让人类确认;Green 和 Yellow 不阻塞启动。
|
|
22
|
-
- 将任务树写入 `ai/project/task.md` 的 `execution_policy.task_tree
|
|
35
|
+
- 将任务树写入 `ai/project/task.md` 的 `execution_policy.task_tree`。简单任务只写最小
|
|
36
|
+
L1 节点;复杂任务再补充 scope、acceptance、evidence、children 等字段。
|
|
23
37
|
|
|
24
38
|
## 任务树
|
|
25
39
|
|
|
@@ -37,7 +51,16 @@
|
|
|
37
51
|
出现 Red、blocked、范围变化或最终收尾时立即写回。不要为每个微小 L3 操作写回。
|
|
38
52
|
- 执行中使用 `pending`、`running`、`done` 或 `blocked` 表示节点状态。
|
|
39
53
|
|
|
40
|
-
|
|
54
|
+
最小节点结构:
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
id: "L1-1"
|
|
58
|
+
title: ""
|
|
59
|
+
risk: "Green | Yellow | Red"
|
|
60
|
+
status: "pending | running | done | blocked"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
复杂任务推荐节点结构:
|
|
41
64
|
|
|
42
65
|
```yaml
|
|
43
66
|
id: "L1-1"
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
不要总结这个文件。
|
|
4
4
|
按下面流程执行。你正在 Agent Execution Template 工作区内操作。
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
本文件只负责路由。先读取最小状态:
|
|
7
7
|
|
|
8
|
-
1. `ai/
|
|
9
|
-
2. `ai/
|
|
10
|
-
3. `ai/
|
|
8
|
+
1. `ai/project/project.md`(如果存在)
|
|
9
|
+
2. `ai/project/task.md`(如果存在)
|
|
10
|
+
3. `ai/project/inbox/`、`ai/project/inbox/ideas/` 和 `ai/project/proposals/final-shape-updates/` 的浅层列表
|
|
11
11
|
|
|
12
12
|
选择模式:
|
|
13
13
|
|
|
14
14
|
- 用户要求更新北极星、最终形态、产品宪法、模块地图、路线图或项目方向,
|
|
15
|
-
或 `ai/project/inbox/ideas/`
|
|
15
|
+
或 `ai/project/inbox/ideas/` 有待评估灵感:读取 `ai/template/protocol.md`、
|
|
16
|
+
`ai/template/rules/core.md` 和相关方向 refs,走 `strategy_update`,生成提案后停下确认。
|
|
16
17
|
- 用户明确确认某个 `ai/project/proposals/final-shape-updates/*.md` 可合并:
|
|
17
|
-
|
|
18
|
+
读取 `ai/template/protocol.md` 和 `ai/template/rules/core.md`,走
|
|
19
|
+
`apply_strategy_update`。若 proposal 仍为 `proposed`,先改为 `accepted`。
|
|
18
20
|
- 如果用户说“开始初始化这个项目,并吸收 ai/project/inbox/ 里的资料”,
|
|
19
21
|
或要求初始化时吸收 inbox:先检查 `ai/project/project.md`。若已存在且有效,
|
|
20
22
|
执行 `ai/template/reconcile.md`,不要重新 bootstrap;若为空、占位或不完整,执行
|
|
@@ -33,7 +35,8 @@
|
|
|
33
35
|
待确认上下文、待确认任务、失败结果、未完成任务或明显风险;给出建议或起草
|
|
34
36
|
`ai/project/task.md`,不要让人类自己找问题。
|
|
35
37
|
- 只有当 `project.md` 和 `task.md` 足以定义身份、目标、范围、权限和验收时,
|
|
36
|
-
|
|
38
|
+
才读取 `ai/template/protocol.md`、`ai/template/rules/core.md`、
|
|
39
|
+
`ai/template/execution-policy.md` 并进入执行模式。
|
|
37
40
|
|
|
38
41
|
## 任务草稿交接
|
|
39
42
|
|
|
@@ -42,9 +45,13 @@
|
|
|
42
45
|
1. 读取已确认的 `ai/project/project.md` 和相关 `ai/project/refs/*.md`。
|
|
43
46
|
2. 根据用户目标、项目上下文和仓库事实推断目标、范围、验收、权限、验证方式和初始风险;
|
|
44
47
|
不要求用户逐项提供。
|
|
45
|
-
3. 起草 `ai/project/task.md
|
|
48
|
+
3. 起草 `ai/project/task.md`。单 L1、Green、低风险任务默认使用 compact task contract:
|
|
49
|
+
只写目标、范围、验收、权限、验证命令和最小 `execution_policy.task_tree`。
|
|
50
|
+
多 L1、Yellow/Red、跨模块、连续执行或高不确定任务才使用 expanded task contract。
|
|
46
51
|
4. 执行前列出 L1 清单并标注 Green / Yellow / Red,写入 `execution_policy.task_tree`。
|
|
47
|
-
L1 < 2 用 `normal`;L1 >= 2 自动用 `bounded_continuous
|
|
52
|
+
L1 < 2 用 `normal`;L1 >= 2 自动用 `bounded_continuous`。完整默认规则由
|
|
53
|
+
`ai/template/execution-policy.md` 承载,不要把 `checkpoint_budget`、`model_policy`
|
|
54
|
+
等内部控制字段机械复制到简单任务草稿里。
|
|
48
55
|
5. 本轮新建或重写 `task.md` 时,将 `readiness` 设为 `draft_for_confirmation` 并停止;
|
|
49
56
|
草稿不能直接执行。
|
|
50
57
|
6. 只有既有任务为 `ready_to_execute` 且无 Red 预检项,才进入执行;否则设为 `blocked`。
|
|
@@ -9,6 +9,10 @@ ai/project/ = 当前项目执行工作区
|
|
|
9
9
|
|
|
10
10
|
`template` 是协议,`project` 是现场。
|
|
11
11
|
|
|
12
|
+
这里的“项目执行工作区”只指当前仓库内的 `ai/project/**` 现场上下文,不是仓库外
|
|
13
|
+
workspace / session / sandbox 运行时。外部运行时可以进入仓库并读取本协议,但不应
|
|
14
|
+
替代 `task.md`、文件修改规则、验收标准或具体编码上下文。
|
|
15
|
+
|
|
12
16
|
项目现场同时保存任务和方向层。方向层回答“为什么做、往哪里长”,执行层回答
|
|
13
17
|
“这次做什么、如何验收”。
|
|
14
18
|
|
|
@@ -49,6 +53,11 @@ ai/project/task.md = 当前执行契约
|
|
|
49
53
|
L1 必须是可独立验收的垂直切片。只有既有任务 `readiness = ready_to_execute` 才能执行;
|
|
50
54
|
本轮新建或重写任务契约时先停下确认。Red 停止确认,Yellow 只允许当前 L1/L2 内的局部低风险修正。
|
|
51
55
|
|
|
56
|
+
任务契约默认按复杂度分层。单 L1、Green、低风险任务使用 compact task contract,只保留
|
|
57
|
+
目标、范围、验收、权限、验证命令和最小 `execution_policy.task_tree`。多 L1、Yellow/Red、
|
|
58
|
+
跨模块、连续执行或高不确定任务才使用 expanded task contract,按需展开 checkpoint、
|
|
59
|
+
模型策略和更完整的任务树字段。
|
|
60
|
+
|
|
52
61
|
任务树、风险分级、Checkpoint 证据和 `task_tree` 写回规则由
|
|
53
62
|
`ai/template/execution-policy.md` 定义。
|
|
54
63
|
|