Loading...
Loading...
Compare original and translation side by side
undefinedundefined
Problem: Tests might have passed before this stage. This doesn't prove authentication was added.
**Good Example:**
```yaml
问题:这些测试可能在该阶段执行前就已经通过了,无法证明认证功能是本次添加的。
**正例:**
```yaml
This proves authentication was ADDED by this stage (not already present).
这能够证明认证功能是**本次阶段新增**的(而非本来就存在)。- id: add-verify-command
name: "Add loom verify command"
stage_type: standard
working_dir: "loom"
description: |
Implement the `loom verify <stage-id>` CLI command.
DELTA PROOF:
- BEFORE: `loom verify --help` fails (command not registered)
- AFTER: `loom verify --help` succeeds
- AFTER: `loom verify test-stage` runs verification logic
truths:
- "loom verify --help"
- "loom verify nonexistent-stage 2>&1 | grep -q 'Stage not found'"
wiring:
- source: "src/main.rs"
pattern: "verify"
description: "Verify command registered in CLI"
- source: "src/commands/verify.rs"
pattern: "pub fn execute"
description: "Verify command implementation exists"
artifacts:
- "src/commands/verify.rs"- id: add-verify-command
name: "Add loom verify command"
stage_type: standard
working_dir: "loom"
description: |
Implement the `loom verify <stage-id>` CLI command.
DELTA PROOF:
- BEFORE: `loom verify --help` fails (command not registered)
- AFTER: `loom verify --help` succeeds
- AFTER: `loom verify test-stage` runs verification logic
truths:
- "loom verify --help"
- "loom verify nonexistent-stage 2>&1 | grep -q 'Stage not found'"
wiring:
- source: "src/main.rs"
pattern: "verify"
description: "Verify command registered in CLI"
- source: "src/commands/verify.rs"
pattern: "pub fn execute"
description: "Verify command implementation exists"
artifacts:
- "src/commands/verify.rs"- id: add-status-endpoint
name: "Add /api/status endpoint"
stage_type: standard
working_dir: "."
description: |
Implement GET /api/status endpoint returning system health.
DELTA PROOF:
- BEFORE: curl localhost:8080/api/status returns 404
- AFTER: curl localhost:8080/api/status returns 200 with JSON health data
truths:
- "curl -sf localhost:8080/api/status | jq -e '.healthy'"
- "curl -sf -o /dev/null -w '%{http_code}' localhost:8080/api/status | grep -q 200"
wiring:
- source: "src/routes/mod.rs"
pattern: "/api/status"
description: "Status endpoint registered in router"
- source: "src/handlers/status.rs"
pattern: "pub async fn status_handler"
description: "Status handler implementation"
artifacts:
- "src/handlers/status.rs"- id: add-status-endpoint
name: "Add /api/status endpoint"
stage_type: standard
working_dir: "."
description: |
Implement GET /api/status endpoint returning system health.
DELTA PROOF:
- BEFORE: curl localhost:8080/api/status returns 404
- AFTER: curl localhost:8080/api/status returns 200 with JSON health data
truths:
- "curl -sf localhost:8080/api/status | jq -e '.healthy'"
- "curl -sf -o /dev/null -w '%{http_code}' localhost:8080/api/status | grep -q 200"
wiring:
- source: "src/routes/mod.rs"
pattern: "/api/status"
description: "Status endpoint registered in router"
- source: "src/handlers/status.rs"
pattern: "pub async fn status_handler"
description: "Status handler implementation"
artifacts:
- "src/handlers/status.rs"- id: add-retry-module
name: "Add retry module"
stage_type: standard
working_dir: "loom"
description: |
Create retry module with exponential backoff.
DELTA PROOF:
- BEFORE: `use crate::retry::RetryPolicy;` would fail (module doesn't exist)
- AFTER: Module compiles, exports are available
truths:
- "cargo check"
- "cargo test --lib retry"
wiring:
- source: "src/lib.rs"
pattern: "pub mod retry"
description: "Retry module exported from lib.rs"
- source: "src/orchestrator/core/orchestrator.rs"
pattern: "use crate::retry"
description: "Retry module imported in orchestrator"
artifacts:
- "src/retry.rs"
- "tests/retry_tests.rs"- id: add-retry-module
name: "Add retry module"
stage_type: standard
working_dir: "loom"
description: |
Create retry module with exponential backoff.
DELTA PROOF:
- BEFORE: `use crate::retry::RetryPolicy;` would fail (module doesn't exist)
- AFTER: Module compiles, exports are available
truths:
- "cargo check"
- "cargo test --lib retry"
wiring:
- source: "src/lib.rs"
pattern: "pub mod retry"
description: "Retry module exported from lib.rs"
- source: "src/orchestrator/core/orchestrator.rs"
pattern: "use crate::retry"
description: "Retry module imported in orchestrator"
artifacts:
- "src/retry.rs"
- "tests/retry_tests.rs"- id: fix-crash-on-empty-plan
name: "Fix crash when plan has no stages"
stage_type: standard
working_dir: "loom"
description: |
Fix crash when initializing empty plan.
DELTA PROOF (NOTE: Before/after are inverted for bugs):
- BEFORE: Empty plan causes panic (bug reproducer succeeds at finding the bug)
- AFTER: Empty plan returns error gracefully (bug reproducer fails to find the bug)
Verification approach:
1. Create test case that reproduces the crash
2. Test should PASS after fix (catches the crash gracefully)
3. The bug is proven fixed when the panic no longer occurs
truths:
- "cargo test test_empty_plan_no_crash"
- "cargo test --lib plan::parser"
wiring:
- source: "src/plan/parser.rs"
pattern: "if stages.is_empty()"
description: "Empty stage list check added"
- source: "src/plan/parser.rs"
pattern: 'Err.*"Plan must contain at least one stage"'
description: "Error returned instead of panic"
artifacts:
- "tests/empty_plan_tests.rs"- id: fix-crash-on-empty-plan
name: "Fix crash when plan has no stages"
stage_type: standard
working_dir: "loom"
description: |
Fix crash when initializing empty plan.
DELTA PROOF (NOTE: Before/after are inverted for bugs):
- BEFORE: Empty plan causes panic (bug reproducer succeeds at finding the bug)
- AFTER: Empty plan returns error gracefully (bug reproducer fails to find the bug)
Verification approach:
1. Create test case that reproduces the crash
2. Test should PASS after fix (catches the crash gracefully)
3. The bug is proven fixed when the panic no longer occurs
truths:
- "cargo test test_empty_plan_no_crash"
- "cargo test --lib plan::parser"
wiring:
- source: "src/plan/parser.rs"
pattern: "if stages.is_empty()"
description: "Empty stage list check added"
- source: "src/plan/parser.rs"
pattern: 'Err.*"Plan must contain at least one stage"'
description: "Error returned instead of panic"
artifacts:
- "tests/empty_plan_tests.rs"undefinedundefined
**Good:**
```yaml
truths:
- "curl -sf -X POST localhost:8080/api/register -d '{\"email\":\"test@example.com\"}' | jq -e '.user_id'"
**正例:**
```yaml
truths:
- "curl -sf -X POST localhost:8080/api/register -d '{\"email\":\"test@example.com\"}' | jq -e '.user_id'"undefinedundefined
**Good:**
```yaml
truths:
- "loom status | grep -q 'Active Plan:'"
- "loom status | grep -q 'Executing:'"
**正例:**
```yaml
truths:
- "loom status | grep -q 'Active Plan:'"
- "loom status | grep -q 'Executing:'"undefinedundefined
Better:
```yaml
artifacts:
- "config.toml"
更优方案:
```yaml
artifacts:
- "config.toml"undefinedundefined
**Correct:**
```yaml
**正确示例:**
```yamlundefinedundefinedbefore_stageafter_stagebefore_stageafter_stageloom stage completebefore_stageafter_stagebefore_stageafter_stageloom stage completebefore_stage:
- command: "cargo test test_feature"
exit_code: 1
description: "Feature test fails before implementation"
after_stage:
- command: "cargo test test_feature"
exit_code: 0
description: "Feature test passes after implementation"commandexit_codedescriptionstdout_containsstdout_not_containsstderr_emptybefore_stage:
- command: "cargo test test_feature"
exit_code: 1
description: "Feature test fails before implementation"
after_stage:
- command: "cargo test test_feature"
exit_code: 0
description: "Feature test passes after implementation"commandexit_codedescriptionstdout_containsstdout_not_containsstderr_emptytruths:
- "command that proves feature works"
- "test that validates behavior"truths:
- "command that proves feature works"
- "test that validates behavior"wiring:
- source: "src/main.rs"
pattern: "register_feature"
description: "Feature registered in main entry point"wiring:
- source: "src/main.rs"
pattern: "register_feature"
description: "Feature registered in main entry point"artifacts:
- "src/feature/implementation.rs"
- "tests/feature_tests.rs"artifacts:
- "src/feature/implementation.rs"
- "tests/feature_tests.rs"description: |
Implement feature X.
DELTA PROOF:
- BEFORE: <what's true before this stage>
- AFTER: <what should be true after this stage>
[Implementation details...]description: |
Implement feature X.
DELTA PROOF:
- BEFORE: <what's true before this stage>
- AFTER: <what should be true after this stage>
[Implementation details...]- id: add-metrics-endpoint
name: "Add /metrics endpoint"
stage_type: standard
working_dir: "."
description: |
Add Prometheus-compatible /metrics endpoint.
DELTA PROOF:
- BEFORE: curl localhost:8080/metrics returns 404
- AFTER: curl localhost:8080/metrics returns Prometheus format
- AFTER: Metrics include request_count, response_time
Implementation:
- Create metrics middleware
- Register /metrics endpoint
- Export request_count and response_time gauges
dependencies: ["add-middleware-support"]
before_stage:
- command: "curl -sf localhost:8080/metrics"
exit_code: 1
description: "Metrics endpoint does not exist yet"
after_stage:
- command: "curl -sf localhost:8080/metrics | grep -q 'request_count'"
exit_code: 0
description: "Metrics endpoint returns request_count"
- command: "curl -sf localhost:8080/metrics | grep -q 'response_time'"
exit_code: 0
description: "Metrics endpoint returns response_time"
truths:
- "curl -sf localhost:8080/metrics | grep -q 'request_count'"
- "curl -sf localhost:8080/metrics | grep -q 'response_time'"
- "curl -sf localhost:8080/metrics | grep -q 'TYPE request_count counter'"
wiring:
- source: "src/routes/mod.rs"
pattern: "Router.*metrics"
description: "Metrics endpoint registered"
- source: "src/middleware/metrics.rs"
pattern: "pub fn track_metrics"
description: "Metrics middleware implemented"
artifacts:
- "src/middleware/metrics.rs"
- "src/routes/metrics.rs"
acceptance:
- "cargo test"
- "cargo clippy -- -D warnings"- id: add-metrics-endpoint
name: "Add /metrics endpoint"
stage_type: standard
working_dir: "."
description: |
Add Prometheus-compatible /metrics endpoint.
DELTA PROOF:
- BEFORE: curl localhost:8080/metrics returns 404
- AFTER: curl localhost:8080/metrics returns Prometheus format
- AFTER: Metrics include request_count, response_time
Implementation:
- Create metrics middleware
- Register /metrics endpoint
- Export request_count and response_time gauges
dependencies: ["add-middleware-support"]
before_stage:
- command: "curl -sf localhost:8080/metrics"
exit_code: 1
description: "Metrics endpoint does not exist yet"
after_stage:
- command: "curl -sf localhost:8080/metrics | grep -q 'request_count'"
exit_code: 0
description: "Metrics endpoint returns request_count"
- command: "curl -sf localhost:8080/metrics | grep -q 'response_time'"
exit_code: 0
description: "Metrics endpoint returns response_time"
truths:
- "curl -sf localhost:8080/metrics | grep -q 'request_count'"
- "curl -sf localhost:8080/metrics | grep -q 'response_time'"
- "curl -sf localhost:8080/metrics | grep -q 'TYPE request_count counter'"
wiring:
- source: "src/routes/mod.rs"
pattern: "Router.*metrics"
description: "Metrics endpoint registered"
- source: "src/middleware/metrics.rs"
pattern: "pub fn track_metrics"
description: "Metrics middleware implemented"
artifacts:
- "src/middleware/metrics.rs"
- "src/routes/metrics.rs"
acceptance:
- "cargo test"
- "cargo clippy -- -D warnings"description: |
[One-line summary of what this stage does]
DELTA PROOF:
- BEFORE: [State before this stage - expected to fail/pass]
- AFTER: [State after this stage - expected to pass/fail]
[Detailed implementation guidance]
EXECUTION PLAN:
[If using subagents, describe parallel work]description: |
[该阶段功能的一行总结]
DELTA PROOF:
- BEFORE: [阶段执行前的状态 - 预期失败/成功]
- AFTER: [阶段执行后的状态 - 预期成功/失败]
[详细实现指导]
EXECUTION PLAN:
[如果使用子Agent,描述并行工作内容]| Verification Type | Use When | Proves |
|---|---|---|
| Behavior is observable via shell commands | Feature works at runtime |
| Feature must integrate with existing code | Code is connected/registered |
| New files must exist | Files were created |
| Standard checks (build, test, lint) | Code compiles and tests pass |
truthswiring| 验证类型 | 使用场景 | 证明内容 |
|---|---|---|
| 行为可通过Shell命令观测 | 功能在运行时可用 |
| 功能必须与现有代码集成 | 代码已连接/注册 |
| 必须新增文件 | 文件已创建 |
| 标准检查(构建、测试、代码检查) | 代码可编译且测试通过 |
truthswiring- id: add-stage-complete-command
name: "Add loom stage complete command"
stage_type: standard
working_dir: "loom"
description: |
Implement `loom stage complete <stage-id>` command to mark stages as complete.
DELTA PROOF:
- BEFORE: `loom stage complete --help` fails (command doesn't exist)
- AFTER: `loom stage complete --help` shows usage
- AFTER: `loom stage complete test-stage` transitions stage to Completed state
Implementation:
- Add StageComplete command to CLI
- Implement state transition logic
- Add validation for stage existence
- Update stage file with completion timestamp
dependencies: ["knowledge-bootstrap"]
truths:
- "loom stage complete --help"
- "loom stage list | grep -q complete"
wiring:
- source: "src/main.rs"
pattern: "Commands::StageComplete"
description: "StageComplete command registered in CLI"
- source: "src/commands/stage.rs"
pattern: "pub fn complete"
description: "Stage complete implementation exists"
- source: "src/models/stage/transitions.rs"
pattern: "fn transition_to_completed"
description: "State transition logic implemented"
artifacts:
- "src/commands/stage.rs"
acceptance:
- "cargo test"
- "cargo test stage_complete"
- "cargo clippy -- -D warnings"- id: add-stage-complete-command
name: "Add loom stage complete command"
stage_type: standard
working_dir: "loom"
description: |
Implement `loom stage complete <stage-id>` command to mark stages as complete.
DELTA PROOF:
- BEFORE: `loom stage complete --help` fails (command doesn't exist)
- AFTER: `loom stage complete --help` shows usage
- AFTER: `loom stage complete test-stage` transitions stage to Completed state
Implementation:
- Add StageComplete command to CLI
- Implement state transition logic
- Add validation for stage existence
- Update stage file with completion timestamp
dependencies: ["knowledge-bootstrap"]
truths:
- "loom stage complete --help"
- "loom stage list | grep -q complete"
wiring:
- source: "src/main.rs"
pattern: "Commands::StageComplete"
description: "StageComplete command registered in CLI"
- source: "src/commands/stage.rs"
pattern: "pub fn complete"
description: "Stage complete implementation exists"
- source: "src/models/stage/transitions.rs"
pattern: "fn transition_to_completed"
description: "State transition logic implemented"
artifacts:
- "src/commands/stage.rs"
acceptance:
- "cargo test"
- "cargo test stage_complete"
- "cargo clippy -- -D warnings"working_dirworking_dir: "loom" # Commands execute from loom/ directory
truths:
- "cargo test" # Runs in loom/ (where Cargo.toml lives)
artifacts:
- "src/commands/verify.rs" # Resolves to loom/src/commands/verify.rs
wiring:
- source: "src/main.rs" # Resolves to loom/src/main.rsworking_dir: "."working_dirworking_dir: "loom" # Commands execute from loom/ directory
truths:
- "cargo test" # Runs in loom/ (where Cargo.toml lives)
artifacts:
- "src/commands/verify.rs" # Resolves to loom/src/commands/verify.rs
wiring:
- source: "src/main.rs" # Resolves to loom/src/main.rsworking_dir: "."before_stageafter_stagetruthswiringartifactsbefore_stageafter_stagetruthswiringartifacts