flower-trellis 0.6.13-beta.1 → 0.6.13-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +39 -0
  2. package/enhancements/0.6/.agents/skills/trellis-check-all/references/findings-and-reporting.md +2 -2
  3. package/enhancements/0.6/.agents/skills/trellis-check-all/references/repair-and-recheck.md +1 -3
  4. package/enhancements/0.6/.agents/skills/trellis-check-all/references/reporting-and-disposition.md +3 -3
  5. package/enhancements/0.6/.agents/skills/trellis-push/SKILL.md +2 -1
  6. package/enhancements/0.6/.agents/skills/trellis-task-brief/SKILL.md +6 -1
  7. package/enhancements/0.6/.claude/skills/trellis-check-all/references/findings-and-reporting.md +2 -2
  8. package/enhancements/0.6/.claude/skills/trellis-check-all/references/repair-and-recheck.md +1 -3
  9. package/enhancements/0.6/.claude/skills/trellis-check-all/references/reporting-and-disposition.md +3 -3
  10. package/enhancements/0.6/.claude/skills/trellis-push/SKILL.md +2 -1
  11. package/enhancements/0.6/.claude/skills/trellis-task-brief/SKILL.md +6 -1
  12. package/enhancements/0.6/overrides/conflicts.json +8 -7
  13. package/enhancements/0.6/overrides/patches/skills/trellis-brainstorm/planning-handoff/content.md +1 -1
  14. package/enhancements/0.6/overrides/patches/workflow/intent-routing/phase-summary/guardrail-content.md +1 -1
  15. package/enhancements/0.6/overrides/patches/workflow/phase-ownership/phase-2-check-content.md +2 -2
  16. package/enhancements/0.6/overrides/patches/workflow/states-planning/common-content.md +1 -1
  17. package/enhancements/0.6/overrides/patches/workflow/task-brief-review/phase-1-activate-content.md +2 -2
  18. package/enhancements/0.6/scripts/confirmation.md +25 -0
  19. package/enhancements/0.6/scripts/confirmation.py +427 -0
  20. package/enhancements/MANIFEST.json +4 -2
  21. package/package.json +3 -3
  22. package/src/assets/confirmation_process.py +146 -0
  23. package/src/assets/flower_session_start.py +40 -5
  24. package/src/builtin-plugins/skill-garden/content-adapter.js +3 -0
  25. package/src/cli.js +9 -4
  26. package/src/commands/session.js +42 -0
  27. package/src/constants.js +7 -0
  28. package/src/lib/config-preserver.js +1 -1
  29. package/src/lib/confirmation-harnesses.js +107 -0
  30. package/src/lib/confirmation-ipc.js +59 -0
  31. package/src/lib/confirmation-mcp.js +73 -0
  32. package/src/lib/confirmation-server.js +123 -0
  33. package/src/lib/confirmation-session.js +170 -0
  34. package/src/lib/confirmation-snapshot.js +58 -0
  35. package/src/lib/confirmation-state.js +243 -0
  36. package/src/lib/copy-scripts.js +12 -5
  37. package/src/lib/global-trellis-sync.js +2 -10
  38. package/src/lib/npm-node-shim.js +36 -0
package/README.md CHANGED
@@ -105,6 +105,7 @@ flower-trellis -v
105
105
  | `telemetry` | 查询、启用或停用用户级匿名安装遥测 |
106
106
  | `plugin` | 管理 Flower Plugin、Marketplace 来源、GitLab 授权和作者校验 |
107
107
  | `worktree` | 创建独立 Git 工作区,准备目标本地工具 |
108
+ | `session` | 通过统一前台入口启动 Codex / Claude,接入会话内限时确认 |
108
109
  | `uninstall` | 移除 Trellis 本体并清理强化包残留(支持 `-y` / `--dry-run`) |
109
110
  | `<其它命令>` | 原样透传给 Trellis,覆盖其现有及未来子命令 |
110
111
  | `-v` / `-h` | 打印版本 / 帮助 |
@@ -124,6 +125,44 @@ flower-trellis -v
124
125
 
125
126
  未指定平台时,交互模式会弹出多选菜单(默认勾选 Claude Code + Codex);也可直接传 `--claude` / `--codex` / `--cursor` / `--devin` / `--zcode` / `--trae` / `--omp` / `--grok` / `--kimi` / `--snow` 等指定,或用 `-y` 跳过菜单。`--windsurf` 仍作为 Devin 的旧别名透传给 Trellis。其余未识别的 flag(如 `-u`、`-f`、`--template`、`--with-statusline`)一律透传给 Trellis。
126
127
 
128
+ ## 限时确认
129
+
130
+ 项目安装或更新到包含确认协议的强化包后,通过统一入口启动交互会话:
131
+
132
+ ```bash
133
+ ftl session -- codex
134
+ ftl session -- claude
135
+ ftl session --target ../my-project -- codex --model <模型>
136
+ ```
137
+
138
+ `--` 后的原参数完整交给 Harness。入口仅为本次会话注册一个 MCP `wait` 工具,精确允许该等待工具;保留其它工具和权限,不写用户全局 MCP 配置。接口基线为 Codex 0.167.0、Claude Code 2.1.293,且须通过当前会话身份、工具发现和进程约束验证。原生命令继续可用,非交互、不同工作目录或独立配置模式回到人工确认;其他 Harness 和尚未验证的操作系统不启用自动模式。
139
+
140
+ Brief 首次开工、Check-All 问题处置、Push 提交计划在能力有效时默认开启。入口完整展示冻结方案、默认动作及秒数后开始等待;Brief 默认开工,检查默认修复当前全部待处置项并重检,提交沿用有效计划的 commit + push,明确 commit-only 时才仅本地提交。Spec 未决事项和新业务取舍仍由用户决定。
141
+
142
+ 在 `.trellis/config.yaml` 调整秒数;省略字段采用下列默认值,更新会保留该配置:
143
+
144
+ ```yaml
145
+ confirmation_timeout:
146
+ enabled: true
147
+ brief:
148
+ enabled: true
149
+ base_seconds: 100
150
+ threshold_chars: 1000
151
+ increment_chars: 500
152
+ increment_seconds: 30
153
+ check:
154
+ enabled: true
155
+ base_seconds: 100
156
+ increment_seconds: 30
157
+ push:
158
+ enabled: true
159
+ seconds: 200
160
+ ```
161
+
162
+ Brief 超过1000字后每500字加30秒,不足一档按一档;文件首尾空白不计字。检查第一条100秒、之后每条加30秒,零条不等待。项目或单类 `enabled: false` 可关闭;损坏配置和超出工具预算会保持人工确认,不截短等待时间。
163
+
164
+ 任何真实按键会先撤销尚未领取的默认决定,再交给原生界面;工具已返回而尚未领取时也可取消。材料或 Git 基线变化后必须重新展示。关闭入口会取消本次等待并结束自有 CLI 和辅助进程,重开不会补跑;已开始的副作用按实际结果报告。最小审计保存在项目 gitignored `.trellis/.runtime/confirmations/`,没有持久唤醒任务,等待期间不轮询模型。
165
+
127
166
  ## 并行工作区
