mrapids 0.1.31

Your OpenAPI, but executable
Documentation
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# Enterprise Commit Standards & Development Guidelines

## Commit Message Convention

### Standard Format
```
<type>(<scope>): <subject>

<body>

<footer>
```

### Commit Types

| Type     | Description             | Example                                         |
|----------|-------------------------|-------------------------------------------------|
| feat     | New feature             | feat(auth): add OAuth 2.0 support              |
| fix      | Bug fix                 | fix(parser): handle empty responses correctly   |
| perf     | Performance improvement | perf(runtime): optimize parallel execution      |
| refactor | Code refactoring        | refactor(client): extract retry logic          |
| docs     | Documentation           | docs(api): update OpenAPI examples             |
| test     | Testing                 | test(e2e): add GraphQL integration tests       |
| build    | Build system            | build(deps): upgrade tokio to 1.40             |
| ci       | CI/CD changes           | ci(github): add security scanning              |
| chore    | Maintenance             | chore(deps): update dependencies               |
| style    | Code style              | style(fmt): apply rustfmt changes              |
| revert   | Revert commit           | revert: feat(auth): add OAuth 2.0 support      |

### Scope Examples
```
feat(runtime): implement spec caching
fix(cli): correct argument parsing for parallel flag
perf(http): add connection pooling
docs(readme): add installation instructions
test(unit): add spec reader test cases
```

### Subject Rules
- Imperative mood: "add" not "added" or "adds"
- No capitalization: "add feature" not "Add feature"  
- No period: "add feature" not "add feature."
- Max 50 characters
- What, not why (why goes in body)

### Body Guidelines
```
feat(runtime): implement intelligent spec caching

- Add LRU cache with 100 spec limit
- Implement file watcher for auto-invalidation  
- Cache keys based on file hash + mtime
- Configurable TTL (default 5 minutes)

Performance impact:
- 10x faster subsequent runs
- Memory usage ~50MB for full cache
- Background cleanup every 60 seconds

Closes #123
```

### Footer Conventions
```
BREAKING CHANGE: rename execute() to run()

The execute() method has been renamed to run() for consistency
with CLI commands. Update all calls accordingly:

Before: runtime.execute(spec)
After: runtime.run(spec)

Fixes #456
Closes #789
See-also: #321
Co-authored-by: Jane Doe <jane@example.com>
Signed-off-by: John Smith <john@example.com>
```

## Commit Categories

### Feature Commits
```bash
# Simple feature
feat(auth): add API key authentication

# Complex feature with body
feat(runtime): add watch mode with hot reload

Implement file system watcher that monitors spec files
and automatically re-executes on changes.

- Debounce period: 100ms
- Supports glob patterns
- Excludes hidden files by default

Closes #234
```

### Bug Fix Commits
```bash
# Critical fix
fix(security): prevent path traversal in file loader

CVE-2024-1234: File loader allowed relative paths
that could access files outside project directory.

Security-Impact: High
Affected-Versions: < 1.2.3
Fixed-Version: 1.2.4

# Standard fix
fix(parser): handle null values in JSON response

Parser was failing when response contained null values
in optional fields. Now treats null as None.

Fixes #567
```

### Breaking Changes
```bash
feat(api)!: restructure plugin API

BREAKING CHANGE: Plugin trait methods now async

All plugin methods now return Future to support
async operations. Update plugins as follows:

Before:
  fn on_request(&self, req: Request) -> Result<()>
  
After:
  async fn on_request(&self, req: Request) -> Result<()>

Migration guide: docs/migration/v2-to-v3.md
```

### Performance Commits
```bash
perf(http): implement connection pooling

Add connection pooling to reuse TCP connections
across requests to the same host.

Benchmark results:
- Throughput: +40% (1200 → 1680 req/s)
- Latency p99: -25% (100ms → 75ms)
- Memory: +5MB for pool overhead

Configuration:
- Max connections per host: 10
- Idle timeout: 60s
- Connection TTL: 300s
```

## Advanced Commit Patterns

### Multi-scope Changes
```bash
refactor(runtime,cli): extract shared configuration

Move configuration logic from CLI into runtime module
to enable programmatic usage without CLI dependency.
```

### Dependency Updates
```bash
build(deps): update critical dependencies

Security updates:
- tokio 1.39.0 → 1.40.0 (RUSTSEC-2024-0001)
- openssl 0.10.63 → 0.10.64

Feature updates:
- reqwest 0.11 → 0.12 (HTTP/3 support)
- clap 4.4 → 4.5 (improved error messages)

BREAKING CHANGE: reqwest 0.12 requires rustls feature
```

### Revert Commits
```bash
revert: fix(parser): add timeout to requests

This reverts commit abc123def456.

The timeout implementation was causing false positives
in slow network conditions. Need to redesign with
configurable backoff strategy.

Re-opens #789
```

## Git Workflow Standards

### Branch Naming
```bash
# Feature branches
feature/add-graphql-support
feature/JIRA-1234-oauth-integration

# Bug fixes
fix/connection-pool-leak
fix/BUG-5678-null-pointer

# Refactoring
refactor/extract-http-client
refactor/TECH-910-modularize-runtime

# Releases
release/v1.2.0
release/2024-Q1

# Hotfixes
hotfix/v1.2.1
hotfix/critical-security-patch
```

### PR Title Format
```
[JIRA-1234] feat(runtime): add caching support
[BUG-5678] fix(parser): handle edge cases
[TECH-910] refactor: improve error handling
[SECURITY] fix: patch CVE-2024-1234
```

