@kylecheng3146/agent-ops 0.5.3 → 0.7.0

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 (124) hide show
  1. package/README.md +103 -1
  2. package/dist/packages/cli/src/args.js +183 -3
  3. package/dist/packages/cli/src/bin.js +76 -19
  4. package/dist/packages/cli/src/cli.js +53 -8
  5. package/dist/packages/cli/src/codex-loop-process.js +19 -2
  6. package/dist/packages/cli/src/commands/advance.js +42 -5
  7. package/dist/packages/cli/src/commands/init.js +2 -0
  8. package/dist/packages/cli/src/commands/office.js +20 -0
  9. package/dist/packages/cli/src/commands/review-show.js +1 -1
  10. package/dist/packages/cli/src/commands/review.js +100 -9
  11. package/dist/packages/cli/src/commands/run.js +115 -0
  12. package/dist/packages/cli/src/commands/task.js +61 -17
  13. package/dist/packages/cli/src/commands/update.js +8 -0
  14. package/dist/packages/cli/src/commands/verify.js +1 -0
  15. package/dist/packages/cli/src/context.js +64 -1
  16. package/dist/packages/cli/src/hook-entry.js +2 -1
  17. package/dist/packages/cli/src/hook-process.js +54 -3
  18. package/dist/packages/cli/src/loop-entry.js +2 -1
  19. package/dist/packages/cli/src/office-entry.js +230 -0
  20. package/dist/packages/cli/src/owned-run-step.js +65 -0
  21. package/dist/packages/cli/src/parallel-deps.js +18 -5
  22. package/dist/packages/cli/src/run-deps.js +321 -0
  23. package/dist/packages/cli/src/run-entry.js +952 -0
  24. package/dist/packages/cli/src/run-setup-entry.js +32 -0
  25. package/dist/packages/cli/src/run-step-entry.js +58 -0
  26. package/dist/packages/cli/src/wizard.js +14 -2
  27. package/dist/runtime/src/adapters/agy/config.js +4 -3
  28. package/dist/runtime/src/adapters/agy/events.js +9 -0
  29. package/dist/runtime/src/adapters/claude/config.js +3 -3
  30. package/dist/runtime/src/adapters/claude/events.js +8 -0
  31. package/dist/runtime/src/adapters/codex/config.js +3 -3
  32. package/dist/runtime/src/adapters/codex/events.js +8 -0
  33. package/dist/runtime/src/adapters/opencode/config.js +5 -4
  34. package/dist/runtime/src/adapters/opencode/events.js +8 -0
  35. package/dist/runtime/src/config/explain.js +11 -0
  36. package/dist/runtime/src/config/hash.js +1 -1
  37. package/dist/runtime/src/config/merge.js +9 -1
  38. package/dist/runtime/src/contracts.js +2 -2
  39. package/dist/runtime/src/hooks/codex-loop.js +4 -0
  40. package/dist/runtime/src/hooks/completion-gate.js +8 -2
  41. package/dist/runtime/src/install/doctor.js +2 -0
  42. package/dist/runtime/src/install/harness.js +44 -1
  43. package/dist/runtime/src/install/plan.js +16 -11
  44. package/dist/runtime/src/install/preauth.js +44 -18
  45. package/dist/runtime/src/install/profiles.js +8 -2
  46. package/dist/runtime/src/install/update.js +1 -0
  47. package/dist/runtime/src/office/collect.js +233 -0
  48. package/dist/runtime/src/office/page.js +873 -0
  49. package/dist/runtime/src/office/scene.js +168 -0
  50. package/dist/runtime/src/office/server.js +139 -0
  51. package/dist/runtime/src/office/sessions.js +115 -0
  52. package/dist/runtime/src/office/snapshot.js +107 -0
  53. package/dist/runtime/src/parallel/finish.js +85 -22
  54. package/dist/runtime/src/parallel/guard.js +12 -2
  55. package/dist/runtime/src/parallel/integrate.js +288 -10
  56. package/dist/runtime/src/parallel/manage.js +4 -1
  57. package/dist/runtime/src/parallel/receipt.js +71 -5
  58. package/dist/runtime/src/parallel/service.js +41 -1
  59. package/dist/runtime/src/review/attestation.js +36 -11
  60. package/dist/runtime/src/review/execute.js +24 -1
  61. package/dist/runtime/src/review/packet.js +35 -1
  62. package/dist/runtime/src/review/runner.js +12 -1
  63. package/dist/runtime/src/review/scope.js +18 -1
  64. package/dist/runtime/src/review/slots.js +35 -10
  65. package/dist/runtime/src/run/authorization.js +60 -0
  66. package/dist/runtime/src/run/budget.js +30 -0
  67. package/dist/runtime/src/run/controls.js +139 -0
  68. package/dist/runtime/src/run/convergence.js +177 -0
  69. package/dist/runtime/src/run/hosts/claude.js +180 -0
  70. package/dist/runtime/src/run/hosts/codex.js +279 -0
  71. package/dist/runtime/src/run/hosts/index.js +4 -0
  72. package/dist/runtime/src/run/hosts/protocol.js +254 -0
  73. package/dist/runtime/src/run/hosts/types.js +1 -0
  74. package/dist/runtime/src/run/hosts/util.js +136 -0
  75. package/dist/runtime/src/run/integration.js +204 -0
  76. package/dist/runtime/src/run/macOS.js +189 -0
  77. package/dist/runtime/src/run/ownership.js +22 -0
  78. package/dist/runtime/src/run/phase.js +37 -0
  79. package/dist/runtime/src/run/planning.js +25 -0
  80. package/dist/runtime/src/run/policy-transition.js +1076 -0
  81. package/dist/runtime/src/run/policy.js +176 -0
  82. package/dist/runtime/src/run/ratchet.js +71 -0
  83. package/dist/runtime/src/run/scheduler.js +260 -0
  84. package/dist/runtime/src/run/service.js +433 -0
  85. package/dist/runtime/src/run/supervisor.js +635 -0
  86. package/dist/runtime/src/run/transport.js +159 -0
  87. package/dist/runtime/src/run/types.js +1 -0
  88. package/dist/runtime/src/run/usage.js +81 -0
  89. package/dist/runtime/src/run/verification.js +64 -0
  90. package/dist/runtime/src/run/worker-gate.js +48 -0
  91. package/dist/runtime/src/schema/acceptance.js +91 -0
  92. package/dist/runtime/src/schema/validate.js +80 -9
  93. package/dist/runtime/src/task/completion.js +14 -2
  94. package/dist/runtime/src/task/contract.js +17 -0
  95. package/dist/runtime/src/task/pin-finding.js +81 -0
  96. package/dist/runtime/src/task/service.js +316 -13
  97. package/dist/runtime/src/task/store.js +57 -7
  98. package/dist/runtime/src/verify/acceptance-coverage.js +85 -0
  99. package/dist/runtime/src/verify/acceptance-protocol.js +252 -0
  100. package/dist/runtime/src/verify/acceptance-replay.js +239 -0
  101. package/dist/runtime/src/verify/adapters/index.js +5 -0
  102. package/dist/runtime/src/verify/adapters/jest.js +142 -0
  103. package/dist/runtime/src/verify/adapters/node-reporter.js +20 -0
  104. package/dist/runtime/src/verify/adapters/node.js +254 -0
  105. package/dist/runtime/src/verify/adapters/pytest.js +188 -0
  106. package/dist/runtime/src/verify/adapters/rust.js +84 -0
  107. package/dist/runtime/src/verify/adapters/shared.js +82 -0
  108. package/dist/runtime/src/verify/adapters/vitest.js +218 -0
  109. package/dist/runtime/src/verify/evidence.js +5 -2
  110. package/dist/runtime/src/verify/service.js +24 -8
  111. package/dist/runtime/src/verify/source-fingerprint.js +1 -1
  112. package/dist/runtime/src/verify/spawn.js +13 -2
  113. package/docs/en/spec/acceptance-and-evidence.md +48 -0
  114. package/docs/en/spec/harness-adapters.md +113 -1
  115. package/docs/en/spec/loop-engineering.md +49 -0
  116. package/docs/zh-TW/spec/acceptance-and-evidence.md +21 -1
  117. package/docs/zh-TW/spec/harness-adapters.md +93 -1
  118. package/docs/zh-TW/spec/loop-engineering.md +22 -0
  119. package/package.json +1 -1
  120. package/schemas/config.schema.json +230 -19
  121. package/schemas/evidence.schema.json +129 -6
  122. package/schemas/task.schema.json +265 -6
  123. package/templates/acceptance/agent_ops_acceptance.rs +36 -0
  124. package/templates/acceptance/agent_ops_pytest.py +46 -0
