Skip to content

refactor(evi): move MCP bearer auth from the channel wiring into agent/lib - #638

Merged
HugoRCD merged 1 commit into
mainfrom
refactor/mcp-auth-placement
Aug 29, 2026
Merged

refactor(evi): move MCP bearer auth from the channel wiring into agent/lib#638
HugoRCD merged 1 commit into
mainfrom
refactor/mcp-auth-placement

Conversation

@evlogai

@evlogai evlogai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What and why

apps/evi/docs/capability-placement.md states the two-layer rule: every code file under agent/ outside agent/lib/ is wiring, and logic lives in agent/lib/<domain>/ (or a flat module) with a colocated *.test.ts. mcpBearerAuth carried its crypto, env and timing-safe comparison logic in the wiring file agent/channels/mcp.ts, while its test already sat on the logic side at agent/lib/mcp.test.ts, importing across the boundary.

This moves MCP_PRINCIPAL and mcpBearerAuth into a new flat module agent/lib/mcp.ts (the mcp domain has only one file) and leaves agent/channels/mcp.ts as pure wiring. The colocated test now imports ./mcp. No behavior change: the only consumer is the channel itself (verified by grep across apps/evi).

Found by the self-review pass, lens B (guides the code stopped obeying).

Checks

  • pnpm run lint: 22/22 green
  • pnpm run typecheck: 27/27 green
  • pnpm run test: 22/22 green (including agent/lib/mcp.test.ts, 3 tests)

No changeset: the change is confined to apps/evi.

Draft until reviewed; marking ready is @HugoRCD's call.

The two-layer rule in apps/evi/docs/capability-placement.md holds that
every code file under agent/ outside agent/lib/ is wiring and logic
lives in agent/lib with a colocated test. mcpBearerAuth carried its
crypto and env logic in the channel file while its test already sat in
agent/lib/mcp.test.ts importing across the boundary.
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fec96af

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evi Ready Ready Preview Aug 29, 2026 1:09pm
4 Skipped Deployments
Project Deployment Actions Updated (UTC)
evlog-docs Skipped Skipped v0 Aug 29, 2026 1:09pm
evlog-render-lab Skipped Skipped Aug 29, 2026 1:09pm
evlog-telemetry Skipped Skipped Aug 29, 2026 1:09pm
just-use-evlog Skipped Skipped Aug 29, 2026 1:09pm

Request Review

@github-actions
github-actions Bot requested a review from HugoRCD August 29, 2026 13:08
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@evlog/cli@638
npm i https://pkg.pr.new/evlog@638
npm i https://pkg.pr.new/@evlog/nuxthub@638
npm i https://pkg.pr.new/@evlog/telemetry@638

commit: fec96af

@HugoRCD
HugoRCD marked this pull request as ready for review August 29, 2026 13:10
@HugoRCD
HugoRCD merged commit b5aa197 into main Aug 29, 2026
22 checks passed
@HugoRCD
HugoRCD deleted the refactor/mcp-auth-placement branch August 29, 2026 13:10
@github-actions
github-actions Bot requested a review from HugoRCD August 29, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant