Commit 919649e
feat: add SQLite storage as single source of truth (#321)
* feat: add SQLite storage infrastructure with schema, populator, and security (#313)
Add in-memory SQLite database as foundation for replacing intermediate
data structures (CombinedRawDataset, CombinedIndexedDataset). Includes
schema with 13 tables, FK indexes, authorizer for security, insert API,
and DatabasePopulator that converts RawDataset to SQL rows.
Phase 1+2 of the migration plan — pure addition with opt-in DB param
on CombinedRawDatasetsGenerator.
* feat: add CHECK constraints for all enum-backed columns
Add SQL CHECK constraints to enforce valid values at the database level
for significance, lifecycle_state, implementation, category,
verification_type, test status, variant, and element_kind columns.
* feat: add EL-to-SQL compiler and SQL-based filter processor (#313)
Add ELToSQLCompiler that translates Lark expression language parse trees
into SQL WHERE clauses with parameterized queries. Add DatabaseFilterProcessor
that replicates the recursive DAG-walk filter logic using SQL DELETEs
with cascade cleanup of orphaned SVCs and MVRs.
* feat: add service layer, repository, and pipeline for SQLite-backed commands (#313)
Phase 4 of the SQLite storage migration: replace CombinedIndexedDataset
with direct database queries through RequirementsRepository and service
layer (StatisticsService, ExportService).
- Add RequirementsRepository as the data access layer wrapping RequirementsDatabase
- Add StatisticsService with TestStats/RequirementStatus/TotalStats dataclasses
- Add ExportService for JSON export with --req-ids/--svc-ids filtering
- Add build_database() pipeline helper in storage/pipeline.py
- Rewrite status, export, and report commands to use DB pipeline
- Migrate LifecycleValidator from CombinedIndexedDataset to RequirementsRepository
- Migrate GroupByOrganizor from CombinedIndexedDataset to RequirementsRepository
- Fix multi-pass DB population to satisfy FK constraints across URNs
- Update all affected tests for new interfaces
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
* refactor: clean up dead code, improve resource management, and align file names (#313)
- Make build_database() a context manager; update all commands to use `with` blocks
- Replace Utils dict helpers with collections.defaultdict in parsing graph
- Delete unused CombinedIndexedDataset, statistics_container, statistics_generator,
indexed_dataset_filter_processor, and 5 dead Utils methods
- Remove empty RequirementsELTransformer/SVCsELTransformer subclasses
- Rename files to match their primary class names (el_compiler → el_to_sql_compiler,
filter_processor → database_filter_processor, generic_el → generic_el_transformer)
- Add unit tests for RequirementsRepository, StatisticsService, ExportService, pipeline
- Update CLAUDE.md architecture docs to reflect SQLite pipeline
Signed-off-by: jimisola <jimisola@jimisola.com>
* refactor: collapse status table test columns into single formatted cells (#313)
Replace 13-column status table (5 sub-columns per test group) with 5
columns using compact inline formatting. Each test cell shows
positionally-aligned counts (T P F S M) with colored numbers and dim
dashes for zeros. Remove merged header complexity.
- Add _format_test_cell() for single-cell test stats rendering
- Use orange for missing, yellow for skipped (was both red)
- Empty cell for not_applicable (was ambiguous dash)
- Color-coded legend
- Delete _build_merged_headers, _parse_col_widths,
_replace_header_with_merged, _format_cell
Signed-off-by: jimisola <jimisola@jimisola.com>
* style: apply black formatting
Signed-off-by: jimisola <jimisola@jimisola.com>
* fix: correct missing test/MVR totals and handle dangling FK references (#313)
Fix two bugs:
- TotalStats.missing_automated_tests and missing_manual_tests were
never aggregated from per-requirement stats, always reporting 0.
Now accumulated from each requirement's TestStats after calculation.
- Dangling FK references (e.g. SVC referencing non-existent requirement)
crashed with IntegrityError. Now caught gracefully with warnings,
allowing semantic validation to report all errors.
Signed-off-by: jimisola <jimisola@jimisola.com>
* chore: remove stale baselines directory
Regression testing verified directly against main. Baselines were
from pre-Pydantic-v2 and are no longer needed.
Signed-off-by: jimisola <jimisola@jimisola.com>
* style: apply black formatting
Signed-off-by: jimisola <jimisola@jimisola.com>
* fix: remove unused variable in test_database_filter_processor
Signed-off-by: jimisola <jimisola@jimisola.com>
* refactor: reduce cyclomatic complexity in service and populator methods
Extract helper methods from ExportService.to_export_dict (C901: 21→<10),
StatisticsService._calculate (C901: 17→<10), and
DatabasePopulator.populate_from_raw_dataset (C901: 14→<10) to satisfy
flake8 C901 complexity threshold.
Signed-off-by: jimisola <jimisola@jimisola.com>
* fix: restore Utils import removed during dead-code cleanup
The top-level `from reqstool.common.utils import Utils` was incorrectly
removed in the dead-code cleanup commit, causing NameError when running
as an installed package (the conditional import only covers direct exec).
Signed-off-by: jimisola <jimisola@jimisola.com>
* feat: migrate commands to SQLite pipeline and fix missing test/MVR counts (#313)
Replace CRD→CID pipeline in all three commands (status, export, report)
with direct DB queries via RequirementsRepository and service layer.
Fix StatisticsService undercounting missing automated tests and MVRs
by aggregating from per-requirement stats instead of global annotation scan.
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
* chore: remove stale TestStatisticsItem pytest exclusion
Signed-off-by: jimisola <jimisola@users.noreply.github.com>
---------
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: jimisola <jimisola@jimisola.com>
Signed-off-by: jimisola <jimisola@users.noreply.github.com>
Co-authored-by: Jimisola Laursen <jimisola.laursen@resurs.se>1 parent 32f8479 commit 919649e
167 files changed
Lines changed: 4497 additions & 13136 deletions
File tree
- baselines
- src/reqstool
- commands
- generate_json
- report
- criterias
- templates
- asciidoc
- markdown
- status
- common
- validators
- expression_languages
- model_generators
- models
- resources/schemas/v1
- services
- storage
- tests/unit/reqstool
- commands
- report/criterias
- status
- common
- validators
- expression_languages
- filters
- model_generators
- services
- storage
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
65 | | - | |
66 | | - | |
| 76 | + | |
67 | 77 | | |
68 | 78 | | |
69 | 79 | | |
70 | | - | |
71 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | | - | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
82 | | - | |
| 94 | + | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
140 | | - | |
| 152 | + | |
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
This file was deleted.
0 commit comments