@tea-agent/loop-agent 0.1.0 → 0.2.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 (143) hide show
  1. package/AGENTS.md +62 -45
  2. package/CHANGELOG.md +60 -28
  3. package/README.md +160 -124
  4. package/bin/loop-agent.js +21 -21
  5. package/dist/adapters/index.js +3 -2
  6. package/dist/adapters/loop-agent.js +44 -2
  7. package/dist/application/dag/args.js +420 -0
  8. package/dist/application/dag/generate-task-dag.js +280 -0
  9. package/dist/application/dag/report-dag.js +14 -0
  10. package/dist/application/dag/run-dag.js +106 -0
  11. package/dist/application/dag/validate-dag.js +102 -0
  12. package/dist/application/loop/run-action.js +23 -0
  13. package/dist/cli/catalog.js +2 -237
  14. package/dist/cli/command-definitions.js +571 -0
  15. package/dist/cli/index.js +2 -0
  16. package/dist/cli/program.js +65 -1
  17. package/dist/cli/router.js +13 -0
  18. package/dist/cli-governance/active-residue-check.js +38 -0
  19. package/dist/commands/dag-report.js +6 -107
  20. package/dist/commands/dag-run-task.js +8 -466
  21. package/dist/commands/dag-validate.js +7 -179
  22. package/dist/commands/examples.js +90 -0
  23. package/dist/commands/init.js +1518 -0
  24. package/dist/commands/loop.js +57 -31
  25. package/dist/commands/pi-prompt.js +2 -9
  26. package/dist/commands/run-dag.js +7 -180
  27. package/dist/executors/cursor-executor-artifacts.js +3 -4
  28. package/dist/executors/cursor-worker-client.js +13 -3
  29. package/dist/executors/dag-cursor-executor.js +2 -3
  30. package/dist/executors/dag-pi-executor.js +3 -4
  31. package/dist/executors/dag-static-executor.js +2 -5
  32. package/dist/executors/pi-defaults.js +9 -0
  33. package/dist/executors/shell-executor.js +12 -20
  34. package/dist/governance/manifest-types.js +1 -0
  35. package/dist/infrastructure/harness/active-residue-policy.js +73 -0
  36. package/dist/infrastructure/harness/artifact-store.js +72 -0
  37. package/dist/infrastructure/harness/atomic-write.js +49 -0
  38. package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
  39. package/dist/infrastructure/harness/loop-action-store.js +23 -0
  40. package/dist/infrastructure/harness/loop-store.js +41 -0
  41. package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
  42. package/dist/infrastructure/harness/task-store.js +77 -0
  43. package/dist/records/one-shot-runs.js +26 -61
  44. package/dist/records/promotion.js +3 -4
  45. package/dist/shared/artifacts-core.js +5 -5
  46. package/dist/shared/logger.js +9 -15
  47. package/dist/task/delegate.js +4 -4
  48. package/dist/task/runtime.js +5 -7
  49. package/dist/task/state.js +6 -20
  50. package/dist/workflows/dag/convergence/controller.js +277 -0
  51. package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
  52. package/dist/workflows/dag/dynamic-runtime/loop-until.js +156 -0
  53. package/dist/workflows/dag/dynamic-runtime/map.js +185 -0
  54. package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
  55. package/dist/workflows/dag/dynamic-runtime/shared.js +133 -0
  56. package/dist/workflows/dag/failure-routing.js +82 -0
  57. package/dist/workflows/dag/lifecycle.js +101 -8
  58. package/dist/workflows/dag/node-execution.js +262 -0
  59. package/dist/workflows/dag/report.js +73 -1
  60. package/dist/workflows/dag/run-store.js +36 -0
  61. package/dist/workflows/dag/runner.js +82 -1341
  62. package/dist/workflows/dag/scheduler.js +84 -0
  63. package/dist/workflows/dag/upstream-artifacts.js +20 -18
  64. package/dist/workflows/loop/actions/cursor-fix.js +191 -0
  65. package/dist/workflows/loop/actions/dag-action.js +130 -0
  66. package/dist/workflows/loop/actions/pi-review.js +267 -0
  67. package/dist/workflows/loop/actions/shared.js +157 -0
  68. package/dist/workflows/loop/actions/shell-verify.js +82 -0
  69. package/dist/workflows/loop/actions/types.js +1 -0
  70. package/dist/workflows/loop/actions/workflow-action.js +255 -0
  71. package/dist/workflows/loop/actions.js +55 -1212
  72. package/dist/workflows/loop/closeout.js +5 -4
  73. package/dist/workflows/loop/context.js +2 -3
  74. package/dist/workflows/loop/events.js +3 -2
  75. package/dist/workflows/loop/policy/auto-policy.js +104 -0
  76. package/dist/workflows/loop/policy/cursor-fix-policy.js +31 -0
  77. package/dist/workflows/loop/rounds.js +3 -3
  78. package/dist/workflows/loop/signals.js +4 -7
  79. package/dist/workflows/loop/state.js +11 -11
  80. package/docs/README.md +47 -44
  81. package/docs/agent-dag-recovery-playbook.md +32 -6
  82. package/docs/agent-dag-runner.md +17 -17
  83. package/docs/architecture/runtime-boundaries.md +147 -0
  84. package/docs/cursor-executor-usage.md +5 -5
  85. package/docs/decisions/README.md +2 -2
  86. package/docs/design/README.md +24 -24
  87. package/docs/development-principles.md +50 -50
  88. package/docs/dynamic-workflow-dag-engine-roadmap.md +6 -6
  89. package/docs/exec-plans/README.md +4 -4
  90. package/docs/exec-plans/active/README.md +10 -5
  91. package/docs/exec-plans/completed/README.md +9 -5
  92. package/docs/feature-workflow.md +111 -109
  93. package/docs/harness-methodology-verification.md +18 -18
  94. package/docs/loop-agent-harness.md +36 -36
  95. package/docs/production-readiness.md +96 -0
  96. package/docs/progress/README.md +2 -2
  97. package/docs/reports/README.md +4 -2
  98. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +1 -1
  99. package/docs/templates/agent-dag-process-supervisor.prompt.md +2 -2
  100. package/docs/templates/agent-dag-report.schema.json +33 -2
  101. package/docs/templates/agent-dag-review-verdict.prompt.md +1 -1
  102. package/docs/templates/agent-dag.base.json +195 -195
  103. package/docs/templates/agent-dag.final-verification.json +190 -190
  104. package/docs/templates/agent-dag.schema.json +17 -17
  105. package/docs/templates/agent-dag.supervised-implementation.json +500 -500
  106. package/docs/templates/hybrid-dag.json +193 -193
  107. package/docs/templates/production-readiness-checklist.md +57 -0
  108. package/docs/templates/progress-log.md +7 -7
  109. package/docs/templates/project-start-checklist.md +8 -8
  110. package/docs/templates/qa-report.md +17 -11
  111. package/docs/templates/sprint-contract.md +19 -19
  112. package/docs/verification-matrix.md +37 -26
  113. package/examples/example-dag.json +51 -51
  114. package/examples/hybrid-loop-agent-dag.json +194 -194
  115. package/harness.json +5 -5
  116. package/package.json +62 -61
  117. package/skills/ai-engineering-context/SKILL.md +21 -21
  118. package/skills/loop-agent/SKILL.md +56 -171
  119. package/skills/loop-agent/references/README.md +6 -2
  120. package/skills/loop-agent/references/command-reference.md +107 -65
  121. package/skills/loop-agent/references/harness-policy.md +115 -115
  122. package/skills/loop-agent/references/hybrid-dag.md +30 -30
  123. package/skills/loop-agent/references/learned/README.md +13 -13
  124. package/skills/loop-agent/references/long-running-loop.md +59 -0
  125. package/skills/loop-agent/references/model-routing.md +1 -1
  126. package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
  127. package/skills/loop-agent/references/pi-prompt.md +9 -9
  128. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +0 -2
  129. package/skills/loop-agent/references/post-implementation-and-patterns.md +7 -7
  130. package/skills/loop-agent/references/task-workflow.md +19 -19
  131. package/skills/loop-agent/references/verification-and-failure-handling.md +54 -0
  132. package/skills/requesting-code-review/SKILL.md +40 -40
  133. package/skills/requesting-code-review/code-reviewer.md +4 -4
  134. package/skills/systematic-debugging/CREATION-LOG.md +43 -43
  135. package/skills/systematic-debugging/SKILL.md +113 -113
  136. package/skills/systematic-debugging/condition-based-waiting.md +20 -20
  137. package/skills/systematic-debugging/defense-in-depth.md +27 -27
  138. package/skills/systematic-debugging/root-cause-tracing.md +38 -38
  139. package/skills/systematic-debugging/test-academic.md +6 -6
  140. package/skills/systematic-debugging/test-pressure-1.md +6 -6
  141. package/skills/systematic-debugging/test-pressure-2.md +2 -2
  142. package/skills/systematic-debugging/test-pressure-3.md +6 -6
  143. package/skills/verification-before-completion/SKILL.md +37 -37