128
167
 
129
168
  先查看创建计划,再使用返回的指纹确认。任务参数可选,省略时只创建和准备工作区:
@@ -63,7 +63,7 @@
63
63
 
64
64
  按“接受后的增量展示”在对话中报告。不得为缩短回复、留存结论或同步任务状态新建 `check-report.md` 等附件或用链接代替应展示内容。
65
65
 
66
- 仅用户明确导出或已确认交付约定要求时由主会话保存。Maven、auto-loop 沿用机器证据契约,不额外生成 Markdown;已有报告不自动删除或复制。
66
+ 仅用户明确导出或交付约定时保存附件。Maven、auto-loop 沿用机器证据契约,不另建 Markdown;已有报告不删除或复制。
67
67
 
68
68
  interactive 完成检查与允许的 DOC 修复后,先自然说明实际改动、行为影响和结论,再展示证据与问题:
69
69
 
@@ -157,7 +157,7 @@ interactive 完成检查与允许的 DOC 修复后,先自然说明实际改动
157
157
 
158
158
  ## 修复与重检
159
159
 
160
- 用户选择 `修复全部`、混合精确问题 ID 或其它明确修复范围后,必须先读取 `references/repair-and-recheck.md` 执行修复续行;未选择时不加载。
160
+ 用户选择 `修复全部`、混合精确问题 ID 或其它明确修复范围,或取得有效 check claim 后,必须先读取 `references/repair-and-recheck.md` 执行修复续行;人工路径未选择时不加载。
161
161
 
162
162
  修复完成后输出:
163
163
 
@@ -1,8 +1,6 @@
1
1
  # Repair And Recheck
2
2
 
3
- 仅在用户选定当前报告的修复范围后读取;未选择时保持检查只读边界。
4
-
5
- 用户选择 `修复全部`、混合精确问题 ID 或其它明确修复范围后:
3
+ 仅在用户选定当前报告修复范围或取得有效 check claim 后读取;否则保持只读。
6
4
 
7
5
  本修复续行优先于新需求分类和 Active Task Scope Guard:归属依据是受检事项、报告证据和用户选定范围。问题跨模块、属于既有缺陷或未写入任务标题/Brief,不单独构成新需求;不得因此新建或纳管任务,也不得重走首次 Brief 确认。必要材料同步沿用 `trellis-task-brief` 的增量规则。
8
6
 
@@ -6,7 +6,7 @@
6
6
  - validated auto-loop:读 `references/auto-loop-return.md`,匹配 action 的 record 成功后立即 next;不渲染交互报告。
7
7
  - 普通 light strict pass:只执行下方简短格式,不读取上述细则。
8
8
 
9
- 默认只在对话中报告,不新建报告附件。只有用户明确导出或已确认交付约定要求时保存;Maven 与 runner 沿用机器证据。不得用链接代替应展示内容。
9
+ 默认只在对话中报告,不新建报告附件;受控跨进程确认仅按 `.trellis/scripts/confirmation.md` 使用 gitignored runtime。导出须用户明确要求或交付约定;Maven 与 runner 沿用机器证据。不得用链接代替应展示内容。
10
10
 
11
11
  ## Light 通过报告
12
12
 
@@ -43,7 +43,7 @@ untracked helper 不存检查证据或风险接受。通过且按下方 Gate 默
43
43
  非 validated auto-loop 先按本文件输出标准报告或接受状态的简短确认,再依序分流;不重贴已有报告:
44
44
 
45
45
  1. 先识别当前事项最新有效的明确停止要求:`只检查`、`只读检查`、`检查后停止`、`暂不收尾`、`仅接受、不继续` 等。停止收尾,不运行 Update-Spec 或生成 Git 计划;同一事项后续明确继续可解除该限制。普通“检查一下”不等于只检查后停止,不从无关历史或摘要猜测限制。
46
- 2. 未处置 `CHK-*` / `FBK-*`、blocked、阻断型部分验证或其它未接受实质风险(`[上线后验证]` 除外)时,报告并停止,不运行 Update-Spec 或生成 Git 计划。Git 请求不授权修复或代用户接受风险;普通代码问题始终由用户选择修复范围。
46
+ 2. 未处置 `CHK-*` / `FBK-*`、blocked、阻断型部分验证或其它未接受实质风险(`[上线后验证]` 除外)时,不运行 Update-Spec 或生成 Git 计划。受控会话没有停止/只读要求、全部当前项可修复时,按 `.trellis/scripts/confirmation.md` 冻结完整报告和全部待处置 ID;有效 check claim 选择修复全部并重检,新业务取舍暂停。无有效 claim 时报告并停止等待人工选择;任何超时均不接受风险。受控例外以外,普通代码问题始终由用户选择修复范围;Git 请求本身不授权修复。
47
47
  3. 没有有效停止要求且 strict pass,或全部 findings 已有效接受时,默认同轮继续;通过条件沿用已加载 findings reference 的风险接受规则和本文件验证阶段,完整登记的 `[上线后验证]` 不阻断。报告或简短确认后同轮进入 Update-Spec,`no-op|written` 再到 Push,`needs-review` 停止。无需 direct Git intent 或额外回复“继续”,通过不授权 Git 写入。
