@voodocs/cli 2.2.1 → 2.2.2
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/CHANGELOG.md +38 -215
- package/LICENSE +1 -1
- package/PRIVACY.md +10 -10
- package/README.md +35 -39
- package/USAGE.md +27 -50
- package/examples/.cursorrules +9 -9
- package/examples/instructions/.claude/instructions.md +65 -77
- package/examples/instructions/.cursorrules +9 -9
- package/examples/instructions/.windsurfrules +9 -9
- package/examples/instructions/VOODOCS_INSTRUCTIONS.md +62 -74
- package/examples/math_example.py +1 -1
- package/examples/phase2_test.py +1 -1
- package/examples/test_function_invariants.py +1 -1
- package/lib/cli/__init__.py +3 -3
- package/lib/cli/benchmark.py +3 -3
- package/lib/cli/context.py +1 -1
- package/lib/cli/fix.py +1 -1
- package/lib/cli/generate.py +1 -1
- package/lib/cli/init.py +10 -10
- package/lib/cli/instruct.py +1 -1
- package/lib/cli/validate.py +3 -3
- package/lib/darkarts/annotations/DARKARTS_SYMBOLS.md +95 -110
- package/lib/darkarts/annotations/TRANSFORMATION_EXAMPLES.md +27 -29
- package/lib/darkarts/annotations/parser.py +215 -36
- package/lib/darkarts/cli_darkarts.py +5 -5
- package/lib/darkarts/context/ai_instructions.py +12 -12
- package/lib/darkarts/context/ai_integrations.py +16 -16
- package/lib/darkarts/context/commands.py +4 -4
- package/lib/darkarts/context/errors.py +1 -1
- package/lib/darkarts/context/models.py +1 -1
- package/lib/darkarts/context/ui.py +4 -4
- package/lib/darkarts/context/yaml_utils.py +3 -3
- package/lib/darkarts/core/loader.py +1 -1
- package/lib/darkarts/exceptions.py +3 -3
- package/lib/darkarts/parsers/typescript/dist/parser.d.ts +16 -0
- package/lib/darkarts/parsers/typescript/dist/parser.d.ts.map +1 -1
- package/lib/darkarts/parsers/typescript/dist/parser.js +64 -0
- package/lib/darkarts/parsers/typescript/dist/parser.js.map +1 -1
- package/lib/darkarts/parsers/typescript/src/parser.ts +68 -0
- package/lib/darkarts/plugins/voodocs/ai_native_plugin.py +1 -1
- package/lib/darkarts/plugins/voodocs/annotation_validator.py +2 -2
- package/lib/darkarts/plugins/voodocs/documentation_generator.py +3 -3
- package/lib/darkarts/plugins/voodocs/html_exporter.py +4 -4
- package/lib/darkarts/plugins/voodocs/instruction_generator.py +10 -10
- package/lib/darkarts/plugins/voodocs/pdf_exporter.py +1 -1
- package/lib/darkarts/plugins/voodocs/test_generator.py +1 -1
- package/lib/darkarts/telemetry.py +5 -5
- package/lib/darkarts/validation/README.md +3 -6
- package/package.json +1 -1
- package/requirements.txt +2 -2
- package/templates/ci/github-actions.yml +64 -64
- package/templates/ci/pre-commit-hook.sh +4 -4
- package/voodocs_cli.py +1 -1
|
@@ -28,86 +28,86 @@ Traditional documentation is written in natural language for humans, forcing AI
|
|
|
28
28
|
|
|
29
29
|
### Meta Symbols (Documentation Structure)
|
|
30
30
|
|
|
31
|
-
| Symbol | Name
|
|
32
|
-
|
|
33
|
-
| `⊢`
|
|
34
|
-
| `∂`
|
|
35
|
-
| `⚠`
|
|
36
|
-
| `⊨`
|
|
37
|
-
| `🔒`
|
|
38
|
-
| `⚡`
|
|
39
|
-
| `📊`
|
|
40
|
-
| `🎯`
|
|
41
|
-
| `⚙️`
|
|
31
|
+
| Symbol | Name | Meaning | Example |
|
|
32
|
+
|--------|------|---------|---------|
|
|
33
|
+
| `⊢` | Turnstile | Module/component declaration | `⊢module:name` |
|
|
34
|
+
| `∂` | Partial | Dependencies | `∂{lib1,lib2}` |
|
|
35
|
+
| `⚠` | Warning | Assumptions/preconditions | `⚠{utf8,fs:readable}` |
|
|
36
|
+
| `⊨` | Models | Invariants (must always be true) | `⊨{∀x→valid}` |
|
|
37
|
+
| `🔒` | Lock | Security model | `🔒{read-only}` |
|
|
38
|
+
| `⚡` | Lightning | Performance model | `⚡{O(n)}` |
|
|
39
|
+
| `📊` | Chart | Complexity analysis | `📊{time:O(n²),space:O(n)}` |
|
|
40
|
+
| `🎯` | Target | Objectives/goals | `🎯{accuracy>90%}` |
|
|
41
|
+
| `⚙️` | Gear | Configuration | `⚙️{cache:enabled}` |
|
|
42
42
|
|
|
43
43
|
### Logical Operators
|
|
44
44
|
|
|
45
|
-
| Symbol | Name
|
|
46
|
-
|
|
47
|
-
| `∀`
|
|
48
|
-
| `∃`
|
|
49
|
-
| `∧`
|
|
50
|
-
| `∨`
|
|
51
|
-
| `¬`
|
|
52
|
-
| `⇒`
|
|
53
|
-
| `⇐`
|
|
54
|
-
| `⇔`
|
|
55
|
-
| `⊕`
|
|
56
|
-
| `⊤`
|
|
57
|
-
| `⊥`
|
|
45
|
+
| Symbol | Name | Meaning | Example |
|
|
46
|
+
|--------|------|---------|---------|
|
|
47
|
+
| `∀` | Forall | For all | `∀x∈S` |
|
|
48
|
+
| `∃` | Exists | There exists | `∃x:valid` |
|
|
49
|
+
| `∧` | And | Logical AND | `A∧B` |
|
|
50
|
+
| `∨` | Or | Logical OR | `A∨B` |
|
|
51
|
+
| `¬` | Not | Logical NOT | `¬modified` |
|
|
52
|
+
| `⇒` | Implies | If...then | `A⇒B` |
|
|
53
|
+
| `⇐` | Implied by | Reverse implication | `B⇐A` |
|
|
54
|
+
| `⇔` | Iff | If and only if | `A⇔B` |
|
|
55
|
+
| `⊕` | XOR | Exclusive OR | `A⊕B` |
|
|
56
|
+
| `⊤` | Top | Always true | `⊤` |
|
|
57
|
+
| `⊥` | Bottom | Always false / Error | `⊥` |
|
|
58
58
|
|
|
59
59
|
### Set/Type Operators
|
|
60
60
|
|
|
61
|
-
| Symbol | Name
|
|
62
|
-
|
|
63
|
-
| `∈`
|
|
64
|
-
| `∉`
|
|
65
|
-
| `⊂`
|
|
66
|
-
| `⊆`
|
|
67
|
-
| `∪`
|
|
68
|
-
| `∩`
|
|
69
|
-
| `∅`
|
|
70
|
-
| `:`
|
|
71
|
-
| `→`
|
|
72
|
-
| `↦`
|
|
61
|
+
| Symbol | Name | Meaning | Example |
|
|
62
|
+
|--------|------|---------|---------|
|
|
63
|
+
| `∈` | Element of | Member of set/type | `x∈ℤ` |
|
|
64
|
+
| `∉` | Not element | Not a member | `x∉∅` |
|
|
65
|
+
| `⊂` | Subset | Proper subset | `A⊂B` |
|
|
66
|
+
| `⊆` | Subset eq | Subset or equal | `A⊆B` |
|
|
67
|
+
| `∪` | Union | Set union | `A∪B` |
|
|
68
|
+
| `∩` | Intersection | Set intersection | `A∩B` |
|
|
69
|
+
| `∅` | Empty set | Empty set | `S≠∅` |
|
|
70
|
+
| `:` | Type | Type annotation | `x:int` |
|
|
71
|
+
| `→` | Maps to | Function mapping | `f:A→B` |
|
|
72
|
+
| `↦` | Maps to (element) | Element mapping | `x↦x²` |
|
|
73
73
|
|
|
74
74
|
### Comparison Operators
|
|
75
75
|
|
|
76
|
-
| Symbol | Name
|
|
77
|
-
|
|
78
|
-
| `=`
|
|
79
|
-
| `≠`
|
|
80
|
-
| `<`
|
|
81
|
-
| `>`
|
|
82
|
-
| `≤`
|
|
83
|
-
| `≥`
|
|
84
|
-
| `≈`
|
|
85
|
-
| `≡`
|
|
76
|
+
| Symbol | Name | Meaning | Example |
|
|
77
|
+
|--------|------|---------|---------|
|
|
78
|
+
| `=` | Equals | Equality | `x=5` |
|
|
79
|
+
| `≠` | Not equals | Inequality | `x≠0` |
|
|
80
|
+
| `<` | Less than | Strictly less | `x<10` |
|
|
81
|
+
| `>` | Greater than | Strictly greater | `x>0` |
|
|
82
|
+
| `≤` | Less or equal | At most | `x≤100` |
|
|
83
|
+
| `≥` | Greater or equal | At least | `x≥1` |
|
|
84
|
+
| `≈` | Approximately | Approximate equality | `π≈3.14` |
|
|
85
|
+
| `≡` | Identical | Definitionally equal | `f≡g` |
|
|
86
86
|
|
|
87
87
|
### Number Sets
|
|
88
88
|
|
|
89
|
-
| Symbol | Name
|
|
90
|
-
|
|
91
|
-
| `ℕ`
|
|
92
|
-
| `ℤ`
|
|
93
|
-
| `ℤ⁺`
|
|
94
|
-
| `ℚ`
|
|
95
|
-
| `ℝ`
|
|
96
|
-
| `ℝ⁺`
|
|
97
|
-
| `ℂ`
|
|
98
|
-
| `ℙ`
|
|
89
|
+
| Symbol | Name | Meaning |
|
|
90
|
+
|--------|------|---------|
|
|
91
|
+
| `ℕ` | Naturals | Natural numbers {0,1,2,...} |
|
|
92
|
+
| `ℤ` | Integers | Integers {...,-1,0,1,...} |
|
|
93
|
+
| `ℤ⁺` | Positive integers | {1,2,3,...} |
|
|
94
|
+
| `ℚ` | Rationals | Rational numbers |
|
|
95
|
+
| `ℝ` | Reals | Real numbers |
|
|
96
|
+
| `ℝ⁺` | Positive reals | Positive real numbers |
|
|
97
|
+
| `ℂ` | Complex | Complex numbers |
|
|
98
|
+
| `ℙ` | Primes | Prime numbers |
|
|
99
99
|
|
|
100
100
|
### State/Flow Operators
|
|
101
101
|
|
|
102
|
-
| Symbol | Name
|
|
103
|
-
|
|
104
|
-
| `++`
|
|
105
|
-
| `--`
|
|
106
|
-
| `+=`
|
|
107
|
-
| `-=`
|
|
108
|
-
| `⊳`
|
|
109
|
-
| `⊲`
|
|
110
|
-
| `⟲`
|
|
102
|
+
| Symbol | Name | Meaning | Example |
|
|
103
|
+
|--------|------|---------|---------|
|
|
104
|
+
| `++` | Increment | Increase by 1 | `v++` |
|
|
105
|
+
| `--` | Decrement | Decrease by 1 | `v--` |
|
|
106
|
+
| `+=` | Add assign | Add and assign | `x+=5` |
|
|
107
|
+
| `-=` | Sub assign | Subtract and assign | `x-=3` |
|
|
108
|
+
| `⊳` | Precondition | Must hold before | `⊳valid` |
|
|
109
|
+
| `⊲` | Postcondition | Must hold after | `⊲success` |
|
|
110
|
+
| `⟲` | Loop | Iteration | `⟲∀i∈[0,n)` |
|
|
111
111
|
|
|
112
112
|
---
|
|
113
113
|
|
|
@@ -134,7 +134,6 @@ Traditional documentation is written in natural language for humans, forcing AI
|
|
|
134
134
|
**Translation**: "Dependencies: lib1, lib2, lib3"
|
|
135
135
|
|
|
136
136
|
**With descriptions**:
|
|
137
|
-
|
|
138
137
|
```python
|
|
139
138
|
"""@darkarts
|
|
140
139
|
∂{ast:py-parsing, re:regex, pathlib:fs}
|
|
@@ -161,8 +160,7 @@ Traditional documentation is written in natural language for humans, forcing AI
|
|
|
161
160
|
"""
|
|
162
161
|
```
|
|
163
162
|
|
|
164
|
-
**Translation**:
|
|
165
|
-
|
|
163
|
+
**Translation**:
|
|
166
164
|
- "Invariants: For all inputs x, x must be valid"
|
|
167
165
|
- "For all operations, state is not modified"
|
|
168
166
|
- "Result is of expected type"
|
|
@@ -201,7 +199,6 @@ Traditional documentation is written in natural language for humans, forcing AI
|
|
|
201
199
|
```
|
|
202
200
|
|
|
203
201
|
**Translation**:
|
|
204
|
-
|
|
205
202
|
```
|
|
206
203
|
Module: validator for strict input validation
|
|
207
204
|
Dependencies: re (regex), typing (type hints)
|
|
@@ -226,7 +223,7 @@ Performance: O(n) where n is input length
|
|
|
226
223
|
"""
|
|
227
224
|
```
|
|
228
225
|
|
|
229
|
-
**Translation**: "All
|
|
226
|
+
**Translation**: "All validate_* functions must raise on failure and return normalized on success"
|
|
230
227
|
|
|
231
228
|
### Version Constraints
|
|
232
229
|
|
|
@@ -308,12 +305,11 @@ Performance: O(n) where n is input length
|
|
|
308
305
|
|
|
309
306
|
---
|
|
310
307
|
|
|
311
|
-
## Comparison:
|
|
308
|
+
## Comparison: VooDocs vs DarkArts
|
|
312
309
|
|
|
313
310
|
### Example 1: Simple Module
|
|
314
311
|
|
|
315
|
-
**
|
|
316
|
-
|
|
312
|
+
**VooDocs** (14 lines, 450 chars):
|
|
317
313
|
```python
|
|
318
314
|
"""@voodocs
|
|
319
315
|
module_purpose: "Input validation utilities"
|
|
@@ -333,7 +329,6 @@ invariants: [
|
|
|
333
329
|
```
|
|
334
330
|
|
|
335
331
|
**DarkArts** (4 lines, 120 chars):
|
|
336
|
-
|
|
337
332
|
```python
|
|
338
333
|
"""@darkarts
|
|
339
334
|
⊢validation:input
|
|
@@ -347,8 +342,7 @@ invariants: [
|
|
|
347
342
|
|
|
348
343
|
### Example 2: Complex Module
|
|
349
344
|
|
|
350
|
-
**
|
|
351
|
-
|
|
345
|
+
**VooDocs** (32 lines, 980 chars):
|
|
352
346
|
```python
|
|
353
347
|
"""@voodocs
|
|
354
348
|
module_purpose: "Multi-language annotation parser"
|
|
@@ -374,7 +368,6 @@ performance_model: "O(n*m) where n=files, m=avg file size"
|
|
|
374
368
|
```
|
|
375
369
|
|
|
376
370
|
**DarkArts** (7 lines, 240 chars):
|
|
377
|
-
|
|
378
371
|
```python
|
|
379
372
|
"""@darkarts
|
|
380
373
|
⊢parser:annotations.multi-lang
|
|
@@ -394,33 +387,33 @@ performance_model: "O(n*m) where n=files, m=avg file size"
|
|
|
394
387
|
|
|
395
388
|
### Symbol → Natural Language
|
|
396
389
|
|
|
397
|
-
| Pattern
|
|
398
|
-
|
|
399
|
-
| `⊢module:name` | "Module: name"
|
|
400
|
-
| `∂{a,b,c}`
|
|
401
|
-
| `⚠{x,y,z}`
|
|
402
|
-
| `⊨{rule}`
|
|
403
|
-
| `∀x→y`
|
|
404
|
-
| `x∈S`
|
|
405
|
-
| `x:type`
|
|
406
|
-
| `A⇒B`
|
|
407
|
-
| `A∧B`
|
|
408
|
-
| `¬x`
|
|
390
|
+
| Pattern | Translation |
|
|
391
|
+
|---------|-------------|
|
|
392
|
+
| `⊢module:name` | "Module: name" |
|
|
393
|
+
| `∂{a,b,c}` | "Dependencies: a, b, c" |
|
|
394
|
+
| `⚠{x,y,z}` | "Assumptions: x, y, z" |
|
|
395
|
+
| `⊨{rule}` | "Invariant: rule" |
|
|
396
|
+
| `∀x→y` | "For all x, then y" |
|
|
397
|
+
| `x∈S` | "x is in S" |
|
|
398
|
+
| `x:type` | "x is of type type" |
|
|
399
|
+
| `A⇒B` | "If A then B" |
|
|
400
|
+
| `A∧B` | "A and B" |
|
|
401
|
+
| `¬x` | "not x" |
|
|
409
402
|
|
|
410
403
|
### Natural Language → Symbols
|
|
411
404
|
|
|
412
|
-
| Phrase
|
|
413
|
-
|
|
414
|
-
| "For all"
|
|
415
|
-
| "There exists"
|
|
416
|
-
| "implies" / "then"
|
|
417
|
-
| "and"
|
|
418
|
-
| "or"
|
|
419
|
-
| "not"
|
|
420
|
-
| "is in" / "member of" | `∈`
|
|
421
|
-
| "must be" / "is"
|
|
422
|
-
| "increment"
|
|
423
|
-
| "always"
|
|
405
|
+
| Phrase | Symbol |
|
|
406
|
+
|--------|--------|
|
|
407
|
+
| "For all" | `∀` |
|
|
408
|
+
| "There exists" | `∃` |
|
|
409
|
+
| "implies" / "then" | `⇒` |
|
|
410
|
+
| "and" | `∧` |
|
|
411
|
+
| "or" | `∨` |
|
|
412
|
+
| "not" | `¬` |
|
|
413
|
+
| "is in" / "member of" | `∈` |
|
|
414
|
+
| "must be" / "is" | `:` or `=` |
|
|
415
|
+
| "increment" | `++` |
|
|
416
|
+
| "always" | `∀` |
|
|
424
417
|
|
|
425
418
|
---
|
|
426
419
|
|
|
@@ -437,13 +430,11 @@ performance_model: "O(n*m) where n=files, m=avg file size"
|
|
|
437
430
|
### Translator Strategy
|
|
438
431
|
|
|
439
432
|
**Symbols → Natural Language**:
|
|
440
|
-
|
|
441
433
|
1. Pattern match symbol sequences
|
|
442
434
|
2. Apply translation rules
|
|
443
435
|
3. Generate readable English
|
|
444
436
|
|
|
445
437
|
**Natural Language → Symbols**:
|
|
446
|
-
|
|
447
438
|
1. Parse English text
|
|
448
439
|
2. Identify patterns (dependencies, invariants, etc.)
|
|
449
440
|
3. Generate symbolic representation
|
|
@@ -462,19 +453,16 @@ performance_model: "O(n*m) where n=files, m=avg file size"
|
|
|
462
453
|
### Domain-Specific Symbols
|
|
463
454
|
|
|
464
455
|
**Web/API**:
|
|
465
|
-
|
|
466
456
|
- `🌐` - HTTP/network operations
|
|
467
457
|
- `📡` - API endpoints
|
|
468
458
|
- `🔑` - Authentication
|
|
469
459
|
|
|
470
460
|
**Database**:
|
|
471
|
-
|
|
472
461
|
- `💾` - Database operations
|
|
473
462
|
- `🔍` - Queries
|
|
474
463
|
- `📝` - Transactions
|
|
475
464
|
|
|
476
465
|
**Concurrency**:
|
|
477
|
-
|
|
478
466
|
- `⚛️` - Atomic operations
|
|
479
467
|
- `🔄` - Concurrent execution
|
|
480
468
|
- `🔐` - Locks/mutexes
|
|
@@ -482,13 +470,11 @@ performance_model: "O(n*m) where n=files, m=avg file size"
|
|
|
482
470
|
### Extended Notation
|
|
483
471
|
|
|
484
472
|
**Temporal Logic**:
|
|
485
|
-
|
|
486
473
|
- `◇` - Eventually
|
|
487
474
|
- `□` - Always
|
|
488
475
|
- `○` - Next
|
|
489
476
|
|
|
490
477
|
**Probability**:
|
|
491
|
-
|
|
492
478
|
- `ℙ` - Probability
|
|
493
479
|
- `𝔼` - Expected value
|
|
494
480
|
- `~` - Distributed as
|
|
@@ -532,10 +518,9 @@ performance_model: "O(n*m) where n=files, m=avg file size"
|
|
|
532
518
|
---
|
|
533
519
|
|
|
534
520
|
**Next Steps**:
|
|
535
|
-
|
|
536
521
|
1. Build symbol parser
|
|
537
522
|
2. Build bidirectional translator
|
|
538
|
-
3. Integrate with
|
|
523
|
+
3. Integrate with VooDocs
|
|
539
524
|
4. Test on real code
|
|
540
525
|
5. Iterate based on usage
|
|
541
526
|
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
🎯{demonstrate-value,validate-design}
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# VooDocs → DarkArts Transformation Examples
|
|
10
10
|
|
|
11
|
-
Real examples from the vooodooo-magic codebase showing the transformation from verbose
|
|
11
|
+
Real examples from the vooodooo-magic codebase showing the transformation from verbose VooDocs annotations to compact DarkArts symbols.
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
## Example 1: validation.py
|
|
16
16
|
|
|
17
|
-
### Original
|
|
17
|
+
### Original VooDocs (21 lines, 625 chars)
|
|
18
18
|
|
|
19
19
|
```python
|
|
20
20
|
"""@voodocs
|
|
@@ -59,7 +59,7 @@ performance_model: "O(1) for all validations - regex matching is fast for short
|
|
|
59
59
|
|
|
60
60
|
## Example 2: ui.py
|
|
61
61
|
|
|
62
|
-
### Original
|
|
62
|
+
### Original VooDocs (19 lines, 540 chars)
|
|
63
63
|
|
|
64
64
|
```python
|
|
65
65
|
"""@voodocs
|
|
@@ -103,16 +103,16 @@ performance_model: "O(1) for all UI operations - negligible overhead"
|
|
|
103
103
|
|
|
104
104
|
## Example 3: errors.py
|
|
105
105
|
|
|
106
|
-
### Original
|
|
106
|
+
### Original VooDocs (16 lines, 480 chars)
|
|
107
107
|
|
|
108
108
|
```python
|
|
109
109
|
"""@voodocs
|
|
110
110
|
module_purpose: "Context system specific exceptions with helpful error messages and recovery suggestions"
|
|
111
111
|
dependencies: [
|
|
112
|
-
"darkarts.exceptions: Base
|
|
112
|
+
"darkarts.exceptions: Base VooDocs exception classes"
|
|
113
113
|
]
|
|
114
114
|
assumptions: [
|
|
115
|
-
"Users may not be familiar with
|
|
115
|
+
"Users may not be familiar with VooDocs",
|
|
116
116
|
"Error messages should be actionable",
|
|
117
117
|
"Emojis improve readability (✅ ❌ 💡)"
|
|
118
118
|
]
|
|
@@ -146,7 +146,7 @@ performance_model: "O(1) - exception creation is negligible"
|
|
|
146
146
|
|
|
147
147
|
## Example 4: annotations/parser.py
|
|
148
148
|
|
|
149
|
-
### Original
|
|
149
|
+
### Original VooDocs (24 lines, 780 chars)
|
|
150
150
|
|
|
151
151
|
```python
|
|
152
152
|
"""@voodocs
|
|
@@ -194,7 +194,7 @@ performance_model: "O(n*m/c) where n=files with annotations, m=average file size
|
|
|
194
194
|
|
|
195
195
|
## Example 5: context/commands.py
|
|
196
196
|
|
|
197
|
-
### Original
|
|
197
|
+
### Original VooDocs (21 lines, 650 chars)
|
|
198
198
|
|
|
199
199
|
```python
|
|
200
200
|
"""@voodocs
|
|
@@ -243,13 +243,13 @@ performance_model: "O(n) where n=number of source files for scanning operations"
|
|
|
243
243
|
|
|
244
244
|
## Example 6: Complex Function Annotation
|
|
245
245
|
|
|
246
|
-
### Original
|
|
246
|
+
### Original VooDocs (18 lines, 520 chars)
|
|
247
247
|
|
|
248
248
|
```python
|
|
249
249
|
def validate_project_name(name: str) -> str:
|
|
250
250
|
"""
|
|
251
251
|
Validate and normalize project name.
|
|
252
|
-
|
|
252
|
+
|
|
253
253
|
@voodocs
|
|
254
254
|
preconditions: [
|
|
255
255
|
"name is a string",
|
|
@@ -285,7 +285,7 @@ def validate_project_name(name: str) -> str:
|
|
|
285
285
|
|
|
286
286
|
## Example 7: State Machine
|
|
287
287
|
|
|
288
|
-
### Original
|
|
288
|
+
### Original VooDocs (25 lines, 680 chars)
|
|
289
289
|
|
|
290
290
|
```python
|
|
291
291
|
"""@voodocs
|
|
@@ -332,7 +332,7 @@ transitions{uninit→init:cmd, init→valid:cmd, valid→gen:cmd}
|
|
|
332
332
|
|
|
333
333
|
## Example 8: Performance-Critical Module
|
|
334
334
|
|
|
335
|
-
### Original
|
|
335
|
+
### Original VooDocs (22 lines, 720 chars)
|
|
336
336
|
|
|
337
337
|
```python
|
|
338
338
|
"""@voodocs
|
|
@@ -380,17 +380,17 @@ performance_model: {
|
|
|
380
380
|
|
|
381
381
|
## Summary Statistics
|
|
382
382
|
|
|
383
|
-
| Example
|
|
384
|
-
|
|
385
|
-
| validation.py | 625 chars
|
|
386
|
-
| ui.py
|
|
387
|
-
| errors.py
|
|
388
|
-
| parser.py
|
|
389
|
-
| commands.py
|
|
390
|
-
| Function
|
|
391
|
-
| State Machine | 680 chars
|
|
392
|
-
| Cache
|
|
393
|
-
| **Average**
|
|
383
|
+
| Example | VooDocs | DarkArts | Compression | Line Reduction |
|
|
384
|
+
|---------|---------|----------|-------------|----------------|
|
|
385
|
+
| validation.py | 625 chars | 180 chars | 71% | 67% |
|
|
386
|
+
| ui.py | 540 chars | 165 chars | 69% | 63% |
|
|
387
|
+
| errors.py | 480 chars | 155 chars | 68% | 56% |
|
|
388
|
+
| parser.py | 780 chars | 210 chars | 73% | 71% |
|
|
389
|
+
| commands.py | 650 chars | 195 chars | 70% | 67% |
|
|
390
|
+
| Function | 520 chars | 140 chars | 73% | 67% |
|
|
391
|
+
| State Machine | 680 chars | 185 chars | 73% | 68% |
|
|
392
|
+
| Cache | 720 chars | 175 chars | 76% | 68% |
|
|
393
|
+
| **Average** | **624 chars** | **176 chars** | **72%** | **66%** |
|
|
394
394
|
|
|
395
395
|
---
|
|
396
396
|
|
|
@@ -398,11 +398,11 @@ performance_model: {
|
|
|
398
398
|
|
|
399
399
|
### Compression Ratio
|
|
400
400
|
|
|
401
|
-
**Average compression: 72%** - DarkArts uses less than 1/3 the characters of
|
|
401
|
+
**Average compression: 72%** - DarkArts uses less than 1/3 the characters of VooDocs
|
|
402
402
|
|
|
403
403
|
### Line Count Reduction
|
|
404
404
|
|
|
405
|
-
**Average reduction: 66%** - DarkArts uses 1/3 the lines of
|
|
405
|
+
**Average reduction: 66%** - DarkArts uses 1/3 the lines of VooDocs
|
|
406
406
|
|
|
407
407
|
### Information Density
|
|
408
408
|
|
|
@@ -423,7 +423,6 @@ performance_model: {
|
|
|
423
423
|
### Example: validation.py
|
|
424
424
|
|
|
425
425
|
**Symbolic**:
|
|
426
|
-
|
|
427
426
|
```python
|
|
428
427
|
"""@darkarts
|
|
429
428
|
⊢validation:ctx.comprehensive
|
|
@@ -436,7 +435,6 @@ performance_model: {
|
|
|
436
435
|
```
|
|
437
436
|
|
|
438
437
|
**Human Translation** (when requested):
|
|
439
|
-
|
|
440
438
|
```
|
|
441
439
|
Module: Input validation for context system (comprehensive)
|
|
442
440
|
|
|
@@ -473,7 +471,7 @@ Performance:
|
|
|
473
471
|
3. ⏳ Build parser for @darkarts annotations
|
|
474
472
|
4. ⏳ Build bidirectional translator
|
|
475
473
|
5. ⏳ Test on real codebase
|
|
476
|
-
6. ⏳ Integrate with
|
|
474
|
+
6. ⏳ Integrate with VooDocs
|
|
477
475
|
|
|
478
476
|
---
|
|
479
477
|
|