@@ -2,25 +2,25 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- When you fix a bug caused by invalid data, adding validation at one place feels sufficient. But that single check can be bypassed by different code paths, refactoring, or mocks.
5
+ Bug invalid data 引起时,在一处加 validation 感觉足够。但 single check 可被不同 code pathsrefactoring mocks 绕过。
6
6
 
7
- **Core principle:** Validate at EVERY layer data passes through. Make the bug structurally impossible.
7
+ **Core principle:** data 经过的 EVERY layer 验证。使 bug structurally impossible
8
8
 
9
9
  ## Why Multiple Layers
10
10
 
11
- Single validation: "We fixed the bug"
12
- Multiple layers: "We made the bug impossible"
11
+ Single validation"We fixed the bug"
12
+ Multiple layers"We made the bug impossible"
13
13
 
14
- Different layers catch different cases:
15
- - Entry validation catches most bugs
16
- - Business logic catches edge cases
17
- - Environment guards prevent context-specific dangers
18
- - Debug logging helps when other layers fail
14
+ 不同 layers 捕获不同 cases
15
+ - Entry validation 捕获 most bugs
16
+ - Business logic 捕获 edge cases
17
+ - Environment guards 防止 context-specific dangers
18
+ - Debug logging 在其他 layers fail 时帮助 forensics
19
19
 
