sumd 0.3.45__tar.gz → 0.3.48__tar.gz

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 (59) hide show
  1. {sumd-0.3.45 → sumd-0.3.48}/.gitignore +14 -1
  2. {sumd-0.3.45 → sumd-0.3.48}/CHANGELOG.md +95 -0
  3. {sumd-0.3.45 → sumd-0.3.48}/PKG-INFO +312 -21
  4. {sumd-0.3.45 → sumd-0.3.48}/README.md +309 -20
  5. {sumd-0.3.45 → sumd-0.3.48}/pyproject.toml +6 -3
  6. {sumd-0.3.45 → sumd-0.3.48}/sumd/__init__.py +1 -1
  7. sumd-0.3.48/sumd/__main__.py +5 -0
  8. {sumd-0.3.45 → sumd-0.3.48}/sumd/cli.py +259 -3
  9. sumd-0.3.48/sumd/cqrs/__init__.py +18 -0
  10. sumd-0.3.48/sumd/cqrs/aggregates.py +220 -0
  11. sumd-0.3.48/sumd/cqrs/commands.py +265 -0
  12. sumd-0.3.48/sumd/cqrs/events.py +184 -0
  13. sumd-0.3.48/sumd/cqrs/queries.py +419 -0
  14. sumd-0.3.48/sumd/cqrs/sumd_aggregate.py +344 -0
  15. sumd-0.3.48/sumd/dsl/__init__.py +14 -0
  16. sumd-0.3.48/sumd/dsl/ast_nodes.py +54 -0
  17. sumd-0.3.48/sumd/dsl/commands.py +656 -0
  18. sumd-0.3.48/sumd/dsl/engine.py +594 -0
  19. sumd-0.3.48/sumd/dsl/lexer.py +132 -0
  20. sumd-0.3.48/sumd/dsl/nlp.py +447 -0
  21. sumd-0.3.48/sumd/dsl/parser.py +501 -0
  22. sumd-0.3.48/sumd/dsl/schema.py +351 -0
  23. sumd-0.3.48/sumd/dsl/schema_commands.py +517 -0
  24. sumd-0.3.48/sumd/dsl/shell.py +359 -0
  25. {sumd-0.3.45 → sumd-0.3.48}/sumd/extractor.py +341 -3
  26. sumd-0.3.48/sumd/mcp_server.py +714 -0
  27. {sumd-0.3.45 → sumd-0.3.48}/sumd/pipeline.py +18 -10
  28. sumd-0.3.48/sumd/prolog_engine.py +430 -0
  29. sumd-0.3.48/sumd/rules.pl +41 -0
  30. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/architecture.py +15 -0
  31. {sumd-0.3.45 → sumd-0.3.48}/sumd/validator.py +53 -1
  32. sumd-0.3.45/sumd/mcp_server.py +0 -358
  33. {sumd-0.3.45 → sumd-0.3.48}/LICENSE +0 -0
  34. {sumd-0.3.45 → sumd-0.3.48}/sumd/generator.py +0 -0
  35. {sumd-0.3.45 → sumd-0.3.48}/sumd/models.py +0 -0
  36. {sumd-0.3.45 → sumd-0.3.48}/sumd/parser.py +0 -0
  37. {sumd-0.3.45 → sumd-0.3.48}/sumd/renderer.py +0 -0
  38. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/__init__.py +0 -0
  39. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/api_stubs.py +0 -0
  40. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/base.py +0 -0
  41. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/call_graph.py +0 -0
  42. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/code_analysis.py +0 -0
  43. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/configuration.py +0 -0
  44. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/dependencies.py +0 -0
  45. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/deployment.py +0 -0
  46. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/environment.py +0 -0
  47. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/extras.py +0 -0
  48. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/interfaces.py +0 -0
  49. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/metadata.py +0 -0
  50. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/quality.py +0 -0
  51. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/refactor_analysis.py +0 -0
  52. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/source_snippets.py +0 -0
  53. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/swop.py +0 -0
  54. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/test_contracts.py +0 -0
  55. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/utils/__init__.py +0 -0
  56. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/utils/render.py +0 -0
  57. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/utils/should_render.py +0 -0
  58. {sumd-0.3.45 → sumd-0.3.48}/sumd/sections/workflows.py +0 -0
  59. {sumd-0.3.45 → sumd-0.3.48}/sumd/toon_parser.py +0 -0
