Skip to content

feat(mcp): harden local scorer adapter setup - #27

Merged
JSONbored merged 7 commits into
JSONbored:mainfrom
monsterdavidliu-ux:feat/24-local-scorer-adapter
May 29, 2026
Merged

feat(mcp): harden local scorer adapter setup#27
JSONbored merged 7 commits into
JSONbored:mainfrom
monsterdavidliu-ux:feat/24-local-scorer-adapter

Conversation

@monsterdavidliu-ux

@monsterdavidliu-ux monsterdavidliu-ux commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Harden GITTENSOR_SCORE_PREVIEW_CMD handling with structured failure codes (missing_scorer_command, timeout, malformed_json, non_zero_exit) and metadata-only fallback.
  • Add gittensory-mcp doctor local scorer diagnostics plus actionable setup guidance in preflight CLI output.
  • Ship reference wrapper scripts (gittensor-score-preview.mjs / .py) and adapter unit tests covering success, missing command, timeout, malformed JSON, non-zero exit, and source-upload guard.

Closes #24

Validation

  • npm run typecheck
  • npm run build:mcp
  • npm run test:mcp-pack
  • npx vitest run test/unit/local-scorer-adapter.test.ts test/unit/mcp-cli.test.ts (12/12 passed)

Safety

  • Backend-only change (MCP package + tests/docs)
  • No secrets, wallet details, user PATs, raw trust scores, or private rankings exposed
  • Public text avoids compensation-seeking or optimization-tactic language
  • OpenAPI/MCP behavior updated where needed
  • Public docs/changelogs updated where needed

Add structured scorer failure codes, doctor diagnostics, reference wrapper
scripts, and adapter unit tests so MCP users get actionable fallback guidance
when GITTENSOR_SCORE_PREVIEW_CMD is missing or misconfigured.

Closes JSONbored#24
@monsterdavidliu-ux
monsterdavidliu-ux force-pushed the feat/24-local-scorer-adapter branch from efcc9ea to 1d01d84 Compare May 28, 2026 23:42

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

PR #27 - feat(mcp): harden local scorer adapter setup
Signal: REQUEST CHANGES

Required changes:

  • Fix failing local scorer test: malformed JSON currently returns scorer_failed instead of malformed_json.
  • Use portable node-based scorer fixtures instead of shell/echo/sh snippets that can classify differently across environments.
  • Do not print local absolute paths in doctor output; current code can expose GITTENSOR_ROOT and scorer command paths.
  • Redact scorer command/path details in human-readable and JSON diagnostics unless intentionally safe.
  • Add test coverage for path redaction around GITTENSOR_ROOT and GITTENSOR_SCORE_PREVIEW_CMD.

Classify malformed scorer stdout reliably, use portable node test fixtures,
and redact local paths from doctor and scorer diagnostics.
@dosubot dosubot Bot added the size:XL label May 29, 2026
monsterdavidliu-ux and others added 3 commits May 29, 2026 05:07
Move adapter test fixtures to test/fixtures/local-scorer and redact
absolute interpreter paths in scorer command diagnostics.

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

PR #27 — request changes
feat(mcp): harden local scorer adapter setup

Required changes:

  • Do not delete/corrupt package-lock content; regenerate cleanly from repo root.
  • Fix malformed JSON classification so malformed output is not reported as generic scorer_failed.
  • Replace shell/echo scorer fixtures with portable Node fixtures.
  • Redact GITTENSOR_ROOT and scorer command paths from human and JSON diagnostics.
  • Add path-redaction tests for GITTENSOR_ROOT and GITTENSOR_SCORE_PREVIEW_CMD.

Restore package-lock.json from main to undo accidental libc metadata
removals, redact config paths in doctor JSON output, classify stderr-only
malformed scorer output as malformed_json, and extend doctor tests.
@monsterdavidliu-ux

Copy link
Copy Markdown
Contributor Author

Addressed the follow-up review in 9c75461: restored package-lock.json from main, tightened doctor path redaction, and re-ran MCP tests (12/12). Ready for re-review.

@JSONbored

Copy link
Copy Markdown
Owner

This

Please fix merge conflicts

Resolve doctor merge conflicts: keep local scorer diagnostics and path
redaction from the feature branch, version/API compatibility checks from
main, and use MCP client config wording instead of Cursor in PATH hints.
@monsterdavidliu-ux

Copy link
Copy Markdown
Contributor Author

merge conflicts are fixed and it’s ready for re-review.

@JSONbored
JSONbored dismissed their stale review May 29, 2026 08:03

issues resolved

@JSONbored
JSONbored merged commit 08f4116 into JSONbored:main May 29, 2026
3 checks passed
@JSONbored JSONbored added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): harden local scorer adapter setup

2 participants