48
48
  4. 只从当前完成链证据识别 direct Git intent,保留 push / 用户主动 `commit-only` 选择;不从无关历史、摘要、dirty 状态或 auto-loop action 推断。风险接受沿用 findings reference 的证据规则。
49
49
 
@@ -51,7 +51,7 @@ untracked helper 不存检查证据或风险接受。通过且按下方 Gate 默
51
51
 
52
52
  所有 interactive 标准报告都必须在末尾输出 `### 下一步`,并按以下首个命中分支给出一个明确主动作:
53
53
 
54
- 1. 有未处置 findings:提示 `修复全部`、精确 ID、接受当前报告全部风险、`接受风险 <ID> 并继续` 或 `仅保留报告`;不逐项重复确认。
54
+ 1. 有未处置 findings:提示 `修复全部`、精确 ID、接受当前报告全部风险、`接受风险 <ID> 并继续` 或 `仅保留报告`;不逐项重复确认。受控分支说明默认动作和时长后按协议等待,不能写成已修复。
55
55
  2. 有 blocked、阻断型部分验证或未标记 `[上线后验证]` 的实质风险:指出所需决策、授权或验证,完成后重跑 Check-All;不自行执行生产、外部或破坏性操作。
56
56
  3. 有有效的明确停止要求且检查通过:说明已按要求停止,之后明确继续才恢复收尾。
57
57
  4. 无有效停止要求且 strict pass / 已接受风险通过:说明本轮正在进入 `trellis-update-spec`,不要求用户再次回复“继续”;Git 计划确认仍由 Push 执行。
@@ -5,7 +5,7 @@ description: "按确认的精确文件范围提交普通变更或完成已就绪
5
5
 
6
6
  # Trellis Push
7
7
 
8
- `trellis-push` 是 Phase 3.4 唯一的代码提交入口。负责最小计划、精确提交与普通推送;task 同步进度,untracked 清理状态。
8
+ `trellis-push` 是 Phase 3.4 唯一的代码提交入口。负责最小计划、精确提交推送、task 进度与 untracked 清理。
9
9
 
10
10
  ## 职责与条件入口
11
11
 
@@ -21,6 +21,7 @@ description: "按确认的精确文件范围提交普通变更或完成已就绪
21
21
  | 普通 push 且有活动 task | [task-progress.md](references/task-progress.md);计划前读取,业务 Git 后执行 |
22
22
  | taskStatus=completed 的恢复 | [completed-task-recovery.md](references/completed-task-recovery.md);先完成只读 preflight |
23
23
  | validated runner 的内部 commit-only | [auto-loop-commit.md](references/auto-loop-commit.md);不 push、不执行 Step 5、不渲染交互模板 |
24
+ | 超时 | `.trellis/scripts/confirmation.md` |
24
25
 
25
26
  未命中场景不加载其 reference;命中却缺失细则时阻塞,不凭记忆代替。内部 commit-only 只接受 runner 的合法预授权。
26
27
 
@@ -13,6 +13,10 @@ description: "从最新 prd.md、design.md、implement.md 生成、刷新、校
13
13
 
14
14
  本例外沿用 runner 的 prepare、Open Questions、readiness 和 artifact 校验,不扩张任务或授权边界。schema 1 返回的 `refresh_brief` 同样在展示后交回 runner,由后续 `confirm_brief` action 等待人工确认。run 已停止、终态、损坏或 action/task 不匹配时不得免确认或代为推进;由 auto-loop owner 处理诊断。普通交互调用继续遵守以下确认规则。
15
15
 
16
+ ## 受控会话超时确认
17
+
18
+ 当前启动上下文明确提供会话确认控制器时,首次评审先读取 `.trellis/scripts/confirmation.md`。按该协议把最新 Brief 交给控制器完整展示;只有匹配本次材料的 `brief / implement` 单次 claim 成功,才在同轮启动任务。未决事项、明确暂停、能力缺失或领取失败仍等待人工;这不是把沉默解释为用户确认。auto-loop 优先使用上方 runner 例外。
19
+
16
20
  ## 核心规则
17
21
 
18
22
  - 每次运行都重新读取最新 `prd.md`、`design.md if present`、`implement.md if present`。
@@ -21,7 +25,7 @@ description: "从最新 prd.md、design.md、implement.md 生成、刷新、校
21
25
  - 不要在 `brief.md` 里发明三件套没有表达的新需求。必填字段缺失时写“未明确”,并提示应补充三件套;没有明确技术机制时省略 `Technical Overview`,没有具体风险时省略 `Risks`。
22
26
  - `Goal` 保持一句话,`Scope` 只写本轮纳入的行为或改动对象;延期事项归入 `Non-Goals`,不另设栏目,也不把范围、方案和验收写成同义复述。
23
27
  - 首次开工评审或用户明确要求查看全貌时,写回 `brief.md` 后必须展示 brief 正文,不要只给文件路径;首次批准后的同步按下方增量规则展示变化。
24
- - 首次实施批准前必须展示完整 brief。除上方经 runner 校验的 Auto-Loop Action 例外外,默认等待用户确认后再运行 `task.py start`;只有用户明确把当前任务或最终 Brief 与“展示后直接开始 / 不用再次确认 / 视为已确认”绑定时,才可在范围未变化的前提下免除第二次确认。
28
+ - 首次实施批准前必须展示完整 brief。除经 runner 校验的 Auto-Loop Action 或上方受控会话有效 claim 外,默认等待用户确认后再运行 `task.py start`;只有用户明确把当前任务或最终 Brief 与“展示后直接开始 / 不用再次确认 / 视为已确认”绑定时,才可在范围未变化的前提下免除第二次确认。
25
29
  - “开始做吧”“按你建议来”“可以创建任务”等普通实现或建任务意图不是 Brief 预授权,不能据此跳过确认。
26
30
  - 普通交互预授权只依赖当前对话中仍然明确可见的用户表达,不建立跨会话永久偏好,也不写 session runtime;auto-loop 恢复由上方 runner 例外所有。
