Skip to content

feat: add minSeverityLevel option to extractRouting - #307

Merged
codeZe-us merged 1 commit into
Boxkit-Labs:mainfrom
Sulamoney222:feat/severity-thresholds
Aug 27, 2026
Merged

feat: add minSeverityLevel option to extractRouting#307
codeZe-us merged 1 commit into
Boxkit-Labs:mainfrom
Sulamoney222:feat/severity-thresholds

Conversation

@Sulamoney222

@Sulamoney222 Sulamoney222 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a minSeverityLevel configuration option to extractRouting that allows consumers to filter warnings by severity threshold, preventing UI clutter from non-critical notifications.

Changes

packages/core-ts/src/address/types.ts

  • Added WarningSeverity type ("info" | "warn" | "error")

packages/core-ts/src/routing/types.ts

  • Added optional minSeverityLevel property to RoutingInput (defaults to "info")

packages/core-ts/src/routing/extract.ts

  • Added SEVERITY_ORDER mapping and filterBySeverity helper function
  • Applied severity filtering to all warning return paths in extractRouting
  • Backward compatible: defaults to "info" which returns all warnings

Usage

// Only get warn and error warnings (filter out info):
const result = extractRouting({
  destination: "M...",
  memoType: "text",
  memoValue: "hello",
  sourceAccount: null,
  minSeverityLevel: "warn",
});

// Only get critical errors:
const result = extractRouting({
  destination: "C...",
  memoType: "none",
  memoValue: null,
  sourceAccount: null,
  minSeverityLevel: "error",
});

Acceptance Criteria

  • minSeverityLevel option added to extractRouting configuration
  • Output warnings array filtered based on provided threshold
  • Backward compatible (defaults to "info", returning all warnings)

Closes #275

Summary by CodeRabbit

  • New Features
    • Added configurable warning severity levels: info, warning, and error.
    • Routing now supports a minimum warning severity threshold.
    • Validation results can be filtered to show only warnings at or above the selected severity.

- Add WarningSeverity type for severity levels (info, warn, error)
- Add optional minSeverityLevel to RoutingInput config
- Filter warnings by severity before returning results
- Default to 'info' for full backward compatibility

Closes Boxkit-Labs#275
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Sulamoney222 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 53d5f29f-49e9-4725-b3a3-35dae56853fe

📥 Commits

Reviewing files that changed from the base of the PR and between 24a9d0c and ff7ca9d.

📒 Files selected for processing (3)
  • packages/core-ts/src/address/types.ts
  • packages/core-ts/src/routing/extract.ts
  • packages/core-ts/src/routing/types.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

RoutingInput now accepts a minimum warning severity. extractRouting filters warnings for C-address, muxed M-address, and standard G-address results. The default threshold remains info.

Changes

Routing warning severity thresholds

Layer / File(s) Summary
Severity threshold contract
packages/core-ts/src/address/types.ts, packages/core-ts/src/routing/types.ts
The routing API adds the exported WarningSeverity union and the optional RoutingInput.minSeverityLevel property.
Routing warning filtering
packages/core-ts/src/routing/extract.ts
extractRouting orders warning severities, defaults the threshold to info, and filters warnings for all supported routing result types.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ff7ca

This change adds an optional warning-severity filter while preserving the existing default behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding the minSeverityLevel option to extractRouting.
Linked Issues check ✅ Passed The changes add WarningSeverity, add the optional RoutingInput.minSeverityLevel configuration, filter warnings by severity across routing paths, and preserve backward compatibility with an info defaul…
Out of Scope Changes check ✅ Passed All changes support the linked issue by defining warning severity, exposing the configuration option, and applying severity filtering in extractRouting. No unrelated changes are shown.
Full details: Linked Issues check

Explanation

The changes add WarningSeverity, add the optional RoutingInput.minSeverityLevel configuration, filter warnings by severity across routing paths, and preserve backward compatibility with an info default. These changes satisfy issue #275.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeZe-us
codeZe-us self-requested a review August 27, 2026 15:11

@codeZe-us codeZe-us left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR reviewed

@codeZe-us
codeZe-us merged commit 1535872 into Boxkit-Labs:main Aug 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Warning Severity Thresholds Configuration

2 participants