@@ -1,6 +1,26 @@
1
1
  # 驗收與證據
2
2
 
3
- English source version: 2026-09-27. Revalidate: when the English specification changes.
3
+ ## EVIDENCE-CONTRACT-001
4
+
5
+ 可執行驗收 MUST 將目前契約綁定到不可變的 replay 證據。
6
+
7
+ - Trigger: 驗證或完成 typed 驗收契約。
8
+ - Action: 在固定 baseline 與目前 candidate replay 授權 checks,再取得 fresh review。
9
+ - Evidence: 綁定摘要的 phase results 與目前 coverage 進入兩輪 reviewer packet。
10
+ - Positive: baseline 斷言 FAIL、candidate PASS 證明 behavioral check。
11
+ - Negative: 把 fixture error 算 red,或用舊 review 證明修訂後 criteria。
12
+
13
+ - `behavioral`:指定 red checks 在 baseline 都因斷言失敗,candidate 的必要 checks 全部通過。`invariant`:candidate 的必要 checks 通過,baseline 原本 PASS 有效。`review-only`:兩輪 fresh review 對照原始目標驗收,不宣稱機械證明。
14
+ - repo 授權的 `verification.acceptanceRunners` 定義 argv、setup、產品與 test build。task 提供穩定 check IDs 與明列且已 commit 的 test/fixture/helper;兩側各自安裝並 build 其版本,再覆蓋 candidate 材料。task 不能改 runner 命令。
15
+ - fixture、collection、build、timeout、取消、輸出截斷、缺少或重複 ID、retry、skip MUST NOT 算 red 或 green。完整 execution artifacts 以摘要綁定契約、材料與 commits。
16
+ - 原生 Jest JSON 與 Vitest task errors 無法完整區分 test-call 斷言與 hook/fixture cleanup。除非已 review 的 repo collector 提供明確斷言分類,失敗列 MUST 保持 UNKNOWN;AssertionError 名稱、matcher 資料與 pass 的 hook 狀態都不足。green 需要明確的單次 attempt 證據:attempts、Jest invocations,或 Vitest retryCount 與 repeatCount 兩者。原生 Vitest JSON 省略這些 counters,不能單獨提供機械證明。pytest 每個 nodeid 必須有一組依序的 setup/call/teardown;Rust protocol 必須提供 attempts。缺 metadata MUST NOT 預設為一次成功。
17
+ - baseline 固定為建立 commit;finding pin 使用被 FAIL 的 candidate。revise/replan 保留原始目標、全部映射要求與先前契約/證據。新契約必須重新取證並取得兩輪 fresh review。
18
+ - `task pin-finding` 驗證已保存 report 的 digest/index 來源。recurrence 明確引用既有 pin。第六條回傳 replan 義務且不修改狀態;映射後必須保留 pin 與全部要求。
19
+ - reviewer packet 包含原始目標、修訂歷史、coverage 與 verifier 材料,審查斷言本身與明確的 fallback 理由。機械 green 不會省略必要 policy commands 或任一 fresh review。
20
+
21
+ task state 寫入 version 2、讀取 version 1;evidence version 4 讀取舊證據,attestation version 3 綁定契約與 coverage。legacy criteria 維持下列 verifier 規則;typed/revised 契約不能沿用舊 review。coverage 分列機械證明、review-only、legacy;runner 綁定本身不算證明。明確 no-change proof 列出固定 candidate 上已 commit 的 regular source files;整合時重新解析支持路徑。一般 empty-diff review 與 empty-branch direct finish 仍拒絕。
22
+
23
+ English source version: 2026-10-06. Revalidate: when the English specification changes.
4
24
 