27
31
  - `in_progress` 阶段只读取 brief 和任务材料,不例行重新生成、展示或确认;新会话或压缩恢复同样如此。首次批准后的方案变化按下方增量规则处理,用户明确要求查看时再完整展示。
@@ -69,6 +73,7 @@ description: "从最新 prd.md、design.md、implement.md 生成、刷新、校
69
73
  6. 写回 `<task>/brief.md`。如果文件已存在,仍用最新三件套派生内容覆盖旧正文。
70
74
  7. 在对话中展示 brief 正文,并说明来源文件:
71
75
  - 经校验的 auto-loop `refresh_brief`:展示后返回 runner,不进入下方交互分支;schema 1 的确认由后续 action 所有。
76
+ - 受控会话:按上方协议由控制器完整展示并等待;只有有效 claim 才同轮返回主 workflow 启动任务,取消或失效时转人工。该可信终端展示满足本步骤,不重复输出正文。
72
77
  - 无有效预授权:展示后结束当前回合,等待用户确认。
73
78
  - 有有效预授权:先完整展示,再在同一回合返回主 workflow 执行 `task.py start`,不得省略展示步骤。
74
79
 
@@ -63,7 +63,7 @@
63
63
 
64
64
  按“接受后的增量展示”在对话中报告。不得为缩短回复、留存结论或同步任务状态新建 `check-report.md` 等附件或用链接代替应展示内容。
65
65
 
66
- 仅用户明确导出或已确认交付约定要求时由主会话保存。Maven、auto-loop 沿用机器证据契约,不额外生成 Markdown;已有报告不自动删除或复制。
66
+ 仅用户明确导出或交付约定时保存附件。Maven、auto-loop 沿用机器证据契约,不另建 Markdown;已有报告不删除或复制。
67
67
 
68
68
  interactive 完成检查与允许的 DOC 修复后,先自然说明实际改动、行为影响和结论,再展示证据与问题:
69
69
 
@@ -157,7 +157,7 @@ interactive 完成检查与允许的 DOC 修复后,先自然说明实际改动
157
157
 
158
158
  ## 修复与重检
159
159
 
160
- 用户选择 `修复全部`、混合精确问题 ID 或其它明确修复范围后,必须先读取 `references/repair-and-recheck.md` 执行修复续行;未选择时不加载。
160
+ 用户选择 `修复全部`、混合精确问题 ID 或其它明确修复范围,或取得有效 check claim 后,必须先读取 `references/repair-and-recheck.md` 执行修复续行;人工路径未选择时不加载。
161
161
 
162
162
  修复完成后输出:
163
163
 
@@ -1,8 +1,6 @@
1
1
  # Repair And Recheck
2
2
 
3
- 仅在用户选定当前报告的修复范围后读取;未选择时保持检查只读边界。
4
-
5
- 用户选择 `修复全部`、混合精确问题 ID 或其它明确修复范围后:
3
+ 仅在用户选定当前报告修复范围或取得有效 check claim 后读取;否则保持只读。
6
4
 
7
5
  本修复续行优先于新需求分类和 Active Task Scope Guard:归属依据是受检事项、报告证据和用户选定范围。问题跨模块、属于既有缺陷或未写入任务标题/Brief,不单独构成新需求;不得因此新建或纳管任务,也不得重走首次 Brief 确认。必要材料同步沿用 `trellis-task-brief` 的增量规则。
8
6
 
@@ -6,7 +6,7 @@
6
6
  - validated auto-loop:读 `references/auto-loop-return.md`,匹配 action 的 record 成功后立即 next;不渲染交互报告。
7
7
  - 普通 light strict pass:只执行下方简短格式,不读取上述细则。
8
8
 
9
- 默认只在对话中报告,不新建报告附件。只有用户明确导出或已确认交付约定要求时保存;Maven 与 runner 沿用机器证据。不得用链接代替应展示内容。
9
+ 默认只在对话中报告,不新建报告附件;受控跨进程确认仅按 `.trellis/scripts/confirmation.md` 使用 gitignored runtime。导出须用户明确要求或交付约定;Maven 与 runner 沿用机器证据。不得用链接代替应展示内容。
10
10
 
11
11
  ## Light 通过报告
12
12
 
@@ -43,7 +43,7 @@ untracked helper 不存检查证据或风险接受。通过且按下方 Gate 默
43
43
  非 validated auto-loop 先按本文件输出标准报告或接受状态的简短确认,再依序分流;不重贴已有报告:
44
44
 
45
45
  1. 先识别当前事项最新有效的明确停止要求:`只检查`、`只读检查`、`检查后停止`、`暂不收尾`、`仅接受、不继续` 等。停止收尾,不运行 Update-Spec 或生成 Git 计划;同一事项后续明确继续可解除该限制。普通“检查一下”不等于只检查后停止,不从无关历史或摘要猜测限制。
46
- 2. 未处置 `CHK-*` / `FBK-*`、blocked、阻断型部分验证或其它未接受实质风险(`[上线后验证]` 除外)时,报告并停止,不运行 Update-Spec 或生成 Git 计划。Git 请求不授权修复或代用户接受风险;普通代码问题始终由用户选择修复范围。
46
+ 2. 未处置 `CHK-*` / `FBK-*`、blocked、阻断型部分验证或其它未接受实质风险(`[上线后验证]` 除外)时,不运行 Update-Spec 或生成 Git 计划。受控会话没有停止/只读要求、全部当前项可修复时,按 `.trellis/scripts/confirmation.md` 冻结完整报告和全部待处置 ID;有效 check claim 选择修复全部并重检,新业务取舍暂停。无有效 claim 时报告并停止等待人工选择;任何超时均不接受风险。受控例外以外,普通代码问题始终由用户选择修复范围;Git 请求本身不授权修复。
47
47
  3. 没有有效停止要求且 strict pass,或全部 findings 已有效接受时,默认同轮继续;通过条件沿用已加载 findings reference 的风险接受规则和本文件验证阶段,完整登记的 `[上线后验证]` 不阻断。报告或简短确认后同轮进入 Update-Spec,`no-op|written` 再到 Push,`needs-review` 停止。无需 direct Git intent 或额外回复“继续”,通过不授权 Git 写入。
