-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpmat-quality.toml
More file actions
169 lines (154 loc) · 5.28 KB
/
pmat-quality.toml
File metadata and controls
169 lines (154 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Bashrs Quality Configuration
# EXTREME TDD with Zero Tolerance Quality Gates
# Inspired by paiml-mcp-agent-toolkit quality standards
[complexity]
# Pragmatic thresholds - parser code is inherently complex
cyclomatic_threshold = 20 # Allow complex parsing logic
cognitive_threshold = 30 # Allow complex control flow in parsers
max_nesting_depth = 6 # Parsers need deeper nesting
max_function_lines = 150 # Allow larger parsing functions
max_file_lines = 2000 # Large modules are acceptable for parsers
[entropy]
# Code duplication detection for transpiler patterns
enabled = true
min_pattern_occurrences = 12 # Detect repetitive IR conversion patterns
min_pattern_lines = 8 # Ignore trivial patterns
max_violations_to_report = 50 # Focus on significant duplication
pattern_similarity_threshold = 0.95 # High similarity for duplicates
ignore_test_files = true
ignore_generated_files = true
ignore_patterns = [
"*/target/*",
"*/node_modules/*",
"*_test.rs",
"*_tests.rs",
"*/tests/*",
"*.proptest-regressions",
"*/examples/*", # Examples may have intentional duplication
"*/rash-book/*" # Documentation examples
]
[satd]
# Focus on real technical debt, not documentation
enabled = true
zero_tolerance = false
min_severity = "high"
patterns = [
"TODO:",
"FIXME:",
"HACK:",
"XXX:",
"KLUDGE:",
"WORKAROUND:"
]
# Exclude bug fix documentation (BUG-XXX FIX is not debt)
exclude_patterns = [
"BUG-\\d+ FIX",
"BUG-\\d+:",
"Intentionally"
]
[dead_code]
# Dead code detection with transpiler-specific rules
enabled = true
ignore_test_functions = true
ignore_cfg_test = true
threshold_percentage = 0.5 # Very strict - no dead code in transpiler
[coverage]
# Coverage requirements for safety-critical transpiler
minimum_coverage = 85.0 # Current: 85.36% core, maintain this
enforce_on_new_code = true
ignore_test_files = true
target_core_modules = [
"src/parser/",
"src/ir/",
"src/emitter/",
"src/verifier/"
]
[documentation]
# Documentation requirements for transpiler correctness
minimum_doc_coverage = 75.0 # Public API must be documented
require_examples = true # All public functions need examples
require_safety_docs = true # Safety-critical code requires docs
require_panic_docs = true # Document panic conditions
# Documentation link validation configuration
[documentation.link_validation]
enabled = true
# Skip domains that require authentication or have paywalls
skip_domains = [
"doi.org", # Academic paper DOIs (paywall/auth required)
"dl.acm.org", # ACM Digital Library (paywall)
"zsh.sourceforge.io" # Zsh docs (503 errors due to sourceforge instability)
]
# Skip internal links to future/planned chapters
skip_patterns = [
"**/rash-book/src/ch*.html", # Future book chapters not yet written
"**/pkg/**" # Generated WASM package (copied from elsewhere)
]
[security]
# Security scanning for injection prevention
enabled = true
scan_dependencies = true
check_unsafe_code = true
max_unsafe_blocks = 0 # Zero unsafe code in transpiler
enforce_shell_escaping = true
check_injection_vectors = true
[performance]
# Performance requirements for transpiler
enabled = true
max_transpile_time_us = 50 # Current: 19.1µs, target <50µs
max_memory_mb = 100 # Memory budget for transpilation
track_benchmarks = true
[quality_gate]
# Overall quality gate configuration - EXTREME TDD
fail_on_any_violation = false # Use weighted scoring
aggregate_scoring = true
weights = {
complexity = 0.30, # High weight - complexity is critical
entropy = 0.10, # Moderate - some duplication acceptable
satd = 0.25, # High - zero tolerance policy
dead_code = 0.15, # Important - no unused code
coverage = 0.15, # Important - test everything
documentation = 0.05 # Lower - focus on critical APIs
}
# Grade thresholds - EXTREME QUALITY
[grades]
a_plus = 98 # Perfection
a = 95 # Excellent
a_minus = 90 # Very good
b_plus = 85 # Good
b = 80 # Acceptable
b_minus = 75 # Needs improvement
c_plus = 70 # Warning
c = 65 # Poor
d = 55 # Critical
f = 0 # Unacceptable
[verification]
# Transpiler-specific verification requirements
enabled = true
check_posix_compliance = true
check_determinism = true
check_idempotence = true
shellcheck_severity = "error"
require_shellcheck_pass = true
[mutation_testing]
# Mutation testing configuration
enabled = true
minimum_kill_rate = 0.90 # Target: ≥90% mutation kill rate
timeout_seconds = 120 # 2 minutes per mutant
smart_test_filtering = true # Only run relevant tests per mutant
target_modules = [
"parser",
"ir",
"emitter"
]
[property_testing]
# Property-based testing requirements
enabled = true
minimum_properties = 50 # Current: 52, maintain 50+
cases_per_property = 500 # 500 cases per property = 25,000+ total
timeout_per_property = 30 # 30 seconds max per property
[toyota_way]
# Toyota Production System principles
jidoka = true # Build quality in (zero defects)
hansei = true # Reflection via Five Whys
kaizen = true # Continuous improvement
genchi_genbutsu = true # Go and see (dogfooding)