5
25
  ## EVIDENCE-CRITERION-001
6
26
 
@@ -1,6 +1,6 @@
1
1
  # Harness Adapter
2
2
 
3
- English source version: 2026-08-03. Revalidate: when the English specification or any vendor reference changes.
3
+ English source version: 2026-10-07. Revalidate: when the English specification or any vendor reference changes.
4
4
 
5
5
  本文件所述 OpenCode plugin 行為已於 2026-07-31 依據[官方 plugin 文件](https://opencode.ai/docs/plugins/)與[Bun shell 文件](https://bun.sh/docs/runtime/shell)檢查;Codex 與 Claude Code loop-hook 行為已於 2026-08-03 依據 [Codex hook 文件](https://developers.openai.com/codex/config-advanced#hooks) 與 [Claude Code hook 文件](https://code.claude.com/docs/en/hooks) 檢查;agy hook 行為已於 2026-08-28 依據[官方 Antigravity hook 文件](https://antigravity.google/docs/hooks) 檢查。任何 vendor 參考變更時都必須重新驗證。
6
6
 
@@ -90,6 +90,7 @@ script,也不得改變一般 permission request。
90
90
 
91
91
  | Capability | agy | Codex | Claude Code | OpenCode |
92
92
  | --- | --- | --- | --- | --- |
93
+ | office-presence (Preview) | degraded | degraded | supported | degraded |
93
94
  | lifecycle-summary | degraded | supported | supported | degraded |
94
95
  | command-policy | supported | unknown | supported | supported |
95
96
  | completion-gate | supported | unsupported | unsupported | unsupported |
@@ -118,3 +119,94 @@ Stop verification 必須明確啟用、具備 trust、為 report-only 且預設
118
119
  event metadata、回傳有界且 redacted 的 session context,並在 update 或 uninstall
119
120
  時保留 local goal、state、telemetry 與 Codex TOML file。既有 Codex configuration
120
121
  中清楚解析出的 `[features]` / `hooks = false` MUST 在任何 write 前拒絕 loop planning。
122
+
123
+ ## HARNESS-ADAPTER-007
124
+
125
+ `run` profile MUST 是 opt-in,會一併選取 `core` 與 `loop`,且只新增 `auto-run`
126
+ capability。啟用後,Claude Code 與 Codex 的 managed rules 會將需要超過五項
127
+ acceptance criteria 的變更交給 `agent-ops run`;五項以內仍留在 session 中處理。
128
+ agy rules,以及所有未含 `auto-run` 的 rule file,MUST 與未啟用此 profile 時
129
+ byte-identical。
130
+
131
+ - Trigger: Project 選擇 `run`,且 Claude Code 或 Codex session 遇到需要超過五項
132
+ acceptance criteria 的變更。
133
+ - Action: Agent 在 main checkout、且在任何 `task create` 之前,將使用者 prompt
134
+ 原文與其提議的 acceptance criteria(標示為提議)寫入已 gitignore 的
135
+ `.agent-ops/state/run-goal.md`,再以 background shell command 啟動
136
+ `agent-ops run --goal-file .agent-ops/state/run-goal.md --host <claude|codex> --wait`。
137
+ Codex 的啟動方式與 review 相同:outer request 使用
138
+ `sandbox_permissions: "require_escalated"` 與
139
+ `env -u CODEX_SANDBOX_NETWORK_DISABLED`。Awaiting-input 結果會轉達給使用者,並以
140
+ `agent-ops run respond` 回覆。啟動遭 `RUN_TARGET_REQUIRED`、
141
+ `RUN_BACKGROUND_UNSUPPORTED`、`RUN_TARGET_DIRTY` 或 `WORKTREE_NESTED` 拒絕時,以
142
+ 一行說明該 code,並退回 subtask flow;`RUN_REPO_UNTRUSTED` 則停止並詢問使用者。
143
+ 未完成即結束的 run(blocked、budget exhausted、stopped、review 失敗)須回報其
144
+ `run status` state 與 code、最後的 `run logs` event,以及確切的
145
+ `agent-ops run resume <id>` 與 `agent-ops run stop <id>` command,且永不自動
146
+ resume 或由 session 接手。在 worktree auto mode 下,Claude `PreToolUse`
147
+ worktree guard 允許在 main checkout 寫入恰為 `.agent-ops/state/run-goal.md`
148
+ 的路徑,且不建立 worktree。確認後的 init/update 會預先授權 `agent-ops run`:
149
+ Claude Code 為 `Bash(agent-ops run *)`,Codex 為
150
+ `env -u CODEX_SANDBOX_NETWORK_DISABLED agent-ops run` 的 escalated prefix rule。
151
+ - Evidence: Profile、managed-rule digest、pre-authorization 與 worktree-guard
152
+ test 涵蓋解析後的 profile、未變更的 rules、新增的 entry,以及唯一豁免的路徑。
153
+ - Positive: `啟用 run profile 的 Claude Code session 在 main checkout 寫入 .agent-ops/state/run-goal.md,並在 background 啟動 agent-ops run --host claude --wait。`
154
+ - Negative: `run profile 啟用時仍將八項 criteria 的變更拆成 subtask、在 GEMINI.md 加入 auto-run 文字,或未經使用者即 resume blocked run。`
155
+
156
+ ## HARNESS-ADAPTER-008
157
+
158
+ `agent-ops office`(Preview)MUST 只依據 agent-ops state 以 read-only 方式呈現進度。
159
+ Supervisor 在確定性的轉換點記錄每個 run 與 worker 的 optional phase
160
+ (`planning`、`implementing`、`verifying`、`reviewing`、`integrating`),以及每個
161
+ task 最近一次 verify 與 review 結果與通過/總數 criteria。Phase 出現前寫入的 run
162
+ state MUST 仍能通過驗證,並顯示為 `unknown`。變更檔案來自各 worktree 自身相對
163
+ base 的 `git diff`;旁白只使用路徑(`docs/**` 為「writing docs」、`tests/**` 為
164
+ 「writing tests」,其他為「editing <file>」)。Office MUST NOT 讀取 Claude 或 Codex
165
+ 的 native transcript 或檔案內容。
166
+
167
+ - Office Preview 透過 `features.office.enabled` 明確啟用。Init MUST 提供預設關閉
168
+ 的選項;互動式 update MUST 以既有選擇為預設。非互動式 update MUST 保留選擇,
169
+ 除非傳入 `--office on|off`。即使只選 core,啟用 Office 也 MUST 安裝 presence
170
+ hook,但 MUST NOT 同時啟用 command policy、Stop verification 或 lifecycle
171
+ summary。Office-only OpenCode 的 runtime 失敗 MUST fail-open;與 command
172
+ policy 同時啟用時 MUST 保留原有拒絕與 runtime unavailable 行為。Agy 啟動事件
173
+ 以 invocation 為單位,OpenCode 以 app 為單位,部分 Codex 模式沒有 Stop;過期
174
+ presence 依有界限的 hook 活動逾時處理。舊設定可省略此欄位,省略代表關閉;features 維持
175
+ 原有的整個物件 layer 優先順序。關閉時 hook MUST NOT 記錄 Office presence、
176
+ 啟動 server 或開啟瀏覽器,明確的 office 指令 MUST 說明啟用方法。運行中的
177
+ server MUST 在下一次 15 秒生命週期檢查觀察到關閉選擇後結束。
178
+ - Trigger: 啟用後,Managed 一般 session 啟動或回報活動,或使用者執行
179
+ `agent-ops office`、`agent-ops run start` 或 `agent-ops run status`。
180
+ - Action: Command 重用記錄於 `<git common dir>/agent-ops/office.json` 的 live
181
+ server,否則啟動一個,並印出 URL。一般 session hook 也會自動啟動或重用
182
+ Office,包含尚未建立 task 或 worktree 的 session。只有成功取得新 server
183
+ 所有權的 process 開啟瀏覽器,後續 session 共用同一個 Office。Session metadata
184
+ 只記錄有界限的識別資訊、已知工作狀態與活動時間,不包含 native transcript、
185
+ prompt、tool 或檔案內容。啟動與活動觀察失敗均為 advisory。
186
+ Server 綁定 127.0.0.1 的隨機 port,要求 URL 中不可猜測的 token,拒絕該位址與
187
+ port 以外的 Host,所有非 GET 回應 405,並在 run 與一般 session 都沒有活動
188
+ 10 分鐘後結束。唯一的 inline page 使用奶油白、淺木與鼠尾草綠的程式內 16 色
189
+ 場景 sprite,沒有圖片 asset。32×48 人物各自使用固定的膚色、髮色與服裝色盤,
190
+ 支援四方向走路,並顯示本地化的職責文字。使用者標籤在中文顯示「你」、英文顯示「You」,總覽大小與
191
+ 最大房間的成員一致。總覽填滿頂部工具列下方的單一
192
+ viewport,同時呈現全部有家具的工作房間,必要時自動縮小且不捲動頁面。
193
+ 房間以共用走廊連接;使用者可以用方向鍵或 WASD 操控本機 Supervisor 角色,
194
+ 走進每間房並返回總覽,不會呼叫模型或透過網路修改狀態。每個 run 團隊共用一間房,
195
+ 每個一般 session 各有一間,執行中的 review 也保持可見。點房間進入放大的
196
+ 詳細畫面,並可返回總覽。每間房包含規劃、開發、驗證、審查與整合區。角色依
197
+ 已知 phase 移動與播放輕量動作,並有簡短名牌與狀態;不從對話推測未知狀態。
198
+ 白板顯示 criteria 進度、verify/review 結果與待回覆問題,`!` 標示未回答的問題。
199
+ 點白板或進度板開啟房間工作清單,點工位或階段區查看該階段的已知工作。
200
+ 點待回覆標記查看完整問題與現有可複製指令;同一套分頁視窗也可用
201
+ `L`(工作清單)、`1–5`(階段)與 `Q`(問題)開啟。
202
+ 點角色開啟有界限且分頁的 status 詳情,包含可複製的 command。完成房間移到
203
+ 最近完成,最多保留兩小時。支援中英文切換並記住選擇、鍵盤操作與 reduced
204
+ motion。一般 session 的存活狀態依 hook 活動判定,30 分鐘沒有事件就會移除
205
+ 過期的 presence,不會讀取 native host process。Office 啟動失敗絕不使
206
+ hook、`run start` 或 `run status` 失敗。
207
+ - Evidence: Phase、snapshot、server、scene 與 CLI test 涵蓋 legacy state、彙整與
208
+ 旁白、一般 session 登記與只開啟一次、完成後兩小時的邊界、token/Host/method
209
+ 防護、重用與 injected clock 的 idle 結束、viewport 與房間切換、中英文,以及
210
+ 印出的 URL。Browser read-back 檢查實際渲染的單頁布局。
211
+ - Positive: `一般 session 自動開啟共用 Office,尚未建立 worktree 就能看到自己的房間;進入團隊房時看到 coordinator 在驗證桌旁,白板顯示 6 項 criteria 已通過 2 項。`
212
+ - Negative: `在 0.0.0.0 提供 office、接受 POST、讀取 worker transcript 來產生旁白,或打包 PNG sprite sheet。`
@@ -1,5 +1,27 @@
1
1
  # 迴圈工程
2
2
 
3
+ ## LOOP-RUN-001
4
+
5
+ `run` MUST 保留原始使用者目標,並要求目前有效的 agent-ops 證據。
6
+
7
+ - Trigger: 啟動、修復或恢復 native goal run。
8
+ - Action: writer 綁定目前 lease,並要求最終 verify、雙 review 與 receipt 證據。
9
+ - Evidence: run ledger 與封存 receipt 綁定目前 candidate 及原始目標。
10
+ - Positive: 恢復未完成清理時,保留 target 與已保存的 final proof。
11
+ - Negative: 只因 native goal completion 就把 run 標為 complete。
12
+
13
+ - macOS supervisor 在啟動 goal 前保存 Claude/Codex native 身份。同 host writers 使用獨立 worktrees 與目前 generation lease;coordinator 計入最多兩個 writer。依賴以固定交付提供,child baseline 在依賴 commits 進入 checkout 後建立。
14
+ - 預設 60 分鐘預算計算 active intervals 聯集,包含 setup、verify、review、整合。resume 保留時間與 usage epochs;缺少計數維持 UNKNOWN,partial usage 不算完整成本。
15
+ - 實質疑問暫停並要求明確回答。修復保留目標與失敗紀錄;連續兩次相同失敗且無進展停止該 worker 及其依賴,獨立 task 仍可執行。review findings 在下次 final gate 前必須有回歸 pin 或記錄 review-only fallback。
16
+ - native completion 僅是觀察。完成必須有必要驗證、兩輪 fresh review、完成的 task state、綁定 target 的 receipt。整合在移動 target 前封存 candidate,記錄 task、receipt、note、cleanup 進度;恢復驗證封存證據,不重做成功的 target mutation。不一致的 target 維持 blocked。
17
+ - Stop 先保存禁止續跑,再確認受管 process group 死亡。crash recovery 不得取代仍存活或身份不明的 writer。dirty checkout、版本漂移、restart storm 保留現場。重開機/login 改變必須明確 resume;不修改全域 host policy。
18
+ - Native handshake 前先保存啟動程序身份;尚未開啟的 Codex session 必須證明程序死亡,才可在新 lease 重新初始化。
19
+
20
+ - Setup 與 native agent 發起的 local proof MUST 先登記 dormant process group 再執行;Stop 也要取消子程序。中斷的 setup 必須明確 resume,保留 checkout 與失敗 artifact。
21
+ - Coordinator 只能在綁定原始 repository trust、可執行 runtime、剩餘預算的 run-scoped policy 下,評估新增固定且非危險的能力。不得繞過 native 或組織的明確拒絕。Policy 變更先停止所有 writer,保留固定交付,以 journal 記錄 contract 同步,再啟動新 generation;不授予永久 repository trust。Native decision 保存遮罩後的命令範圍與理由,provider 未提供的證據維持 UNKNOWN。
22
+ - 明確 resume 從剩餘預算續期過期授權,並先核對不可變 renewal lineage,再同步 policy。回答問題也沿用相同恢復檢查;兩者皆不得復活已被明確拒絕的工作。
23
+ - 收斂判斷比較實際 per-check 狀態及未解除的 finding pins;source fingerprint、時間或診斷文字本身不能算進展。
24
+
3
25
  English source version: 2026-07-23. Revalidate: when the English specification changes.
4
26
 
5
27
  ## LOOP-START-001
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kylecheng3146/agent-ops",
3
- "version": "0.5.3",
3
+ "version": "0.7.0",
4
4
  "description": "Evidence-driven development loops for agy, Codex, Claude Code, and opencode",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -20,7 +20,13 @@
20
20
  "type": "array",
21
21
  "uniqueItems": true,
22
22
  "items": {
23
- "enum": ["core", "advisory", "guardrails", "loop"]
23
+ "enum": [
24
+ "core",
25
+ "advisory",
26
+ "guardrails",
27
+ "loop",
28
+ "run"
29
+ ]
24
30
  }
25
31
  },