48
48
  4. 只从当前完成链证据识别 direct Git intent,保留 push / 用户主动 `commit-only` 选择;不从无关历史、摘要、dirty 状态或 auto-loop action 推断。风险接受沿用 findings reference 的证据规则。
49
49
 
@@ -51,7 +51,7 @@ untracked helper 不存检查证据或风险接受。通过且按下方 Gate 默
51
51
 
52
52
  所有 interactive 标准报告都必须在末尾输出 `### 下一步`,并按以下首个命中分支给出一个明确主动作:
53
53
 
54
- 1. 有未处置 findings:提示 `修复全部`、精确 ID、接受当前报告全部风险、`接受风险 <ID> 并继续` 或 `仅保留报告`;不逐项重复确认。
54
+ 1. 有未处置 findings:提示 `修复全部`、精确 ID、接受当前报告全部风险、`接受风险 <ID> 并继续` 或 `仅保留报告`;不逐项重复确认。受控分支说明默认动作和时长后按协议等待,不能写成已修复。
55
55
  2. 有 blocked、阻断型部分验证或未标记 `[上线后验证]` 的实质风险:指出所需决策、授权或验证,完成后重跑 Check-All;不自行执行生产、外部或破坏性操作。
56
56
  3. 有有效的明确停止要求且检查通过:说明已按要求停止,之后明确继续才恢复收尾。
57
57
  4. 无有效停止要求且 strict pass / 已接受风险通过:说明本轮正在进入 `trellis-update-spec`,不要求用户再次回复“继续”;Git 计划确认仍由 Push 执行。
@@ -5,7 +5,7 @@ description: "按确认的精确文件范围提交普通变更或完成已就绪
5
5
 
6
6
  # Trellis Push
7
7
 
8
- `trellis-push` 是 Phase 3.4 唯一的代码提交入口。负责最小计划、精确提交与普通推送;task 同步进度,untracked 清理状态。
8
+ `trellis-push` 是 Phase 3.4 唯一的代码提交入口。负责最小计划、精确提交推送、task 进度与 untracked 清理。
9
9
 
10
10
  ## 职责与条件入口
11
11
 
@@ -21,6 +21,7 @@ description: "按确认的精确文件范围提交普通变更或完成已就绪
21
21
  | 普通 push 且有活动 task | [task-progress.md](references/task-progress.md);计划前读取,业务 Git 后执行 |
22
22
  | taskStatus=completed 的恢复 | [completed-task-recovery.md](references/completed-task-recovery.md);先完成只读 preflight |
23
23
  | validated runner 的内部 commit-only | [auto-loop-commit.md](references/auto-loop-commit.md);不 push、不执行 Step 5、不渲染交互模板 |
24
+ | 超时 | `.trellis/scripts/confirmation.md` |
24
25
 
25
26
  未命中场景不加载其 reference;命中却缺失细则时阻塞,不凭记忆代替。内部 commit-only 只接受 runner 的合法预授权。
26
27
 
@@ -13,6 +13,10 @@ description: "从最新 prd.md、design.md、implement.md 生成、刷新、校
13
13
 
14
14
  本例外沿用 runner 的 prepare、Open Questions、readiness 和 artifact 校验,不扩张任务或授权边界。schema 1 返回的 `refresh_brief` 同样在展示后交回 runner,由后续 `confirm_brief` action 等待人工确认。run 已停止、终态、损坏或 action/task 不匹配时不得免确认或代为推进;由 auto-loop owner 处理诊断。普通交互调用继续遵守以下确认规则。
15
15
 
16
+ ## 受控会话超时确认
17
+
18
+ 当前启动上下文明确提供会话确认控制器时,首次评审先读取 `.trellis/scripts/confirmation.md`。按该协议把最新 Brief 交给控制器完整展示;只有匹配本次材料的 `brief / implement` 单次 claim 成功,才在同轮启动任务。未决事项、明确暂停、能力缺失或领取失败仍等待人工;这不是把沉默解释为用户确认。auto-loop 优先使用上方 runner 例外。
19
+
16
20
  ## 核心规则
17
21
 
18
22
  - 每次运行都重新读取最新 `prd.md`、`design.md if present`、`implement.md if present`。
@@ -21,7 +25,7 @@ description: "从最新 prd.md、design.md、implement.md 生成、刷新、校
21
25
  - 不要在 `brief.md` 里发明三件套没有表达的新需求。必填字段缺失时写“未明确”,并提示应补充三件套;没有明确技术机制时省略 `Technical Overview`,没有具体风险时省略 `Risks`。
22
26
  - `Goal` 保持一句话,`Scope` 只写本轮纳入的行为或改动对象;延期事项归入 `Non-Goals`,不另设栏目,也不把范围、方案和验收写成同义复述。
23
27
  - 首次开工评审或用户明确要求查看全貌时,写回 `brief.md` 后必须展示 brief 正文,不要只给文件路径;首次批准后的同步按下方增量规则展示变化。
24
- - 首次实施批准前必须展示完整 brief。除上方经 runner 校验的 Auto-Loop Action 例外外,默认等待用户确认后再运行 `task.py start`;只有用户明确把当前任务或最终 Brief 与“展示后直接开始 / 不用再次确认 / 视为已确认”绑定时,才可在范围未变化的前提下免除第二次确认。
28
+ - 首次实施批准前必须展示完整 brief。除经 runner 校验的 Auto-Loop Action 或上方受控会话有效 claim 外,默认等待用户确认后再运行 `task.py start`;只有用户明确把当前任务或最终 Brief 与“展示后直接开始 / 不用再次确认 / 视为已确认”绑定时,才可在范围未变化的前提下免除第二次确认。
25
29
  - “开始做吧”“按你建议来”“可以创建任务”等普通实现或建任务意图不是 Brief 预授权,不能据此跳过确认。
26
30
  - 普通交互预授权只依赖当前对话中仍然明确可见的用户表达,不建立跨会话永久偏好,也不写 session runtime;auto-loop 恢复由上方 runner 例外所有。