@@ -1,3 +1,16 @@
1
+ .code2llm_cache/CHANGELOG_1779369542938918821_23281.pkl
2
+ .code2llm_cache/README_1779369515747267462_22533.pkl
3
+ .code2llm_cache/README_1779369542476943815_21853.pkl
4
+ .code2llm_cache/__init___1779369542477957807_771.pkl
5
+ .code2llm_cache/__init___1779369542733974491_65.pkl
6
+ .code2llm_cache/pyproject_1779369542473943784_2355.pkl
7
+ .testql
8
+ !.testql/
9
+ !.testql/autoloop-state.json
10
+ !.testql/schemas/
11
+ !.testql/schemas/llm-decision.schema.json
12
+ !.testql/reports/
13
+ !.testql/reports/llm-decision.json
1
14
  # Byte-compiled / optimized / DLL files
2
15
  .env.example
3
16
  __pycache__/
@@ -106,7 +119,7 @@ ipython_config.py
106
119
  # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
120
  # This is especially recommended for binary packages to ensure reproducibility, and is more
108
121
  # commonly ignored for libraries.
109
- #uv.lock
122
+ uv.lock
110
123
 
111
124
  # poetry
112
125
  # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
@@ -7,6 +7,98 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+ - **CQRS ES Architecture**: Implemented Command Query Responsibility Segregation with Event Sourcing
12
+ - Command and Query buses for separate read/write operations
13
+ - Event store for persistent audit trail and state reconstruction
14
+ - Aggregate roots for business logic consistency
15
+ - SUMD-specific aggregates, commands, queries, and events
16
+ - **Domain Specific Language (DSL)**: Powerful scripting and interactive shell
17
+ - Complete lexer, parser, and engine for DSL expressions
18
+ - Arithmetic, logical, comparison, and pipeline operations
19
+ - Built-in commands for file operations, SUMD operations, search, and utilities
20
+ - Interactive shell with tab completion and history
21
+ - Script execution support with error handling
22
+ - **Enhanced MCP Server**: Extended with CQRS ES and DSL capabilities
23
+ - New MCP tools: execute_command, execute_query, get_events, get_aggregate
24
+ - New MCP tools: execute_dsl, dsl_shell_info
25
+ - Full integration with CQRS ES architecture and DSL engine
26
+ - **New CLI Commands**:
27
+ - `sumd dsl` - Interactive DSL shell and command execution
28
+ - `sumd cqrs` - Execute CQRS commands on SUMD aggregates
29
+ - **Comprehensive Testing**: Full test suite for CQRS ES and DSL functionality
30
+ - Event store, command bus, query bus, and aggregate tests
31
+ - DSL parser, engine, and shell tests
32
+ - MCP server integration tests
33
+ - **Documentation**: Updated README with CQRS ES and DSL architecture details
34
+
35
+ ### Fixed
36
+ - **File filtering**: sumd now properly respects .gitignore and .sumdignore files when analyzing source files
37
+ - Added support for standard gitignore patterns including wildcards, directory patterns, and negation
38
+ - Improved file collection performance by skipping ignored files and directories
39
+
40
+ ## [0.3.48] - 2026-05-21
41
+
42
+ ### Docs
43
+ - Update README.md
44
+ - Update SUMD.md
45
+ - Update SUMR.md
46
+ - Update docs/README.md
47
+ - Update project/README.md
48
+ - Update project/context.md
49
+
50
+ ### Other
51
+ - Update .code2llm_cache/CHANGELOG_1779369542938918821_23281.pkl
52
+ - Update .code2llm_cache/README_1779369515747267462_22533.pkl
53
+ - Update .code2llm_cache/README_1779369542476943815_21853.pkl
54
+ - Update .code2llm_cache/__init___1779369542477957807_771.pkl
55
+ - Update .code2llm_cache/__init___1779369542733974491_65.pkl
56
+ - Update .code2llm_cache/pyproject_1779369542473943784_2355.pkl
57
+ - Update app.doql.less
58
+ - Update project.sh
59
+ - Update project/analysis.toon.yaml
60
+ - Update project/calls.mmd
61
+ - ... and 19 more files
62
+
63
+ ## [0.3.47] - 2026-05-21
64
+
65
+ ### Docs
66
+ - Update CHANGELOG.md
67
+ - Update README.md
68
+ - Update SPEC.md
69
+ - Update SUMD.md
70
+ - Update TODO.md
71
+ - Update docs/USAGE.md
72
+ - Update project/README.md
73
+ - Update project/context.md
74
+ - Update sumd_logic_validator/README.md
75
+
76
+ ### Test
77
+ - Update testql-scenarios/sumd-cli.testql.toon.yaml
78
+ - Update tests/test_architectural_logic.py
79
+
80
+ ### Other
81
+ - Update TODO.txt
82
+ - Update print_errors.py
83
+ - Update project.sh
84
+ - Update project/analysis.toon.yaml
85
+ - Update project/logic.logicml
86
+ - Update project/logic.pl
87
+ - Update project/map.toon.yaml
88
+ - Update sumd/__main__.py
89
+ - Update sumd/cli.py
90
+ - Update sumd/extractor.py
91
+ - ... and 19 more files
92
+
93
+ ## [0.3.46] - 2026-05-02
94
+
95
+ ### Docs
96
+ - Update README.md
97
+
98
+ ### Other
99
+ - Update .sumdignore
100
+ - Update sumd/extractor.py
101
+
10
102
  ## [0.3.45] - 2026-04-25
