@namewta/speculo 0.7.1 → 0.7.3
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 +2 -1
- package/dist/src/migrations.js +604 -23
- package/dist/src/migrations.js.map +1 -1
- package/package.json +1 -1
- package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +171 -277
- package/template/canonical/canonical-specdev-goal-plan.md +714 -833
- package/template/canonical/canonical-specdev-grill-with-docs.md +172 -278
- package/template/canonical/canonical-specdev-spec.md +199 -315
- package/template/canonical/canonical-specdev-tickets.md +405 -398
- package/template/canonical/canonical-specdev-wayfinder.md +170 -276
- package/template/skills/migrate-runtime-state/SKILL.md +6 -6
- package/template/skills/migrate-runtime-state/references/migration-contract.md +9 -3
- package/template/skills/migrate-runtime-state/scripts/migrate-runtime-state.mjs +322 -33
- package/template/skills/optimize-codex-config/SKILL.md +81 -0
- package/template/skills/optimize-codex-config/references/configuration-contract.md +103 -0
- package/template/skills/optimize-codex-config/references/troubleshooting.md +79 -0
- package/template/skills/optimize-codex-config/scripts/audit-codex-config.mjs +747 -0
- package/template/workflows/specdev/I-implement/I-implement.md +97 -142
- package/template/workflows/specdev/I-implement/evidence-template.md +60 -48
- package/template/workflows/specdev/I-implement/execution-preflight.md +29 -19
- package/template/workflows/specdev/I-implement/merge-conflict-protocol.md +12 -11
- package/template/workflows/specdev/I-init-setup/I-init-setup.md +4 -5
- package/template/workflows/specdev/I-init-setup/change-status-template.json +14 -1
- package/template/workflows/specdev/I-init-setup/config-template.json +3 -5
- package/template/workflows/specdev/I-init-setup/status-template.json +1 -1
- package/template/workflows/specdev/INDEX.md +12 -8
- package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +76 -93
- package/template/workflows/specdev/P-goal-plan/completion-control.md +26 -44
- package/template/workflows/specdev/P-goal-plan/goal-plan-template.md +43 -31
- package/template/workflows/specdev/P-goal-plan/lead-orchestration.md +34 -0
- package/template/workflows/specdev/P-goal-plan/orchestration-protocol.md +31 -42
- package/template/workflows/specdev/P-goal-plan/planning-modes.md +42 -61
- package/template/workflows/specdev/T-tickets/T-tickets.md +6 -3
- package/template/workflows/specdev/T-tickets/ticket-readiness.md +5 -3
- package/template/workflows/specdev/T-tickets/ticket-template.md +8 -1
- package/template/workflows/specdev/T-tickets/tickets-map-template.md +5 -4
- package/template/workflows/specdev/_state/status.json +1 -1
- package/template/workflows/specdev/common/README.md +2 -2
- package/template/workflows/specdev/common/rules/change-completion.md +17 -19
- package/template/workflows/specdev/common/rules/deviation-control.md +1 -1
- package/template/workflows/specdev/common/rules/evidence-and-verification.md +27 -37
- package/template/workflows/specdev/common/rules/path-ownership.md +21 -23
- package/template/workflows/specdev/common/rules/readiness-and-depth.md +1 -1
- package/template/workflows/specdev/common/schemas/change-status.schema.json +136 -195
- package/template/workflows/specdev/common/schemas/config.schema.json +9 -11
- package/template/workflows/specdev/common/schemas/goal-plan.schema.json +24 -6
- package/template/workflows/specdev/common/schemas/status.schema.json +7 -63
- package/template/workflows/specdev/common/skills/dev-worktree/SKILL.md +42 -21
- package/template/workflows/specdev/common/skills/dev-worktree/references/create.md +48 -18
- package/template/workflows/specdev/common/skills/dev-worktree/references/finalize.md +47 -12
- package/template/workflows/specdev/common/skills/subagent-delivery/SKILL.md +34 -30
- package/template/workflows/specdev/common/skills/subagent-delivery/references/external-web-subagent.md +10 -23
- package/template/workflows/specdev/common/skills/subagent-delivery/references/native-subagent.md +14 -25
- package/template/workflows/specdev/common/tools/validate-specdev.mjs +507 -117
- package/template/workflows/specdev/I-implement/delegated-evidence-template.md +0 -11
- package/template/workflows/specdev/P-goal-plan/delegated-execution-template.md +0 -33
- package/template/workflows/specdev/P-goal-plan/delegated-execution.md +0 -53
|
@@ -1,35 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Create Or Restore Worktree
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Ticket 前置条件
|
|
4
4
|
|
|
5
|
-
- Ticket
|
|
6
|
-
-
|
|
7
|
-
-
|
|
5
|
+
- Ticket Ready,项目根是有效 Git repository,父分支和 `base_sha` 可解析;
|
|
6
|
+
- implementation commit 与 local candidate integration/父分支更新已授权;
|
|
7
|
+
- workspace、implementation、integration owner 唯一;integration owner 必须为 Lead;
|
|
8
|
+
- `specdev-worktree/` 已由 Speculo init 加入项目 `.gitignore`;
|
|
9
|
+
- 目标 branch/worktree 不覆盖现有用户 workspace,路径合同无冲突。
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
Prototype 只要求调用方已记录本次临时 branch/worktree 授权、问题、owner、locator 和清理策略;它不写 Ticket worktree 状态。
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
## 创建 Ticket 来源 worktree
|
|
14
|
+
|
|
15
|
+
1. 重读父分支 HEAD、工作树、现有 worktrees 与 refs;父 HEAD 与计划基线不一致时由 Lead决定更新 `base_sha` 或阻塞;
|
|
16
|
+
2. 固定 branch `speculo/<change>/<ticket-id>` 与 locator `specdev-worktree/<ticket-id>`;
|
|
17
|
+
3. 确认目标 branch/path 不存在,或其实际记录精确匹配当前 Ticket;
|
|
18
|
+
4. 从 `base_sha` 创建 Git worktree,不复用其他 Ticket/原型目录;
|
|
19
|
+
5. 在来源 worktree 读取项目 Agent 指令、依赖、构建与路径合同;
|
|
20
|
+
6. 安装实际需要的依赖,运行最小非 E2E 基线;
|
|
21
|
+
7. Lead 写入 `<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>`,状态为 `active`。
|
|
22
|
+
|
|
23
|
+
初始记录:
|
|
19
24
|
|
|
20
25
|
```json
|
|
21
26
|
{
|
|
22
27
|
"ticket_id": "T-01",
|
|
23
|
-
"owner": "
|
|
28
|
+
"owner": "lead",
|
|
29
|
+
"implementation_owner": "lead-or-dynamic-agent",
|
|
30
|
+
"integration_owner": "lead",
|
|
24
31
|
"provider": "git",
|
|
25
|
-
"base_sha": "<sha>",
|
|
32
|
+
"base_sha": "<immutable-sha>",
|
|
33
|
+
"parent_branch": "<parent-branch>",
|
|
26
34
|
"branch": "speculo/<change>/T-01",
|
|
27
35
|
"workspace_ref": "specdev-worktree/T-01",
|
|
36
|
+
"source_checkpoint": null,
|
|
37
|
+
"integration": {
|
|
38
|
+
"status": "pending",
|
|
39
|
+
"parent_before_sha": null,
|
|
40
|
+
"source_sha": null,
|
|
41
|
+
"candidate_sha": null,
|
|
42
|
+
"candidate_branch": null,
|
|
43
|
+
"candidate_workspace_ref": null,
|
|
44
|
+
"result_sha": null,
|
|
45
|
+
"method": null,
|
|
46
|
+
"conflict_paths": [],
|
|
47
|
+
"verification": "pending",
|
|
48
|
+
"e2e": {"required": false, "status": "not-required", "evidence": null},
|
|
49
|
+
"evidence": "<Path>{roots.state}/specdev/changes/<change>/evidence/T-01.md</Path>",
|
|
50
|
+
"attempts": 0
|
|
51
|
+
},
|
|
28
52
|
"status": "active",
|
|
29
53
|
"updated_at": "<ISO-8601>"
|
|
30
54
|
}
|
|
31
55
|
```
|
|
32
56
|
|
|
33
|
-
|
|
57
|
+
`e2e.required` 与 Ticket/Goal Plan disposition 一致;required 时初始 status 为 `pending`。
|
|
58
|
+
|
|
59
|
+
## 恢复
|
|
60
|
+
|
|
61
|
+
恢复时核对 repository、branch、locator、`base_sha`、实际 HEAD、dirty 状态和 owner。状态记录与 Git 不一致、branch 被其他 worktree 占用或出现越界修改时停止;Lead 写 blocker,不重建覆盖。
|
|
62
|
+
|
|
63
|
+
进入 `review` 前必须由 implementation owner 创建最终 commit;Lead 重读 branch tip、diff 与 `git status`,把精确 SHA 写入 `source_checkpoint`。
|
|
34
64
|
|
|
35
|
-
|
|
65
|
+
**完成标准**:来源 worktree 可定位且唯一;基线、记录与 Git 一致;source 检查不含 E2E;失败时保留现场。
|
|
@@ -1,18 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Candidate Merge And Parent Integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
仅由 Lead/integration owner 对状态为 `review` 的 Ticket 调用。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 1. 接收 source checkpoint
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
7
|
+
1. 核对 Ticket、Goal Plan、Evidence 目标、owner 与本地 integration 授权;
|
|
8
|
+
2. 验证来源 worktree clean,branch tip 精确等于 `source_checkpoint`,commit 从 `base_sha` 可达;
|
|
9
|
+
3. 审计实际 diff 未越过 writable/shared owner 合同;
|
|
10
|
+
4. 确认 source-worktree 必跑非 E2E 检查已执行,且没有把 E2E 自报为通过;
|
|
11
|
+
5. 重读父分支 checkout clean、HEAD 与 remote/本地约定,记录 `parent_before_sha`。
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
失败时保持 `review`/`blocked`,不开始候选合并。
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
2. Git provider 从 project root 解析 `specdev-worktree/<work-item-id>`,重验无路径逃逸且与 `git worktree list --porcelain` 的记录一致,再从主工作树移除;native/external 通过对应 provider 管理入口移除。
|
|
16
|
-
3. 确认 worktree 不再注册且工作项目录不存在后删除对应分支。Ticket 将状态更新为 `removed`;原型把 `cleanup_status` 更新为 `clean`。保留项目根 `specdev-worktree/` 统一目录及 `.gitignore` 条目。
|
|
15
|
+
## 2. 建立 parent-candidate checkout
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
1. 使用 branch `speculo/integration/<change>/<ticket-id>` 和 locator `specdev-worktree/.integration/<ticket-id>`,从最新 `parent_before_sha` 建立 Lead-owned integration worktree;
|
|
18
|
+
2. 如果父 SHA 是 source checkpoint 的祖先,在 candidate checkout 执行 `git merge --ff-only <source_checkpoint>`,`method=fast-forward`;
|
|
19
|
+
3. 否则执行 `git merge --no-ff --no-commit <source_checkpoint>`;
|
|
20
|
+
4. 冲突按 `<Path>{roots.workflows}/specdev/I-implement/merge-conflict-protocol.md</Path>` 处理。需要新产品决定时执行 `git merge --abort`,记录 blocker 并返回来源 worktree;
|
|
21
|
+
5. 对分叉结果创建一次 Lead-owned candidate merge commit,`method=merge-commit`;
|
|
22
|
+
6. 记录 candidate branch/locator、`candidate_sha`、`source_sha`、冲突路径与 attempts,worktree 状态改为 `integrating`、integration 状态改为 `candidate`。
|
|
23
|
+
|
|
24
|
+
重试前从最新父分支重建 candidate branch/worktree;旧 candidate SHA 保存在 Evidence。候选生命周期的重建/回收包含在 local candidate integration 授权中。
|
|
25
|
+
|
|
26
|
+
## 3. 在候选父状态验证
|
|
27
|
+
|
|
28
|
+
在 candidate checkout 运行:
|
|
29
|
+
|
|
30
|
+
- Ticket 受影响集成与回归;
|
|
31
|
+
- 项目要求的 typecheck/lint/build 或其他父状态检查;
|
|
32
|
+
- 仅当 Ticket/Goal Plan `e2e.required=true` 时运行对应 E2E。
|
|
33
|
+
|
|
34
|
+
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha`。可由既有合同机械修正的失败最多处理三轮;不得放宽断言、删除检查或发明行为。
|
|
35
|
+
|
|
36
|
+
## 4. 推进父分支
|
|
37
|
+
|
|
38
|
+
全部 required 检查通过后:
|
|
39
|
+
|
|
40
|
+
1. 重读父分支 HEAD;不等于 `parent_before_sha` 时将 candidate 标记 `stale`,不推进父分支并从步骤 2 重建;
|
|
41
|
+
2. 在父分支 checkout 执行 `git merge --ff-only <candidate_sha>`;候选 merge commit 本身已以父 SHA 为第一祖先,因此不再创建第二个 merge commit;
|
|
42
|
+
3. 重读父 HEAD、tree 与 ancestor 关系,确认 HEAD 精确等于 candidate SHA 且包含 source checkpoint;
|
|
43
|
+
4. 写入 `result_sha=candidate_sha`、`verification=passed`、E2E 最终状态和 Evidence;
|
|
44
|
+
5. integration/status 改为 `passed`/`integrated`,再由 Lead 标记 Ticket Done。
|
|
45
|
+
|
|
46
|
+
## 5. 失败、清理与恢复
|
|
47
|
+
|
|
48
|
+
- candidate 检查失败:父分支不动,Ticket 回 `in_progress` 或 `blocked`,来源 worktree 保留;
|
|
49
|
+
- 父 HEAD 漂移:旧 candidate 记 `stale`,完整重建并重跑;
|
|
50
|
+
- 成功后可按 candidate integration 授权回收 transient integration worktree/branch;来源 branch/worktree 不自动清理。获得独立 cleanup 授权并清理后,只将生命周期状态改为 `removed`,完整保留已经通过的集成与 E2E 证据;
|
|
51
|
+
- push、PR、remote merge、deploy、migration 和生产动作仍需各自授权。
|
|
52
|
+
|
|
53
|
+
**完成标准**:passed 时父 HEAD=result/candidate SHA 且包含 source commit;failed/stale 时父 HEAD 仍为开始该轮记录的父状态或更新后的外部事实,没有本轮候选污染。
|
|
@@ -1,59 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: subagent-delivery
|
|
3
|
-
description:
|
|
3
|
+
description: 动态派单合同:为 Lead 生成受限的 implementation/review/research/test-observation packet,绑定不可变 checkpoint,并在返回时核对 commit、范围和候选声明。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Subagent Delivery
|
|
7
7
|
|
|
8
|
-
本 Skill
|
|
8
|
+
本 Skill 被 P-goal-plan 与 I-implement 调用。它不选择是否使用 Lead 模式:Lead 是固定外层 owner;本 Skill 只保证每次动态派单可恢复、可验收且不产生第二个 SpecDev 状态写入者。
|
|
9
9
|
|
|
10
10
|
## 输入
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- `execution_model`:`native-subagent` 或 `external-web-subagent`;
|
|
14
|
-
- Lead、Ticket、Goal Plan、Spec、适用 ADR/CONTEXT、Wave/Gate 和依赖 Evidence;
|
|
15
|
-
- 项目写、只读和 shared 路径,验证矩阵与当前源码基线;
|
|
16
|
-
- provider、会话或 workspace locator、源码交付方式,以及用户当前明确授权。
|
|
12
|
+
所有调用都必须提供 `operation=plan | dispatch | accept` 与 Lead owner/session locator。其余输入按 operation 判定,不得把后续阶段事实反向要求给 `plan`:
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
- `operation=plan`:提供允许的 `task_kind` 集合、implementation subagent 上限、Lead/SpecDev/父分支/E2E 所有权和通用授权边界;Goal Plan 此时可以尚未写入,不要求 Ticket、provider、checkpoint 或 workspace;
|
|
15
|
+
- `operation=dispatch`:提供 `task_kind=implementation | review | research | test-observation`、已存在 Goal Plan(若有)、Ticket/固定审查目标、依赖 Evidence、适用合同、repository、不可变 checkpoint、项目 Agent 指令、workspace/session locator、provider、允许动作、路径边界、检查、停止条件与返回格式;
|
|
16
|
+
- `operation=accept`:提供原 Dispatch Packet、subagent 返回、当前 repository/workspace、预期与实际 checkpoint,以及 Lead 可用于独立核对的 Git/命令事实。
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
`operation=dispatch` 且 `task_kind=implementation` 时,还必须提供独立 Ticket worktree、branch、`base_sha`、writable/shared owner、implementation commit 授权与 source-worktree 非 E2E 检查。缺失时返回 blocked,不推断权限或创建 current-workspace 写入者。
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
## 1. 固定 Lead 与任务类型
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
Lead 保留需求解释、DAG/Wave/Gate、shared owner、权限、SpecDev 工件、Evidence、candidate-merge、父分支和最终回复。subagent 不写 Ticket、Map、Goal Plan、Evidence、change status 或父分支。
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
- implementation 可以写唯一 Ticket worktree,并在授权时创建实现 commit;
|
|
25
|
+
- review/research/test-observation 只读,返回 findings、来源或命令观察;
|
|
26
|
+
- E2E Gate 永远由 Lead 拥有,不能派给 implementation 或只读 agent;Ticket E2E 在 parent-candidate 状态执行,Direct Spec E2E 在 Lead-owned current workspace 执行。
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**完成标准**:Lead、task kind、写入边界和 E2E owner 唯一。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
## 2. 锁定基线、provider 与授权
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
记录 repository、branch、`base_sha`/固定审查 SHA、workspace/session locator 和 provider。GitHub 是源码事实来源时加载 `<Path>{roots.workflows}/specdev/common/skills/subagent-delivery/references/github-checkpoints.md</Path>`;需要向外部 provider 发送附件或私有上下文时,取得发送授权后加载 `<Path>{roots.workflows}/specdev/common/skills/subagent-delivery/references/source-package.md</Path>`。
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
授权逐动作记录:worktree local changes、implementation commit、外部内容发送、push、PR、remote merge、deploy、migration 和 production actions。Goal Plan 的本地 commit/integration 授权不扩展到远端、清理或生产动作。
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
**完成标准**:每个可变输入绑定 checkpoint;provider 只接收已授权范围;未授权动作不可执行。
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
## 3. 生成动态 Dispatch Packet
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
- `external-web-subagent`:加载 `<Path>{roots.workflows}/specdev/common/skills/subagent-delivery/references/external-web-subagent.md</Path>`,完成能力探测、会话恢复、候选交付与修正。
|
|
40
|
+
`operation=plan` 时只返回通用 Lead delivery contract,不读取尚未生成的 Goal Plan,也不为 Ticket 预分配 agent/provider。
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
`operation=dispatch` 时为单次任务生成 Packet:目标、IN/OUT、已锁定决定、固定输入、workspace、writable/read-only/shared paths、允许动作、必跑检查、禁止在 source worktree 运行 E2E、停止条件和返回字段。
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
- 原生 Agent:加载 `<Path>{roots.workflows}/specdev/common/skills/subagent-delivery/references/native-subagent.md</Path>`;
|
|
45
|
+
- 外部网页 Agent:加载 `<Path>{roots.workflows}/specdev/common/skills/subagent-delivery/references/external-web-subagent.md</Path>`。
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
implementation Packet 必须适合一个上下文独立完成;多个 implementation subagent 由 Lead 控制在 Goal Plan/config 上限内且最多三个。只读 agent 不设置 SpecDev 数字上限,但不得争用可变环境。
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
**完成标准**:Packet 可独立投递;目标、checkpoint、路径、权限、检查和返回均可判定。
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
## 4. 接收与验收候选
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
`operation=accept` 时,Lead 核对 Packet、当前父/来源基线、实际路径、dirty 状态、commit 可达性、命令输出和未验证项。外部声明、截图、provider 自报测试和推断保持 `unverified`,直到 Lead 在本地复核。
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
implementation 返回必须包含 Ticket ID、workspace locator、最终 commit、dirty 状态、修改路径、非 E2E 检查、失败/未运行项和恢复条件。review/research/test-observation 返回固定输入、findings、来源、命令与未验证声明。Lead 把验收结果写入调用方拥有的 Evidence/状态。
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
**完成标准**:每个 pass 有 Lead 可复查事实;candidate 未被误写为 Done 或父分支结果。
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
## 5. 修正与恢复
|
|
60
|
+
|
|
61
|
+
修正继续使用同一 Ticket 与 worktree,基于最后 source checkpoint 生成新 commit。基线或父分支漂移时由 Lead 暂停派单、重算影响并更新 Packet;契约冲突返回拥有该决定的工件。Lead 可以按当次风险在 Dispatch Packet 中定义停止条件,但 SpecDev 不推断全局修正次数;继续修正已无合理收益或需要上游决定时,返回 blocked、最后可信 checkpoint、失败命令和恢复条件。
|
|
62
|
+
|
|
63
|
+
**完成标准**:恢复不重新决定已锁定事项;每次候选都有唯一 checkpoint 和明确 owner。
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# External Web Subagent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用户已授权目标 provider 与发送内容范围,且外部网页模型能为当前任务提供实际价值时加载。外部会话永远返回候选,不拥有本地 worktree、commit、SpecDev 状态或 E2E Gate。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 能力与数据门
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
先确认 provider 能接收的文件、大小、会话恢复、输出格式和数据保留边界。需要源码包时加载 source-package reference,排除凭据、真实用户数据、运行时状态和无关代码;记录 locator、hash 与 checkpoint。能力或授权不足时改用原生/Lead 执行,不降低合同。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 投递与返回
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Packet 固定目标、范围、合同、checkpoint、路径边界、非 E2E 验证要求和停止条件。外部 provider 返回 patch/文件、修改清单、推理摘要、模拟或自报测试、未验证项和会话 locator。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Lead 在 Ticket worktree 中核对附件 hash、应用候选、检查 diff、依赖与锁文件、运行本地非 E2E 检查并创建 implementation commit。外部自报结果、截图或模拟保持 `unverified`;适用 E2E 仍只在 parent-candidate 状态运行。
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## 修正与恢复
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
2. 用户结果、里程碑位置、相关模块、公共契约和领域不变量;
|
|
19
|
-
3. allowed/read-only/shared 路径、保留行为和依赖策略;
|
|
20
|
-
4. 需要返回的方案、修改清单、patch/源码、测试、实际命令和风险;
|
|
21
|
-
5. 当前授权矩阵与逐项验收标准;
|
|
22
|
-
6. 未实际运行的检查必须标记 `unverified`。
|
|
17
|
+
修正轮绑定新的源码 checkpoint 或 candidate hash,不覆盖旧附件。会话无法恢复、输出越界或 contract 冲突时停止并保留最后可信包、失败证据和恢复条件。
|
|
23
18
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## 候选交付与修正
|
|
27
|
-
|
|
28
|
-
Lead 在隔离工作区从派单 checkpoint 应用候选交付,核对附件 hash、修改范围、依赖与锁文件、数据和安全边界,再运行 Ticket 与 Goal Plan 要求的验证。模拟结果、provider 自报测试和静态推断分别标记,不替代本地或目标环境证据。
|
|
29
|
-
|
|
30
|
-
修正请求必须包含未通过项、checkpoint、命令与退出状态、最小错误、项目位置、正确约束和必须保留的已通过行为。每轮重新核对 checkpoint、范围、受影响检查和验收矩阵;达到修正上限后形成 blocker。
|
|
31
|
-
|
|
32
|
-
**完成标准**:每轮会话和候选交付绑定唯一基线;每个 `pass` 有 Lead 独立证据,未验证项保持显式。
|
|
19
|
+
**完成标准**:发送范围有授权且可审计;本地 commit 与验收完全由 Lead 拥有;外部声明不被当作通过证据。
|
package/template/workflows/specdev/common/skills/subagent-delivery/references/native-subagent.md
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Native Subagent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lead 可以直接创建和管理隔离 Agent 时加载。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 派单
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Lead 为每个 Agent 发送一个完整 Dispatch Packet。implementation Agent 只进入指定 Ticket worktree;review/research/test-observation Agent 只读取固定输入。并行前核对 Ticket 依赖与 writable/shared path,不以“不同 Agent”代替路径隔离。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
DISPATCH ticket=<id> wave=<wave> gate=<gate>
|
|
11
|
-
baseline=<sha> branch=<branch> workspace=<workspace-ref>
|
|
12
|
-
ticket_path=<full-ticket-path> evidence_path=<full-evidence-path>
|
|
13
|
-
```
|
|
9
|
+
Packet 对 implementation 明确:
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
候选交付必须同时通过:
|
|
22
|
-
|
|
23
|
-
- 标准轴:正确性、架构、错误处理、安全、依赖和测试质量;
|
|
24
|
-
- 规范轴:Spec、ADR、Ticket、Goal Plan、路径合同和验收映射;
|
|
25
|
-
- Lead 复跑的定向验证与适用回归;
|
|
26
|
-
- 对可能静默失效的门禁执行一次受控反向验证,并恢复绿色基线。
|
|
27
|
-
|
|
28
|
-
失败时沿用同一 Agent 或建立明确继任者,返回失败标准、命令与退出状态、最小错误、文件位置、正确约束、当前 checkpoint 和必须保留的已通过行为。达到修正上限后标记 blocker,不无限重派。
|
|
11
|
+
- Ticket、Goal Plan、依赖 Evidence 与 `base_sha`;
|
|
12
|
+
- branch、portable `workspace_ref`、writable/read-only/shared paths;
|
|
13
|
+
- 允许 worktree local changes 与 implementation commit;
|
|
14
|
+
- 单元、组件、静态、类型、lint/build 等适用非 E2E 检查;
|
|
15
|
+
- E2E 由 Lead 在 parent-candidate 状态执行;
|
|
16
|
+
- 越界、合同冲突、基线漂移和无法提交时立即停止。
|
|
29
17
|
|
|
30
18
|
## 返回
|
|
31
19
|
|
|
32
|
-
Agent 返回 Ticket
|
|
20
|
+
implementation Agent 返回 Ticket ID、workspace locator、最终 commit、`git status`、修改路径、命令/结果、未运行项、冲突和恢复条件,不写 SpecDev Evidence。只读 Agent 返回固定 checkpoint、findings、来源、命令观察和未验证项。
|
|
33
21
|
|
|
34
|
-
|
|
22
|
+
Lead 重读 worktree、验证 commit 可达且 tip 一致、检查实际 diff 与路径合同,再决定接受、修正或 blocked。接受的 implementation 候选进入 dev-worktree candidate-merge;只读结论由 Lead 写入对应权威工件。
|
|
35
23
|
|
|
24
|
+
**完成标准**:原生 Agent 的写入与返回均绑定一个 Packet;Lead 可以独立复现其事实声明。
|