27
31
  - `in_progress` 阶段只读取 brief 和任务材料,不例行重新生成、展示或确认;新会话或压缩恢复同样如此。首次批准后的方案变化按下方增量规则处理,用户明确要求查看时再完整展示。
@@ -69,6 +73,7 @@ description: "从最新 prd.md、design.md、implement.md 生成、刷新、校
69
73
  6. 写回 `<task>/brief.md`。如果文件已存在,仍用最新三件套派生内容覆盖旧正文。
70
74
  7. 在对话中展示 brief 正文,并说明来源文件:
71
75
  - 经校验的 auto-loop `refresh_brief`:展示后返回 runner,不进入下方交互分支;schema 1 的确认由后续 action 所有。
76
+ - 受控会话:按上方协议由控制器完整展示并等待;只有有效 claim 才同轮返回主 workflow 启动任务,取消或失效时转人工。该可信终端展示满足本步骤,不重复输出正文。
72
77
  - 无有效预授权:展示后结束当前回合,等待用户确认。
73
78
  - 有有效预授权:先完整展示,再在同一回合返回主 workflow 执行 `task.py start`,不得省略展示步骤。
74
79
 
@@ -116,12 +116,13 @@
116
116
  "values": [
117
117
  "The existing `Interactive Post-Check Stop Gate` owns default continuation and explicit stopping.",
118
118
  "without another next/continue reply or a direct Git prerequisite",
119
- "checks never authorize ordinary code repair",
119
+ "repair needs a selected scope or a matching controlled-session `check` claim",
120
+ "timeout cannot accept risks",
120
121
  "or replace Push confirmation"
121
122
  ]
122
123
  },
123
124
  "owner": "trellis-check-all",
124
- "reason": "检查通过后默认推进,明确只检查仍停止;普通修复和 Git 写入仍需人工决定。"
125
+ "reason": "检查通过后默认推进,明确只检查仍停止;修复需人工范围或有效受控 claim,风险接受仍须人工,Git 归 Push。"
125
126
  },
126
127
  {
127
128
  "id": "workflow-required-task-brief-review",
@@ -134,14 +135,14 @@
134
135
  "type": "required-literal",
135
136
  "values": [
136
137
  "<!-- BEGIN skill-garden patch workflow-phase-1-activate v0.6 -->\n#### 1.4 Activate task `[required · once]`\n\nBefore changing task status, load `trellis-task-brief`",
137
- "Unless `trellis-task-brief` validates an explicit preauthorization for the current final Brief",
138
+ "Unless `trellis-task-brief` validates an explicit preauthorization for the current final Brief or a matching controlled-session `brief` policy-timeout claim",
138
139
  "Ordinary implementation or task-creation intent is not confirmation.",
139
140
  "After initial approval, follow that owner's incremental change rules",
140
- "After a later confirmation, or in the same turn when that explicit preauthorization remains valid"
141
+ "After a later confirmation, or in the same turn when that explicit preauthorization remains valid or a matching single-use policy-timeout claim succeeds"
141
142
  ]
142
143
  },
143
144
  "owner": "trellis-task-brief",
144
- "reason": "Phase 1.4 只保留 Brief 展示、默认等待和由 trellis-task-brief 验证的预授权分支。"
145
+ "reason": "Phase 1.4 由 trellis-task-brief 完整展示并校验人工、预授权或匹配材料的一次性超时 claim。"
145
146
  },