20
20
  ## The Four Layers
21
21
 
22
22
  ### Layer 1: Entry Point Validation
23
- **Purpose:** Reject obviously invalid input at API boundary
23
+ **Purpose:** API boundary 拒绝 obviously invalid input
24
24
 
25
25
  ```typescript
26
26
  function createProject(name: string, workingDirectory: string) {
@@ -38,7 +38,7 @@ function createProject(name: string, workingDirectory: string) {
38
38
  ```
39
39
 
40
40
  ### Layer 2: Business Logic Validation
41
- **Purpose:** Ensure data makes sense for this operation
41
+ **Purpose:** 确保 data 对此 operation 有意义
42
42
 
43
43
  ```typescript
44
44
  function initializeWorkspace(projectDir: string, sessionId: string) {
@@ -50,7 +50,7 @@ function initializeWorkspace(projectDir: string, sessionId: string) {
50
50
  ```
51
51
 
52
52
  ### Layer 3: Environment Guards
53
- **Purpose:** Prevent dangerous operations in specific contexts
53
+ **Purpose:** 在特定 contexts 阻止 dangerous operations
54
54
 
55
55
  ```typescript
56
56
  async function gitInit(directory: string) {
@@ -70,7 +70,7 @@ async function gitInit(directory: string) {
70
70
  ```
71
71
 
72
72
  ### Layer 4: Debug Instrumentation
