flower-trellis 0.5.0-beta.7 → 0.5.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/enhancements/0.6/.agents/skills/trellis-auto-loop/SKILL.md +93 -151
- package/enhancements/0.6/.agents/skills/trellis-check-all/SKILL.md +10 -3
- package/enhancements/0.6/.agents/skills/trellis-push/SKILL.md +11 -0
- package/enhancements/0.6/.agents/skills/trellis-route/SKILL.md +4 -2
- package/enhancements/0.6/.claude/skills/trellis-auto-loop/SKILL.md +93 -151
- package/enhancements/0.6/.claude/skills/trellis-check-all/SKILL.md +10 -3
- package/enhancements/0.6/.claude/skills/trellis-push/SKILL.md +11 -0
- package/enhancements/0.6/.claude/skills/trellis-route/SKILL.md +4 -2
- package/enhancements/0.6/overrides/bundles/auto-loop.json +7 -0
- package/enhancements/0.6/overrides/bundles/finish-work.json +4 -1
- package/enhancements/0.6/overrides/bundles/intent-routing.json +1 -0
- package/enhancements/0.6/overrides/bundles/task-progress-recovery.json +7 -0
- package/enhancements/0.6/overrides/conflicts.json +232 -0
- package/enhancements/0.6/overrides/patches/scripts/task-store-write-integrity/archive-guard-content.py +13 -0
- package/enhancements/0.6/overrides/patches/scripts/task-store-write-integrity/decision-import-content.py +2 -0
- package/enhancements/0.6/overrides/patches/scripts/task-store-write-integrity/decision-import-selector.py +3 -0
- package/enhancements/0.6/overrides/patches/scripts/task-store-write-integrity/patch.json +8 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-before-dev/project-knowledge-discovery/content.md +5 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-before-dev/project-knowledge-discovery/patch.json +31 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-before-dev/project-knowledge-discovery/selector.md +1 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/auto-task-create/patch.json +1 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-authorization/content.md +2 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-handoff/patch.json +1 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-continue/task-progress-recovery/content.md +21 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-continue/task-progress-recovery/patch.json +32 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-continue/task-progress-recovery/selector.md +1 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-finish-work/exact-bookkeeping/content.md +23 -6
- package/enhancements/0.6/overrides/patches/skills/trellis-finish-work/exact-bookkeeping/gemini-content.md +3 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-finish-work/exact-bookkeeping/gemini-selector.txt +1 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-finish-work/exact-bookkeeping/patch.json +34 -0
- package/enhancements/0.6/overrides/patches/skills/trellis-start/no-task-routing/content.md +1 -1
- package/enhancements/0.6/overrides/patches/skills/trellis-update-spec/autonomous-evaluation/content.md +1 -1
- package/enhancements/0.6/overrides/patches/skills/trellis-update-spec/autonomous-evaluation/patch.json +22 -0
- package/enhancements/0.6/overrides/patches/workflow/hub/content.md +30 -163
- package/enhancements/0.6/overrides/patches/workflow/intent-routing/request-triage/content.md +11 -5
- package/enhancements/0.6/overrides/patches/workflow/phase-ownership/phase-2-check-content.md +2 -0
- package/enhancements/0.6/overrides/patches/workflow/phase-ownership/phase-2-implement-content.md +1 -1
- package/enhancements/0.6/overrides/patches/workflow/state-no-task/content.md +2 -1
- package/enhancements/0.6/overrides/patches/workflow/states-in-progress/common-content.md +3 -2
- package/enhancements/0.6/overrides/patches/workflow/states-planning/common-content.md +1 -0
- package/enhancements/0.6/scripts/auto_loop.py +1556 -26
- package/enhancements/0.6/scripts/decision_log.py +492 -0
- package/enhancements/0.6/scripts/task_progress.py +20 -4
- package/enhancements/MANIFEST.json +15 -2
- package/package.json +7 -4
- package/src/cli.js +3 -68
- package/src/commands/init.js +1 -1
- package/src/commands/self-check.js +1 -1
- package/src/commands/self-update.js +1 -1
- package/src/commands/uninstall.js +11 -9
- package/src/commands/update-check.js +1 -1
- package/src/commands/update.js +44 -1
- package/src/constants.js +29 -0
- package/src/lib/apply-enhancements.js +30 -32
- package/src/lib/cli-args.js +88 -0
- package/src/lib/copy-scripts.js +13 -0
- package/src/lib/copy-skills.js +27 -36
- package/src/lib/enhancement-catalog.js +3 -3
- package/src/lib/patch-conflicts.js +184 -43
- package/src/lib/patch-engine.js +453 -138
- package/src/lib/update-backups.js +246 -0
- package/src/lib/update-check.js +1 -1
package/README.md
CHANGED
|
@@ -52,6 +52,9 @@ flower-trellis init -u <your-name> -y
|
|
|
52
52
|
# 升级 Trellis 并按新版本重新叠加强化包
|
|
53
53
|
flower-trellis update
|
|
54
54
|
|
|
55
|
+
# 临时保留最近 5 份升级备份;传 0 可关闭本次自动清理
|
|
56
|
+
flower-trellis update --backup-retention 5
|
|
57
|
+
|
|
55
58
|
# 检查当前项目是否需要更新(稳定 JSON,供 AI / hook 使用)
|
|
56
59
|
flower-trellis self-check --json --target .
|
|
57
60
|
|
|
@@ -97,9 +100,23 @@ flower-trellis -v
|
|
|
97
100
|
| `--variant <old\|0.5\|0.6>` | 强制指定强化包变体(默认按 `.trellis/.version` 自动选) |
|
|
98
101
|
| `--target <dir>` | 目标目录(默认当前目录) |
|
|
99
102
|
| `--no-update-check` | 本次跳过 flower-trellis 新版本检测(等价环境变量 `FLOWER_NO_UPDATE_CHECK=1`) |
|
|
103
|
+
| `--backup-retention <n>` | `update` 成功后保留最近 n 份 `.trellis/.backup-<timestamp>` 快照(默认 3,`0` 表示本次不清理) |
|
|
100
104
|
|
|
101
105
|
未指定平台时,交互模式会弹出多选菜单(默认勾选 Claude Code + Codex);也可直接传 `--claude` / `--codex` / `--cursor` / `--devin` / `--zcode` / `--trae` 等指定,或用 `-y` 跳过菜单。`--windsurf` 仍作为 Devin 的旧别名透传给 Trellis。其余未识别的 flag(如 `-u`、`-f`、`--template`、`--with-statusline`)一律透传给 Trellis。
|
|
102
106
|
|
|
107
|
+
### 升级备份保留
|
|
108
|
+
|
|
109
|
+
上游 `trellis update` 会在写入前创建 `.trellis/.backup-<timestamp>/` 完整快照。
|
|
110
|
+
`flower-trellis update` 在 Trellis 更新、强化包叠加和本地配置恢复流程完成后,默认只保留最近 3 份:
|
|
111
|
+
|
|
112
|
+
- 只有名称严格符合时间戳格式的直接子目录会参与清理;`.trellis/.backup-flower/`、普通文件、
|
|
113
|
+
软链接和相似名称目录不会被删除。
|
|
114
|
+
- 更新失败时不清理,并保留本轮上游已经创建的备份。
|
|
115
|
+
- `--dry-run` 只展示预计保留和删除的备份,不修改文件系统。
|
|
116
|
+
- `--backup-retention 0` 可关闭本次自动清理;该设置只影响当前命令,不写入项目配置。
|
|
117
|
+
- `self-update` 可通过 `--` 传入覆盖值,例如
|
|
118
|
+
`flower-trellis self-update --target . --yes -- --backup-retention 5`。
|
|
119
|
+
|
|
103
120
|
### 自动版本检测
|
|
104
121
|
|
|
105
122
|
运行 `init` / `update` 时,flower-trellis 会顺带检测**自身**在 npm 上是否有新版本:
|
|
@@ -5,210 +5,152 @@ description: "启动、恢复和推进 Trellis 自动任务循环。用于用户
|
|
|
5
5
|
|
|
6
6
|
# Trellis Auto Loop
|
|
7
7
|
|
|
8
|
-
用 `.trellis/scripts/auto_loop.py`
|
|
8
|
+
用 `.trellis/scripts/auto_loop.py` 驱动批量无人值守任务。runner 是状态、manifest、hash、依赖和预算的权威;本 skill 只判断语义边界并执行 runner 返回的 action。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Run Contract
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- 启动 runner 前先完成 route 准备度判断:已有当前任务 runtime route 决策或个人 `.trellis/.route-prefs.tmp` 时可启动;没有时先进入 `trellis-route` 正常询问 / fallback,写入真实决策后再启动。
|
|
21
|
-
- auto-loop 不默认写 `route_authorization`;只有用户本次明确给出的临时 route 策略,才能通过 `--route-implement` / `--route-check` 传给 runner,且不能当成模型真实执行结果。
|
|
22
|
-
- auto-loop 启动前若 implement 与 check 都缺 route,优先展示 auto-loop 专用的合并选择,不要把 `trellis-route` 的两套完整 fallback 原样贴给用户。仍允许用户回复高级格式 `implement 1, check 1`。
|
|
23
|
-
- 检查深度由 run 级 `--check-depth auto|light|full` 控制,默认 `auto`,与 `--route-check` 独立;历史 run 缺少该字段时按 `full` 兼容。
|
|
24
|
-
- 代码提交必须复用 `trellis-push` 的内部 commit-only 执行能力;auto-loop 自己负责预授权校验和 runner 回写,不要裸 `git commit` / `git push`。
|
|
25
|
-
- `Open Questions` 的确定性状态由 runner 处理:`- [ ]` 阻塞,`- [x]` 不阻塞,无章节或空章节放行。历史无 checkbox 列表只能按 `review_open_questions` action 做语义复核,不能自行跳过 runner 回写。
|
|
26
|
-
- 启动或恢复 validated auto-loop 前先运行 `python3 ./.trellis/scripts/pre_check_state.py clear`,静默清除当前任务的交互式 Check-All 前暂缓偏好。清理返回 miss 或 task mismatch 视为无状态;runtime 损坏只记录诊断,不得阻断 runner,也不得让 runner 读取该偏好。
|
|
12
|
+
- 仅在用户明确要求 auto-loop、自动跑到底、goal-like 或继续既有 run 时使用;普通实现请求不能自动升级。
|
|
13
|
+
- 用户发出启动指令即授权本次 `commit-only` run。prepare 完成后不再确认 manifest,也不逐任务执行 `confirm_brief`。
|
|
14
|
+
- 新 run 先 prepare 全部显式任务,Open Questions 全部收敛后才进入 running。running 中不再询问 route、planning 或普通 Check-All 停止边界。
|
|
15
|
+
- 每个 action 完成后,必须用同名 `record --action ...` 精确回写并立即 `next`。不得根据聊天摘要手改 runtime 或跳步。
|
|
16
|
+
- 本地提交是自动终点。不得 push、merge、release、deploy、finish-work 或 archive;queue item 完成后 Trellis task 仍保持 `in_progress`。
|
|
17
|
+
- 任务顺序只决定稳定调度顺序,不隐含依赖。依赖必须通过 `--depends-on dependent=dependency` 明确传入或由 planning artifacts 明确声明。
|
|
18
|
+
- 任务级失败只阻塞自身及显式依赖项;独立任务继续。fix/recheck 与 planning repair 各最多 3 轮,队列结束后不自动执行第二遍恢复扫描。
|
|
19
|
+
- schema 1 runtime 继续按 runner 返回的旧 action 恢复,包括 outstanding `confirm_brief`;不要把旧 run 改写成 schema 2。
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
用户给了任务列表时,按原顺序传入;用户只说当前任务时,用 `task.py current --source` 的当前任务。
|
|
31
|
-
|
|
32
|
-
启动前先静默清理交互式暂缓偏好:
|
|
21
|
+
启动或恢复前静默清除交互式 pre-check hold;miss、task mismatch 或损坏诊断不阻断 runner:
|
|
33
22
|
|
|
34
23
|
```bash
|
|
35
24
|
python3 ./.trellis/scripts/pre_check_state.py clear
|
|
36
25
|
```
|
|
37
26
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
python3 .agents/skills/trellis-route/scripts/route_state.py resolve --target implement
|
|
42
|
-
python3 .agents/skills/trellis-route/scripts/route_state.py resolve --target check
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
如果两个 target 都返回 `status=miss`,优先用 auto-loop 专用合并选择询问用户,避免把两套 route fallback 列表完整贴出:
|
|
46
|
-
|
|
47
|
-
```text
|
|
48
|
-
auto-loop 需要你先选执行路线,才能启动。
|
|
27
|
+
## Start
|
|
49
28
|
|
|
50
|
-
|
|
51
|
-
1. 本次全 Inline:implement inline + check-all inline(只影响本次 run)
|
|
52
|
-
2. 本次全 Subagent:implement subagent + check-all subagent(只影响本次 run)
|
|
53
|
-
3. 保存默认全 Inline:写入个人默认,后续自动复用
|
|
54
|
-
4. 保存默认全 Subagent:写入个人默认,后续自动复用
|
|
55
|
-
|
|
56
|
-
高级:也可以回复 `implement 1, check 2` 分别选择。
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
映射规则:
|
|
60
|
-
|
|
61
|
-
- `1` → `--route-implement inline --route-check check-all-inline`
|
|
62
|
-
- `2` → `--route-implement subagent --route-check check-all-subagent`
|
|
63
|
-
- `3` → 先用 `trellis-route` helper 分别写入 `implement=inline`、`check=check-all-inline` 且 `--save-pref`,再启动 runner
|
|
64
|
-
- `4` → 先用 `trellis-route` helper 分别写入 `implement=subagent`、`check=check-all-subagent` 且 `--save-pref`,再启动 runner
|
|
65
|
-
|
|
66
|
-
如果只有一个 target 返回 `status=miss`,再按 `trellis-route` 的对应 target 正常 numbered fallback 询问。不要替用户默认 inline 或 subagent。若用户选择的是本次临时策略,把选择映射为 runner route 参数一起传入,例如 `implement 1, check 1` 对应 `--route-implement inline --route-check check-all-inline`。若用户选择保存默认,则由 `trellis-route` 写入偏好后再启动 runner。
|
|
29
|
+
任务列表必须显式。用户只说当前任务时,先用 `task.py current --source` 解析。启动前为 implement/check 解析可复用 route;已有 session runtime 或 `.trellis/.route-prefs.tmp` 就复用,没有时按 `trellis-route` 询问并写入真实选择。临时选择才传 runner 参数,个人默认由 route helper 自己保存。
|
|
67
30
|
|
|
68
31
|
```bash
|
|
69
32
|
python3 ./.trellis/scripts/auto_loop.py start \
|
|
70
33
|
--tasks <task> [<task> ...] \
|
|
34
|
+
[--depends-on <dependent>=<dependency>] \
|
|
71
35
|
--profile commit-only \
|
|
72
36
|
[--check-depth auto|light|full] \
|
|
73
37
|
[--route-implement inline|subagent] \
|
|
74
38
|
[--route-check check-all-inline|check-all-subagent]
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
除非用户明确指定 light/full,启动时使用默认 `--check-depth auto`。显式 light 仍必须进入 Check-All,命中 hard-full 时由 Check-All 升级 full;不得把它映射到顶层 `trellis-check`。
|
|
78
|
-
|
|
79
|
-
多任务队列中,当前任务切换到下一个任务且缺少该任务 route 决策时,回到 `trellis-route` 获取该任务真实选择,再继续 `next` / `record`。个人 `.trellis/.route-prefs.tmp` 会由 `trellis-route` 统一复用并写回 runtime。
|
|
80
|
-
|
|
81
|
-
启动后立即运行:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
39
|
python3 ./.trellis/scripts/auto_loop.py next
|
|
85
40
|
```
|
|
86
41
|
|
|
87
|
-
|
|
42
|
+
默认 check depth 为 `auto`。light/full 只是 Check-All 请求深度,不是 route mode;hard-full 风险仍由 Check-All 升级。
|
|
88
43
|
|
|
89
|
-
|
|
44
|
+
用户一次选择全 Inline/Subagent 时可同时映射两个 route:
|
|
90
45
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
python3 ./.trellis/scripts/auto_loop.py resume
|
|
94
|
-
python3 ./.trellis/scripts/auto_loop.py next
|
|
95
|
-
```
|
|
46
|
+
- Inline:`--route-implement inline --route-check check-all-inline`
|
|
47
|
+
- Subagent:`--route-implement subagent --route-check check-all-subagent`
|
|
96
48
|
|
|
97
|
-
|
|
49
|
+
runner 在 start 时检查任务存在性、task status、staged/conflict/未完成 Git 集成,并捕获主仓及已初始化子仓的 dirty baseline。全局安全错误不得通过 `--force` 绕过。
|
|
98
50
|
|
|
99
|
-
##
|
|
51
|
+
## Prepare Actions
|
|
100
52
|
|
|
101
|
-
|
|
53
|
+
prepare action 必须先完成并 record,runner 才会继续扫描整个队列。
|
|
102
54
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
python3 ./.trellis/scripts/auto_loop.py next
|
|
111
|
-
```
|
|
55
|
+
| action | 主 agent 行为 | record |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `classify_dirty_baseline` | 把每个 `repository::path` 精确归到一个任务的 owned dirty,或归为 protected-retained;不猜测归属 | `record --action classify_dirty_baseline --result ok [--owned-dirty <task>=<repository>::<path>] [--protected-retained <repository>::<path>]` |
|
|
58
|
+
| `resolve_open_questions` | 使用 `trellis-brainstorm` 一次引导人工回答一个问题,并更新对应 planning artifacts;AI 不得代答、删除、改写或勾选 | 全部问题消失后 `record --action resolve_open_questions --result ok` |
|
|
59
|
+
| `review_planning_readiness` | 读取 action 绑定的 artifacts,按 Brainstorm Quality Bar 判断 `ready|repairable|blocking` | `record --action review_planning_readiness --result ok --readiness-verdict ready|repairable --summary "..."`;blocking 用 `--result blocked` |
|
|
60
|
+
| `run_planning_repair` | 仅按现有需求、代码、spec 和仓库证据修复 planning;不得处理 Open Questions 或高风险事项 | `record --action run_planning_repair --result ok --summary "..."` |
|
|
61
|
+
| `refresh_brief` | 使用 `trellis-task-brief` 刷新派生的 `brief.md`,无需再次让用户确认 | `record --action refresh_brief --result ok` |
|
|
112
62
|
|
|
113
|
-
|
|
63
|
+
`resolve_open_questions` 是整队列门禁:任一任务仍有 `- [ ]` 或历史裸列表时,run 保持 `awaiting_input`,不得先执行其它任务。`- [x]`、空章节或无章节不阻塞。
|
|
114
64
|
|
|
115
|
-
|
|
65
|
+
readiness 的 `repairable` 仅适用于不改变目标、可由仓库证据确定的问题,例如验收不可测试、design/implement 不完整或 context 未整理。达到 3 轮、需要产品选择或越过风险黑名单时返回 blocking。
|
|
116
66
|
|
|
117
|
-
|
|
118
|
-
| --- | --- | --- |
|
|
119
|
-
| `review_open_questions` | 结合 PRD 语义判断历史裸列表是已解决、仍阻塞或无法确定 | 已解决:`record --action review_open_questions --result ok --review-verdict resolved --summary "<摘要>"`;仍阻塞/无法确定:使用 `--result blocked --review-verdict blocking|ambiguous` |
|
|
120
|
-
| `refresh_brief` | 使用 `trellis-task-brief` 生成并展示 brief | `record --action refresh_brief --result ok` |
|
|
121
|
-
| `start_task` | 执行返回的 `task.py start ...` 命令 | `record --action start_task --result ok` |
|
|
122
|
-
| `run_implement` | 进入 Phase 2.1,先用 `trellis-route(target=implement)` 决定 inline/subagent,再实现 | `record --action run_implement --result ok --route-mode <mode> --route-source <source>` |
|
|
123
|
-
| `run_check_all` | 进入 Phase 2.2,先用 `trellis-route(target=check)`,按 action 的 requested depth 执行 Check-All | `record --action run_check_all --result ok --route-mode <mode> --route-source <source> --effective-check-depth <light|full> --check-depth-reason "<摘要>"` |
|
|
124
|
-
| `run_fix` | 根据 `last_failure` 修复,复用当前任务 implement route | `record --action run_fix --result ok --route-mode <mode> --route-source <source>` |
|
|
125
|
-
| `run_recheck` | 复用当前任务 check route,按 action 的 requested/minimum depth 重新 Check-All | `record --action run_recheck --result ok --route-mode <mode> --route-source <source> --effective-check-depth <light|full> --check-depth-reason "<摘要>"` |
|
|
126
|
-
| `run_spec_update` | 调用 `trellis-update-spec` 自主返回三态 | `no-op` / `written`:`record --action run_spec_update --result ok` 后立即 `next`;`needs-review`:`record --action run_spec_update --result blocked --failure-type spec-needs-review` |
|
|
127
|
-
| `commit_only` | 校验本 run 的预授权与文件归属,再把 exact files/message 交给 `trellis-push` 内部 commit-only 执行 | auto-loop 执行 `record --action commit_only --result ok --commit <hash>` |
|
|
128
|
-
|
|
129
|
-
失败时写回:
|
|
67
|
+
## Autonomous Decisions
|
|
130
68
|
|
|
131
|
-
|
|
132
|
-
python3 ./.trellis/scripts/auto_loop.py record \
|
|
133
|
-
--action <action> \
|
|
134
|
-
--result failed \
|
|
135
|
-
--failure-type <type> \
|
|
136
|
-
--summary "<失败摘要>" \
|
|
137
|
-
[--effective-check-depth light|full] \
|
|
138
|
-
[--check-depth-reason "<深度原因>"] \
|
|
139
|
-
--files <file> [<file> ...]
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
需要用户产品决策或越权时写回 blocked:
|
|
69
|
+
满足任务目标内、仅影响本地代码、可逆且可验证时,AI可自主选择推荐方案。作出选择后必须先记录,再继续修改或 record;会修改 planning/handoff 时,`--file` 必须列出全部目标 artifact:
|
|
143
70
|
|
|
144
71
|
```bash
|
|
145
|
-
python3 ./.trellis/scripts/auto_loop.py
|
|
146
|
-
--
|
|
147
|
-
--
|
|
148
|
-
--
|
|
149
|
-
--
|
|
150
|
-
|
|
151
|
-
[--
|
|
72
|
+
python3 ./.trellis/scripts/auto_loop.py decide \
|
|
73
|
+
--task <task> \
|
|
74
|
+
--topic "<主题>" \
|
|
75
|
+
--option "<候选>" [--option "<候选>" ...] \
|
|
76
|
+
--choice "<选择>" \
|
|
77
|
+
--summary "<依据摘要>" \
|
|
78
|
+
[--evidence "<证据>" ...] \
|
|
79
|
+
--risk low|medium \
|
|
80
|
+
--confidence low|medium|high \
|
|
81
|
+
[--requirement <id> ...] [--file <repository>::<path> ...] \
|
|
82
|
+
[--verification "<验证摘要>"]
|
|
152
83
|
```
|
|
153
84
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
`review_open_questions` 必须只依据 action 返回的 `questions` 和当前 PRD 判断。runner 会把结果绑定到 action 发出时的 PRD SHA-256;PRD 在复核期间发生变化时,record 会返回 `stale-open-questions-review`,此时重新运行 `next`,不得复用旧判断。`ambiguous` 必须保守阻塞,交由用户或 planning 收敛。
|
|
157
|
-
|
|
158
|
-
`record` 默认只返回当前 item 的 `task`、`item_status`、`current_step`、`commit` 和紧凑 `summary`;只有排查状态漂移时才加 `--verbose` 查看完整 `item`。
|
|
85
|
+
决策写入 runtime 摘要和任务 `decisions.jsonl`,只保存结论与证据,不保存思维链。下一次同任务 action record 会消费该决策:列明的 planning/handoff 变化生成绑定 decision ID 的 manifest revision;其它变化按 `artifact-drift` 阻塞。
|
|
159
86
|
|
|
160
|
-
|
|
161
|
-
`--route-mode inline --route-source route-prefs` 或
|
|
162
|
-
`--route-mode check-all-subagent --route-source trellis-route`;不要写 auto-loop 默认值。
|
|
87
|
+
以下事项不得用 `decide`,必须 blocked:
|
|
163
88
|
|
|
164
|
-
|
|
89
|
+
- 不可逆真实数据修改。
|
|
90
|
+
- 扩大权限或降低安全、隐私保护。
|
|
91
|
+
- 公开 API 或数据格式破坏性变更。
|
|
92
|
+
- 费用、生产环境或外部系统影响。
|
|
93
|
+
- push、merge、release、deploy、finish-work、archive。
|
|
94
|
+
- 明显改变任务目标或业务规则且仓库没有倾向证据。
|
|
95
|
+
- `Open Questions` 中人工保留的任何选择。
|
|
165
96
|
|
|
166
|
-
|
|
97
|
+
## Running Actions
|
|
167
98
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
99
|
+
| action | 主 agent 行为 | 成功 record |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `start_task` | 执行 action 返回的 `task.py start ...` | `record --action start_task --result ok` |
|
|
102
|
+
| `run_implement` | 进入 Phase 2.1,复用 manifest/当前任务 implement route | `record --action run_implement --result ok --route-mode <mode> --route-source <source>` |
|
|
103
|
+
| `run_check_all` | 进入 Phase 2.2,按 requested depth 执行统一 Check-All | `record --action run_check_all --result ok --route-mode <mode> --route-source <source> --effective-check-depth light|full --check-depth-reason "..."` |
|
|
104
|
+
| `run_fix` | 根据 `last_failure` 修复并复用 implement route | `record --action run_fix --result ok --route-mode <mode> --route-source <source>` |
|
|
105
|
+
| `run_recheck` | 复用 check route,且不得低于 `minimum_check_depth` | 同 `run_check_all`,action 改为 `run_recheck` |
|
|
106
|
+
| `run_spec_update` | 执行 `trellis-update-spec` | `no-op|written` 用 ok;`needs-review` 用 blocked + `spec-needs-review` |
|
|
107
|
+
| `commit_only` | 复用 `trellis-push` 内部精确本地提交能力,不 push | `record --action commit_only --result ok --commit <hash> --files <exact...> --commit-message "..."` |
|
|
173
108
|
|
|
174
|
-
|
|
175
|
-
2. 读取当前任务 artifacts、`git status`、`git diff` 和必要文件内容,由 AI 生成 exact files、commit message 与逐文件归属理由。
|
|
176
|
-
3. 确认 staged 区为空、没有冲突或未完成的 Git 集成状态,所有 planned files 均属于当前任务,且不包含 `.trellis/.runtime/`、`.trellis/.route-prefs.tmp`、其他任务目录或未解释文件。
|
|
177
|
-
4. 调用 `trellis-push` 内部 commit-only,只传 exact files 与 message。该调用只执行精确本地提交,不读取 auto-loop 状态、不 push、不写任务进度。
|
|
178
|
-
5. 提交成功后,本 skill 执行:
|
|
109
|
+
失败或越权时必须回写,runner 决定重试、blocked 或继续队列:
|
|
179
110
|
|
|
180
111
|
```bash
|
|
181
112
|
python3 ./.trellis/scripts/auto_loop.py record \
|
|
182
|
-
--action
|
|
183
|
-
--
|
|
184
|
-
--
|
|
185
|
-
|
|
186
|
-
--commit-message "<message>"
|
|
113
|
+
--action <action> --result failed|blocked \
|
|
114
|
+
--failure-type <type> --summary "<摘要>" \
|
|
115
|
+
[--files <repository>::<path> ...]
|
|
116
|
+
python3 ./.trellis/scripts/auto_loop.py next
|
|
187
117
|
```
|
|
188
118
|
|
|
189
|
-
|
|
119
|
+
Check-All 的 ok/failed/blocked 都要带实际 effective depth 与原因。validated auto-loop 不进入普通 Post-Check Stop Gate;检查完成后立即 `record + next`。
|
|
120
|
+
|
|
121
|
+
## Commit-Only
|
|
190
122
|
|
|
191
|
-
|
|
123
|
+
收到 `commit_only` 后:
|
|
192
124
|
|
|
193
|
-
|
|
125
|
+
1. 用 `status` 确认 active run、profile、outstanding action 和 task 一致。
|
|
126
|
+
2. 读取任务 artifacts、Git status/diff,生成 exact files、message 和归属理由。
|
|
127
|
+
3. staged 必须为空;不得包含冲突、未完成集成、runtime、route prefs、其它任务目录或 protected-retained。
|
|
128
|
+
4. 使用 `trellis-push` 内部 commit-only 提交 exact files。不得裸 `git add .`、`git add -A`、push 或按时间差猜归属。
|
|
129
|
+
5. 用提交 hash 和 exact files record,然后立即 next。
|
|
194
130
|
|
|
195
|
-
|
|
131
|
+
`decisions.jsonl` 属于当前任务文件,发生决策时应进入该任务最终精确提交。任务 `task.json.status` 不因 queue item completed 而改写。
|
|
196
132
|
|
|
197
|
-
|
|
133
|
+
## Resume, Retry, Stop
|
|
198
134
|
|
|
199
135
|
```bash
|
|
200
|
-
python3 ./.trellis/scripts/auto_loop.py
|
|
201
|
-
|
|
136
|
+
python3 ./.trellis/scripts/auto_loop.py resume
|
|
137
|
+
python3 ./.trellis/scripts/auto_loop.py next
|
|
202
138
|
|
|
203
|
-
|
|
139
|
+
python3 ./.trellis/scripts/auto_loop.py retry-blocked \
|
|
140
|
+
[--run-id <run-id>] [--task <task>] [--all] \
|
|
141
|
+
[--check-depth auto|light|full]
|
|
142
|
+
python3 ./.trellis/scripts/auto_loop.py next
|
|
204
143
|
|
|
205
|
-
|
|
144
|
+
python3 ./.trellis/scripts/auto_loop.py status [--verbose]
|
|
206
145
|
python3 ./.trellis/scripts/auto_loop.py stop --reason "<原因>"
|
|
207
146
|
```
|
|
208
147
|
|
|
209
|
-
|
|
148
|
+
默认使用紧凑输出;只有诊断 manifest、dirty、漂移、依赖链或决策详情时加 `--verbose`。`completed_with_blocked` 已是本次 run 的可审计终态,后续恢复由用户显式调用 `retry-blocked`。
|
|
149
|
+
|
|
150
|
+
## 禁止事项
|
|
210
151
|
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
152
|
+
- 不手写 `.trellis/.runtime/auto-loop/*.json`,不提交 runtime 或 `.route-prefs.tmp`。
|
|
153
|
+
- 不覆盖、暂存或提交 protected-retained 文件;发生路径冲突只阻塞涉及任务。
|
|
154
|
+
- 不用 `start --force` 代替 `retry-blocked`。
|
|
155
|
+
- 不把 queue item completed 解释为任务已归档。
|
|
156
|
+
- 不在无人值守执行中替用户回答 Open Questions。
|
|
@@ -362,7 +362,7 @@ interactive 模式完成所有可继续检查后,严格按以下顺序输出
|
|
|
362
362
|
结论:<重检结论与下一步>
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
-
|
|
365
|
+
检查通过后的动作由下方 `Interactive Post-Check Stop Gate` 判断:普通交互停止等待,符合 direct Git 严格通过条件时同轮进入 Phase 3.3 `trellis-update-spec`,再到 Phase 3.4 `trellis-push`。仍有问题时停留在修复/重检循环。
|
|
366
366
|
|
|
367
367
|
---
|
|
368
368
|
|
|
@@ -380,7 +380,14 @@ validated auto-loop 复用相同的 audit-only 检查、画像和问题模型,
|
|
|
380
380
|
|
|
381
381
|
## Interactive Post-Check Stop Gate
|
|
382
382
|
|
|
383
|
-
非 validated auto-loop
|
|
383
|
+
非 validated auto-loop 先输出上述完整标准报告,再在本 Gate 内按以下顺序分流:
|
|
384
|
+
|
|
385
|
+
1. 只从触发本轮完成链的最新用户消息识别 direct Git intent:明确请求普通 push,或用户主动 `commit-only`。不得从历史消息、任务标题、摘要、dirty 状态或 auto-loop 内部 action 推断。
|
|
386
|
+
2. direct Git 只有在 Check-All 整体结论通过、问题数为 0、无阻塞、无部分验证、无待用户接受的实质剩余风险时才算严格通过。标准报告输出后,同一轮进入 Phase 3.3 `trellis-update-spec`;`no-op|written` 再由其加载 `trellis-push`,`needs-review` 停止。
|
|
387
|
+
3. findings、blocked、部分验证或实质剩余风险均不满足条件:输出标准报告并停止,不运行 Update-Spec,也不生成 Git 计划。原始 Git 请求不授权自动修复、忽略问题或扩大 Git 权限。
|
|
388
|
+
4. 没有匹配 direct Git intent 的普通 interactive 检查保持原行为:报告后立即停止并等待用户选择。
|
|
389
|
+
|
|
390
|
+
允许 Check-All 标准报告输出的内容只有:
|
|
384
391
|
|
|
385
392
|
- 各维度状态、问题数和问题清单;
|
|
386
393
|
- 已执行验证及结果;
|
|
@@ -388,7 +395,7 @@ validated auto-loop 复用相同的 audit-only 检查、画像和问题模型,
|
|
|
388
395
|
- 总体结论;
|
|
389
396
|
- 有问题时的一次修复范围选择,或通过时的 Phase 3.3 / Phase 3.4 下一步指向。
|
|
390
397
|
|
|
391
|
-
|
|
398
|
+
Check-All 不新增 direct Git 专用摘要,也不得自行生成提交计划、commit message、拟提交文件或要求用户确认提交;strict pass 后的 Git 计划仍由 Update-Spec disposition 和 `trellis-push` owner 生成。
|
|
392
399
|
|
|
393
400
|
---
|
|
394
401
|
|
|
@@ -28,6 +28,17 @@ description: "按确认的精确文件范围提交普通变更或完成已就绪
|
|
|
28
28
|
|
|
29
29
|
内部 `commit-only` 不接受临时扩大文件范围、远端推送或其他附加动作。安全条件不满足时返回失败,由调用方决定后续状态。
|
|
30
30
|
|
|
31
|
+
## Step 0:交互式完成链门禁
|
|
32
|
+
|
|
33
|
+
除 auto-loop 内部 `commit-only` 外,任何普通 push 或用户 `commit-only` 在读取 Git 提交计划前,按以下顺序验证交互式完成链:
|
|
34
|
+
|
|
35
|
+
1. 当前工作内容缺少有效 Check-All,或实际 diff、检查范围/结论已变化:返回 Phase 2.2。唯一例外是当前有效 `spec_update_result.status=written` 的 `changed_files`,且这些受控写入全部位于 `.trellis/spec/**`;该 Update-Spec 自校验结果不触发额外 Check-All。当前 direct Git 请求只作为“严格通过后继续”的条件意图;Check-All 有 findings、blocked、部分验证或实质剩余风险时停止。此分支不得运行 Update-Spec,也不得读取 Git 计划。
|
|
36
|
+
2. Check-All 有效后检查当前有效的 `spec_update_result`。结果缺失,或除上述受控 spec 写入外的实际 diff、Check-All 结论、用户 spec 意图已变化时,先加载 `trellis-update-spec`;只有新的 `no-op|written` 才能回到本 skill。
|
|
37
|
+
3. `status=no-op|written`:继续本 skill 的 Git 预检与计划。
|
|
38
|
+
4. `status=needs-review`:停止,不生成提交计划。
|
|
39
|
+
|
|
40
|
+
用户直接说 push/提交不构成跳过 Phase 3.3 的授权。auto-loop 内部 `commit-only` 已由 runner 的 `run_spec_update -> commit_only` 状态机和预授权保证顺序,因此不得重复进入本门禁。
|
|
41
|
+
|
|
31
42
|
## Step 1:发现仓库与任务
|
|
32
43
|
|
|
33
44
|
候选仓库包括:
|
|
@@ -177,11 +177,13 @@ helper 写入规则:保留另一个 target 的 runtime 决策和偏好;覆
|
|
|
177
177
|
|
|
178
178
|
| 路由决定 | 主 agent 应执行 |
|
|
179
179
|
|---------|----------------|
|
|
180
|
-
| `inline implement` | `Skill({skill: "trellis-before-dev"})` 加载 spec → 读任务文档 → 主线程实施 → 跑必要验证 |
|
|
181
|
-
| `subagent implement` | `Agent({subagent_type: "trellis-implement"})`;若 `subagent_skip_compile=true`,dispatch prompt 附加“跳过 mvn install / npm run build / tsc 等耗时编译类检查(已由主 agent
|
|
180
|
+
| `inline implement` | `Skill({skill: "trellis-before-dev"})` 加载 spec → 读任务文档 → 主线程实施 → 跑必要验证 → 回到 Phase 2.1 completion contract 解析 Pre-Check,不得在局部验证后直接结束 |
|
|
181
|
+
| `subagent implement` | `Agent({subagent_type: "trellis-implement"})`;若 `subagent_skip_compile=true`,dispatch prompt 附加“跳过 mvn install / npm run build / tsc 等耗时编译类检查(已由主 agent 验证或最终统一执行)”;主 agent 收到结果后回到 Phase 2.1 completion contract 解析 Pre-Check |
|
|
182
182
|
| `inline check-all` | `Skill({skill: "trellis-check-all"})` |
|
|
183
183
|
| `subagent check-all` | 优先使用明确 audit-only 的 `trellis-check-all` agent;不存在时使用平台通用 subagent,并用下方 dispatch 契约执行本地 `trellis-check-all`。禁止 fallback 到会直接修改工作区的 `trellis-check` agent;无兼容 subagent 时停止并请用户改选 inline |
|
|
184
184
|
|
|
185
|
+
implement 路由只决定执行位置,不拥有实现后的停止策略。无论 inline 或 subagent,focused validation 完成后都必须返回 workflow Phase 2.1 的 completion contract;由该 owner 处理 auto-loop、用户显式继续/暂缓、已有 hold 和默认立即 Check-All 的优先级。
|
|
186
|
+
|
|
185
187
|
### Subagent Check-All Dispatch 契约
|
|
186
188
|
|
|
187
189
|
使用专用或通用 subagent 时,dispatch prompt 第一行必须是当前任务路径,并包含以下完整边界:
|