## Development Standards

### Code Review Checklist
```markdown
## Review Checklist
- [ ] Commit messages follow convention
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] CHANGELOG.md updated
- [ ] No security vulnerabilities
- [ ] Performance impact assessed
- [ ] Breaking changes documented
- [ ] Error handling comprehensive
- [ ] Logs and metrics added
```

### Pre-commit Hooks
```yaml
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/commitizen/commitizen
    hooks:
      - id: commitizen
        stages: [commit-msg]
        
  - repo: local
    hooks:
      - id: rust-linting
        name: Rust linting
        entry: cargo clippy -- -D warnings
        language: system
        files: \.rs$
        
      - id: rust-formatting
        name: Rust formatting
        entry: cargo fmt -- --check
        language: system
        files: \.rs$
        
      - id: test-runner
        name: Run tests
        entry: cargo test
        language: system
        pass_filenames: false
```

### Semantic Versioning
```
MAJOR.MINOR.PATCH

MAJOR: Breaking changes
MINOR: New features (backward compatible)
PATCH: Bug fixes (backward compatible)

Examples:
1.0.0 → 2.0.0  (BREAKING CHANGE)
1.0.0 → 1.1.0  (feat: new feature)
1.0.0 → 1.0.1  (fix: bug fix)
```

## Enterprise Integration

### JIRA Integration
```bash
# Link to JIRA tickets
feat(API-1234): implement retry mechanism

Implements exponential backoff retry for failed requests
as specified in API-1234.

JIRA: API-1234
```

### Security Commits
```bash
fix(security): patch SQL injection vulnerability

[SECURITY ADVISORY]
Severity: CRITICAL
CVE: CVE-2024-12345
CVSS: 9.8

Sanitize user input in query builder to prevent
SQL injection attacks.

Reported-by: security@example.com
Fixed-by: security-team@company.com
```

### Compliance Commits
```bash
feat(compliance): add GDPR data retention

Implement automatic data deletion after retention
period as required by GDPR Article 17.

Compliance: GDPR-ART17
Audit-Trail: AUDIT-2024-Q1-023
Reviewed-by: legal@company.com
```

## Metrics and Tracking

### Commit Metrics
Tracking:
- Commit frequency per developer
- Average commit size (lines changed)
- Time between commit and review
- Commit message quality score
- Fix commit ratio (bugs per feature)

### Automated Validation
```json
{
  "rules": {
    "header-max-length": [2, "always", 72],
    "type-enum": [2, "always", [
      "feat", "fix", "docs", "style",
      "refactor", "perf", "test", "build",
      "ci", "chore", "revert"
    ]],
    "scope-case": [2, "always", "lower-case"],
    "subject-case": [2, "always", "lower-case"],
    "subject-empty": [2, "never"],
    "subject-full-stop": [2, "never", "."],
    "body-leading-blank": [2, "always"],
    "footer-leading-blank": [2, "always"]
  }
}
```

## Commit Examples by Scenario

### Feature Development
```bash
# Initial implementation
feat(runtime): add basic spec execution

# Enhancement
feat(runtime): add parallel execution support

# Configuration
feat(runtime): make timeout configurable
```

### Bug Fixing
```bash
# Investigation
test(runtime): add failing test for issue #123

# Fix
fix(runtime): correct timeout calculation

# Verification
test(runtime): verify timeout fix
```

### Refactoring
```bash
# Preparation
test(client): add tests for current behavior

# Refactor
refactor(client): extract retry logic to middleware

# Cleanup
chore(client): remove deprecated methods
```

## Validation Tools

### commitlint Configuration
```javascript
// commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'header-max-length': [2, 'always', 72],
    'scope-enum': [2, 'always', [
      'runtime', 'cli', 'parser', 'http',
      'auth', 'cache', 'plugin', 'config'
    ]],
    'type-enum': [2, 'always', [
      'feat', 'fix', 'perf', 'refactor',
      'docs', 'test', 'build', 'ci',
      'chore', 'style', 'revert'
    ]]
  }
};
```

### Git Aliases
```bash
# ~/.gitconfig
[alias]
  # Conventional commits
  feat = "!f() { git commit -m \"feat($1): $2\"; }; f"
  fix = "!f() { git commit -m \"fix($1): $2\"; }; f"
  docs = "!f() { git commit -m \"docs($1): $2\"; }; f"
  refactor = "!f() { git commit -m \"refactor($1): $2\"; }; f"
  
  # Utilities
  last = log -1 HEAD --stat
  unstage = reset HEAD --
  visual = !gitk
  changelog = log --pretty=format:'* %s (%h)' --no-merges
```

## Quick Reference

### Common Patterns
```bash
# Feature with tests
feat(module): add new capability
test(module): add tests for new capability

# Bug fix with regression test
fix(module): resolve edge case
test(module): prevent regression of edge case

# Performance with benchmarks
perf(module): optimize algorithm
test(bench): add performance benchmarks

# Breaking change
feat(api)!: restructure public interface
BREAKING CHANGE: detailed migration instructions

# Security patch
fix(security): patch vulnerability CVE-2024-1234
```

### Commit Workflow
1. Make changes
2. Run tests: `cargo test`
3. Format code: `cargo fmt`
4. Lint code: `cargo clippy`
5. Stage changes: `git add .`
6. Commit with message: `git commit`
7. Push to branch: `git push origin feature/branch-name`

This comprehensive guide ensures consistent, traceable, and professional commit history suitable for enterprise environments with audit requirements and compliance needs.