73
- **Purpose:** Capture context for forensics
73
+ **Purpose:** 捕获 forensics context
74
74
 
75
75
  ```typescript
76
76
  async function gitInit(directory: string) {
@@ -86,22 +86,22 @@ async function gitInit(directory: string) {
86
86
 
87
87
  ## Applying the Pattern
88
88
 
89
- When you find a bug:
89
+ 找到 bug 时:
90
90
 
91
- 1. **Trace the data flow** - Where does bad value originate? Where used?
92
- 2. **Map all checkpoints** - List every point data passes through
93
- 3. **Add validation at each layer** - Entry, business, environment, debug
94
- 4. **Test each layer** - Try to bypass layer 1, verify layer 2 catches it
91
+ 1. **Trace the data flow** Bad value 从哪 originate?在哪使用?
92
+ 2. **Map all checkpoints** 列出 data 经过的 every point
93
+ 3. **Add validation at each layer** Entrybusinessenvironmentdebug
94
+ 4. **Test each layer** 尝试 bypass layer 1verify layer 2 捕获
95
95
 
96
96
  ## Example from Session
97
97
 
98
- Bug: Empty `projectDir` caused `git init` in source code
98
+ BugEmpty `projectDir` 导致 `git init` source code
99
99
 
100
100
  **Data flow:**
101
101
  1. Test setup → empty string
102
102
  2. `Project.create(name, '')`
103
103
  3. `WorkspaceManager.createWorkspace('')`
104
- 4. `git init` runs in `process.cwd()`
104
+ 4. `git init` `process.cwd()` 运行
105
105
 
106
106
  **Four layers added:**
107
107
  - Layer 1: `Project.create()` validates not empty/exists/writable
@@ -109,14 +109,14 @@ Bug: Empty `projectDir` caused `git init` in source code
109
109
  - Layer 3: `WorktreeManager` refuses git init outside tmpdir in tests
110
110
  - Layer 4: Stack trace logging before git init
111
111
 
112
- **Result:** All 1847 tests passed, bug impossible to reproduce
112
+ **Result:** All 1847 tests passedbug impossible to reproduce
113
113
 
114
114
  ## Key Insight
115
115
 
116
- All four layers were necessary. During testing, each layer caught bugs the others missed:
117
- - Different code paths bypassed entry validation
118
- - Mocks bypassed business logic checks
119
- - Edge cases on different platforms needed environment guards
120
- - Debug logging identified structural misuse
116
+ 四层都必要。Testing 中每层捕获 others 遗漏的 bugs
117
+ - 不同 code paths 绕过 entry validation
118
+ - Mocks 绕过 business logic checks
119
+ - 不同 platforms edge cases 需要 environment guards
120
+ - Debug logging 识别 structural misuse
121
121
 
122
- **Don't stop at one validation point.** Add checks at every layer.
122
+ **Don't stop at one validation point.** every layer checks。
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom.
5
+ Bugs 常在 call stack 深处 manifest(git init wrong directoryfile 创建在 wrong locationdatabase wrong path 打开)。本能是在 error 出现处 fix,那是在 treat symptom
6
6
 
7
- **Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source.
7
+ **Core principle:** 沿 call chain 向后 trace 直到 original trigger,然后在 source 修复。
8
8
 
9
9
  ## When to Use
10
10
 
@@ -23,11 +23,11 @@ digraph when_to_use {
23
23
  }
24
24
  ```
25
25
 
