Skip to content

Update provider templates to match current base class contracts#2415

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/update-provider-templates
Draft

Update provider templates to match current base class contracts#2415
Copilot wants to merge 3 commits intomainfrom
copilot/update-provider-templates

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

The scaffold templates in docs/examples/provider-template/ had drifted from the current base class APIs, making them incorrect guides for implementing new providers.

TemplateSymbolSearchProvider.cs — breaking mismatch (major)

BaseSymbolSearchProvider no longer exposes SearchAsync for override. Derived classes must implement four abstract template methods; the base handles HTTP, rate limiting, and filtering automatically. Replaced the stale direct SearchAsync overrides with the correct hooks:

protected override string BuildSearchUrl(string query, string? assetType, string? exchange) { ... }
protected override string BuildDetailsUrl(string symbol) { ... }
protected override IEnumerable<SymbolSearchResult> DeserializeSearchResults(string json, string query) { ... }
protected override async Task<SymbolDetails?> DeserializeDetailsAsync(string json, string symbol, CancellationToken ct) { ... }

TemplateHistoricalDataProvider.cs

  • Constructor: (httpClient, log)base(httpClient, log)ILogger? was missing
  • if (Disposed) return []ThrowIfDisposed() (base helper)
  • Inline ArgumentExceptionValidateSymbol(symbol) (base helper)
  • Added IsAvailableAsync override with credential guard and structured exception logging
  • Added [DataSource] + [ImplementsAdr("ADR-005", …)] attributes (were missing)

TemplateMarketDataClient.cs

  • Added ILogger? logger optional constructor parameter forwarded to WebSocketProviderBase

README.md

  • Updated architecture rules to accurately describe each provider type's required method contract

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🔍 Copilot Code Review — Six-Lens Analysis

Build Tests

⚠️ REQUEST CHANGES — 1 warning(s) and 0 info item(s) should be addressed.

📋 Summary

Metric Value
Files reviewed 3
🔴 Critical 0
🟡 Warning 1
🔵 Info 0
Build errors 5
Tests passed 0 / 0
📁 Changed files (3)
  • docs/examples/provider-template/TemplateHistoricalDataProvider.cs
  • docs/examples/provider-template/TemplateMarketDataClient.cs
  • docs/examples/provider-template/TemplateSymbolSearchProvider.cs

🛡️ Error Handling & Resilience

  • [E-WARNING] docs/examples/provider-template/TemplateHistoricalDataProvider.cs: Bare catch (Exception) — use specific types from Core/Exceptions/ (e.g. DataProviderException, StorageException).

ℹ️ About this review

This review applies the six-lens framework from code-review-agent.md:

  1. 🏗️ MVVM Architecture — thin code-behind, BindableBase, dependency rules
  2. Real-Time Performance — blocking calls, hot-path allocations, channel policies, ADR-014 JSON
  3. 🛡️ Error Handling & Resilience — exception hierarchy, provider reconnection, shutdown paths
  4. 🧪 Test Quality — naming convention, async patterns, no sleep/delay
  5. 🔌 Provider Compliance — interface completeness, rate limiting, [ImplementsAdr] attributes
  6. 📐 Conventions — structured logging, IHttpClientFactory, sealed classes, ADRs

Severity scale: 🔴 CRITICAL (must fix before merge) · 🟡 WARNING (should address) · 🔵 INFO (minor)

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Six-Lens Code Review — 0 critical issue(s) detected. See the detailed comment above for all findings.

- TemplateHistoricalDataProvider: add ILogger? log param to ctor, use
  ThrowIfDisposed()/ValidateSymbol() from base, add IsAvailableAsync,
  add [DataSource] + [ImplementsAdr ADR-005] attributes, add Serilog using
- TemplateSymbolSearchProvider: replace direct SearchAsync overrides with
  the four abstract template methods (BuildSearchUrl, BuildDetailsUrl,
  DeserializeSearchResults, DeserializeDetailsAsync) required by
  BaseSymbolSearchProvider; add [DataSource]+[ImplementsAdr ADR-005];
  add Priority override; add ILogger? log ctor param; add Serilog using
- TemplateMarketDataClient: add ILogger? logger ctor param passed to base
- README: update architecture rules to reflect accurate method requirements
  for all three provider types"

Agent-Logs-Url: https://github.com/rodoHasArrived/Meridian/sessions/a2599ee1-3855-49ff-8aed-612c255a0fe3

Co-authored-by: rodoHasArrived <55965792+rodoHasArrived@users.noreply.github.com>
@github-actions github-actions bot added documentation Improvements or additions to documentation size/M labels Apr 7, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Six-Lens Code Review — 0 critical issue(s) detected. See the detailed comment above for all findings.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

📚 Documentation Automation Summary

Metric Value
Any changes detected true
Generated docs changed true
Changed files docs/generated/adr-index.md,docs/generated/documentation-coverage.md,docs/generated/project-context.md,docs/generated/repository-structure.md,docs/generated/workflows-overview.md,docs/status/health-dashboard.md
Total TODOs N/A
Untracked TODOs N/A
DocFX build failure
Pages deploy skipped

This comment is updated automatically by the Documentation Automation workflow.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Six-Lens Code Review — 0 critical issue(s) detected. See the detailed comment above for all findings.

Copilot AI changed the title [WIP] Update provider templates to match current repository structure Update provider templates to match current base class contracts Apr 7, 2026
Copilot AI requested a review from rodoHasArrived April 7, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/M size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants