@pennixrv/trellis 0.7.2-beta.33 → 0.7.2-beta.34

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.7.2-beta.34",
3
+ "description": "Recover delegated preparation through controlled clarification inputs",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "Expose preparation blocked reports in wait and inspect. Reuse delegate-followup for new frozen preparation clarifications without granting implementation permission, replaying old inputs or allowing an older ready to bypass the latest prerequisite.",
7
+ "migrations": [],
8
+ "notes": "No task-data, binding or candidate-format migration. Upgrade the synchronized CLI/core/adapter cohort through its owner, then use native trellis update for corrected scripts and controller guidance. Retained attempts remain unaccepted; preparation clarification requires a current approved attempt, exact base and source identity, and known uncontaminated delivery."
9
+ }
@@ -53,6 +53,8 @@ binding format 3 固定包、父合同、子 PRD、设置、能力、角色、
53
53
 
54
54
  `delegate-followup <child> --instructions-ref <子任务内文件>` 在同一未变包内续接。同 Agent 正在运行时使用原生 queue,不默认 steer/interrupt;每次输入持久保存准确 prompt、messageId、冻结 context 和候选路径。input ID 就是原生 messageId。节点结果 version 2 按输入/实际批次保留,主控从完整公开 timeline 关联多输入到一个 turn;外部输入污染、缺页、epoch 不可恢复、未知发送和旧结果都阻止接受。no-op 仍需本轮证据。
55
55
 
56
+ 尚无 execute、许可仍为 preparation 时,同一 followup 命令用于补充准备信息,保存新的 prepare 输入,不重发首轮,也不授业务源码写权。wait/inspect 会展示当前准备 blocked;主控可补已批准的只读资料引用,节点不能改用主控 Task CLI。最新准备输入仍排队、未消费或 missing 非空时,旧 ready 不触发 execute;准备续接仍核准确 base、干净源码、身份与父授权,未知或污染输入须先保全和核验。进入实施后,followup 保持原业务续接语义。
57
+
56
58
  超范围的新需求走独立批准任务或包。父合同整体冻结;修改父合同会撤销其旧绑定,不新增可变的包级权限。
57
59
 
58
60
  正常包关闭后,同一控制根可在新绑定显式使用 `--reuse-task <旧子任务>` 复用语境。旧包须正常 owner 接受、原生运行关闭、输入全部已消费、队列与后台工作为空,并具有准确稳定 locator;checkout、运行设置、角色和节点方法必须匹配。新包仍重新准备,历史输入不覆盖。旧格式、配置不符或 quarantined Agent 不复用,也不私改 launchEnv。
@@ -495,7 +495,12 @@ def run(args):
495
495
  fail("initial execution input already exists; use a new authorized followup")
496
496
  source_clean(record, path)
497
497
  instructions = file_ref(child_dir, args.instructions_ref).read_text(encoding="utf8") if operation == "followup" else ""
498
- send_input(root, child_dir, record, path, operation, instructions, rpc=rpc)
498
+ stage = operation
499
+ if operation == "followup" and not any(item["stage"] != "prepare" for item in record.get("inputs", [])):
500
+ if not record.get("inputs"):
501
+ fail("preparation input must exist before a clarification")
502
+ stage = "prepare"
503
+ send_input(root, child_dir, record, path, stage, instructions, rpc=rpc)
499
504
  print(json.dumps(record, ensure_ascii=False))
500
505
  return 0
501
506
  fail("legacy inputs have no message-scoped contract; retain before rebinding")
@@ -140,9 +140,11 @@ def send_input(root: Path, child_dir: Path, record: dict, path: Path, stage: str
140
140
  package_admission(root, child_dir, record, path)
141
141
  if record.get("intent") or record.get("cancel_requested") or record.get("quarantined"):
142
142
  fail("pending operation or quarantine prevents new input")
143
+ if stage == "prepare" and record.get("inputs") and not instructions.strip():
144
+ fail("preparation input already exists; use an explicit authorized clarification")
143
145
  tree = assert_worktree(record)
144
146
  observed = native_lifecycle(record, rpc=rpc)["agents"][0]
145
- if stage != "prepare":
147
+ if stage != "prepare" or record.get("inputs"):
146
148
  runtime = observed.get("runtimeInfo") or {}
147
149
  model = runtime.get("model") or observed.get("model")
148
150
  mode = runtime.get("modeId") or observed.get("currentModeId")
@@ -154,7 +156,16 @@ def send_input(root: Path, child_dir: Path, record: dict, path: Path, stage: str
154
156
  if record.get("intent") or record.get("cancel_requested") or record.get("quarantined"):
155
157
  fail("input preflight became stale; preserve the pending operation without sending")
156
158
  if stage == "prepare" and record.get("inputs"):
157
- fail("preparation input already exists; recover its delivery instead of resending")
159
+ if (not instructions.strip() or record.get("execution_permission") != "preparation"
160
+ or any(item["stage"] != "prepare" for item in record["inputs"])):
161
+ fail("preparation clarification cannot replace an existing business input or permission")
162
+ package_admission(root, child_dir, record, path)
163
+ if any(item.get("delivery") not in {"queued", "consumed"} or item.get("foreign_input")
164
+ for item in record["inputs"]):
165
+ fail("preparation delivery is unresolved or contaminated; reconcile before clarifying")
166
+ if git(tree, "rev-parse", "HEAD") != record["binding"]["base_commit"]:
167
+ fail("preparation clarification requires the exact approved HEAD")
168
+ contract.source_clean(record, path)
158
169
  if stage == "execute":
159
170
  if any(item["stage"] != "prepare" for item in record.get("inputs", [])):
160
171
  fail("initial business input was already allocated during preflight")
@@ -201,6 +212,8 @@ def send_input(root: Path, child_dir: Path, record: dict, path: Path, stage: str
201
212
 
202
213
 
203
214
  def candidate_input(record: dict, name: str):
215
+ if name == "blocked":
216
+ return next(reversed(record.get("inputs", [])), None)
204
217
  stage = "prepare" if name == "ready" else None
205
218
  return next((item for item in reversed(record.get("inputs", []))
206
219
  if (item["stage"] == stage if stage else item["stage"] != "prepare")), None)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pennixrv/trellis",
3
- "version": "0.7.2-beta.33",
3
+ "version": "0.7.2-beta.34",
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.33"
38
+ "@pennixrv/trellis-core": "0.7.2-beta.34"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@eslint/js": "^9.18.0",