@pennixrv/trellis 0.7.2-beta.27 → 0.7.2-beta.28
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/dist/migrations/manifests/0.7.2-beta.28.json +8 -0
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +4 -2
- package/dist/templates/common/skills/request-intake.md +3 -0
- package/dist/templates/trellis/scripts/common/task_workflow.py +31 -1
- package/dist/templates/trellis/workflow.md +9 -0
- package/package.json +2 -2
|
@@ -42,6 +42,8 @@ flowchart TD
|
|
|
42
42
|
output --> solution_design_and_convergence
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
接受前先用 `phase artifact` 绑定决策产物及表中引用的证据,再运行 `phase preflight --result-ref <决策产物>`;复用接受校验,自行修正格式、覆盖或未绑定文件,不把机械错误交给用户重新确认。
|
|
46
|
+
|
|
45
47
|
### 离开阶段的条件
|
|
46
48
|
|
|
47
49
|
- 有实质决策空间时,候选、关键证据、关系、未知项和推荐均能支持下一阶段比较;不要求固定字段数量或同时使用多种图表。
|
package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md
CHANGED
|
@@ -15,7 +15,7 @@ flowchart TD
|
|
|
15
15
|
request["核对请求、项目背景和目标对象"] --> evidence["选择必要证据并核验现状"]
|
|
16
16
|
evidence --> baseline["整理目标、范围、成功条件与约束"]
|
|
17
17
|
baseline --> enough{"关键事实是否足以形成基线?"}
|
|
18
|
-
enough -->|"否,需用户补充"| ask["
|
|
18
|
+
enough -->|"否,需用户补充"| ask["主控直接使用合法原生同步提问;阶段保持 active"]
|
|
19
19
|
ask --> wait["只暂停依赖答复的动作;继续独立取证"]
|
|
20
20
|
wait --> evidence
|
|
21
21
|
enough -->|"否,依赖阻断"| blocked["记录 blocked 与恢复条件"]
|
|
@@ -29,9 +29,11 @@ flowchart TD
|
|
|
29
29
|
gate --> route["按当前路线选择后续阶段;跳过决策空间构造与归并阶段也保留此确认"]
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
首次确认前先用 `phase artifact` 绑定产物,再运行 `phase preflight --result-ref <需求产物>`;格式或编号错误自行修正后重新绑定,检查通过再展示和请求首次确认。明确补充未接受候选时直接落实,不制造第二次纳入确认。
|
|
33
|
+
|
|
32
34
|
### 离开阶段的条件
|
|
33
35
|
|
|
34
|
-
- `accepted` 及明确用户确认必须绑定当前 `artifact_revision
|
|
36
|
+
- `accepted` 及明确用户确认必须绑定当前 `artifact_revision`;真正改变已接受核心时重新核验受影响接受。支持证据追加与同范围细化遵循公共路由,不因文件新增或摘要变化自动重问基线。
|
|
35
37
|
- `needs_user_input` 或 `blocked` 时不推进阶段游标。
|
|
36
38
|
- `terminated` 不代表用户撤回任务;如用户明确撤回,按交付审查与现场收尾阶段中的取消审查处理。
|
|
37
39
|
- 可从目标探索与需求核对阶段直接进入解决方案设计与收敛阶段,但不能绕过需求基线确认。
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Use this entry skill to route new input. Check it against the active task and its accepted artifacts:
|
|
4
4
|
|
|
5
5
|
- Supporting evidence that leaves the goal, constraints, acceptance criteria, basis for comparing candidates, and authorization intact belongs in the current phase's evidence records. Preserve accepted artifacts and continue the phase; do not stop at acknowledging the evidence.
|
|
6
|
+
- An explicit same-scope supplement is already an instruction to incorporate it, not a question about whether to include it. Update the current proposal, relevant verification and evidence, then continue. Do not ask for a new baseline just because text or supporting files changed. Revise an unaccepted candidate directly; keep accepted core contracts separate from mutable supporting records.
|
|
6
7
|
- A material change to any of those facts returns to the earliest affected phase. Pause only actions that depend on what changed. If the user also requests work whose scope is still clear and authorized, complete it before waiting for clarification about the change, unless workflow dependencies or explicit user instructions require waiting. Do not infer a pause from new evidence.
|
|
7
8
|
- Independent work needs its own intake. Do not put it into the active task, abandon that task, or bypass its ownership and acceptance gates.
|
|
8
9
|
|
|
@@ -10,6 +11,8 @@ To resume without new input, use trellis-continue and the current native task fa
|
|
|
10
11
|
|
|
11
12
|
Reuse verified evidence and existing authorization. Follow the taskless route in workflow.md only when all of these are true: the goal is clear; the scope and owner are bounded; risk is controlled; the user has authorized the actual action; success can be verified in the current session; and the work needs no persistent route, coordination, design, review, release, installation, migration, external delivery, or dedicated rollback plan. A bounded irreversible action additionally needs exact target verification, an acceptable recovery or loss boundary, and a stop condition. User authorization alone is not sufficient. Read-only inspection, bounded diagnosis, low-impact native-owner maintenance or cleanup, small single-surface edits, and rerunning existing checks are examples, not an allowlist. Intake ends when the request reaches its appropriate phase; do not repeat session initialization or conduct a second requirements or planning workflow here.
|
|
12
13
|
|
|
14
|
+
When an accepted contract already exists and the user now explicitly authorizes its implementation, record that actual approval and use the native authorization/start route. Do not reopen requirements or ask them to approve the same plan again. Genuine scope changes and native execution approvals remain separate.
|
|
15
|
+
|
|
13
16
|
Routine self-review and verification do not by themselves require a task. Where Codex turn evidence is active, record a verified bounded maintenance or edit as `bounded_reply --scope maintenance`, with references to the actual action and its verification, not as inspection or task completion. An unrelated active task keeps its own state.
|
|
14
17
|
|
|
15
18
|
## Start the task
|
|
@@ -973,11 +973,41 @@ def cmd_phase(args: argparse.Namespace) -> int:
|
|
|
973
973
|
def _preflight(args: argparse.Namespace, task_dir: Path, state: dict) -> int:
|
|
974
974
|
if args.expected_route_revision is not None:
|
|
975
975
|
_expected_route(state, args.expected_route_revision)
|
|
976
|
-
print(json.dumps(
|
|
976
|
+
print(json.dumps(phase_preflight(task_dir, state, args.outcome_kind,
|
|
977
977
|
args.result_ref or args.contract_ref, args.artifact_revision), ensure_ascii=False))
|
|
978
978
|
return 0
|
|
979
979
|
|
|
980
980
|
|
|
981
|
+
def phase_preflight(task_dir: Path, state: dict, outcome: str | None, ref: str | None, revision: str | None) -> dict:
|
|
982
|
+
"""Validate a candidate before asking; never accept or mutate phase state."""
|
|
983
|
+
current = state.get("current_phase_id")
|
|
984
|
+
if current not in PHASE_IDS[:2]:
|
|
985
|
+
return design_preflight(task_dir, state, outcome, ref, revision)
|
|
986
|
+
record = state["phases"][current]
|
|
987
|
+
if current == PHASE_IDS[1]:
|
|
988
|
+
_require_current_requirements_confirmation(task_dir, state)
|
|
989
|
+
_require_current_accepted_artifacts(task_dir, state)
|
|
990
|
+
_require_current_omissions(task_dir, state)
|
|
991
|
+
outcome = outcome or "accepted"
|
|
992
|
+
if current == PHASE_IDS[0] and outcome != "accepted":
|
|
993
|
+
raise TaskWorkflowError("TASK_PHASE_INVALID_TRANSITION", "requirements preflight requires phase_result=accepted")
|
|
994
|
+
ref = _required_text(ref or record.get("result_ref"), "--result-ref")
|
|
995
|
+
candidate = _artifact_digest(task_dir, record["artifact_refs"])
|
|
996
|
+
if (ref not in record["artifact_refs"] or candidate != record["artifact_revision"]
|
|
997
|
+
or revision is not None and revision != candidate):
|
|
998
|
+
raise TaskWorkflowError("TASK_PHASE_STALE_ARTIFACT", "bind the current phase candidate with phase artifact before preflight")
|
|
999
|
+
if current == PHASE_IDS[0]:
|
|
1000
|
+
if _coverage_enabled(state):
|
|
1001
|
+
_requirements_ids(task_dir, ref)
|
|
1002
|
+
else:
|
|
1003
|
+
_check_coverage(task_dir, state, current, outcome, ref)
|
|
1004
|
+
return {
|
|
1005
|
+
"status": "ready", "task": task_dir.name, "phase_id": current,
|
|
1006
|
+
"route_revision": state["task_route_revision"], "input_revision": state["input_revision"],
|
|
1007
|
+
"outcome_kind": outcome, "result_ref": ref, "artifact_revision": candidate,
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
|
|
981
1011
|
def design_preflight(task_dir: Path, state: dict, outcome: str | None, ref: str | None, revision: str | None) -> dict:
|
|
982
1012
|
current = state.get("current_phase_id")
|
|
983
1013
|
if current not in {PHASE_IDS[2], PHASE_IDS[3]}:
|
|
@@ -54,6 +54,15 @@ python3 ./.trellis/scripts/task.py reopen <task> --reason "<reason>" --evidence-
|
|
|
54
54
|
|
|
55
55
|
任务阶段、当前请求及依赖动作的停点不同。可查事实和独立且已授权的动作继续;必要未决事项在就绪时直接用宿主允许的同步入口提问,只有依赖该答案的动作暂停。必须用普通文本时直接说明问题;有独立工作先完成。请求已核验、用户明确要求停止,或具体外部依赖阻断全部剩余已授权动作时才结束回合。宿主权限和业务决定分别取得,进度、空答、Hook 纠偏或交付审查接受都不是任务终态。Codex 原生回合证据用 `task.py turn record`,有界维护用 `bounded_reply --scope maintenance`,无可继续工作的外部阻断用 `external_block --no-independent-work --blocker <具体阻断>`;两者都须核对实际动作及证据,不授予额外权限。
|
|
56
56
|
|
|
57
|
+
### 补充、提问与相称流程
|
|
58
|
+
|
|
59
|
+
- 用户明确要求补充当前方案的停止点、既有规范或同目标验收细节,直接核对、落实到当前方案及验证并继续,不询问是否纳入或重新确认基线。未接受的候选直接完善;已接受的核心合同保持可追溯,支持证据和决定写当前自然落点,不无区别绑定为上游合同。补充不能只记入台账却遗漏交付。
|
|
60
|
+
- 真正改变目标、交付主体、权限、安全或重大成本时,只处理剩余实质选择及最早受影响阶段;不得以冻结文档或复制旧摘要冒用批准。格式、路径和回执解析问题由代理自行修正,不构成用户选择。
|
|
61
|
+
- 主控在宿主允许且原生阻塞式提问工具可用时直接调用;同步提问期间阶段保持 active,不先制造 `phase wait`。收到答案后记录真实语义与影响并继续;工具返回 complete 不等于用户接受方案。正文提问仅用于实际宿主例外或必要人工操作,团队成员/委派执行者仍向主控报告。
|
|
62
|
+
- taskless、短路线和复杂依赖采用现有相应能力,不因补充增加固定访谈轮次,也不把局部失败、后台等待或单项验证当成全局外阻。真实安全审批、明确停止和不可替代的人工作业保持。
|
|
63
|
+
- 首次确认前先 `phase artifact` 绑定实际产物及覆盖证据,再 `phase preflight --result-ref <产物>`;需求与决策预检复用接受校验,设计保留原接口。预检只读,不接受、不授权;`artifact` 回执字段位于顶层,不按 `phase show` 的完整结构解析。
|
|
64
|
+
- 恢复沿已知任务和工具断点继续,只补缺失、冲突或接口必要事实,不重新全量启动。输出保留影响行动的结果和限制;用户明确要求的报告约定仍须遵守,不编造风险或重复内部自证。
|
|
65
|
+
|
|
57
66
|
只有阶段路线已到达获准的实施入口时,`task.py start` 才会将任务从 `planning` 改为 `in_progress`。分析任务可在交付审查与现场收尾阶段后仍处于 `planning` 时完成。`complete` 将任务移入 `completed/YYYY-MM/<task>`,`cancel` 将任务移入 `cancelled/<task>`,并在同一事务中清除任务的运行时会话指针。
|
|
58
67
|
|
|
59
68
|
工作流阶段回流与原生任务生命周期恢复分别操作。`completed` 或 `cancelled` 任务需要在原线程继续时,先用 `reopen` 恢复到 `planning`,保留终态事实、取消原因和恢复证据,清除旧运行态、实施授权和依赖准入;工作流阶段保持原记录。随后用 `phase return` 回到最早受影响阶段。实现任务重新接受合同、取得新的实施授权并核验准入后,才由 `start` 进入 `in_progress`。`phase return` 不能直接修改终态任务。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pennixrv/trellis",
|
|
3
|
-
"version": "0.7.2-beta.
|
|
3
|
+
"version": "0.7.2-beta.28",
|
|
4
4
|
"description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"inquirer": "^9.3.7",
|
|
36
36
|
"undici": "^6.21.0",
|
|
37
37
|
"zod": "^4.4.2",
|
|
38
|
-
"@pennixrv/trellis-core": "0.7.2-beta.
|
|
38
|
+
"@pennixrv/trellis-core": "0.7.2-beta.28"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/js": "^9.18.0",
|