@tea-agent/loop-agent 0.7.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.7.2] - 2026-07-11
8
+
9
+ ### 修复
10
+
11
+ - 修复 adapter 将治理检查包装为 `bash -lc "bash scripts/check-repo.sh"` 时未注入 `HARNESS_ALLOW_ACTIVE_DAG_RUNS=1`,导致新 `verify-shell` 把自身 active DAG 误判为 runtime 脏状态的问题。
12
+
13
+ ## [0.7.1] - 2026-07-11
14
+
15
+ ### 修复
16
+
17
+ - 标准与 review-gated Agent DAG 现在会把 adapter/TaskSpec 的最终验证命令物化为 `verify-shell`,在 `verify-pi`、review 和 closeout 前保存真实 exit code/stdout/stderr,避免实现已绿但因缺少新鲜 shell 证据被 review gate 拦截。
18
+
7
19
  ## [0.7.0] - 2026-07-11
8
20
 
9
21
  ### 新增
@@ -262,7 +262,7 @@ function verifyCommandToShell(repoRoot, command) {
262
262
  ? `cd ${shellQuote(command.cwd)} && `
263
263
  : "";
264
264
  const envPrefix = [
265
- ...(command.args.includes("scripts/check-repo.sh")
265
+ ...(command.args.some((arg) => arg.includes("scripts/check-repo.sh"))
266
266
  ? ["HARNESS_ALLOW_ACTIVE_DAG_RUNS=1"]
267
267
  : []),
268
268
  ...Object.entries(command.env ?? {}).map(([key, value]) => `${key}=${shellQuote(String(value))}`),
@@ -466,6 +466,39 @@ export function buildStandardHybridDagFromTask(sources) {
466
466
  const implementComplexity = resolveWriterComplexity(taskConfig);
467
467
  const writerExecutor = resolveImplementationExecutor(sources);
468
468
  const implementId = implementationNodeId(writerExecutor);
469
+ const finalVerifyCommands = sources.verifyCommands?.final ?? [];
470
+ const verifyShellCommands = buildVerifyShellCommands({
471
+ repoRoot: sources.repoRoot,
472
+ commands: finalVerifyCommands,
473
+ fallbackCommands: [],
474
+ });
475
+ const verifyShellTask = verifyShellCommands.length > 0
476
+ ? [{
477
+ id: "verify-shell",
478
+ depends_on: [implementId],
479
+ role: "verifier",
480
+ executor: "shell",
481
+ complexity: "LOW",
482
+ writePolicy: "read-only",
483
+ allowedPaths: taskConfig.allowedPaths.length > 0 ? taskConfig.allowedPaths : ["**"],
484
+ forbiddenPaths,
485
+ outputContract: "Archived final shell verification stdout/stderr with exit codes; no worktree writes.",
486
+ subtask_prompt: "Run the adapter-resolved final verification commands before read-only verification review.",
487
+ shell: {
488
+ commands: verifyShellCommands,
489
+ verifyEvidence: buildVerifyEvidence({
490
+ phase: "final",
491
+ quota: "full",
492
+ commandSource: "adapter",
493
+ commands: finalVerifyCommands,
494
+ fallbackCommands: [],
495
+ finalFullRequired: true,
496
+ }),
497
+ cwd: ".",
498
+ timeoutMs: 300000,
499
+ },
500
+ }]
501
+ : [];
469
502
  const sourceContext = buildSourceContextBlock(sources);
470
503
  const globalConstraints = [
471
504
  ...taskConfig.hardConstraints,
@@ -569,9 +602,10 @@ export function buildStandardHybridDagFromTask(sources) {
569
602
  sourceContext,
570
603
  ].filter((value) => Boolean(value)).join("\n\n"),
571
604
  },
605
+ ...verifyShellTask,
572
606
  {
573
607
  id: "verify-pi",
574
- depends_on: [implementId],
608
+ depends_on: verifyShellTask.length > 0 ? ["verify-shell"] : [implementId],
575
609
  role: "verifier",
576
610
  executor: "pi",
577
611
  complexity: "MED",
@@ -97,16 +97,17 @@ contract-pi
97
97
  -> scout-src + scout-tests
98
98
  -> plan-pi
99
99
  -> implement-pi
100
+ -> verify-shell
100
101
  -> verify-pi
101
102
  -> closeout-pi
102
103
  ```
103
104
 
104
105
  `implement-pi` 使用 `executor: "pi"` 与 `toolProfile: "write"`。当 `harness.json` 显式禁用 Pi 并启用 Cursor 时,实现与修复 writer 节点改用 `implement-cursor` / `repair-cursor`。
105
106
 
106
- review-gated 模板插入:
107
+ `verify-shell` 使用 adapter 根据 task verify preset/quota 解析出的最终验证命令,并把新鲜 exit code/stdout/stderr 交给后续只读 verifier。review-gated 模板继续插入:
107
108
 
108
109
  ```text
109
- verify-pi -> review-pi -> review-gate-shell -> closeout-pi
110
+ verify-shell -> verify-pi -> review-pi -> review-gate-shell -> closeout-pi
110
111
  ```
111
112
 
112
113
  supervised 模板在实现路径上增加 write-set audit、soft/hard shell 验证、process supervision、有界 repair、decision gates 与可选 convergence retry。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",