@rune-kit/rune 2.12.3 → 2.14.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.
- package/README.md +41 -7
- package/compiler/__tests__/adr-scoring.test.js +91 -0
- package/compiler/__tests__/context-md-format.test.js +180 -0
- package/compiler/__tests__/context-pack-smell-tests.test.js +215 -0
- package/compiler/__tests__/diversity-score.test.js +117 -0
- package/compiler/__tests__/improve-architecture.test.js +171 -0
- package/compiler/__tests__/openclaw-adapter.test.js +31 -0
- package/compiler/__tests__/out-of-scope-format.test.js +303 -0
- package/compiler/__tests__/zoom-out-output.test.js +112 -0
- package/compiler/adapters/openclaw.js +43 -3
- package/package.json +2 -2
- package/skills/adversary/SKILL.md +1 -1
- package/skills/audit/SKILL.md +1 -0
- package/skills/autopsy/SKILL.md +1 -1
- package/skills/ba/SKILL.md +241 -82
- package/skills/ba/references/context-md-format.md +136 -0
- package/skills/ba/references/explore-first.md +107 -0
- package/skills/ba/references/out-of-scope-format.md +152 -0
- package/skills/brainstorm/SKILL.md +77 -1
- package/skills/brainstorm/references/design-it-twice.md +155 -0
- package/skills/context-pack/SKILL.md +69 -26
- package/skills/context-pack/evals.md +122 -0
- package/skills/context-pack/references/brief-template.md +121 -0
- package/skills/context-pack/references/durability-rules.md +109 -0
- package/skills/cook/SKILL.md +4 -4
- package/skills/debug/SKILL.md +2 -1
- package/skills/fix/SKILL.md +2 -1
- package/skills/graft/SKILL.md +1 -1
- package/skills/improve-architecture/SKILL.md +275 -0
- package/skills/improve-architecture/evals.md +145 -0
- package/skills/improve-architecture/references/deepening.md +87 -0
- package/skills/improve-architecture/references/interface-design.md +68 -0
- package/skills/improve-architecture/references/language.md +81 -0
- package/skills/improve-architecture/references/scoring.md +122 -0
- package/skills/journal/SKILL.md +34 -7
- package/skills/journal/references/adr-criteria.md +109 -0
- package/skills/marketing/SKILL.md +2 -1
- package/skills/review/SKILL.md +1 -0
- package/skills/review-intake/SKILL.md +25 -2
- package/skills/safeguard/SKILL.md +1 -1
- package/skills/scout/SKILL.md +33 -1
- package/skills/sentinel-env/SKILL.md +24 -13
- package/skills/skill-forge/SKILL.md +108 -1
- package/skills/surgeon/SKILL.md +17 -2
- package/skills/test/SKILL.md +48 -1
- package/skills/test/evals.md +137 -0
- package/skills/test/references/mocking-policy.md +121 -0
- package/skills/test/references/test-quality.md +124 -0
- package/skills/test/references/vertical-tdd.md +110 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Vertical TDD — Tracer-Bullet Cycles
|
|
2
|
+
|
|
3
|
+
The Iron Law catches "code before test." Vertical TDD catches the subtler failure: writing a *batch* of tests up front, then a batch of implementation. Tests written this way verify imagined behavior — the contract you *thought* the system would have — not actual behavior. Such tests pass, but they don't catch real bugs and they don't survive refactors.
|
|
4
|
+
|
|
5
|
+
## The Two Patterns
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
HORIZONTAL (forbidden):
|
|
9
|
+
RED: write test 1, test 2, test 3, test 4, test 5
|
|
10
|
+
GREEN: write impl 1, impl 2, impl 3, impl 4, impl 5
|
|
11
|
+
|
|
12
|
+
VERTICAL (required):
|
|
13
|
+
cycle 1: RED test 1 → GREEN impl 1 → COMMIT
|
|
14
|
+
cycle 2: RED test 2 → GREEN impl 2 → COMMIT
|
|
15
|
+
cycle 3: RED test 3 → GREEN impl 3 → COMMIT
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The horizontal pattern looks productive — five tests! — but each test was written without learning anything from the previous implementation. The vertical pattern lets each test respond to what the prior cycle revealed about the interface.
|
|
19
|
+
|
|
20
|
+
## Why Horizontal Slicing Fails
|
|
21
|
+
|
|
22
|
+
1. **Tests verify shape, not behavior.** When you write 5 tests in a row before any code exists, you can only describe the *shape* of what you imagine — function signatures, return types, data structures. Behavior tests need to react to actual runtime feedback.
|
|
23
|
+
2. **Bulk tests outrun the headlights.** You commit to a test structure before learning what the implementation needs. The 4th test you wrote is now wrong because the 1st implementation taught you something — but the test is already written and you "have to" make it pass.
|
|
24
|
+
3. **Refactor brittleness.** Bulk-written tests share a mental model from one moment in time. Refactor the impl and many tests break together — not because behavior changed, but because the imagined shape did.
|
|
25
|
+
|
|
26
|
+
## The Cycle Counter (machine-checked)
|
|
27
|
+
|
|
28
|
+
Track these two integers per session:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
cycle_count = number of (RED → GREEN) pairs completed
|
|
32
|
+
bulk_test_count = number of test files added since last GREEN
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Pre-first-GREEN gate: `bulk_test_count` MUST stay <= 1 until the first cycle reaches GREEN. Adding a 2nd test before the 1st test reaches GREEN = HORIZONTAL VIOLATION.
|
|
36
|
+
|
|
37
|
+
Mid-session gate: after each GREEN, `bulk_test_count` resets to 0. Writing 2 tests before the next GREEN = HORIZONTAL VIOLATION.
|
|
38
|
+
|
|
39
|
+
Emit `tdd.horizontal.violation` signal when triggered. `completion-gate` blocks "tests pass" claims that lack a matching cycle count in git log.
|
|
40
|
+
|
|
41
|
+
## Git Audit Trail (verifiable claim)
|
|
42
|
+
|
|
43
|
+
Every cycle MUST produce a commit pair. Suggested message format:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
test(<scope>): <behavior phrase> ← RED commit
|
|
47
|
+
feat(<scope>): <behavior phrase> ← GREEN commit
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The receiving skill (`completion-gate`, `preflight`) reads `git log --oneline -n 20` and counts `test:` / `feat:` pairs. Claim "I did TDD" without paired commits = REJECTED.
|
|
51
|
+
|
|
52
|
+
This gate is honest because it's mechanical: git history doesn't lie about ordering. It also lets a parent agent verify a subagent's TDD claim without re-running the full pipeline.
|
|
53
|
+
|
|
54
|
+
## Right vs Wrong (worked examples)
|
|
55
|
+
|
|
56
|
+
### WRONG — horizontal slicing
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
> Write 5 tests for the password reset flow.
|
|
60
|
+
|
|
61
|
+
[creates test_request_reset.py, test_send_email.py, test_verify_token.py,
|
|
62
|
+
test_set_new_password.py, test_rate_limit.py — all in one go]
|
|
63
|
+
|
|
64
|
+
> Now implement them all.
|
|
65
|
+
|
|
66
|
+
[writes 5 source files matching the imagined shape]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Symptom: tests pass. Real bug: rate-limit test asserts `429` but the actual middleware returns `503` under load. Test never caught it because the test was written from imagination, not observation.
|
|
70
|
+
|
|
71
|
+
### RIGHT — vertical tracer bullets
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
cycle 1:
|
|
75
|
+
RED test_request_reset_sends_email_to_user — fails (function not defined)
|
|
76
|
+
GREEN minimal request_reset() that sends email — test passes
|
|
77
|
+
COMMIT pair
|
|
78
|
+
|
|
79
|
+
cycle 2:
|
|
80
|
+
RED test_request_reset_rejects_unknown_email — fails (currently sends to anyone)
|
|
81
|
+
GREEN add lookup; only send if user exists — test passes
|
|
82
|
+
COMMIT pair
|
|
83
|
+
← user feedback: "we need rate limiting before this ships"
|
|
84
|
+
← cycle 3 plan adjusts based on what cycle 2 revealed
|
|
85
|
+
|
|
86
|
+
cycle 3:
|
|
87
|
+
RED test_request_reset_rate_limits_3_per_hour — fails (no limit)
|
|
88
|
+
GREEN add rate limit middleware — test passes
|
|
89
|
+
COMMIT pair
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Each cycle reacts to the previous. The rate-limit test is now grounded in real middleware behavior, not imagination. If the rate-limit response code surprises you, you discover it in cycle 3 instead of in production.
|
|
93
|
+
|
|
94
|
+
## When Bulk Test Writing IS OK
|
|
95
|
+
|
|
96
|
+
Two narrow exceptions:
|
|
97
|
+
|
|
98
|
+
1. **Retrofitting tests for existing untested code** — characterization tests, written together, capture current behavior to enable safe refactor. Iron Law lifted; vertical slicing not required because behavior already exists to observe.
|
|
99
|
+
2. **Test scaffolding for a fixed external contract** — when implementing against an OpenAPI spec or a published wire protocol, tests can be generated from the spec en masse. The "imagination" risk is gone because the contract is external.
|
|
100
|
+
|
|
101
|
+
In both cases, document the exception in the test file header so future readers know why the cycle counter isn't expected to match.
|
|
102
|
+
|
|
103
|
+
## Recovery Procedure
|
|
104
|
+
|
|
105
|
+
If you catch yourself horizontal-slicing mid-session:
|
|
106
|
+
|
|
107
|
+
1. STOP. Do not write more tests, do not write any impl.
|
|
108
|
+
2. Identify which tests cover behavior you've actually verified vs which were written from imagination.
|
|
109
|
+
3. Keep the verified ones. Delete the rest.
|
|
110
|
+
4. Resume vertical: pick the next behavior, write 1 test, run it, see RED, write minimal impl, see GREEN, commit.
|