@voodocs/cli 2.5.3 → 3.0.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/CHANGELOG.md +156 -252
- package/README.md +215 -399
- package/lib/cli/__init__.py +1 -3
- package/lib/cli/init.py +11 -13
- package/lib/darkarts/annotations/darkarts_parser.py +159 -142
- package/lib/darkarts/annotations/darkarts_parser_v2.py.bak +238 -0
- package/lib/darkarts/companion_files.py +62 -9
- package/lib/darkarts/context/ai_instructions.py +385 -571
- package/lib/darkarts/context/ai_instructions_v2.py.bak +741 -0
- package/lib/darkarts/darkarts_abbreviations.py +324 -0
- package/lib/darkarts/darkarts_parser_v3.py +486 -0
- package/lib/darkarts/darkarts_patterns.py +249 -0
- package/lib/darkarts/darkarts_symbols.py +276 -0
- package/lib/darkarts/plugins/voodocs/documentation_generator.py +31 -2
- package/lib/darkarts/validation/semantic.py +135 -18
- package/package.json +5 -4
- package/lib/cli/convert.py +0 -144
- package/lib/darkarts/voodocs_lite_dict.py +0 -216
- package/lib/darkarts/voodocs_lite_dict_v2.py +0 -198
- package/lib/darkarts/voodocs_lite_parser.py +0 -404
|
@@ -22,6 +22,11 @@ File naming convention:
|
|
|
22
22
|
import re
|
|
23
23
|
from pathlib import Path
|
|
24
24
|
from typing import Dict, List, Optional, Tuple
|
|
25
|
+
import sys
|
|
26
|
+
|
|
27
|
+
# Import expansion functionality
|
|
28
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
29
|
+
from companion_files_expansion import expand_symbol_content, expand_companion_content
|
|
25
30
|
|
|
26
31
|
|
|
27
32
|
class CompanionFileScanner:
|
|
@@ -137,9 +142,10 @@ class CompanionFileScanner:
|
|
|
137
142
|
# Extract ⊢{} notation
|
|
138
143
|
purpose_symbol = re.search(r'⊢\{([^}]+)\}', purpose_text)
|
|
139
144
|
if purpose_symbol:
|
|
140
|
-
|
|
145
|
+
# Expand abbreviations for human readability
|
|
146
|
+
sections['purpose'] = expand_symbol_content(purpose_symbol.group(1).strip())
|
|
141
147
|
else:
|
|
142
|
-
sections['purpose'] = purpose_text
|
|
148
|
+
sections['purpose'] = expand_companion_content(purpose_text)
|
|
143
149
|
|
|
144
150
|
# Extract Architecture section
|
|
145
151
|
arch_match = re.search(r'##\s+Architecture\s*\n(.*?)(?=\n##|\Z)', content, re.DOTALL)
|
|
@@ -272,28 +278,75 @@ class CompanionFileScanner:
|
|
|
272
278
|
|
|
273
279
|
template = f"""# {stem}.voodocs.md
|
|
274
280
|
|
|
281
|
+
Companion documentation for `{filename}` using DarkArts v3.0.0 mathematical notation.
|
|
282
|
+
|
|
275
283
|
## Purpose
|
|
276
|
-
⊢{{[Describe
|
|
284
|
+
⊢{{[Describe module's primary purpose - use abbreviations like 'svc', 'auth', 'db']}}
|
|
285
|
+
|
|
286
|
+
## Dependencies
|
|
287
|
+
∂{{[List external dependencies - e.g., bcrypt,jsonwebtoken,db]}}
|
|
277
288
|
|
|
278
289
|
## Architecture
|
|
279
|
-
- **Depends On**: [List dependencies]
|
|
290
|
+
- **Depends On**: [List internal module dependencies]
|
|
280
291
|
- **Depended By**: [List modules that depend on this]
|
|
281
292
|
- **Storage**: [Data storage information if applicable]
|
|
282
293
|
|
|
294
|
+
## Preconditions
|
|
295
|
+
⊳{{[Input validation - use patterns like email:email, pw≥8, id:uuid]}}
|
|
296
|
+
|
|
297
|
+
## Postconditions
|
|
298
|
+
⊲{{[Output guarantees - e.g., ret JWT tok|null]}}
|
|
299
|
+
|
|
283
300
|
## Invariants
|
|
284
|
-
⊨{{[Invariant 1:
|
|
301
|
+
⊨{{[Invariant 1: Condition that must always hold - e.g., no pw log]}}
|
|
285
302
|
⊨{{[Invariant 2: Another invariant]}}
|
|
286
303
|
|
|
304
|
+
## Side Effects
|
|
305
|
+
⊕{{[Side effects - e.g., logs auth, updates last_login]}}
|
|
306
|
+
|
|
307
|
+
## Forbidden Operations
|
|
308
|
+
⊗{{[Operations that must not happen - e.g., no pw in logs]}}
|
|
309
|
+
|
|
310
|
+
## Security
|
|
311
|
+
🔒{{[Security requirements - e.g., pw:hash, tok:enc]}}
|
|
312
|
+
|
|
313
|
+
## Complexity
|
|
314
|
+
⚡{{[Time/space complexity - e.g., O(1), O(n)]}}
|
|
315
|
+
|
|
316
|
+
## Bidirectional Relationships
|
|
317
|
+
⇄{{[Related operations - e.g., login↔logout]}}
|
|
318
|
+
|
|
319
|
+
## Logical Consequences
|
|
320
|
+
∴{{[Implications - e.g., invalid→null]}}
|
|
321
|
+
|
|
322
|
+
## Universal Quantifiers
|
|
323
|
+
∀{{[Statements that apply to all - e.g., users have unique email]}}
|
|
324
|
+
|
|
325
|
+
## Existential Quantifiers
|
|
326
|
+
∃{{[Existence requirements - e.g., admin required]}}
|
|
327
|
+
|
|
328
|
+
## Approximations
|
|
329
|
+
≈{{[Performance targets - e.g., ~50ms]}}
|
|
330
|
+
|
|
287
331
|
## Assumptions
|
|
288
|
-
|
|
332
|
+
⚠{{[Environmental assumptions - e.g., db conn established]}}
|
|
289
333
|
|
|
290
334
|
## Critical Sections
|
|
291
335
|
- `functionName()` - [Description of why this is critical]
|
|
292
336
|
|
|
293
|
-
## Security Considerations
|
|
294
|
-
⊨{{[Security-specific invariant or requirement]}}
|
|
295
|
-
|
|
296
337
|
## Notes
|
|
297
338
|
[Any additional notes, diagrams, or references]
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
**DarkArts v3.0.0 Symbols:**
|
|
343
|
+
- ⊢ Purpose | ∂ Dependencies | ⊳ Preconditions | ⊲ Postconditions
|
|
344
|
+
- ⊨ Invariants | ⊕ Side Effects | ⊗ Forbidden | 🔒 Security
|
|
345
|
+
- ⚡ Complexity | ⇄ Bidirectional | ∴ Consequences | ∀ Universal
|
|
346
|
+
- ∃ Existential | ≈ Approximation | ⚠ Assumptions
|
|
347
|
+
|
|
348
|
+
**Pattern Shortcuts:**
|
|
349
|
+
- :uuid, :email, :url, :json, :jwt, :hash, :enc
|
|
350
|
+
- ≥N, ≤N, >N, <N, [N,M], ∈{{...}}
|
|
298
351
|
"""
|
|
299
352
|
return template
|