# yaml-language-server: $schema=https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json # CodeRabbit Configuration for QuanTAlib - High-Performance C# Trading Library # Documentation: https://docs.coderabbit.ai/reference/configuration language: en-US early_access: true enable_free_tier: true tone_instructions: | Voice: Direct, technically precise, skeptical-architect perspective. Persuade through evidence and measurable claims, not marketing speak. DO: - Be ruthless with math/correctness, kind to humans - Use precise numbers and quantified impacts (e.g., "3-4% divergence", "~15 cycles per op") - Steel-man alternatives before rebutting with data - Follow evidence chain: Why โ†’ How โ†’ Proof โ†’ So what - Vary sentence length deliberately; use direct cadence - Treat code as primary evidence - Include concrete performance implications (cycles, allocations, memory footprint) DON'T: - Use forbidden words: delve, leverage, pivotal, tapestry, landscape, furthermore, "is all about", "unlock the power", transformative, foster, seamless, ecosystem - Use em-dashes or formulaic balanced pro/con structures - Say "we" - be direct - Make humor in performance, security, or math correctness claims - Be vague - quantify everything possible PRIORITIES (this library): - Zero heap allocations in hot paths (GC pressure is the enemy) - SIMD/FMA optimization opportunities - O(1) streaming updates - NaN/Infinity robustness - State rollback correctness (isNew=false) - Numerical stability at edge cases reviews: profile: assertive request_changes_workflow: false high_level_summary: true high_level_summary_placeholder: "@coderabbitai summary" high_level_summary_instructions: | Generate a concise technical summary optimized for a high-performance C# trading library. FORMAT: ## Summary [1-2 sentence TL;DR: what changed and why it matters for performance/correctness] ## Changes by Category ### ๐Ÿš€ Performance - [SIMD/FMA optimizations, allocation reductions, O(1) improvements] ### ๐Ÿ”ง Indicators - [New/modified indicators with parameter signatures] ### ๐Ÿ›ก๏ธ Robustness - [NaN/Infinity handling, state rollback fixes, edge cases] ### ๐Ÿงช Testing - [Validation coverage, new test categories] ### ๐Ÿ“š Documentation - [Doc updates, validation matrix changes] ### ๐Ÿ”Œ Quantower - [Adapter additions/changes] (Omit empty categories) ## Impact Assessment | Metric | Before | After | Delta | |--------|--------|-------|-------| | Allocations in hot path | ? | ? | ? | | SIMD coverage | ? | ? | ? | | Test coverage | ? | ? | ? | (Include table only when quantifiable changes exist) ## Breaking Changes - [List any API breaks with migration path, or "None"] auto_title_instructions: | Generate PR title following conventional commit format: : [scope] TYPES (required prefix): - feat: New indicator, API addition, capability - perf: SIMD optimization, allocation reduction, O(1) improvement - fix: Bug fix, numerical stability, edge case handling - refactor: Code restructure without behavior change - test: Test additions, validation coverage - docs: Documentation, markdown updates RULES: - Subject line โ‰ค50 characters - Use imperative mood ("add", "fix", "optimize" not "added", "fixes", "optimizes") - Include [scope] when change is localized (e.g., [Ema], [RingBuffer], [Quantower]) - For performance changes, append brief metric hint if space allows EXAMPLES: - feat: add Jma indicator with adaptive smoothing [trends_IIR] - perf: eliminate allocations in Sma.Update hot path - fix: handle NaN in Rsi state rollback [isNew=false] - refactor: extract SIMD helpers to core/simd - test: add validation tests for Ema vs TA-Lib - docs: update validation matrix for momentum indicators AVOID: - Vague titles ("update code", "fix bug", "improvements") - Past tense ("added", "fixed") - Articles ("add the", "fix a") - Exceeding 50 chars (truncate scope if needed) review_status: true commit_status: true collapse_walkthrough: false changed_files_summary: true sequence_diagrams: false estimate_code_review_effort: true assess_linked_issues: true related_issues: true related_prs: true suggested_labels: true suggested_reviewers: true poem: false path_filters: # --- Core Infrastructure --- - "lib/core/**/*.cs" - "lib/feeds/**/*.cs" - "lib/numerics/**/*.cs" # --- Trend Indicators --- - "lib/trends_FIR/**/*.cs" - "lib/trends_IIR/**/*.cs" # --- Oscillators & Momentum --- - "lib/oscillators/**/*.cs" - "lib/momentum/**/*.cs" # --- Channels & Volatility --- - "lib/channels/**/*.cs" - "lib/volatility/**/*.cs" # --- Dynamics & Reversals --- - "lib/dynamics/**/*.cs" - "lib/reversals/**/*.cs" # --- Statistics & Errors --- - "lib/statistics/**/*.cs" - "lib/errors/**/*.cs" # --- Cycles, Filters, Forecasts --- - "lib/cycles/**/*.cs" - "lib/filters/**/*.cs" - "lib/forecasts/**/*.cs" # --- Volume --- - "lib/volume/**/*.cs" # --- Quantower Adapters --- - "quantower/**/*.cs" # --- Always Excluded --- - "!**/bin/**" - "!**/obj/**" - "!**/.vs/**" - "!**/.git/**" - "!**/BenchmarkDotNet.Artifacts/**" - "!**/TestResults/**" - "!**/TestResultsCoverage/**" - "!**/_site/**" - "!**/ndepend/NDependOut/**" - "!**/perf/publish/**" - "!**/temp/**" - "!**/*.sarif" - "!**/*.snupkg" - "!**/*.nupkg" path_instructions: - path: "**/**" instructions: | QuanTAlib code review checklist: MEMORY & PERFORMANCE: - No heap allocations in Update() methods - Use Math.FusedMultiplyAdd for a*b+c patterns - [MethodImpl(AggressiveInlining)] for hot paths - SIMD opportunities in Calculate(Span) methods - Verify O(1) streaming updates where math allows STATE & CORRECTNESS: - Support isNew=false for bar correction (state rollback via _p_state) - Handle NaN/Infinity with last-valid-value substitution - Verify RingBuffer usage for sliding windows - Check numerical stability at edge cases (overflow, underflow, div/0) API CONSISTENCY: - Dual API: stateful Update + stateless static Calculate - ArgumentException with nameof(param) for validation - ITValuePublisher implementation for reactive chaining PATTERNS: - State as private record struct - List for SoA storage (suppress MA0016 locally) - DateTime.UtcNow (never DateTime.Now) auto_review: enabled: true auto_incremental_review: true ignore_title_keywords: - "WIP" - "DO NOT MERGE" - "draft" drafts: false base_branches: - dev finishing_touches: docstrings: enabled: false unit_tests: enabled: false tools: ast-grep: rule_dirs: - ".coderabbit/ast-grep-rules" util_dirs: [] essential_rules: true packages: - "ast-grep-essentials" shellcheck: enabled: false ruff: enabled: false eslint: enabled: false flake8: enabled: false pylint: enabled: false rubocop: enabled: false phpstan: enabled: false golangci-lint: enabled: false swiftlint: enabled: false detekt: enabled: false yamllint: enabled: true markdownlint: enabled: true gitleaks: enabled: true github-checks: enabled: true timeout_ms: 90000 chat: auto_reply: true knowledge_base: opt_out: false web_search: enabled: true code_guidelines: enabled: true filePatterns: - ".clinerules/**" learnings: scope: auto issues: scope: auto pull_requests: scope: auto