146
147
  {
147
148
  "id": "brainstorm-required-planning-handoff",
@@ -157,7 +158,7 @@
157
158
  "<!-- BEGIN skill-garden patch brainstorm-planning-handoff v0.6 -->\n## Quality Bar",
158
159
  "## Planning Handoff",
159
160
  "<!-- BEGIN skill-garden patch brainstorm-planning-readiness v0.6 -->\n8. Load `trellis-task-brief`",
160
- "Only valid explicit preauthorization for the current final Brief, as defined by `trellis-task-brief`, permits same-turn start within unchanged scope.",
161
+ "Only valid explicit preauthorization or a matching controlled-session policy-timeout claim under `trellis-task-brief` permits same-turn start within unchanged scope.",
161
162
  "The final Brief must cover a one-sentence Goal, a Scope limited to included changes, Non-Goals, Context & Decisions, Acceptance, and one-hop Next Step",
162
163
  "Ordinary implementation intent expressed before the final artifacts and full Brief are shown authorizes planning only",
163
164
  "Once initial Brief approval exists, plan updates use `trellis-task-brief`'s incremental change rules.",
@@ -182,7 +183,7 @@
182
183
  "<!-- BEGIN skill-garden patch brainstorm-planning-handoff v0.6 -->\n## Quality Bar",
183
184
  "## Planning Handoff",
184
185
  "<!-- BEGIN skill-garden patch brainstorm-planning-readiness v0.6 -->\n8. Load `trellis-task-brief`",
185
- "Only valid explicit preauthorization for the current final Brief, as defined by `trellis-task-brief`, permits same-turn start within unchanged scope.",
186
+ "Only valid explicit preauthorization or a matching controlled-session policy-timeout claim under `trellis-task-brief` permits same-turn start within unchanged scope.",
186
187
  "The final Brief must cover a one-sentence Goal, a Scope limited to included changes, Non-Goals, Context & Decisions, Acceptance, and one-hop Next Step",
187
188
  "Ordinary implementation intent expressed before the final artifacts and full Brief are shown authorizes planning only",
188
189
  "Once initial Brief approval exists, plan updates use `trellis-task-brief`'s incremental change rules.",
@@ -14,7 +14,7 @@ Do not start implementation merely because the user originally asked for impleme
14
14
 
15
15
  ## Planning Handoff
16
16
 
17
- Once the Quality Bar is satisfied, load `trellis-task-brief`, refresh `brief.md` from the final planning artifacts, and display the full Brief in chat. By default, end the current turn and wait for the user's planning review confirmation. Only valid explicit preauthorization for the current final Brief, as defined by `trellis-task-brief`, permits same-turn start within unchanged scope.
17
+ Once the Quality Bar is satisfied, load `trellis-task-brief`, refresh `brief.md` from final planning artifacts, and display the full Brief in chat or through that owner's verified foreground controller. By default, end the current turn and wait for the user's planning review confirmation. Only valid explicit preauthorization or a matching controlled-session policy-timeout claim under `trellis-task-brief` permits same-turn start within unchanged scope.
18
18
 
19
19
  Ordinary implementation intent expressed before the final artifacts and full Brief are shown authorizes planning only; it cannot be reused as the final review confirmation.
20
20
 
@@ -1 +1 @@
1
- - Task creation approval is not implementation approval; task implementation waits for `task.py start` after artifact review.
1
+ - Task creation approval is not implementation approval; task implementation waits for `task.py start` after artifact review. `trellis-task-brief` owns any verified controlled-session timeout claim.
@@ -6,8 +6,8 @@ For untracked work, route reads only the personal pref helper and the dispatch p
6
6
 
7
7
  Before interactive Check-All begins, run `python3 ./.trellis/scripts/pre_check_state.py clear`. A missing, subject-mismatched, or already-cleared preference is a no-op; a damaged runtime is reported diagnostically but safely defaults to checking.
8
8
 
9
- Check-All selects light/full depth from intent, actual behavioral-contract impact, and runtime context. It is audit-only and collect-all by default: classify main-path issues as `CHK-*`, fallback-path issues as `FBK-*`, and low-risk factual drift as `DOC-*`. Assign P0/P1/P2 after root-cause classification; severity does not choose the channel. Report all items and stop before code changes only when `CHK-*` / `FBK-*` repair scope needs confirmation. The only write exception is low-risk `DOC-*` auto-remediation for eligible documents or narrowly verified source-comment facts, never executable code, unless a validated auto-loop owns the continuation.
9
+ Check-All selects light/full depth from intent, actual behavioral-contract impact, and runtime context. It is audit-only and collect-all by default: classify main-path issues as `CHK-*`, fallback-path issues as `FBK-*`, and low-risk factual drift as `DOC-*`. Assign P0/P1/P2 after classification. Report all items before code changes; repair needs a selected scope or a matching controlled-session `check` claim under Check-All's reporting owner. Low-risk `DOC-*` auto-remediation remains the sole audit-stage write exception, unless a validated auto-loop owns continuation.
10
10
 
11
- The existing `Interactive Post-Check Stop Gate` owns default continuation and explicit stopping. Unless the user explicitly requests check-only, read-only checking, stopping after the check, or no further completion work for this subject, a strict pass or a pass with every remaining finding explicitly and validly accepted by the user continues to `trellis-update-spec` in the same turn, without another next/continue reply or a direct Git prerequisite. Both paths require no blocker, no blocking partial verification, and no unaccepted material residual risk outside explicitly recorded `[上线后验证]`. A user reply accepting all findings from the current report covers the full report, including P0, without a fixed phrase or repeated ID confirmation; partial acceptance must identify a unique subset. Do not infer acceptance or Git write authorization from unrelated history, summaries, or dirty state. Preserve accepted findings in existing evidence and use the reporting reference's incremental display rules. `[上线后验证]` items remain visible but do not block. Any unaccepted finding or blocker reports and stops for human disposition; checks never authorize ordinary code repair, create the Git plan themselves, or replace Push confirmation.
11
+ The existing `Interactive Post-Check Stop Gate` owns default continuation and explicit stopping. Unless the user explicitly requests check-only, read-only checking, stopping after the check, or no further completion work for this subject, a strict pass or a pass with every remaining finding explicitly and validly accepted by the user continues to `trellis-update-spec` in the same turn, without another next/continue reply or a direct Git prerequisite. Both paths require no blocker, no blocking partial verification, and no unaccepted material residual risk outside explicitly recorded `[上线后验证]`. A user reply accepting all findings from the current report covers the full report, including P0, without a fixed phrase or repeated ID confirmation; partial acceptance must identify a unique subset. Do not infer acceptance or Git write authorization from unrelated history, summaries, or dirty state. Preserve accepted findings in existing evidence and use the reporting reference's incremental display rules. `[上线后验证]` items remain visible but do not block. Unresolved findings return to Check-All's reporting owner for manual disposition or a verified timeout repair selection; timeout cannot accept risks. Checks do not create the Git plan or replace Push confirmation.
12
12
 
13
13
  After authorized repairs, return through the same route and re-run Check-All. Finishing Phase 2.2 or entering the commit chain does not itself force another Full: reuse still-valid Full evidence plus complete focused recheck evidence. Run Full again only when the user explicitly requests it, a hard-full signal appears, scope cannot be closed, a baseline or related contract changes, an unknown dirty path appears, or prior evidence becomes stale or invalid.
@@ -2,5 +2,5 @@ Planning is not implementation permission. Load `trellis-brainstorm` and stay in
2
2
  A created task or default `prd.md` is not enough to start implementation. Lightweight tasks may remain PRD-only; complex tasks require `prd.md`, `design.md`, and `implement.md`.
3
3
  Before changing artifacts, routing, or files, follow `Request Triage`: resolve selected Check-All repairs first; apply the Active Task Scope Guard only to new work.
4
4
  If the latest current-request switch says no task/direct edit, call `task_intent.py discard --task <current-task>` only for a task auto-created by intent routing. Continue only on `status=discarded`; keep manual or historical tasks unchanged.
5
- Before the first implementation approval, refresh and display `brief.md` through `trellis-task-brief`, then wait for planning review confirmation. After initial approval, use that owner's incremental change rules instead of repeating whole-Brief approval on every artifact update.
5
+ Before the first implementation approval, refresh and fully display `brief.md` through `trellis-task-brief`; its owner validates manual confirmation, preauthorization, or a matching controlled-session policy-timeout claim. After initial approval, use that owner's incremental change rules instead of repeating whole-Brief approval on every artifact update.
6
6
  After status becomes `in_progress`, enter Phase 2 through `trellis-route(target=implement)` instead of editing or dispatching directly.
@@ -1,12 +1,12 @@
1
1
  #### 1.4 Activate task `[required · once]`
2
2
 
3
- Before changing task status, load `trellis-task-brief`. For the first implementation approval, refresh `<task>/brief.md` and display the full brief in chat. Unless `trellis-task-brief` validates an explicit preauthorization for the current final Brief, stop the current turn and wait for planning review confirmation. Ordinary implementation or task-creation intent is not confirmation.
3
+ Before changing task status, load `trellis-task-brief`. For the first implementation approval, refresh `<task>/brief.md` and fully display it through that owner. Unless `trellis-task-brief` validates an explicit preauthorization for the current final Brief or a matching controlled-session `brief` policy-timeout claim, stop and wait for planning review confirmation. Ordinary implementation or task-creation intent is not confirmation.
4
4
 
5
5
  After initial approval, follow that owner's incremental change rules: synchronize affected artifacts and resolve only new decisions, without repeating whole-Brief approval for a document refresh or an already authorized change. Existing approval with no unresolved change decisions permits activation without another confirmation.
6
6
 
7
7
  Lightweight tasks need `prd.md`; complex tasks also need `design.md` and `implement.md`. Sub-agent routes require real entries in both JSONL manifests.
8
8
 
9
- After a later confirmation, or in the same turn when that explicit preauthorization remains valid, run:
9
+ After a later confirmation, or in the same turn when that explicit preauthorization remains valid or a matching single-use policy-timeout claim succeeds, run:
10
10
 
11
11
  ```bash
12
12
  python3 ./.trellis/scripts/task.py start <task-dir>
@@ -0,0 +1,25 @@
1
+ # 会话内超时确认
2
+
3
+ 本协议只服务 Brief 首次开工、Check-All 问题处置、Push 精确计划。必须由 `ftl session -- codex|claude` 管理当前前台会话;普通原生启动、其它 Harness、无效配置和失联均继续人工确认。经校验的 auto-loop 使用原 runner,不叠加本协议。Spec 歧义、未决业务取舍和独立权限审批不能自动作答。
4
+
5
+ ## 先确认能力
6
+
7
+ 执行 `python3 .trellis/scripts/confirmation.py status`,项目选用其它 Python 命令时沿用该命令。只有结果同时为 `bound=true`、`ready=true`、`enabled=true`,且 `kinds.<brief|check|push>=true` 才准备自动确认。`server_name` 是本次随机注册的 MCP 名称;只能调用它实际提供的 `wait`,找不到工具就回到人工。禁止给 `request_user_input` 添加 timeout 字段、启动定时唤醒或每秒询问模型。
8
+
9
+ ## 冻结、展示与领取
10
+
11
+ 1. 先按流程 owner 形成完整材料,保留原模板、全部范围和风险。Brief 直接使用最新 `<task>/brief.md`。检查报告和 Git 计划将完整正文送入 `confirmation.py materialize` 的 stdin;结果给出 gitignored `.trellis/.runtime/confirmations/materials/<id>.md`。该文件仅用于当前跨进程校验,不是导出附件,不放入任务交付或 Git 计划。禁止用 shell 插值生成正文。
12
+ 2. 执行 `confirmation.py prepare --kind <kind> --file <正文相对路径>`。关联依据逐个加 `--basis-file <相对路径>`;检查为当前**全部待处置**条目逐个加 `--problem-id CHK-1`(同样接受 FBK/DOC);提交必须加 `--mode push|commit-only` 及逐个 `--git-path <精确文件>`。多仓逐个加 `--repository '{"root":"仓库路径","git_paths":["精确文件"]}'`,按原计划顺序列出,当前主仓也可用此格式;任务记录、生成命令和预计输出仍完整写在原计划正文中。prepare 成功不计时。
13
+ 3. 使用返回的 `request_id` 调用本次 MCP `wait(request_id)`。控制器直接向用户完整展示冻结正文、默认动作和实际秒数,排空后开始计时;这次可信终端展示满足对应 owner 的完整展示要求,无需另输出一份正文。不得以模型结束标记、仅文件链接或自行估算时间替代。按宿主工具协议等待原调用完成,pending 时继续原等待,不创建第二次决定。
14
+ 4. 只有 `source=policy_timeout`、`decision=continue` 才执行 `confirmation.py claim --request-id <id>`。**claim 成功**且返回的 kind/action 与本次 owner 匹配,才替代该次人工范围选择。工具返回后、claim 之前到达的人工按键仍会撤销旧决定。claim 拒绝、取消、版本变化、工具失败或预算不足时保持人工;不得重试领取来重复执行,也不得把 cancelled 当成拒绝业务方案,用户回复仍由 owner 解释。
15
+ 5. 领取后仍遵守 owner 全部检查、前置条件、文件与分支范围。动作结束执行 `confirmation.py finish --request-id <id> --outcome completed|interrupted|needs_verification`,据实际结果选择;失联时如实报告已完成副作用和待核验项,不能声称撤销。活许可只存在于本次入口内存,重开不会消费旧请求。
16
+
17
+ ## 默认动作
18
+
19
+ | kind | 时长默认值 | claim.action | 领取后的动作 |
20
+ | --- | --- | --- | --- |
21
+ | brief | 正文1000字内100秒,之后每500字加30秒,不足一档按一档 | implement | 对这份已展示且有效的方案运行 `task.py start`,进入实现 |
22
+ | check | 第一条100秒,每多一条加30秒;零条不等待 | repair_all_and_recheck | 修复当前报告全部待处置项并重检;新业务取舍暂停,风险接受仍必须人工明确决定 |
23
+ | push | 200秒 | execute_git_plan | 沿用当前计划和模式;普通 commit + push,明确 commit-only 时仅本地提交 |
24
+
25
+ 报告必须把自动决定来源写为 `policy_timeout`,不能写成“用户已经确认”。人工分支由原 owner 核对真实回复并记 `human`;按键取消本身不是批准。prepare 重试复用同一请求,已领取或撤销的同版本材料不能重新自动执行。材料、范围、模式、Git 基线或会话变化后,旧请求失效;更改方案必须重新冻结和展示。显式只读、暂停、停止、拒绝或用户更改范围时不准备自动决定。项目默认启用,`.trellis/config.yaml` 的 `confirmation_timeout.enabled: false` 可关闭;各类的 `enabled` 和秒数配置独立,缺失采用默认、损坏回人工,不得临时缩短用户时长来促使当前动作执行。