Skip to content

fix(mcp): keep repo root out of API payloads - #59

Merged
JSONbored merged 2 commits into
mainfrom
codex/fix-reporoot-local-path-leak
May 29, 2026
Merged

fix(mcp): keep repo root out of API payloads#59
JSONbored merged 2 commits into
mainfrom
codex/fix-reporoot-local-path-leak

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent leaking a local filesystem path (repoRoot) in API requests and avoid validation rejections by the strict localBranchAnalysisSchema when building branch-analysis payloads.
  • Preserve local scorer behavior while ensuring repoRoot is only used for subprocess execution and not included in outbound JSON.

Description

  • Stop mutating the shared metadata in buildBranchAnalysisPayload by creating a scorerMetadata clone that includes repoRoot and pass that to runExternalScorePreview instead of the original metadata.
  • Keep the returned payload shape unchanged except for omitting repoRoot so API-bound bodies no longer contain local paths.
  • Add a unit assertion to test/unit/local-scorer-adapter.test.ts that verifies buildBranchAnalysisPayload output does not have the repoRoot property.

Testing

  • Ran the focused unit tests with npm run test:unit -- test/unit/local-scorer-adapter.test.ts and all tests passed.
  • Ran type checking with npm run typecheck (tsc --noEmit) and it succeeded.
  • Verified there are no whitespace or diff issues with git diff --check which reported no problems.

Codex Task

@JSONbored
JSONbored merged commit fd6e841 into main May 29, 2026
5 checks passed
@JSONbored
JSONbored deleted the codex/fix-reporoot-local-path-leak branch May 29, 2026 21:53
@JSONbored JSONbored added the bug label May 30, 2026
james3773 pushed a commit to james3773/gittensory that referenced this pull request May 31, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant