Skip to content

feat(score): display the trust tier alongside the numeric score (closes #236) - #341

Open
dchaudhari7177 wants to merge 1 commit into
KryptosAI:mainfrom
dchaudhari7177:feat/score-trust-tier
Open

feat(score): display the trust tier alongside the numeric score (closes #236)#341
dchaudhari7177 wants to merge 1 commit into
KryptosAI:mainfrom
dchaudhari7177:feat/score-trust-tier

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Closes #236. Part of the #174 trust-tier roadmap.

mcp-observatory score printed only the number and letter grade, so the tier that turns it into a trust signal was invisible in the terminal.

  MCP Health Score: 95/100 (A)  Tier: Platinum
  MCP Health Score: 87/100 (B)  Tier: Gold
  MCP Health Score: 72/100 (C)  Tier: Silver
  MCP Health Score: 55/100 (F)  Tier: Bronze
  MCP Health Score: 30/100 (F)  Tier: Unrated

Notes

  • Appended to the existing header, not added as a separate line, so the existing formatting is untouched as the issue asked.
  • Tier colours are deliberately distinct from grade colours. Grade is green/yellow/red (pass/warn/fail); if the tier reused those, the two signals would read as one. Per the issue: platinum cyan, gold yellow; then silver blue, bronze and unrated dim. All from the existing ANSI palette in commands/helpers.ts, so --no-color keeps working.
  • getTrustTier already exists in src/score.ts and is covered by tests/score.test.ts (including the 90/80/65/50 boundaries), so this PR adds only the rendering — no scoring logic changes, and formatTier is a pure lowercase→label helper.

Verification

npx tsc --noEmit          clean
npx vitest run tests/score.test.ts    15 passed

Rendered every tier band to confirm the line composes correctly with and without ANSI codes (the plain: forms above).

Note the repo's npm run lint crashes on this machine with TypeError: Cannot read properties of undefined (reading 'Cjs') — it does so on pristine main too, so it's environmental and not from this change.

🤖 Generated with Claude Code

`mcp-observatory score` printed only the number and letter grade, so the tier
that turns it into a trust signal was invisible in the terminal.

  MCP Health Score: 87/100 (B)  Tier: Gold

Appended to the existing header rather than added as a new line, so the
existing formatting is untouched. Tier colours are deliberately distinct from
the grade colours (grade is green/yellow/red for pass/warn/fail), so the two
signals do not read as one: platinum cyan and gold yellow per the issue, silver
blue, bronze and unrated dim.

getTrustTier already exists in src/score.ts and is covered by tests, so this
adds only the rendering; no scoring logic changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

Display trust tier alongside score in terminal output

2 participants