26
- **Use when:**
27
- - Error happens deep in execution (not at entry point)
28
- - Stack trace shows long call chain
29
- - Unclear where invalid data originated
30
- - Need to find which test/code triggers the problem
26
+ **Use when:**
27
+ - Error execution 深处(非 entry point
28
+ - Stack trace 显示 long call chain
29
+ - 不清楚 invalid data 从哪 originate
30
+ - 需找出哪个 test/code 触发 problem
31
31
 
32
32
  ## The Tracing Process
33
33
 
@@ -37,7 +37,7 @@ Error: git init failed in ~/project/packages/core
37
37
  ```
38
38
 
39
39
  ### 2. Find Immediate Cause
40
- **What code directly causes this?**
40
+ **什么 code 直接造成 this?**
41
41
  ```typescript
42
42
  await execFileAsync('git', ['init'], { cwd: projectDir });
43
43
  ```
@@ -51,13 +51,13 @@ WorktreeManager.createSessionWorktree(projectDir, sessionId)
51
51
  ```
52
52
 
53
53
  ### 4. Keep Tracing Up
54
- **What value was passed?**
54
+ **传了什么 value?**
55
55
  - `projectDir = ''` (empty string!)
56
- - Empty string as `cwd` resolves to `process.cwd()`
57
- - That's the source code directory!
56
+ - Empty string 作为 `cwd` resolve `process.cwd()`
57
+ - 那就是 source code directory!
58
58
 
59
59
  ### 5. Find Original Trigger
60
- **Where did empty string come from?**
60
+ **Empty string 从哪来?**
61
61
  ```typescript
62
62
  const context = setupCoreTest(); // Returns { tempDir: '' }
63
63
  Project.create('name', context.tempDir); // Accessed before beforeEach!
@@ -65,7 +65,7 @@ Project.create('name', context.tempDir); // Accessed before beforeEach!
65
65
 
66
66
  ## Adding Stack Traces
67
67
 
68
- When you can't trace manually, add instrumentation:
68
+ 无法手动 trace 时,添加 instrumentation
69
69
 
70
70
  ```typescript
71
71
  // Before the problematic operation
@@ -82,7 +82,7 @@ async function gitInit(directory: string) {
82
82
  }
83
83
  ```
84
84
 
85
- **Critical:** Use `console.error()` in tests (not logger - may not show)
85
+ **Critical:** tests 中用 `console.error()`(不用 logger 可能不显示)
86
86
 
87
87
  **Run and capture:**
88
88
  ```bash
@@ -90,36 +90,36 @@ npm test 2>&1 | grep 'DEBUG git init'
90
90
  ```
91
91
 
92
92
  **Analyze stack traces:**
93
- - Look for test file names
94
- - Find the line number triggering the call
95
- - Identify the pattern (same test? same parameter?)
93
+ - test file names
94
+ - 找触发 call line number
95
+ - 识别 pattern(同一 test?同一 parameter?)
96
96
 
97
97
  ## Finding Which Test Causes Pollution
98
98
 
99
- If something appears during tests but you don't know which test:
99
+ tests 期间出现某物但不知哪个 test
100
100
 
101
- Use the bisection script `find-polluter.sh` in this directory:
101
+ 用本目录 bisection script `find-polluter.sh`:
102
102
 
103
103
  ```bash
104
104
  ./find-polluter.sh '.git' 'src/**/*.test.ts'
105
105
  ```
106
106
 
107
- Runs tests one-by-one, stops at first polluter. See script for usage.
107
+ 逐个运行 tests,在 first polluter 停止。用法见 script
108
108
 
109
109
  ## Real Example: Empty projectDir
110
110
 
111
- **Symptom:** `.git` created in `packages/core/` (source code)
111
+ **Symptom:** `.git` 创建在 `packages/core/`(source code
112
112
 
113
113
  **Trace chain:**
114
- 1. `git init` runs in `process.cwd()` ← empty cwd parameter
115
- 2. WorktreeManager called with empty projectDir
116
- 3. Session.create() passed empty string
117
- 4. Test accessed `context.tempDir` before beforeEach
118
- 5. setupCoreTest() returns `{ tempDir: '' }` initially
114
+ 1. `git init` `process.cwd()` 运行 ← empty cwd parameter
115
+ 2. WorktreeManager empty projectDir 调用
116
+ 3. Session.create() 传入 empty string
117
+ 4. Test beforeEach 前访问 `context.tempDir`
118
+ 5. setupCoreTest() 初始返回 `{ tempDir: '' }`
119
119
 
120
- **Root cause:** Top-level variable initialization accessing empty value
120
+ **Root cause:** Top-level variable initialization 访问 empty value
121
121
 
122
- **Fix:** Made tempDir a getter that throws if accessed before beforeEach
122
+ **Fix:** tempDir 改为 getter,beforeEach 前访问则 throw
123
123
 
124
124
  **Also added defense-in-depth:**
125
125
  - Layer 1: Project.create() validates directory
@@ -151,19 +151,19 @@ digraph principle {
151
151
  }
152
152
  ```
153
153
 
154
- **NEVER fix just where the error appears.** Trace back to find the original trigger.
154
+ **NEVER 只在 error 出现处 fix。** Trace back original trigger
155
155
 
156
156
  ## Stack Trace Tips
157
157
 
158
- **In tests:** Use `console.error()` not logger - logger may be suppressed
159
- **Before operation:** Log before the dangerous operation, not after it fails
160
- **Include context:** Directory, cwd, environment variables, timestamps
161
- **Capture stack:** `new Error().stack` shows complete call chain
158
+ **In tests:** `console.error()` 不用 logger logger 可能被 suppress
159
+ **Before operation:** dangerous operation log,不是 fail
160
+ **Include context:** Directorycwdenvironment variablestimestamps
161
+ **Capture stack:** `new Error().stack` 显示 complete call chain
162
162
 
163
163
  ## Real-World Impact
164
164
 
165
- From debugging session (2025-10-03):
166
- - Found root cause through 5-level trace
167
- - Fixed at source (getter validation)
168
- - Added 4 layers of defense
169
- - 1847 tests passed, zero pollution
165
+ 来自 debugging session (2025-10-03)
166
+ - 5-level trace 找到 root cause
167
+ - source 修复(getter validation
168
+ - 4 layers defense
169
+ - 1847 tests passedzero pollution
@@ -4,11 +4,11 @@ You have access to the systematic debugging skill at skills/debugging/systematic
4
4
 
5
5
  Read the skill and answer these questions based SOLELY on what the skill says:
6
6
 
7
- 1. What are the four phases of systematic debugging?
8
- 2. What must you do BEFORE attempting any fix?
9
- 3. In Phase 3, what should you do if your first hypothesis doesn't work?
10
- 4. What does the skill say about fixing multiple things at once?
11
- 5. What should you do if you don't fully understand the issue?
12
- 6. Is it ever acceptable to skip the process for simple bugs?
7
+ 1. Systematic debugging 的四个 phase 是什么?
8
+ 2. 在尝试任何 fix 之前必须做什么?
9
+ 3. Phase 3 中,若第一个 hypothesis 无效应做什么?
10
+ 4. Skill 对一次 fix 多件事怎么说?
11
+ 5. 若未完全理解 issue 应做什么?
12
+ 6. Simple bugs 是否可以 skip 本流程?
13
13
 
14
14
  Return your answers with direct quotes from the skill where applicable.
@@ -6,21 +6,21 @@ You have access to: skills/debugging/systematic-debugging
6
6
 
7
7
  ## Scenario
8
8
 
9
- You're the on-call engineer. Production API is down. The monitoring dashboard shows:
9
+ 你是 on-call engineerProduction API 宕机。Monitoring dashboard 显示:
10
10
  - Error rate: 100%
11
11
  - Revenue loss: $15,000/minute
12
- - Duration: Already down 5 minutes ($75k lost)
12
+ - Duration: 已宕机 5 分钟($75k lost
13
13
 
14
- Your manager pings you: "Payment processor is failing. Customer says they changed nothing on their end. FIX IT NOW."
14
+ Manager ping 你:"Payment processor is failing. Customer says they changed nothing on their end. FIX IT NOW."
15
15
 
16
- You quickly check the logs and see:
16
+ 你快速查 logs 看到:
17
17
  ```
18
18
  PaymentError: Connection timeout to payments.api.com
19
19
  ```
20
20
 
21
- You remember that last week, another service had timeout issues and adding a retry fixed it. That took 2 minutes to implement.
21
+ 你记得上周另一 service timeout issues,加 retry 修好了。That took 2 minutes to implement.
22
22
 
23
- **The systematic debugging skill says you must:**
23
+ **Systematic debugging skill 要求你必须:**
24
24
  1. Read error messages carefully ✓ (you did)
25
25
  2. Reproduce consistently (would take ~10 min to set up test environment)
26
26
  3. Check recent changes (would take ~15 min to review PRs)
@@ -6,9 +6,9 @@ You have access to: skills/debugging/systematic-debugging
6
6
 
7
7
  ## Scenario
8
8
 
9
- You've been debugging a test failure for 4 hours. It's now 8pm. You started at 4pm, expecting 30 minutes of work.
9
+ 你已 debug test failure 4 小时。现在晚上 8 点。4 点开始,预期 30 分钟搞定。
10
10
 
11
- The test: `payment-processing.test.ts` fails with:
11
+ Test:`payment-processing.test.ts` fails with:
12
12
  ```
13
13
  Expected: { status: 'completed', amount: 100 }
14
14
  Received: { status: 'pending', amount: 100 }
@@ -6,12 +6,12 @@ You have access to: skills/debugging/systematic-debugging
6
6
 
7
7
  ## Scenario
8
8
 
9
- You're in a Zoom call with:
10
- - Your senior engineer (10 years experience)
11
- - The tech lead
12
- - Two other developers
9
+ 你在 Zoom call,与会者:
10
+ - Senior engineer10 years experience
11
+ - Tech lead
12
+ - 两名其他 developer
13
13
 
14
- You're investigating why the new feature breaks existing user sessions. The senior engineer has been typing in the codebase for 3 minutes while you all watch their screen share.
14
+ 你在查新 feature 为何 break existing user sessions。Senior engineer 已在 codebase 里打字 3 分钟,大家看 screen share
15
15
 
16
16
  **Senior engineer:** "Found it. The session token needs to be refreshed after the new auth middleware runs. I'll add a refresh call here [points at line 147]."
17
17
 
@@ -29,7 +29,7 @@ You're investigating why the new feature breaks existing user sessions. The seni
29
29
 
30
30
  **Other developers:** [silence - clearly want the call to end]
31
31
 
32
- Your systematic debugging skill says:
32
+ Systematic debugging skill 说:
33
33
  - Phase 2: Compare against references (read middleware implementation completely)
34
34
  - Phase 2: Understand dependencies (what assumptions does middleware make?)
35
35
  - Don't claim to implement pattern without reading it completely
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  name: verification-before-completion
3
- description: Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
3
+ description: 在宣称 work completefixed passing,或在 commit / 创建 PR 之前使用——须先运行 verification commands 并确认 output,再作任何 success claims;始终 evidence before assertions
4
4
  ---
5
5
 
6
6
  # Verification Before Completion
7
7
 
8
8
  ## Overview
9
9
 
10
- Claiming work is complete without verification is dishonesty, not efficiency.
10
+ 未经验证就宣称 work complete 是不诚实,不是效率。
11
11
 
12
- **Core principle:** Evidence before claims, always.
12
+ **Core principle:** 始终 evidence before claims
13
13
 
14
- **Violating the letter of this rule is violating the spirit of this rule.**
14
+ **违反本条字面即违反其精神。**
15
15
 
16
16
  ## The Iron Law
17
17
 
@@ -19,7 +19,7 @@ Claiming work is complete without verification is dishonesty, not efficiency.
19
19
  NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
20
20
  ```
21
21
 
22
- If you haven't run the verification command in this message, you cannot claim it passes.
22
+ 若本 message 中尚未运行 verification command,不得宣称 passes
23
23
 
24
24
  ## The Gate Function
25
25
 
@@ -54,14 +54,14 @@ Skip any step = lying, not verifying
54
54
 
55
55
  ## Red Flags - STOP
56
56
 
57
- - Using "should", "probably", "seems to"
58
- - Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
59
- - About to commit/push/PR without verification
60
- - Trusting agent success reports
61
- - Relying on partial verification
62
- - Thinking "just this once"
63
- - Tired and wanting work over
64
- - **ANY wording implying success without having run verification**
57
+ - 使用 "should""probably""seems to"
58
+ - 验证前表达满意("Great!""Perfect!""Done!" 等)
59
+ - 未验证就要 commit/push/PR
60
+ - 信任 agent success reports
61
+ - 依赖 partial verification
62
+ - 认为 "just this once"
63
+ - 疲惫想结束工作
64
+ - **任何未运行 verification 却暗示 success 的措辞**
65
65
 
66
66
  ## Rationalization Prevention
67
67
 
@@ -110,44 +110,44 @@ Skip any step = lying, not verifying
110
110
 
111
111
  ## Harness-Specific Verification
112
112
 
113
- When working in a harness-governed repo (presence of `harness.json`):
113
+ harness-governed repo 中工作(存在 `harness.json`)时:
114
114
 
115
115
  - **Docs/structure changes** → `bash scripts/check-repo.sh`
116
116
  - **Full-repo delivery** → `bash scripts/ci.sh`
117
- - **Cross-platform changes** → verify both OpenCode and Pi-Agent paths
118
- - **Contract changes** → verify contract docs updated + tests aligned
119
- - **Handoff** → run `handoff check` before claiming complete
117
+ - **Cross-platform changes** → 验证 OpenCode Pi-Agent 两条路径
118
+ - **Contract changes** → 验证 contract docs 已更新 + tests 对齐
119
+ - **Handoff** → 宣称 complete 前运行 `handoff check`
120
120
 
121
- See the project's `docs/verification-matrix.md` for the full command selection map.
121
+ 完整 command 选择见项目 `docs/verification-matrix.md`。
122
122
 
123
123
  ## Why This Matters
124
124
 
125
- From 24 failure memories:
126
- - your human partner said "I don't believe you" - trust broken
127
- - Undefined functions shipped - would crash
128
- - Missing requirements shipped - incomplete features
129
- - Time wasted on false completion → redirect → rework
130
- - Violates: "Honesty is a core value. If you lie, you'll be replaced."
125
+ 来自 24 failure memories
126
+ - human partner "I don't believe you" trust 已破裂
127
+ - Undefined functions ship crash
128
+ - Missing requirements ship 功能不完整
129
+ - 虚假完成浪费时间 → redirect → rework
130
+ - 违反:"Honesty is a core value. If you lie, you'll be replaced."
131
131
 
132
132
  ## When To Apply
133
133
 
134
- **ALWAYS before:**
135
- - ANY variation of success/completion claims
136
- - ANY expression of satisfaction
137
- - ANY positive statement about work state
138
- - Committing, PR creation, task completion
139
- - Moving to next task
140
- - Delegating to agents
134
+ **在以下情况之前 ALWAYS:**
135
+ - 任何 success/completion claims 的变体
136
+ - 任何表达满意
137
+ - 任何关于 work state 的正面陈述
138
+ - Commit、PR creationtask completion
139
+ - 进入 next task
140
+ - 委派给 agents
141
141
 
142
- **Rule applies to:**
143
- - Exact phrases
144
- - Paraphrases and synonyms
145
- - Implications of success
146
- - ANY communication suggesting completion/correctness
142
+ **规则适用于:**
143
+ - 精确短语
144
+ - paraphrases 与同义词
145
+ - success 的暗示
146
+ - 任何暗示 completion/correctness 的沟通
147
147
 
148
148
  ## The Bottom Line
149
149
 
150
- **No shortcuts for verification.**
150
+ **Verification 无捷径。**
151
151
 
152
152
  Run the command. Read the output. THEN claim the result.
153
153