26
32
  "reviewRoles": {
@@ -28,7 +34,10 @@
28
34
  "items": {
29
35
  "type": "object",
30
36
  "additionalProperties": false,
31
- "required": ["role", "targets"],
37
+ "required": [
38
+ "role",
39
+ "targets"
40
+ ],
32
41
  "properties": {
33
42
  "role": {
34
43
  "enum": [
@@ -43,19 +52,34 @@
43
52
  "minItems": 1,
44
53
  "uniqueItems": true,
45
54
  "items": {
46
- "enum": ["codex", "agy", "claude"]
55
+ "enum": [
56
+ "codex",
57
+ "agy",
58
+ "claude"
59
+ ]
47
60
  }
48
61
  },
49
- "model": { "type": "string", "minLength": 1 },
50
- "effort": { "type": "string", "minLength": 1 },
51
- "timeoutMs": { "type": "integer", "minimum": 1 }
62
+ "model": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "effort": {
67
+ "type": "string",
68
+ "minLength": 1
69
+ },
70
+ "timeoutMs": {
71
+ "type": "integer",
72
+ "minimum": 1
73
+ }
52
74
  }
53
75
  }
54
76
  },
55
77
  "verification": {
56
78
  "type": "object",
57
79
  "additionalProperties": false,
58
- "required": ["commands"],
80
+ "required": [
81
+ "commands"
82
+ ],
59
83
  "properties": {
60
84
  "commands": {
61
85
  "type": "array",
@@ -69,18 +93,171 @@
69
93
  }
70
94
  ]
71
95
  }
96
+ },
97
+ "acceptanceRunners": {
98
+ "type": "array",
99
+ "maxItems": 128,
100
+ "items": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": [
104
+ "id",
105
+ "command",
106
+ "args",
107
+ "cwd",
108
+ "adapter"
109
+ ],
110
+ "properties": {
111
+ "id": {
112
+ "$ref": "#/$defs/id"
113
+ },
114
+ "command": {
115
+ "type": "string",
116
+ "minLength": 1
117
+ },
118
+ "args": {
119
+ "type": "array",
120
+ "maxItems": 512,
121
+ "items": {
122
+ "type": "string"
123
+ }
124
+ },
125
+ "cwd": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "adapter": {
130
+ "enum": [
131
+ "generic",
132
+ "node",
133
+ "jest",
134
+ "vitest",
135
+ "pytest",
136
+ "rust"
137
+ ]
138
+ },
139
+ "timeoutMs": {
140
+ "type": "integer",
141
+ "minimum": 1,
142
+ "maximum": 3600000
143
+ },
144
+ "setup": {
145
+ "type": "array",
146
+ "maxItems": 64,
147
+ "items": {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": [
151
+ "command",
152
+ "args"
153
+ ],
154
+ "properties": {
155
+ "command": {
156
+ "type": "string",
157
+ "minLength": 1
158
+ },
159
+ "args": {
160
+ "type": "array",
161
+ "maxItems": 512,
162
+ "items": {
163
+ "type": "string"
164
+ }
165
+ },
166
+ "timeoutMs": {
167
+ "type": "integer",
168
+ "minimum": 1,
169
+ "maximum": 3600000
170
+ }
171
+ }
172
+ }
173
+ },
174
+ "build": {
175
+ "type": "array",
176
+ "maxItems": 64,
177
+ "items": {
178
+ "type": "object",
179
+ "additionalProperties": false,
180
+ "required": [
181
+ "command",
182
+ "args"
183
+ ],
184
+ "properties": {
185
+ "command": {
186
+ "type": "string",
187
+ "minLength": 1
188
+ },
189
+ "args": {
190
+ "type": "array",
191
+ "maxItems": 512,
192
+ "items": {
193
+ "type": "string"
194
+ }
195
+ },
196
+ "timeoutMs": {
197
+ "type": "integer",
198
+ "minimum": 1,
199
+ "maximum": 3600000
200
+ }
201
+ }
202
+ }
203
+ },
204
+ "testBuild": {
205
+ "type": "array",
206
+ "maxItems": 64,
207
+ "items": {
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": [
211
+ "command",
212
+ "args"
213
+ ],
214
+ "properties": {
215
+ "command": {
216
+ "type": "string",
217
+ "minLength": 1
218
+ },
219
+ "args": {
220
+ "type": "array",
221
+ "maxItems": 512,
222
+ "items": {
223
+ "type": "string"
224
+ }
225
+ },
226
+ "timeoutMs": {
227
+ "type": "integer",
228
+ "minimum": 1,
229
+ "maximum": 3600000
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
72
236
  }
73
237
  }
74
238
  },