11
103
 
12
104
  ### Docs
@@ -561,6 +653,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
561
653
  - 88 unit tests across `test_pipeline.py`, `test_sections.py` (30), `test_extractor.py` (37)
562
654
  - `--cov-branch` added to pytest `addopts` for accurate branch+statement coverage reporting
563
655
  - pyqual gates: `coverage_min: 35`, `vallm_pass_min: 60`
656
+ - **PyPI Release**: Published to PyPI: https://pypi.org/project/sumd/0.2.0rc1/
564
657
 
565
658
  ### Fixed
566
659
  - Single `.venv`: removed dual-venv split (`.venv` vs `venv`), all tasks use `{{.VENV_PY}} = .venv/bin/python`
@@ -591,6 +684,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
591
684
 
592
685
  ### Changed
593
686
  - `generate_sumd_content` refactored to 4-line shim delegating to `RenderPipeline` (fan-out: 34→2)
687
+ - Extracted core logic into separate modular files: `sumd/extractor.py`, `sumd/renderer.py`, and `sumd/toon_parser.py`
688
+ - Replaced `sumd/generator.py` with an 18-line shim re-exporting `extractor.py` and `renderer.py`
594
689
  - `_render_code_analysis` accepts `skip_files` param to avoid duplicating call graph data
595
690
  - Parser `_VALID_MARKPACT_KINDS` whitelist extended with 6 new semantic kinds
596
691
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sumd
3
- Version: 0.3.45
3
+ Version: 0.3.48
4
4
  Summary: SUMD - Structured Unified Markdown Descriptor for AI-aware project documentation
5
5
  Project-URL: Homepage, https://github.com/tom/statement
6
6
  Project-URL: Repository, https://github.com/tom/statement
@@ -18,6 +18,7 @@ Requires-Python: >=3.10
18
18
  Requires-Dist: click>=8.3.3
19
19
  Requires-Dist: costs>=0.1.50
20
20
  Requires-Dist: goal>=2.1.190
21
+ Requires-Dist: mcp>=1.27.0
21
22
  Requires-Dist: pfix>=0.1.72
22
23
  Requires-Dist: pyyaml>=6.0.3
23
24
  Requires-Dist: toml>=0.10.2
@@ -28,6 +29,7 @@ Requires-Dist: goal>=2.1.190; extra == 'dev'
28
29
  Requires-Dist: mcp>=1.27.0; extra == 'dev'
29
30
  Requires-Dist: pfix>=0.1.72; extra == 'dev'
30
31
  Requires-Dist: pyqual>=0.1.143; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
31
33
  Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
32
34
  Requires-Dist: pytest>=9.0.3; extra == 'dev'
33
35
  Requires-Dist: ruff>=0.15.11; extra == 'dev'
@@ -38,21 +40,18 @@ Description-Content-Type: text/markdown
38
40
 
39
41
  # SUMD
40
42
 
41
-
42
43
  ## AI Cost Tracking
43
44
 
