@kylecheng3146/agent-ops 0.3.3 → 0.3.5
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/packages/cli/src/args.js +34 -1
- package/dist/packages/cli/src/bin.js +48 -3
- package/dist/packages/cli/src/cli.js +13 -4
- package/dist/packages/cli/src/commands/parallel.js +3 -1
- package/dist/packages/cli/src/commands/review.js +11 -3
- package/dist/packages/cli/src/commands/verify.js +1 -1
- package/dist/packages/cli/src/hook-process.js +10 -1
- package/dist/runtime/src/contracts.js +1 -1
- package/dist/runtime/src/install/doctor.js +31 -1
- package/dist/runtime/src/parallel/finish.js +32 -10
- package/dist/runtime/src/parallel/manage.js +30 -1
- package/dist/runtime/src/parallel/service.js +111 -5
- package/dist/runtime/src/review/execute.js +125 -9
- package/dist/runtime/src/review/extract.js +40 -0
- package/dist/runtime/src/review/invocation.js +3 -0
- package/dist/runtime/src/review/usage.js +19 -0
- package/dist/runtime/src/schema/validate.js +1 -1
- package/dist/runtime/src/task/completion.js +2 -0
- package/dist/runtime/src/task/service.js +77 -1
- package/dist/runtime/src/verify/command-executor.js +6 -2
- package/dist/runtime/src/verify/evidence.js +2 -1
- package/dist/runtime/src/verify/service.js +5 -2
- package/dist/runtime/src/verify/test-count.js +89 -89
- package/docs/en/guides/configuration.md +26 -4
- package/docs/en/spec/acceptance-and-evidence.md +5 -1
- package/docs/en/spec/delegation.md +1 -1
- package/docs/zh-TW/guides/configuration.md +20 -4
- package/docs/zh-TW/spec/acceptance-and-evidence.md +6 -2
- package/docs/zh-TW/spec/delegation.md +1 -1
- package/package.json +1 -1
- package/schemas/evidence.schema.json +1 -1
|
@@ -92,6 +92,18 @@ would consume the following flag instead. It deliberately does not pass
|
|
|
92
92
|
`--dangerously-skip-permissions`, which overrides the permission boundary, or
|
|
93
93
|
`--disable-slash-commands`, which disables plan-mode behavior.
|
|
94
94
|
|
|
95
|
+
Agy can end its one `--print` turn without answering: print mode has nobody to
|
|
96
|
+
confirm a tool call, so it refuses the call and the turn stops with an empty
|
|
97
|
+
`response` and no `structured_output`. The refused tools are listed in the
|
|
98
|
+
envelope's `denied_actions` and named in the diagnostic. agent-ops first resumes
|
|
99
|
+
that same conversation once (`--conversation`) and asks for the answer without
|
|
100
|
+
tools, then falls back to one fresh session. The lost turn's `agy.log` and
|
|
101
|
+
`stdout.json` are kept under `.agent-ops/reviews/lost-turns/<sessionId>/`
|
|
102
|
+
(local, git-ignored, never cleaned up automatically). If the denied tool is an
|
|
103
|
+
MCP tool from your own agy configuration, disabling that server for agy
|
|
104
|
+
(`agy mcp disable <name>`) removes the trigger; agent-ops does not change your
|
|
105
|
+
agy configuration.
|
|
106
|
+
|
|
95
107
|
Host network or loopback restrictions return `REVIEW_NOT_RUN` before any
|
|
96
108
|
reviewer is started. The managed instructions require a trusted outer host
|
|
97
109
|
runner to start the exact same command with both capabilities on its first
|
|
@@ -164,9 +176,15 @@ evidence. Give each editing conversation its own worktree instead:
|
|
|
164
176
|
fails, the denial says why and falls back to the manual `worktree add`.
|
|
165
177
|
Run `agent-ops update` once so the PreToolUse hook gets the 600-second
|
|
166
178
|
timeout setup needs.
|
|
167
|
-
- `add` creates `.worktrees/<name>` on branch `agent-ops/<name>`
|
|
168
|
-
|
|
169
|
-
|
|
179
|
+
- `add` creates `.worktrees/<name>` on branch `agent-ops/<name>` and excludes
|
|
180
|
+
`/.worktrees/` through `.git/info/exclude`, never `.gitignore`. Its base and
|
|
181
|
+
its merge target are the branch the main checkout was on when the session
|
|
182
|
+
began: SessionStart records that branch once per session (resume, compact and
|
|
183
|
+
clear never overwrite it; nothing is recorded on a detached HEAD or from
|
|
184
|
+
inside a worktree), so switching branches mid-session does not retarget the
|
|
185
|
+
work. Without a record it reads the main checkout's HEAD at add time, an
|
|
186
|
+
explicit `--target-branch` or `--from` outranks the record, and a recorded
|
|
187
|
+
branch that no longer exists is an error naming `--target-branch`. It copies the ignored files agent-ops installed and any
|
|
170
188
|
file matched by a root `.worktreeinclude` (gitignore syntax, for example
|
|
171
189
|
`.env` or `local.properties`); a file Git already checked out is never
|
|
172
190
|
overwritten. Trust is inherited only when the main checkout is trusted and
|
|
@@ -188,7 +206,11 @@ evidence. Give each editing conversation its own worktree instead:
|
|
|
188
206
|
each task keeps its own review record, so a parent and a subtask reviewed
|
|
189
207
|
on the same source do not overwrite each other.
|
|
190
208
|
- `agent-ops worktree finish <name>` merges by fast-forward only, one finish
|
|
191
|
-
at a time.
|
|
209
|
+
at a time. When the main checkout is on the target branch the merge updates
|
|
210
|
+
its files, so uncommitted changes there block it. When the main checkout is
|
|
211
|
+
on another branch or detached, only the target's ref moves: the checkout, its
|
|
212
|
+
files and its uncommitted changes are left alone. A target checked out in
|
|
213
|
+
another worktree is refused, naming that path. If the target moved, it rebases; a clean rebase whose own patch
|
|
192
214
|
is unchanged is re-verified before merging, and a conflict is reported with
|
|
193
215
|
the `refs/notes/agent-ops` intent of the work that landed first. The note
|
|
194
216
|
records every task of the worktree, subtasks indented under their parent.
|
|
@@ -33,10 +33,14 @@ The verifier MUST return FAIL when a criterion is missing, duplicated, unknown,
|
|
|
33
33
|
- Every criterion needs at least one required verifier and current PASS evidence for every required verifier it names. Verify always includes those task-required commands, even when path mappings select a narrower set. Supply the evidence file references produced by `agent-ops verify --task <id>`, not command strings or a written assertion of PASS.
|
|
34
34
|
- The task's config baseline and evidence must match the current effective config and source fingerprint in the selected scope. Outstanding verification failures block completion. A newer failing result cannot be replaced by an older PASS; contradictory results at the same timestamp fail closed.
|
|
35
35
|
- Run `agent-ops review --task <id> --yes` for the whole task. Completion requires its current, task-bound PASS attestation; generic reviews and partial-criterion reviews do not satisfy it.
|
|
36
|
-
- Starting
|
|
36
|
+
- An unchanged task, source, criteria and config may reuse its recorded PASS review after fresh verification. Starting a fresh authorized review (`--rerun`) invalidates the previous attestation for that source fingerprint. If the reviewer cannot run or does not pass, run a fresh successful whole-task review before completion.
|
|
37
37
|
- All subtasks and descendants must have completed without an outstanding failure. Archiving unfinished work does not satisfy this requirement. A completed or archived parent cannot accept new subtasks. If a subtask is abandoned, recreate the parent task without that cancelled branch and verify/review the new task tree.
|
|
38
38
|
- Evidence, source and config validation run outside the task store lock. After rechecking source and config, completion briefly locks state, rejects a changed task snapshot (`TASK_COMPLETION_STATE_CHANGED`), rechecks descendants, and writes completion atomically. Slow validation does not block task reads or other task mutations; a concurrent mutation remains intact when completion is rejected.
|
|
39
39
|
|
|
40
|
+
`test-count.minimum` counts explicitly passed tests, excluding skipped, todo, expected failures and discovery totals. Zero passed tests fail even with minimum zero; an unrecognizable passed summary is UNKNOWN. Explicit failed, error or cancelled outcomes fail even when the process exits zero. Exit-code verifiers retain their existing behavior. Task verify returns `VERIFICATION_UNKNOWN`, names uncovered criteria and runs no verifier commands when any criterion lacks a required verifier; optional-only results cannot establish formal task verification.
|
|
41
|
+
|
|
42
|
+
New verification evidence uses schema 3. Schema 2 remains readable and its exit-code evidence remains valid; schema 2 test-count evidence cannot establish PASS and requires fresh verification. Old references are retained. A completed task may append fresh verification only for its original source, criteria and config, preserving completedAt and review references. Its entire state snapshot is compared atomically before appending and clearing failure; concurrent changes are preserved and rejected. Fresh FAIL or UNKNOWN blocks completion until resolved; archived tasks remain immutable. Source or config changes require a new task.
|
|
43
|
+
|
|
40
44
|
Existing task files remain readable without migration. Legacy tasks without a config baseline, arbitrary evidence references, or unfinished archived children must be recreated and verified/reviewed before completion. Repeating completion also revalidates the evidence; an old completed status alone is insufficient. Runtime callers must supply `TaskServiceOptions.completion`; omitting this repository context fails closed for completion while leaving read-only task operations available.
|
|
41
45
|
|
|
42
46
|
Before committing, use the default worktree scope for verify, review and completion. After committing, use the same `--base <git-ref>` on all three commands to produce fresh proof for that committed range; `TaskServiceOptions.completion.base` selects it for runtime callers. Base mode requires a clean worktree. Without a worktree change surface or an explicit base, completion returns `TASK_COMPLETION_SCOPE_REQUIRED`. The agy Stop gate still checks worktree-scoped proof: complete and stop before committing, or use its user-approved one-time permit after inspecting a completed base-scoped task.
|
|
@@ -35,7 +35,7 @@ Concurrent delegated writers MUST NOT share one working tree.
|
|
|
35
35
|
Parallel editing conversations in one repository MUST each work in their own agent-ops worktree.
|
|
36
36
|
|
|
37
37
|
- Trigger: `worktree.mode` is `auto`, or a second conversation will edit the repository while another is still open.
|
|
38
|
-
- Action: Run `agent-ops worktree add <name> --session <id>` from the main checkout before the first edit, work only in the printed path, and merge with `agent-ops worktree finish <name>` after the task completes against the printed `--base`.
|
|
38
|
+
- Action: Run `agent-ops worktree add <name> --session <id>` from the main checkout before the first edit, work only in the printed path, and merge with `agent-ops worktree finish <name>` after the task completes against the printed `--base`. The merge lands on the branch the main checkout was on when the session began, wherever that checkout is now.
|
|
39
39
|
- Evidence: `agent-ops worktree list` shows one worktree per editing session, and each finish reports a fast-forward merge.
|
|
40
40
|
- Positive: `Two conversations edit .worktrees/login and .worktrees/cart; each verifies, reviews and finishes on its own.`
|
|
41
41
|
- Negative: `Two conversations edit the main checkout at once, so each one's verification and review is voided by the other's writes.`
|
|
@@ -81,6 +81,15 @@ Agy 的 prompt 會直接作為 `--print` 的值;裸用 `-p` 會誤吞下一個
|
|
|
81
81
|
agent-ops 刻意不傳會繞過權限邊界的 `--dangerously-skip-permissions`,也不傳會
|
|
82
82
|
使 plan mode 失效的 `--disable-slash-commands`。
|
|
83
83
|
|
|
84
|
+
Agy 可能在唯一一輪 `--print` 中沒有回答就結束:print mode 沒有人可以確認工具呼叫,
|
|
85
|
+
會拒絕該次呼叫並停止,`response` 為空且沒有 `structured_output`。被拒的工具列在
|
|
86
|
+
信封的 `denied_actions`,並寫進診斷訊息。agent-ops 會先在同一個對話續問一次
|
|
87
|
+
(`--conversation`,要求不用工具直接回答),失敗才退回一個全新的 session。lost turn 的
|
|
88
|
+
`agy.log` 與 `stdout.json` 會保留在 `.agent-ops/reviews/lost-turns/<sessionId>/`
|
|
89
|
+
(僅本機、被 git 忽略、不會自動清理)。若被拒的是你自己 agy 設定的 MCP 工具,
|
|
90
|
+
對 agy 停用該 server(`agy mcp disable <name>`)即可移除觸發原因;agent-ops 不會
|
|
91
|
+
更動你的 agy 設定。
|
|
92
|
+
|
|
84
93
|
Host 缺少 network 或 loopback 權限時,會在啟動任何 reviewer 前回傳
|
|
85
94
|
`REVIEW_NOT_RUN`。Managed 規則要求可信任的外部 host runner 在第一次呼叫時
|
|
86
95
|
就用兩項權限啟動同一個完整指令;不要先在原 sandbox 執行再重試,因為那不算
|
|
@@ -145,9 +154,13 @@ fingerprint,因此兩個對話修改同一個 checkout 會互相作廢對方
|
|
|
145
154
|
則作為每條命令的工作目錄);同一 session 之後被拒絕時會重用它。
|
|
146
155
|
建立失敗時,拒絕訊息會說明原因並退回手動 `worktree add`。需先執行一次
|
|
147
156
|
`agent-ops update`,讓 PreToolUse hook 取得 setup 所需的 600 秒逾時。
|
|
148
|
-
- `add`
|
|
149
|
-
|
|
150
|
-
|
|
157
|
+
- `add` 建立 `.worktrees/<name>` 與 branch `agent-ops/<name>`,並透過
|
|
158
|
+
`.git/info/exclude`(而非 `.gitignore`)排除 `/.worktrees/`。它的 base 與合併
|
|
159
|
+
目標是 session 開始時主 checkout 所在的 branch:SessionStart 會為每個 session
|
|
160
|
+
記錄該 branch 一次(resume、compact、clear 都不會覆寫;detached HEAD 或在
|
|
161
|
+
worktree 內觸發時不記錄),所以中途切換 branch 不會改變工作的目標。沒有記錄時
|
|
162
|
+
會在 add 當下讀取主 checkout 的 HEAD;明確的 `--target-branch` 或 `--from`
|
|
163
|
+
優先於記錄;記錄的 branch 已不存在時會報錯,並提示使用 `--target-branch`。它會複製 agent-ops 安裝的 ignored 檔案,以及根目錄
|
|
151
164
|
`.worktreeinclude`(gitignore 語法,例如 `.env` 或 `local.properties`)比對到
|
|
152
165
|
的檔案;Git 已 checkout 的檔案一律不覆寫。只有主 checkout 已 trusted 且
|
|
153
166
|
worktree 的 effective config 完全相同時才繼承 trust。
|
|
@@ -165,7 +178,10 @@ fingerprint,因此兩個對話修改同一個 checkout 會互相作廢對方
|
|
|
165
178
|
維持附著在 task 樹最上層,且每個 task 各自保留 review 紀錄,所以在同一份原始碼上
|
|
166
179
|
review 的 parent 與 subtask 不會互相覆蓋。
|
|
167
180
|
- `agent-ops worktree finish <name>` 只以 fast-forward 合併,一次只執行一個
|
|
168
|
-
finish
|
|
181
|
+
finish。主 checkout 就在 target branch 上時,合併會更新它的檔案,所以那裡有未
|
|
182
|
+
commit 的變更會擋住合併;主 checkout 在其他 branch 或 detached 時,只移動
|
|
183
|
+
target 的 ref,checkout、檔案與未 commit 的變更都不會被動到。Target 若被其他
|
|
184
|
+
worktree checkout 則拒絕,並指出該路徑。Target 若已前進會先 rebase;沒有衝突且自身 patch 不變的 rebase 會先
|
|
169
185
|
重新驗證再合併;衝突則連同先合併那份工作在 `refs/notes/agent-ops` 的意圖一起
|
|
170
186
|
回報。Note 會記錄 worktree 的每個 task,subtask 縮排在其 parent 之下。
|
|
171
187
|
- `worktree list`、`resume <name> --session <id>` 與 `remove <name>` 管理剩下的
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 驗收與證據
|
|
2
2
|
|
|
3
|
-
English source version: 2026-09-
|
|
3
|
+
English source version: 2026-09-27. Revalidate: when the English specification changes.
|
|
4
4
|
|
|
5
5
|
## EVIDENCE-CRITERION-001
|
|
6
6
|
|
|
@@ -35,10 +35,14 @@ English source version: 2026-09-07. Revalidate: when the English specification c
|
|
|
35
35
|
- 每項 criterion 至少需要一個 required verifier,且其列出的每個 required verifier 都要有目前有效的 PASS evidence。即使 path mapping 選出較小範圍,verify 也會包含 task 明列的 required 命令。請提供 `agent-ops verify --task <id>` 產生的證據檔參照,不能只填命令文字或自行宣稱 PASS。
|
|
36
36
|
- 任務的 config baseline、evidence 必須符合目前有效設定與所選 scope 的來源指紋。尚未解決的驗證失敗會阻擋完成;舊 PASS 不能蓋過較新的失敗,同時間戳的矛盾結果也會阻擋。
|
|
37
37
|
- 使用 `agent-ops review --task <id> --yes` 審查整個任務。完成時必須有目前有效且綁定該 task 的 PASS attestation;generic review 與只涵蓋部分 criterion 的 review 不算。
|
|
38
|
-
-
|
|
38
|
+
- task、來源、criteria 與 config 不變時,重新驗證後可沿用原 PASS review。開始新的已授權 review(`--rerun`)才會撤銷該來源指紋先前的 attestation。若 reviewer 未能執行或未通過,完成前必須重新取得成功的全任務 review。
|
|
39
39
|
- 所有子任務與後代任務都必須已完成,且沒有尚未解決的失敗。封存未完成工作不算完成;已完成或封存的 parent 不能新增子任務。若放棄某個 subtask,請重建不含該取消分支的 parent task,並重新驗證與審查新的 task tree。
|
|
40
40
|
- 證據、來源與設定檢查在 task store 鎖外執行。再次確認來源與設定後,完成操作才短暫鎖住狀態,比對 task 快照(改變時回傳 `TASK_COMPLETION_STATE_CHANGED`)、重查後代任務並原子寫入。慢速檢查不會阻擋 task 讀取或其他修改;完成被拒絕時,併發修改仍會保留。
|
|
41
41
|
|
|
42
|
+
`test-count.minimum` 只計明確 passed 的測試,排除 skipped、todo、預期失敗與 discovery total。零 passed 即使 minimum 為零也會 FAIL;無法辨識 passed 摘要時為 UNKNOWN。摘要有 failed、error 或 cancelled,即使 process exit code 為零也會 FAIL。exit-code verifier 保留既有行為。任一 criterion 缺少 required verifier 時,task verify 回傳 `VERIFICATION_UNKNOWN`、列出缺少 coverage 的 criterion,且不執行 verifier 命令;只有 optional 結果不能建立正式 task 的驗證 PASS。
|
|
43
|
+
|
|
44
|
+
新 verification evidence 使用 schema 3。Schema 2 仍可讀取,其 exit-code 證據仍有效;schema 2 test-count 證據不能建立 PASS,必須重新驗證。舊參照會保留。Completed task 只可為原來源、criteria 與 config 追加 fresh verification,保留 completedAt 與 review 參照。追加與清除 failure 前,會原子比對完整狀態快照;併發修改保留並拒絕本次追加。Fresh FAIL 或 UNKNOWN 在修正前阻擋完成;archived task 不可修改。來源或 config 改變時必須建立新 task。
|
|
45
|
+
|
|
42
46
|
既有 task 檔案仍可直接讀取,不需資料格式遷移。缺少 config baseline、使用任意文字證據,或含有未完成但已封存子任務的舊任務,必須重建並完成驗證與審查。重複執行 complete 也會重新驗證證據;舊的 completed 狀態本身不夠。Runtime 呼叫端必須提供 `TaskServiceOptions.completion`;缺少此 repository context 時,complete 會拒絕執行,但仍可讀取任務。
|
|
43
47
|
|
|
44
48
|
Commit 前,verify、review、complete 使用預設 worktree scope。Commit 後,三個命令都使用相同的 `--base <git-ref>`,為已提交範圍重新產生證據;runtime 呼叫端使用 `TaskServiceOptions.completion.base`。Base 模式要求 worktree 乾淨。沒有 worktree 變更又未指定 base 時,complete 會回傳 `TASK_COMPLETION_SCOPE_REQUIRED`。agy Stop gate 仍檢查 worktree scope 的證據:請在 commit 前完成並停止,或由使用者檢查已完成的 base-scope 任務後,核准一次性的 Stop permit。
|
|
@@ -37,7 +37,7 @@ English source version: 2026-09-24. Revalidate: when the English specification c
|
|
|
37
37
|
同一個 repository 中並行修改檔案的對話 MUST 各自在自己的 agent-ops worktree 中工作。
|
|
38
38
|
|
|
39
39
|
- Trigger: `worktree.mode` 為 `auto`,或另一個對話仍開著時,第二個對話也要修改這個 repository。
|
|
40
|
-
- Action: 第一次修改前,在主 checkout 執行 `agent-ops worktree add <name> --session <id>`,只在印出的路徑中工作;task 以印出的 `--base` 完成後,用 `agent-ops worktree finish <name>`
|
|
40
|
+
- Action: 第一次修改前,在主 checkout 執行 `agent-ops worktree add <name> --session <id>`,只在印出的路徑中工作;task 以印出的 `--base` 完成後,用 `agent-ops worktree finish <name>` 合併。合併目標是 session 開始時主 checkout 所在的 branch,不論該 checkout 現在在哪裡。
|
|
41
41
|
- Evidence: `agent-ops worktree list` 顯示每個修改中的 session 各有一個 worktree,且每次 finish 都回報 fast-forward 合併。
|
|
42
42
|
- Positive: `兩個對話分別修改 .worktrees/login 與 .worktrees/cart;各自驗證、review 並 finish。`
|
|
43
43
|
- Negative: `兩個對話同時修改主 checkout,彼此的寫入讓對方的驗證與 review 全部作廢。`
|
package/package.json
CHANGED