75
239
  "features": {
76
240
  "type": "object",
77
241
  "additionalProperties": false,
78
- "required": ["completionGate", "stopVerification"],
242
+ "required": [
243
+ "completionGate",
244
+ "stopVerification"
245
+ ],
79
246
  "properties": {
80
- "completionGate": {
247
+ "office": {
81
248
  "type": "object",
82
249
  "additionalProperties": false,
83
250
  "required": ["enabled"],
251
+ "properties": {
252
+ "enabled": { "type": "boolean" }
253
+ }
254
+ },
255
+ "completionGate": {
256
+ "type": "object",
257
+ "additionalProperties": false,
258
+ "required": [
259
+ "enabled"
260
+ ],
84
261
  "properties": {
85
262
  "enabled": {
86
263
  "type": "boolean"
@@ -90,7 +267,9 @@
90
267
  "stopVerification": {
91
268
  "type": "object",
92
269
  "additionalProperties": false,
93
- "required": ["enabled"],
270
+ "required": [
271
+ "enabled"
272
+ ],
94
273
  "properties": {
95
274
  "enabled": {
96
275
  "type": "boolean"
@@ -104,7 +283,10 @@
104
283
  "items": {
105
284
  "type": "object",
106
285
  "additionalProperties": false,
107
- "required": ["path", "verifierIds"],
286
+ "required": [
287
+ "path",
288
+ "verifierIds"
289
+ ],
108
290
  "properties": {
109
291
  "path": {
110
292
  "$ref": "#/$defs/relativePath"
@@ -122,17 +304,25 @@
122
304
  "worktree": {
123
305
  "type": "object",
124
306
  "additionalProperties": false,
125
- "required": ["mode"],
307
+ "required": [
308
+ "mode"
309
+ ],
126
310
  "properties": {
127
311
  "mode": {
128
- "enum": ["auto", "off"]
312
+ "enum": [
313
+ "auto",
314
+ "off"
315
+ ]
129
316
  },
130
317
  "setup": {
131
318
  "type": "array",
132
319
  "items": {
133
320
  "type": "object",
134
321
  "additionalProperties": false,
135
- "required": ["command", "args"],
322
+ "required": [
323
+ "command",
324
+ "args"
325
+ ],
136
326
  "properties": {
137
327
  "command": {
138
328
  "$ref": "#/$defs/nonEmptyString"
@@ -159,7 +349,12 @@
159
349
  "items": {
160
350
  "type": "object",
161
351
  "additionalProperties": false,
162
- "required": ["ruleId", "scope", "expiresAt", "reason"],
352
+ "required": [
353
+ "ruleId",
354
+ "scope",
355
+ "expiresAt",
356
+ "reason"
357
+ ],
163
358
  "properties": {
164
359
  "ruleId": {
165
360
  "$ref": "#/$defs/id"
@@ -259,10 +454,16 @@
259
454
  "evidence": {
260
455
  "type": "object",
261
456
  "additionalProperties": false,
262
- "required": ["kind"],
457
+ "required": [
458
+ "kind"
459
+ ],
263
460
  "properties": {
264
461
  "kind": {
265
- "enum": ["exit-code", "test-count", "file"]
462
+ "enum": [
463
+ "exit-code",
464
+ "test-count",
465
+ "file"
466
+ ]
266
467
  },
267
468
  "minimum": {
268
469
  "type": "integer",
@@ -273,7 +474,14 @@
273
474
  },
274
475
  "commandFields": {
275
476
  "type": "object",
276
- "required": ["id", "command", "args", "cwd", "required", "evidence"],
477
+ "required": [
478
+ "id",
479
+ "command",
480
+ "args",
481
+ "cwd",
482
+ "required",
483
+ "evidence"
484
+ ],
277
485
  "properties": {
278
486
  "id": {
279
487
  "$ref": "#/$defs/id"
@@ -335,7 +543,10 @@
335
543
  {
336
544
  "type": "object",
337
545
  "additionalProperties": false,
338
- "required": ["shell", "acknowledgeRisk"],
546
+ "required": [
547
+ "shell",
548
+ "acknowledgeRisk"
549
+ ],
339
550
  "properties": {
340
551
  "id": true,
341
552
  "command": true,