@kylecheng3146/agent-ops 0.0.1

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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +83 -0
  3. package/SECURITY.md +22 -0
  4. package/dist/packages/cli/src/args.js +322 -0
  5. package/dist/packages/cli/src/bin.js +290 -0
  6. package/dist/packages/cli/src/cli.js +80 -0
  7. package/dist/packages/cli/src/commands/config.js +8 -0
  8. package/dist/packages/cli/src/commands/doctor.js +32 -0
  9. package/dist/packages/cli/src/commands/index.js +16 -0
  10. package/dist/packages/cli/src/commands/init.js +65 -0
  11. package/dist/packages/cli/src/commands/review.js +71 -0
  12. package/dist/packages/cli/src/commands/task.js +141 -0
  13. package/dist/packages/cli/src/commands/trust.js +48 -0
  14. package/dist/packages/cli/src/commands/uninstall.js +58 -0
  15. package/dist/packages/cli/src/commands/update.js +58 -0
  16. package/dist/packages/cli/src/commands/verify.js +108 -0
  17. package/dist/packages/cli/src/output.js +53 -0
  18. package/dist/packages/cli/src/plan-output.js +28 -0
  19. package/dist/packages/cli/src/wizard.js +75 -0
  20. package/dist/runtime/src/adapters/claude/config.js +109 -0
  21. package/dist/runtime/src/adapters/claude/events.js +8 -0
  22. package/dist/runtime/src/adapters/claude/input.js +38 -0
  23. package/dist/runtime/src/adapters/claude/output.js +30 -0
  24. package/dist/runtime/src/adapters/codex/config.js +93 -0
  25. package/dist/runtime/src/adapters/codex/events.js +8 -0
  26. package/dist/runtime/src/adapters/codex/input.js +41 -0
  27. package/dist/runtime/src/adapters/codex/output.js +24 -0
  28. package/dist/runtime/src/config/explain.js +34 -0
  29. package/dist/runtime/src/config/load.js +25 -0
  30. package/dist/runtime/src/config/merge.js +170 -0
  31. package/dist/runtime/src/config/migrate.js +61 -0
  32. package/dist/runtime/src/contracts.js +1 -0
  33. package/dist/runtime/src/discovery/go.js +145 -0
  34. package/dist/runtime/src/discovery/index.js +40 -0
  35. package/dist/runtime/src/discovery/make.js +162 -0
  36. package/dist/runtime/src/discovery/node.js +175 -0
  37. package/dist/runtime/src/discovery/python.js +163 -0
  38. package/dist/runtime/src/discovery/rust.js +159 -0
  39. package/dist/runtime/src/discovery/types.js +1 -0
  40. package/dist/runtime/src/fs/hash.js +19 -0
  41. package/dist/runtime/src/fs/managed-block.js +90 -0
  42. package/dist/runtime/src/fs/manifest.js +24 -0
  43. package/dist/runtime/src/fs/mutation-worker.js +185 -0
  44. package/dist/runtime/src/fs/paths.js +96 -0
  45. package/dist/runtime/src/fs/transaction.js +498 -0
  46. package/dist/runtime/src/guardrails/destructive.js +207 -0
  47. package/dist/runtime/src/guardrails/evaluate.js +9 -0
  48. package/dist/runtime/src/guardrails/exceptions.js +49 -0
  49. package/dist/runtime/src/guardrails/secrets.js +97 -0
  50. package/dist/runtime/src/guardrails/types.js +9 -0
  51. package/dist/runtime/src/hooks/dispatch.js +78 -0
  52. package/dist/runtime/src/hooks/events.js +1 -0
  53. package/dist/runtime/src/hooks/hook-entry.js +19 -0
  54. package/dist/runtime/src/hooks/normalize.js +59 -0
  55. package/dist/runtime/src/hooks/output.js +12 -0
  56. package/dist/runtime/src/hooks/shell.js +138 -0
  57. package/dist/runtime/src/hooks/stop-verify.js +70 -0
  58. package/dist/runtime/src/install/apply.js +70 -0
  59. package/dist/runtime/src/install/doctor.js +196 -0
  60. package/dist/runtime/src/install/harness.js +87 -0
  61. package/dist/runtime/src/install/ownership.js +84 -0
  62. package/dist/runtime/src/install/plan.js +257 -0
  63. package/dist/runtime/src/install/profiles.js +28 -0
  64. package/dist/runtime/src/install/types.js +1 -0
  65. package/dist/runtime/src/install/uninstall.js +206 -0
  66. package/dist/runtime/src/install/update.js +123 -0
  67. package/dist/runtime/src/logging/local-log.js +158 -0
  68. package/dist/runtime/src/registry/npm.js +141 -0
  69. package/dist/runtime/src/review/claude-runner.js +4 -0
  70. package/dist/runtime/src/review/codex-runner.js +4 -0
  71. package/dist/runtime/src/review/packet.js +10 -0
  72. package/dist/runtime/src/review/result.js +24 -0
  73. package/dist/runtime/src/review/roles.js +3 -0
  74. package/dist/runtime/src/review/runner.js +45 -0
  75. package/dist/runtime/src/schema/validate.js +584 -0
  76. package/dist/runtime/src/security/permissions.js +654 -0
  77. package/dist/runtime/src/security/redact.js +41 -0
  78. package/dist/runtime/src/security/trust.js +209 -0
  79. package/dist/runtime/src/task/render.js +43 -0
  80. package/dist/runtime/src/task/service.js +235 -0
  81. package/dist/runtime/src/task/store.js +265 -0
  82. package/dist/runtime/src/verify/change-surface.js +86 -0
  83. package/dist/runtime/src/verify/evidence.js +89 -0
  84. package/dist/runtime/src/verify/fingerprint.js +67 -0
  85. package/dist/runtime/src/verify/scope.js +69 -0
  86. package/dist/runtime/src/verify/service.js +217 -0
  87. package/dist/runtime/src/verify/spawn.js +326 -0
  88. package/dist/runtime/src/verify/test-count.js +148 -0
  89. package/docs/en/spec/README.md +13 -0
  90. package/docs/en/spec/acceptance-and-evidence.md +21 -0
  91. package/docs/en/spec/delegation.md +21 -0
  92. package/docs/en/spec/guardrails.md +21 -0
  93. package/docs/en/spec/harness-adapters.md +21 -0
  94. package/docs/en/spec/judgment.md +21 -0
  95. package/docs/en/spec/loop-engineering.md +23 -0
  96. package/docs/en/spec/maintenance.md +21 -0
  97. package/docs/en/spec/review.md +21 -0
  98. package/docs/en/spec/troubleshooting.md +21 -0
  99. package/docs/zh-TW/spec/README.md +13 -0
  100. package/docs/zh-TW/spec/acceptance-and-evidence.md +23 -0
  101. package/docs/zh-TW/spec/delegation.md +23 -0
  102. package/docs/zh-TW/spec/guardrails.md +23 -0
  103. package/docs/zh-TW/spec/harness-adapters.md +23 -0
  104. package/docs/zh-TW/spec/judgment.md +23 -0
  105. package/docs/zh-TW/spec/loop-engineering.md +23 -0
  106. package/docs/zh-TW/spec/maintenance.md +23 -0
  107. package/docs/zh-TW/spec/review.md +23 -0
  108. package/docs/zh-TW/spec/troubleshooting.md +23 -0
  109. package/package.json +41 -0
  110. package/schemas/config.schema.json +231 -0
  111. package/schemas/evidence.schema.json +115 -0
  112. package/schemas/manifest.schema.json +116 -0
  113. package/schemas/task.schema.json +59 -0
  114. package/templates/common/AGENTS.block.md +3 -0
  115. package/templates/common/CLAUDE.block.md +3 -0
