Skip to content

update complexity boundaries - #5529

Closed
kohlivrinda wants to merge 1 commit into
feat/routing-transparency-uifrom
07-24-update_complexity_boundaries
Closed

kohlivrinda wants to merge 1 commit into
feat/routing-transparency-uifrom
07-24-update_complexity_boundaries

Conversation

@kohlivrinda

@kohlivrinda kohlivrinda commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

Adjusts the complexity tier classification boundaries from 0.17/0.39 to 0.20/0.40 to better reflect the scoring distribution produced by the current keyword weight scale. The previous thresholds were causing borderline technical questions to land in SIMPLE when they should register a meaningful positive score, regardless of tier.

Changes

  • simpleMediumBoundary raised from 0.170.20 and mediumComplexBoundary from 0.390.40 in the Go config and mirrored in the UI type definitions.
  • Tests for TestAnalyze_SimpleKeywordDoesNotSuppressTechnicalSignals and TestAnalyze_AccessVsRefreshTokens were updated to reflect that these inputs now correctly score in SIMPLE under the new boundary — the assertions were relaxed from requiring a non-SIMPLE tier to requiring a positive score and a non-nil result, which is the meaningful invariant.
  • The TestAnalyze_CustomTierBoundaries probe value was updated from 0.18 to 0.25 to sit clearly above the new 0.20 simple/medium boundary, keeping the default vs. custom boundary contrast valid.

Type of change

  • Bug fix
  • Refactor
  • Feature
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

# Core/Transports
go test ./plugins/governance/complexity/...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Breaking changes

  • Yes
  • No

Related issues

Security considerations

None.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 03525be8-4b1f-4f81-ba64-3c7e15ec86d3

📥 Commits

Reviewing files that changed from the base of the PR and between 2b1e8d4 and 486f0b2.

📒 Files selected for processing (3)
  • plugins/governance/complexity/analyzer_test.go
  • plugins/governance/complexity/config.go
  • ui/lib/types/complexityRouter.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • plugins/governance/complexity/analyzer_test.go
  • ui/lib/types/complexityRouter.ts
  • plugins/governance/complexity/config.go

📝 Walkthrough

Summary by CodeRabbit

  • Updates

    • Adjusted default complexity score thresholds for SIMPLE, MEDIUM, and COMPLEX classifications.
    • Synchronized threshold behavior between complexity analysis and the user interface.
    • Complexity scores near classification boundaries may now receive a different tier.
  • Tests

    • Updated boundary coverage for revised thresholds.
    • Strengthened technical-signal validation to confirm valid, positively scored analyses.
    • Improved coverage of classification behavior around updated thresholds.

Walkthrough

Complexity tier thresholds were updated in Go and TypeScript. Analyzer tests now use the revised boundary and validate positive scores for technical-signal cases without requiring specific tiers.

Changes

Complexity threshold retuning

Layer / File(s) Summary
Update tier boundaries
plugins/governance/complexity/config.go, ui/lib/types/complexityRouter.ts
Default simple-to-medium and medium-to-complex thresholds changed to 0.20 and 0.40.
Align analyzer tests
plugins/governance/complexity/analyzer_test.go
The custom boundary test now uses 0.25. Two technical-signal tests now require successful analyses with positive scores instead of specific tiers.

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

Mergeability Score: ⚪ Minimal · up to 486f0

The PR adjusts complexity classification thresholds and keeps the corresponding tests and UI definitions aligned; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

Suggested reviewers: akshaydeo, pratham-mishra04, madhuvod

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description explains the purpose, changes, affected areas, testing steps, breaking-change status, and security impact; optional sections are left empty.
Title check ✅ Passed The title is concise and accurately identifies the main change to the complexity boundaries.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-24-update_complexity_boundaries

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.

This was referenced Jul 24, 2026

kohlivrinda commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

@kohlivrinda
kohlivrinda marked this pull request as ready for review July 24, 2026 11:36
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 63fef85 to e163b57 Compare July 24, 2026 12:06
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch 2 times, most recently from a1bb138 to c254159 Compare July 25, 2026 08:57
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from e163b57 to 623a770 Compare July 25, 2026 08:57
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 623a770 to 2aaeca9 Compare July 28, 2026 16:20
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from c254159 to 246c260 Compare July 28, 2026 16:20
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 2aaeca9 to fe6869c Compare July 29, 2026 11:52
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 246c260 to 7dad74e Compare July 29, 2026 11:52
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 7dad74e to 55c20d1 Compare July 30, 2026 07:26
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from fe6869c to 26b3222 Compare July 30, 2026 07:26
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 55c20d1 to d3a2f23 Compare July 30, 2026 09:53
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 26b3222 to 628b876 Compare July 30, 2026 09:53
@Madhuvod
Madhuvod force-pushed the 07-24-update_complexity_boundaries branch from 63cbc53 to 0d8f5d9 Compare August 11, 2026 03:08
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 0d8f5d9 to 3a19e06 Compare August 11, 2026 10:44
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 4e0ba51 to 04c5099 Compare August 11, 2026 10:44
@Madhuvod
Madhuvod force-pushed the feat/routing-transparency-ui branch from 04c5099 to f816639 Compare August 11, 2026 12:48
@Madhuvod
Madhuvod force-pushed the 07-24-update_complexity_boundaries branch from 3a19e06 to 472dd4f Compare August 11, 2026 12:48
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 472dd4f to fc98ddb Compare August 11, 2026 17:43
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from f816639 to 987f510 Compare August 11, 2026 17:43
@Madhuvod
Madhuvod force-pushed the 07-24-update_complexity_boundaries branch from fc98ddb to 6d9e62c Compare August 11, 2026 19:10
@Madhuvod
Madhuvod force-pushed the feat/routing-transparency-ui branch from 987f510 to 213ec30 Compare August 11, 2026 19:10
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 6d9e62c to ac1cbac Compare August 12, 2026 09:55
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 213ec30 to 10b752e Compare August 12, 2026 09:55
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from ac1cbac to e5a7ac1 Compare August 12, 2026 15:04
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 10b752e to 7f7f487 Compare August 12, 2026 15:04
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from e5a7ac1 to d6417aa Compare August 12, 2026 16:27
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from 7f7f487 to 0c0eed6 Compare August 12, 2026 16:27
@Madhuvod
Madhuvod force-pushed the 07-24-update_complexity_boundaries branch from d6417aa to 8748232 Compare August 12, 2026 21:16
@Madhuvod
Madhuvod force-pushed the feat/routing-transparency-ui branch 2 times, most recently from 7676bec to b6d1992 Compare August 12, 2026 22:06
@Madhuvod
Madhuvod force-pushed the 07-24-update_complexity_boundaries branch from 8748232 to 6a92f6e Compare August 12, 2026 22:06
@kohlivrinda
kohlivrinda force-pushed the 07-24-update_complexity_boundaries branch from 6a92f6e to 486f0b2 Compare August 13, 2026 13:43
@kohlivrinda
kohlivrinda force-pushed the feat/routing-transparency-ui branch from b6d1992 to 2b1e8d4 Compare August 13, 2026 13:43
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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.

1 participant