44
- ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.3.45-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
45
- ![AI Cost](https://img.shields.io/badge/AI%20Cost-$7.50-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-27.6h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
45
+ ![PyPI](https://img.shields.io/badge/pypi-costs-blue) ![Version](https://img.shields.io/badge/version-0.3.48-blue) ![Python](https://img.shields.io/badge/python-3.9+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
46
+ ![AI Cost](https://img.shields.io/badge/AI%20Cost-$3.41-orange) ![Human Time](https://img.shields.io/badge/Human%20Time-34.0h-blue) ![Model](https://img.shields.io/badge/Model-openrouter%2Fqwen%2Fqwen3--coder--next-lightgrey)
46
47
 
47
- - 🤖 **LLM usage:** $7.5000 (75 commits)
48
- - 👤 **Human dev:** ~$2765 (27.6h @ $100/h, 30min dedup)
48
+ - 🤖 **LLM usage:** $3.4095 (87 commits)
49
+ - 👤 **Human dev:** ~$3400 (34.0h @ $100/h, 30min dedup)
49
50
 
50
- Generated on 2026-04-25 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
51
+ Generated on 2026-05-21 using [openrouter/qwen/qwen3-coder-next](https://openrouter.ai/qwen/qwen3-coder-next)
51
52
 
52
53
  ---
53
54
 
54
- ![Version](https://img.shields.io/badge/version-0.3.45-blue) ![Python](https://img.shields.io/badge/python-3.10+-blue) ![License](https://img.shields.io/badge/license-Apache--2.0-green)
55
-
56
55
  **SUMD** (Structured Unified Markdown Descriptor) is a semantic project descriptor format in Markdown.
57
56
  It defines intent, structure, execution entry points, and the mental model of a system for both humans and LLMs.
58
57
 
@@ -83,7 +82,7 @@ Think of it as a machine-readable README: a file an AI agent can parse, reason o
83
82
 
84
83
  ```bash
85
84
  pip install sumd # stable
86
- pip install sumd==0.2.0rc1 # latest release candidate
85
+ pip install sumd==0.3.45 # specific version
87
86
  ```
88
87
 
89
88
  ## Developer Workflow
@@ -102,8 +101,6 @@ task pyqual
102
101
  task publish
103
102
  ```
104
103
 
105
-
106
-
107
104
  ## Usage
108
105
 
109
106
  ### CLI Commands
@@ -153,6 +150,17 @@ sumd scaffold ./my-project --force # overwrite existing files
153
150
  sumd analyze ./my-project # run all tools
154
151
  sumd analyze ./my-project --tools code2llm # only code2llm
155
152
  sumd analyze ./my-project --force # reinstall tools
153
+
154
+ # DSL (Domain Specific Language) operations
155
+ sumd dsl # start interactive DSL shell
156
+ sumd dsl -c "scan('.')" # execute single DSL command
157
+ sumd dsl -s script.dsl # execute DSL script file
158
+ sumd dsl -d /path/to/project # set working directory
159
+
160
+ # CQRS ES (Command Query) operations
161
+ sumd cqrs create_sumd_document ./SUMD.md --data '{"project_name":"MyProject"}'
162
+ sumd cqrs add_section ./SUMD.md --data '{"section_name":"Architecture","content":"..."}'
163
+ sumd cqrs validate_sumd_document ./SUMD.md
156
164
  ```
157
165
 
158
166
  ### Section Profiles
@@ -186,6 +194,174 @@ if not result["ok"]:
186
194
  print(issue)
187
195
  ```
188
196
 
197
+ ## File Filtering
198
+
199
+ SUMD respects standard ignore files to exclude unwanted files and directories from analysis:
200
+
201
+ ### Supported Ignore Files
202
+
203
+ - **`.gitignore`** - Standard Git ignore patterns (automatically detected)
204
+ - **`.sumdignore`** - SUMD-specific ignore patterns (overrides .gitignore)
205
+
206
+ ### Pattern Syntax
207
+
208
+ Supports full gitignore pattern syntax:
209
+
210
+ ```gitignore
211
+ # File patterns
212
+ *.log
213
+ *.tmp
214
+ coverage.xml
215
+
216
+ # Directory patterns
217
+ temp/
218
+ build/
219
+ __pycache__/
220
+
221
+ # Negation (include despite other patterns)
222
+ !important.log
223
+ !src/temp/
224
+ ```
225
+
226
+ ### Behavior
227
+
228
+ - Patterns are read from both `.gitignore` and `.sumdignore` files
229
+ - `.sumdignore` patterns take precedence over `.gitignore` patterns
230
+ - Improves performance by skipping ignored files during analysis
231
+ - Works with all `sumd scan`, `sumd map`, and `sumd analyze` commands
232
+
233
+ ## CQRS ES Architecture
234
+
235
+ SUMD now implements **Command Query Responsibility Segregation (CQRS)** with **Event Sourcing (ES)** for robust state management and audit trails:
236
+
237
+ ### Architecture Components
238
+
239
+ - **Commands**: Write operations that modify system state
240
+ - **Queries**: Read operations that retrieve system state
241
+ - **Events**: Immutable records of state changes
242
+ - **Aggregates**: Consistency boundaries for business logic
243
+ - **Event Store**: Persistent storage for event history
244
+
245
+ ### Benefits
246
+
247
+ - **Audit Trail**: Complete history of all changes
248
+ - **Temporal Queries**: Reconstruct state at any point in time
249
+ - **Scalability**: Separate read/write models
250
+ - **Resilience**: Event replay for error recovery
251
+
252
+ ### CLI Integration
253
+
254
+ ```bash
255
+ # Execute CQRS commands
256
+ sumd cqrs create_sumd_document ./SUMD.md --data '{"project_name":"MyProject"}'
257
+ sumd cqrs add_section ./SUMD.md --data '{"section_name":"Architecture","content":"..."}'
258
+
259
+ # Query system state
260
+ sumd cqrs get_aggregate ./SUMD.md
261
+ sumd cqrs get_events ./SUMD.md
262
+ ```
263
+
264
+ ### MCP Integration
265
+
266
+ The MCP server exposes CQRS ES tools:
267
+
268
+ - `execute_command` - Execute write commands
269
+ - `execute_query` - Execute read queries
270
+ - `get_events` - Retrieve event history
271
+ - `get_aggregate` - Get current aggregate state
272
+
273
+ ## DSL (Domain Specific Language)
274
+
275
+ SUMD provides a powerful DSL for interactive operations and scripting:
276
+
277
+ ### DSL Shell
278
+
279
+ ```bash
280
+ # Start interactive shell
281
+ sumd dsl
282
+
283
+ # Execute single command
284
+ sumd dsl -c "scan('.') | validate('.')"
285
+
286
+ # Execute script file
287
+ sumd dsl -s script.dsl
288
+ ```
289
+
290
+ ### DSL Features
291
+
292
+ - **Arithmetic**: `1 + 2 * 3`
293
+ - **Logic**: `x and y or not z`
294
+ - **Comparison**: `x == 42`, `name contains "test"`
295
+ - **Variables**: `x = 42`, `result = scan('.')`
296
+ - **Functions**: `len("hello")`, `exists("file.txt")`
297
+ - **Pipelines**: `scan('.') | validate('.') | export("json")`
298
+ - **File Operations**: `cat("file.txt")`, `ls("*.md")`, `edit("file.txt", "content")`
299
+
300
+ ### Built-in Commands
301
+
302
+ #### File Operations
303
+ - `cat` - Display file contents
304
+ - `ls` - List directory contents
305
+ - `edit` - Edit file content
306
+ - `mkdir` - Create directory
307
+ - `rm` - Remove file/directory
308
+
309
+ #### SUMD Operations
310
+ - `sumd_scan` - Scan and generate SUMD
311
+ - `sumd_map` - Generate project map
312
+ - `sumd_validate` - Validate SUMD document
313
+ - `sumd_info` - Show document info
314
+
315
+ #### Search Operations
316
+ - `find` - Find files matching pattern
317
+ - `grep` - Search text in files
318
+
319
+ #### Utility Operations
320
+ - `echo` - Display message
321
+ - `pwd` - Print working directory
322
+ - `cd` - Change directory
323
+ - `help` - Show help
324
+
325
+ #### Variables
326
+ - `set` - Set variable
327
+ - `get` - Get variable value
328
+ - `unset` - Remove variable
329
+ - `vars` - List all variables
330
+
331
+ ### DSL Examples
332
+
333
+ ```bash
334
+ # Basic arithmetic
335
+ result = 1 + 2 * 3
336
+
337
+ # File operations
338
+ if exists("SUMD.md"):
339
+ content = cat("SUMD.md")
340
+ print(len(content))
341
+
342
+ # SUMD workflow
343
+ scan(".") | validate(".") | export("json")
344
+
345
+ # Variable usage
346
+ project = "my-project"
347
+ files = ls("*.py")
348
+ print(f"Found {len(files)} Python files in {project}")
349
+
350
+ # Conditional logic
351
+ if exists("pyproject.toml"):
352
+ scan(".")
353
+ validate("SUMD.md")
354
+ else:
355
+ print("No Python project found")
356
+ ```
357
+
358
+ ### MCP DSL Integration
359
+
360
+ The MCP server provides DSL tools:
361
+
362
+ - `execute_dsl` - Execute DSL expressions
363
+ - `dsl_shell_info` - Get shell capabilities
364
+
189
365
  ## What is Embedded in SUMD.md?
190
366
 
191
367
  SUMD auto-embeds the following sources from a project (when present):
@@ -225,31 +401,38 @@ SUMD auto-embeds the following sources from a project (when present):
225
401
 
226
402
  ## Ecosystem Architecture
227
403
 
228
- SUMD is part of a three-layer system:
404
+ SUMD is part of a four-layer system:
229
405
 
230
406
  ```
231
407
  ┌─────────────────────────────────────────────────────────────┐
232
- │ SUMD (opis)
233
- │ Structured Unified Markdown Descriptor
234
- │ Project description, intent, architecture
408
+ │ SUMD (opis)
409
+ │ Structured Unified Markdown Descriptor
410
+ │ Project description, intent, architecture
235
411
  └─────────────────────────────────────────────────────────────┘
236
412
 
237
413
  ┌─────────────────────────────────────────────────────────────┐
238
- │ DOQL (wykonanie)
239
- │ Declarative Object Query Language
240
- │ Data manipulation and execution
414
+ │ DOQL (wykonanie)
415
+ │ Declarative Object Query Language
416
+ │ Data manipulation and execution
241
417
  └─────────────────────────────────────────────────────────────┘
242
418
 
243
419
  ┌─────────────────────────────────────────────────────────────┐
244
- │ Taskfile (runtime)
245
- │ Task runner and workflow execution
420
+ │ Taskfile (runtime)
421
+ │ Task runner and workflow execution
246
422
  │ Automation and orchestration │
423
+ └─────────────────────────────────────────────────────────────┘
424
+
425
+ ┌─────────────────────────────────────────────────────────────┐
426
+ │ testql (weryfikacja) │
427
+ │ Test generation and execution │
428
+ │ API, GUI, hardware, shell, WebSocket tests │
247
429
  └─────────────────────────────────────────────────────────────┘
248
430
  ```
249
431
 
250
432
  - **SUMD → opis (description)**: Defines what the system is and how it should work
251
433
  - **DOQL → wykonanie (execution)**: Provides the language to manipulate and execute operations
252
434
  - **Taskfile → runtime**: Manages the actual execution of workflows and tasks
435
+ - **testql → weryfikacja (verification)**: Generates and executes tests across multiple domains
253
436
 
254
437
  ## DOQL Integration
255
438
 
@@ -294,6 +477,114 @@ Flow:
294
477
 
295
478
  This gives you a single command that keeps both documentation and generated code in sync, without unnecessary rebuilds.
296
479
 
480
+ ## testql Integration
481
+
482
+ testql is the testing framework in the SUMD ecosystem, providing automated test generation and execution for APIs, GUI, hardware, shell commands, and WebSockets.
483
+
484
+ ### testql Features
485
+
486
+ #### Test Generation
487
+
488
+ testql automatically generates test scenarios from various sources:
489
+
490
+ - **API Tests**: From OpenAPI/Swagger specifications, FastAPI/Flask/Django routes, Express.js endpoints
491
+ - **GUI Tests**: From Playwright/Selenium configurations
492
+ - **Hardware Tests**: From hardware peripheral configurations
493
+ - **Shell Tests**: From CLI command definitions
494
+ - **WebSocket Tests**: From WebSocket endpoint definitions
495
+ - **Pytest Conversion**: Converts existing Python pytest tests to testql format
496
+ - **OQL/CQL Scenarios**: Converts OQL/CQL scenario files to testql format
497
+
498
+ #### Test Execution
499
+
500
+ testql executes test scenarios written in `.testql.toon.yaml` format with support for:
501
+
502
+ - **API Commands**: `API[method, endpoint, expected_status]` with retry logic
503
+ - **Assertions**: `ASSERT_STATUS`, `ASSERT_OK`, `ASSERT_CONTAINS`, `ASSERT_JSON`, `ASSERT_HEADERS`, `ASSERT_SCHEMA`, `ASSERT_COOKIES`
504
+ - **GUI Commands**: `GUI_START`, `GUI_CLICK`, `GUI_INPUT`, `GUI_ASSERT_VISIBLE`, `GUI_ASSERT_TEXT`, `GUI_CAPTURE`, `GUI_STOP`
505
+ - **Hardware Commands**: `ENCODER_ON`, `ENCODER_OFF`, `ENCODER_SCROLL`, `ENCODER_CLICK`, `ENCODER_FOCUS`, `ENCODER_STATUS`
506
+ - **Shell Commands**: `SHELL`, `EXEC`, `RUN` with exit code and output assertions
507
+ - **WebSocket Commands**: `WS_CONNECT`, `WS_SEND`, `WS_RECEIVE`, `WS_ASSERT_MSG`, `WS_CLOSE`
508
+ - **Flow Control**: `WAIT`, `WAIT_FOR`, `LOG`, `PRINT`, `INCLUDE`
509
+
510
+ #### Endpoint Detection
511
+
512
+ testql includes automatic endpoint detection from:
513
+
514
+ - **Docker Compose**: Service port mappings and configurations
515
+ - **Kubernetes Configs**: Service and deployment configurations
516
+ - **.env Files**: Environment variables with URL, HOST, PORT patterns
517
+ - **config.py Files**: Python configuration files with host/port/url assignments
518
+ - **Framework Detectors**: FastAPI, Flask, Django, Express.js route discovery
519
+ - **Specification Files**: OpenAPI/Swagger, GraphQL schemas
520
+
521
+ #### Configuration
522
+
523
+ testql scenarios support configuration via `CONFIG` block:
524
+
525
+ ```yaml
526
+ CONFIG[4]{key, value}:
527
+ base_url, ${api_url:-http://localhost:8100}
528
+ timeout_ms, 10000
529
+ retry_count, 3
530
+ retry_backoff_ms, 100
531
+ ```
532
+
533
+ #### Reporting
534
+
535
+ testql generates HTML reports from test results:
536
+
537
+ ```bash
538
+ # Generate report from pytest JSON output
539
+ pytest --json-report --json-report-file=test-results.json
540
+ testql report test-results.json -o report.html
541
+
542
+ # Generate example report
543
+ testql report --example -o report.html
544
+ ```
545
+
546
+ #### Integration with SUMD
547
+
548
+ SUMD automatically embeds testql scenarios from `testql-scenarios/` directory into SUMD.md:
549
+
550
+ ```yaml markpact:testql path=testql-scenarios/generated-cli-tests.testql.toon.yaml
551
+ # SCENARIO: CLI Command Tests
552
+ # TYPE: cli
553
+ # GENERATED: true
554
+
555
+ CONFIG[2]{key, value}:
556
+ cli_command, python -msumd
557
+ timeout_ms, 10000
558
+
559
+ LOG[3]{message}:
560
+ "Test CLI help command"
561
+ "Test CLI version command"
562
+ "Test CLI main workflow"
563
+ ```
564
+
565
+ #### Workflow Integration
566
+
567
+ testql is integrated into SUMD workflows:
568
+
569
+ ```bash
570
+ # Run pytest with testql report generation
571
+ task test:report
572
+
573
+ # Generate testql scenario scaffolds from OpenAPI
574
+ sumd scaffold ./my-project --type smoke
575
+ sumd scaffold ./my-project --type crud
576
+ ```
577
+
578
+ ## Dokumentacja
579
+
580
+ - **[CHANGELOG.md](./CHANGELOG.md)** — Historia zmian i wydania
581
+ - **[TODO.md](./TODO.md)** — Aktualne zadania i planowane funkcje
582
+ - **[docs/USAGE.md](./docs/USAGE.md)** — Szczegółowa dokumentacja użycia
583
+ - **[docs/TESTQL_AUTOLOOP_ONBOARDING.md](./docs/TESTQL_AUTOLOOP_ONBOARDING.md)** — Onboarding dla TestQL + MCP + aider loops
584
+ - **[SPEC.md](./SPEC.md)** — Specyfikacja formatu SUMD
585
+ - **[SUMD.md](./SUMD.md)** — Dokumentacja projektu sumd (wygenerowana)
586
+ - **[SUMR.md](./SUMR.md)** — Raport refaktoryzacji (wygenerowany)
587
+
297
588
  ## License
298
589
 
299
590
  Licensed under Apache-2.0.