@@ -0,0 +1,21 @@
1
+ # Acceptance and Evidence
2
+
3
+ ## EVIDENCE-CRITERION-001
4
+
5
+ Every acceptance criterion MUST map to observable evidence.
6
+
7
+ - Trigger: Defining or reviewing task completion.
8
+ - Action: Name a command, read-back, or artifact for each criterion.
9
+ - Evidence: The final report contains one evidence reference per criterion.
10
+ - Positive: `criterion tests → npm test (354 passing tests)`.
11
+ - Negative: `The implementation looks correct, so no evidence is needed.`
12
+
13
+ ## EVIDENCE-AGGREGATE-001
14
+
15
+ The verifier MUST return FAIL when a criterion is missing, duplicated, unknown, or has empty evidence.
16
+
17
+ - Trigger: Combining independent verifier results.
18
+ - Action: Require the exact requested criterion set once each; require non-empty evidence.
19
+ - Evidence: The aggregate lists the criterion IDs and their evidence references.
20
+ - Positive: `tests PASS [report.json]; scope PASS [diff.txt]`.
21
+ - Negative: `tests PASS; tests PASS; extra PASS`.
@@ -0,0 +1,21 @@
1
+ # Delegation
2
+
3
+ ## DELEGATE-SCOPE-001
4
+
5
+ Delegation MUST use a bounded task with an explicit artifact, acceptance criteria, and return format.
6
+
7
+ - Trigger: Investigation spans unknown files, broad scans, or independent workstreams.
8
+ - Action: Send only the necessary context and require evidence-backed findings.
9
+ - Evidence: The delegation record names scope, output, and verification.
10
+ - Positive: `Inspect runtime/src/review and return affected files plus tests.`
11
+ - Negative: `Explore the repository and fix anything you notice.`
12
+
13
+ ## DELEGATE-OWNERSHIP-001
14
+
15
+ The coordinator MUST retain ownership of final integration and verification.
16
+
17
+ - Trigger: A delegated task returns code, findings, or a proposed change.
18
+ - Action: Read back the artifact, reconcile conflicts, and run the required gate.
19
+ - Evidence: The coordinator records the final command output.
20
+ - Positive: `Reviewer reports PASS; coordinator reruns typecheck and tests.`
21
+ - Negative: `Accept the delegated claim without inspecting the diff.`
@@ -0,0 +1,21 @@
1
+ # Guardrails
2
+
3
+ ## GUARDRAIL-SECRET-001
4
+
5
+ The system MUST redact credentials and MUST NOT persist secrets in prompts, logs, fixtures, or reports.
6
+
7
+ - Trigger: Handling command output, configuration, or external input.
8
+ - Action: Apply the shared redaction boundary and keep only bounded evidence.
9
+ - Evidence: A redaction test proves representative credential forms are absent.
10
+ - Positive: `Authorization header becomes a redacted marker.`
11
+ - Negative: `Store raw environment variables for later debugging.`
12
+
13
+ ## GUARDRAIL-DESTRUCTIVE-001
14
+
15
+ Destructive or forceful commands MUST be blocked unless an exact, explicit exception is present.
16
+
17
+ - Trigger: A command can delete, overwrite, force-push, or alter protected state.
18
+ - Action: Block by default and report the stable rule ID.
19
+ - Evidence: Positive and negative command fixtures show the boundary.
20
+ - Positive: `git push --mirror is blocked.`
21
+ - Negative: `Allow every command containing a familiar sub-string.`
@@ -0,0 +1,21 @@
1
+ # Harness Adapters
2
+
3
+ ## HARNESS-ADAPTER-001
4
+
5
+ An adapter MUST preserve native harness semantics and MUST label unsupported behavior as UNKNOWN.
6
+
7
+ - Trigger: Mapping portable lifecycle or review behavior into a native harness.
8
+ - Action: Keep ownership narrow, retain user configuration, and document limitations.
9
+ - Evidence: Adapter tests cover existing configuration and unsupported outcomes.
10
+ - Positive: `A Codex blocking outcome remains UNKNOWN when native denial is unconfirmed.`
11
+ - Negative: `Assume Claude exit semantics apply to Codex.`
12
+
13
+ ## HARNESS-ADAPTER-002
14
+
15
+ An adapter MUST be idempotent and MUST avoid deleting user-owned handlers.
16
+
17
+ - Trigger: Installing, updating, or removing managed harness configuration.
18
+ - Action: Change only stable managed markers or owned handlers.
19
+ - Evidence: Existing configuration fixtures remain intact after apply and uninstall.
20
+ - Positive: `Managed handler updates while unrelated handlers remain byte-for-byte present.`
21
+ - Negative: `Replace the complete settings file with toolkit defaults.`
@@ -0,0 +1,21 @@
1
+ # Judgment
2
+
3
+ ## JUDGMENT-STOP-001
4
+
5
+ The operator MUST stop when requirements, authorization, or a required decision is materially ambiguous.
6
+
7
+ - Trigger: The next action would choose product intent, security policy, or architecture for the user.
8
+ - Action: Report the concrete ambiguity and request a decision.
9
+ - Evidence: The handoff names the blocked choice and the safe alternatives.
10
+ - Positive: `Ask whether project or user scope is intended before applying installation.`
11
+ - Negative: `Assume project scope because it is more convenient.`
12
+
13
+ ## JUDGMENT-RETRY-001
14
+
15
+ The operator MUST change approach after the same failure repeats without new information.
16
+
17
+ - Trigger: The same command or diagnosis fails twice.
18
+ - Action: inspect the failure boundary, then use a different bounded check or stop.
19
+ - Evidence: The report records the repeated failure and the changed check.
20
+ - Positive: `Switch from integration test to isolated fixture inspection after two identical failures.`
21
+ - Negative: `Run the identical failing command indefinitely.`
@@ -0,0 +1,23 @@
1
+ # Loop Engineering
2
+
3
+ This module defines the bounded loop used to plan, implement, verify, and hand off work.
4
+
5
+ ## LOOP-START-001
6
+
7
+ The operator MUST state acceptance criteria before editing and MUST stop when each criterion has evidence.
8
+
9
+ - Trigger: Starting a multi-step implementation or debugging loop.
10
+ - Action: Record 2–5 observable criteria, then inspect only the files needed for the current step.
11
+ - Evidence: The task record and final report link each criterion to a command or read-back.
12
+ - Positive: `Criteria: tests pass; package builds; changed files are read back.`
13
+ - Negative: `I changed the repository and will decide what success means afterward.`
14
+
15
+ ## LOOP-VERIFY-001
16
+
17
+ The operator MUST run the smallest reliable proof for every acceptance criterion before claiming completion.
18
+
19
+ - Trigger: A change appears implemented or a loop reaches a proposed stopping point.
20
+ - Action: Run targeted tests first, then the required project gate, and report failures or unavailable checks.
21
+ - Evidence: Command output contains a non-zero test count and the reported outcome.
22
+ - Positive: `npm run typecheck && npm test` with all tests passing.
23
+ - Negative: `The command exited 0 but discovered no tests; therefore it is proof.`
@@ -0,0 +1,21 @@
1
+ # Maintenance
2
+
3
+ ## MAINTAIN-BACKUP-001
4
+
5
+ Before editing a rule, prompt, model table, memory, or hook, the operator MUST create and verify a recoverable backup when it contains no literal secret.
6
+
7
+ - Trigger: A maintained policy or lifecycle file will change.
8
+ - Action: Copy the source to the dated backup path and compare it before editing.
9
+ - Evidence: The backup path and comparison command are recorded.
10
+ - Positive: `cmp source backup` succeeds before the patch.
11
+ - Negative: `Edit a hook in place without a recoverable copy.`
12
+
13
+ ## MAINTAIN-FACT-001
14
+
15
+ Volatile harness facts MUST live in adapter or research documentation and MUST include a revalidation condition.
16
+
17
+ - Trigger: Recording a versioned or vendor-specific behavior.
18
+ - Action: State the source date and when it must be checked again.
19
+ - Evidence: The document has a source and `Revalidate:` condition.
20
+ - Positive: `Revalidate: when the vendor hook reference changes.`
21
+ - Negative: `Treat a transient CLI flag as a permanent core rule.`
@@ -0,0 +1,21 @@
1
+ # Review
2
+
3
+ ## REVIEW-INDEPENDENT-001
4
+
5
+ An independent reviewer MUST receive a minimal packet containing the request, criteria, artifact references, and evidence requirements.
6
+
7
+ - Trigger: A multi-step change reaches a review checkpoint.
8
+ - Action: Omit implementation rationale, hidden reasoning, raw logs, and credentials.
9
+ - Evidence: The packet keys and artifact references are visible without sensitive content.
10
+ - Positive: `Packet contains criteria, files, and evidence requirements only.`
11
+ - Negative: `Forward the complete session transcript and environment.`
12
+
13
+ ## REVIEW-RESULT-001
14
+
15
+ A review result MUST preserve PASS, FAIL, or NOT_RUN and MUST NOT convert NOT_RUN into PASS.
16
+
17
+ - Trigger: A reviewer CLI is missing, unauthenticated, or quota-limited.
18
+ - Action: Return NOT_RUN with a copyable prompt and limitation.
19
+ - Evidence: The result states harness, configured model or limitation, effort, and reason.
20
+ - Positive: `NOT_RUN: login required; prompt is copyable.`
21
+ - Negative: `No reviewer ran, but mark the change PASS.`
@@ -0,0 +1,21 @@
1
+ # Troubleshooting
2
+
3
+ ## TROUBLESHOOT-REPRO-001
4
+
5
+ Troubleshooting MUST first capture a minimal reproducible symptom and its boundary.
6
+
7
+ - Trigger: A failure is vague, intermittent, or crosses layers.
8
+ - Action: Record the command, inputs, observed output, and smallest suspected owner.
9
+ - Evidence: A fixture or command reproduces the symptom.
10
+ - Positive: `Fixture reproduces the parser failure with exact argv.`
11
+ - Negative: `Rewrite unrelated modules before reproducing the report.`
12
+
13
+ ## TROUBLESHOOT-SAFETY-001
14
+
15
+ The operator MUST preserve the failing evidence before applying a fix.
16
+
17
+ - Trigger: A regression test or diagnostic is available.
18
+ - Action: Add or retain a regression test, then implement the smallest correction.
19
+ - Evidence: The test fails before the fix and passes after it.
20
+ - Positive: `RED parser test → GREEN parser test.`
21
+ - Negative: `Delete the failing test because it is inconvenient.`
@@ -0,0 +1,13 @@
1
+ # Loop Engineering 規範
2
+
3
+ 此目錄是英文規範的繁體中文導讀;規範 rule ID 以英文版本為準。
4
+
5
+ - [迴圈工程](./loop-engineering.md)
6
+ - [驗收與證據](./acceptance-and-evidence.md)
7
+ - [判斷](./judgment.md)
8
+ - [委派](./delegation.md)
9
+ - [審查](./review.md)
10
+ - [疑難排解](./troubleshooting.md)
11
+ - [防護規則](./guardrails.md)
12
+ - [維護](./maintenance.md)
13
+ - [Harness adapter](./harness-adapters.md)
@@ -0,0 +1,23 @@
1
+ # 驗收與證據
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## EVIDENCE-CRITERION-001
6
+
7
+ 每項驗收條件 MUST 對應可觀察的證據。
8
+
9
+ - Trigger: 定義或審查任務完成度。
10
+ - Action: 為每項條件命名命令、讀回內容或產物。
11
+ - Evidence: 最終報告為每項條件提供一個證據參照。
12
+ - Positive: `tests → npm test(354 個測試通過)`。
13
+ - Negative: `看起來正確,所以不需要證據。`
14
+
15
+ ## EVIDENCE-AGGREGATE-001
16
+
17
+ 驗證器 MUST 在條件缺少、重複、未知或證據為空時回傳 FAIL。
18
+
19
+ - Trigger: 合併獨立驗證器結果。
20
+ - Action: 僅接受精確的 criterion 集合且各一次,並要求非空證據。
21
+ - Evidence: 聚合結果列出 criterion ID 與證據參照。
22
+ - Positive: `tests PASS [report.json];scope PASS [diff.txt]`。
23
+ - Negative: `tests PASS;tests PASS;extra PASS`。
@@ -0,0 +1,23 @@
1
+ # 委派
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## DELEGATE-SCOPE-001
6
+
7
+ 委派 MUST 使用有界任務,並明確指定產物、驗收條件與回傳格式。
8
+
9
+ - Trigger: 調查涉及未知檔案、廣泛掃描或獨立工作流。
10
+ - Action: 僅傳送必要上下文,要求有證據的發現。
11
+ - Evidence: 委派紀錄列出範圍、輸出與驗證方式。
12
+ - Positive: `檢查 runtime/src/review,回傳受影響檔案與測試。`
13
+ - Negative: `探索整個 repo 並修正任何你看到的問題。`
14
+
15
+ ## DELEGATE-OWNERSHIP-001
16
+
17
+ 協調者 MUST 保留最終整合與驗證責任。
18
+
19
+ - Trigger: 委派任務回傳程式碼、發現或變更提案。
20
+ - Action: 讀回產物、調和衝突並執行必要 gate。
21
+ - Evidence: 協調者記錄最終命令輸出。
22
+ - Positive: `審查者回傳 PASS;協調者重新跑 typecheck 與測試。`
23
+ - Negative: `不看 diff 就接受委派者的完成宣告。`
@@ -0,0 +1,23 @@
1
+ # 防護規則
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## GUARDRAIL-SECRET-001
6
+
7
+ 系統 MUST 遮罩憑證,且 MUST NOT 將秘密持久化到 prompt、log、fixture 或報告。
8
+
9
+ - Trigger: 處理命令輸出、設定或外部輸入。
10
+ - Action: 使用共用 redaction 邊界,只保留有界證據。
11
+ - Evidence: redaction 測試證明代表性憑證形式不存在。
12
+ - Positive: `Authorization header 變成 redacted marker。`
13
+ - Negative: `為了除錯保存原始環境變數。`
14
+
15
+ ## GUARDRAIL-DESTRUCTIVE-001
16
+
17
+ 破壞性或強制命令 MUST 在沒有精確明確例外時被阻擋。
18
+
19
+ - Trigger: 命令會刪除、覆寫、force-push 或改變受保護狀態。
20
+ - Action: 預設阻擋並回報穩定 rule ID。
21
+ - Evidence: 正反命令 fixture 展示邊界。
22
+ - Positive: `git push --mirror 被阻擋。`
23
+ - Negative: `允許所有包含熟悉子字串的命令。`
@@ -0,0 +1,23 @@
1
+ # Harness Adapter
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## HARNESS-ADAPTER-001
6
+
7
+ Adapter MUST 保留原生 harness 語意,並將未支援行為標示為 UNKNOWN。
8
+
9
+ - Trigger: 將可攜 lifecycle 或 review 行為映射到原生 harness。
10
+ - Action: 保持 ownership 狹窄、保留使用者設定並記錄限制。
11
+ - Evidence: adapter 測試涵蓋既有設定與未支援結果。
12
+ - Positive: `Codex blocking outcome 未確認原生 denial 時保持 UNKNOWN。`
13
+ - Negative: `假設 Claude exit semantics 適用 Codex。`
14
+
15
+ ## HARNESS-ADAPTER-002
16
+
17
+ Adapter MUST 具備冪等性,且 MUST NOT 刪除使用者擁有的 handler。
18
+
19
+ - Trigger: 安裝、更新或移除 managed harness 設定。
20
+ - Action: 只變更穩定 managed marker 或 owned handler。
21
+ - Evidence: 既有設定 fixture 在 apply 與 uninstall 後保持完整。
22
+ - Positive: `更新 managed handler,無關 handler 仍逐位元存在。`
23
+ - Negative: `以 toolkit defaults 取代整份 settings。`
@@ -0,0 +1,23 @@
1
+ # 判斷
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## JUDGMENT-STOP-001
6
+
7
+ 當需求、授權或必要決策有重大歧義時,操作者 MUST 停止。
8
+
9
+ - Trigger: 下一步會替使用者選擇產品意圖、安全政策或架構。
10
+ - Action: 說明具體歧義並請使用者決定。
11
+ - Evidence: 交接內容列出受阻選擇與安全替代方案。
12
+ - Positive: `套用安裝前詢問要 project 或 user scope。`
13
+ - Negative: `因為方便就假設 project scope。`
14
+
15
+ ## JUDGMENT-RETRY-001
16
+
17
+ 相同失敗在沒有新資訊時重複發生,操作者 MUST 改變方法。
18
+
19
+ - Trigger: 同一命令或診斷失敗兩次。
20
+ - Action: 檢查失敗邊界,改用另一個有界檢查或停止。
21
+ - Evidence: 報告記錄重複失敗與改用的檢查。
22
+ - Positive: `兩次相同失敗後改查隔離 fixture。`
23
+ - Negative: `無限重跑完全相同的失敗命令。`
@@ -0,0 +1,23 @@
1
+ # 迴圈工程
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## LOOP-START-001
6
+
7
+ 操作者 MUST 在編輯前列出驗收條件,並在每項條件都有證據時停止。
8
+
9
+ - Trigger: 開始多步驟實作或除錯迴圈。
10
+ - Action: 記錄 2–5 個可觀察條件,只檢查目前步驟所需檔案。
11
+ - Evidence: 任務紀錄與最終報告把每項條件連到命令或讀回內容。
12
+ - Positive: `條件:測試通過;套件建置;讀回變更檔案。`
13
+ - Negative: `先修改,再決定成功標準。`
14
+
15
+ ## LOOP-VERIFY-001
16
+
17
+ 操作者 MUST 在宣告完成前,為每項驗收條件執行最小且可靠的證明。
18
+
19
+ - Trigger: 變更看似完成或迴圈準備停止。
20
+ - Action: 先跑針對性測試,再跑必要 gate,並回報失敗或不可用檢查。
21
+ - Evidence: 命令輸出包含非零測試數與結果。
22
+ - Positive: `npm run typecheck && npm test` 且所有測試通過。
23
+ - Negative: `命令 exit 0 但沒有發現測試,仍視為證明。`
@@ -0,0 +1,23 @@
1
+ # 維護
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## MAINTAIN-BACKUP-001
6
+
7
+ 編輯不含文字秘密的 rule、prompt、model table、memory 或 hook 前,操作者 MUST 建立並驗證可復原備份。
8
+
9
+ - Trigger: 即將變更受維護的政策或 lifecycle 檔案。
10
+ - Action: 編輯前把來源複製到日期化備份路徑並比較。
11
+ - Evidence: 記錄備份路徑與比較命令。
12
+ - Positive: `編輯前 cmp source backup 成功。`
13
+ - Negative: `沒有可復原副本就直接修改 hook。`
14
+
15
+ ## MAINTAIN-FACT-001
16
+
17
+ 易變的 harness fact MUST 放在 adapter 或 research 文件,且 MUST 包含重驗條件。
18
+
19
+ - Trigger: 記錄版本化或 vendor-specific 行為。
20
+ - Action: 說明來源日期與何時重新檢查。
21
+ - Evidence: 文件含來源與 `Revalidate:` 條件。
22
+ - Positive: `Revalidate:vendor hook reference 變更時。`
23
+ - Negative: `把暫時性的 CLI flag 當永久核心規則。`
@@ -0,0 +1,23 @@
1
+ # 審查
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## REVIEW-INDEPENDENT-001
6
+
7
+ 獨立審查者 MUST 只收到包含請求、條件、產物參照與證據要求的最小 packet。
8
+
9
+ - Trigger: 多步驟變更到達審查 checkpoint。
10
+ - Action: 排除實作理由、隱藏推理、原始 log 與憑證。
11
+ - Evidence: 可見 packet keys 與產物參照,且不含敏感內容。
12
+ - Positive: `Packet 僅含條件、檔案與證據要求。`
13
+ - Negative: `轉送完整 session transcript 與環境。`
14
+
15
+ ## REVIEW-RESULT-001
16
+
17
+ 審查結果 MUST 保留 PASS、FAIL 或 NOT_RUN,且 MUST NOT 把 NOT_RUN 轉成 PASS。
18
+
19
+ - Trigger: 審查 CLI 缺少、未登入或 quota 不足。
20
+ - Action: 回傳 NOT_RUN、可複製 prompt 與限制原因。
21
+ - Evidence: 結果列出 harness、設定的 model 或限制、effort 與原因。
22
+ - Positive: `NOT_RUN:需要登入;prompt 可複製。`
23
+ - Negative: `沒有審查執行,仍標示 PASS。`
@@ -0,0 +1,23 @@
1
+ # 疑難排解
2
+
3
+ English source version: 2026-07-23. Revalidate: when the English specification changes.
4
+
5
+ ## TROUBLESHOOT-REPRO-001
6
+
7
+ 疑難排解 MUST 先捕捉最小可重現症狀與邊界。
8
+
9
+ - Trigger: 失敗模糊、間歇性或跨越多層。
10
+ - Action: 記錄命令、輸入、觀察輸出與最小疑似 owner。
11
+ - Evidence: fixture 或命令能重現症狀。
12
+ - Positive: `fixture 以精確 argv 重現 parser 失敗。`
13
+ - Negative: `先重寫無關模組再重現報告。`
14
+
15
+ ## TROUBLESHOOT-SAFETY-001
16
+
17
+ 操作者 MUST 在修正前保留失敗證據。
18
+
19
+ - Trigger: 已有 regression test 或診斷。
20
+ - Action: 新增或保留 regression test,再實作最小修正。
21
+ - Evidence: 測試在修正前失敗、修正後通過。
22
+ - Positive: `RED parser test → GREEN parser test。`
23
+ - Negative: `因為不方便就刪除失敗測試。`
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@kylecheng3146/agent-ops",
3
+ "version": "0.0.1",
4
+ "description": "Evidence-driven development loops for Codex and Claude Code",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": "github:kylecheng3146/agent-ops",
8
+ "engines": {
9
+ "node": ">=22.14.0"
10
+ },
11
+ "bin": {
12
+ "agent-ops": "dist/packages/cli/src/bin.js"
13
+ },
14
+ "files": [
15
+ "dist/",
16
+ "schemas/",
17
+ "templates/",
18
+ "docs/en/spec/",
19
+ "docs/zh-TW/spec/",
20
+ "README.md",
21
+ "LICENSE",
22
+ "SECURITY.md"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "clean": "node scripts/clean.mjs dist .tmp",
29
+ "typecheck": "tsc -p tsconfig.json --noEmit",
30
+ "test:compile": "node scripts/clean.mjs .tmp && tsc -p tsconfig.test.json",
31
+ "test": "npm run test:compile && node scripts/run-tests.mjs .tmp/test-dist/tests",
32
+ "build": "node scripts/clean.mjs dist && tsc -p tsconfig.build.json",
33
+ "package:check": "node scripts/package-check.mjs"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "26.1.1",
37
+ "ajv": "8.20.0",
38
+ "ajv-formats": "3.0.1",
39
+ "typescript": "7.0.2"
40
+ }
41
+ }