Repository navigation
feat(mcp) 1/5: attribute connected-app changes in the activity log - #229
Merged
Merged
Conversation
… payload Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
… data Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
This was referenced Sep 14, 2026
…ghter helper Review of #229: the new activity db test had replaced the existing one instead of joining it; activityActor narrows once through requireOrganizer and the unit test pins the unauthorized code; the organizer-session comment no longer promises byte-identical actors; the telemetry note names the services whose rows carry viaClientId; the bearer seam returns the SDK's AuthInfo and exposes bearerWorkspaces so the MCP layer stops re-deriving both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Update the terms and cookies pages consistently with the new data handling disclosure.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds connected-app attribution to organizer activity logs for upcoming MCP tools while preserving browser behavior.
Changes:
- Adds bearer-only
via.clientIdmetadata and persistspayload.viaClientId. - Centralizes activity actor construction across services.
- Extends bearer resolution with workspace context.
- Updates tests, privacy disclosure, and telemetry documentation.
File summaries
| File | Summary |
|---|---|
src/services/slots.ts |
Uses centralized actor attribution for slot changes. |
src/services/slot-fields.ts |
Uses centralized actor attribution for field changes. |
src/services/signups.ts |
Uses centralized actor attribution for signup changes. |
src/oauth/flow.db.test.ts |
Tests bearer attribution and workspace fields. |
src/lib/policy.ts |
Supports optional connected-app provenance. |
src/lib/activity.ts |
Maps actors and persists app attribution. |
src/lib/activity.test.ts |
Tests activity actor mapping. |
src/lib/activity.db.test.ts |
Tests activity payload persistence. |
src/auth/organizer-session.ts |
Documents organizer actor behavior. |
src/auth/bearer.ts |
Returns app and workspace metadata. |
src/app/(legal)/privacy/page.tsx |
Updates connected-app privacy disclosure; nit (3 votes): update terms and cookies pages and their dates too. |
docs/telemetry.md |
Documents viaClientId. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #228.
What this does
When an organizer connects an assistant (Claude, Claude Code) and it changes a signup, the activity log now records which app made the change. Nothing changes for organizers working in the browser.
Why
The MCP server, coming in the next PRs of this stack, lets an assistant act as the organizer. The audit trail should show that.
Changes
via: { clientId }. Only the bearer-token path sets it.activityActor()helper replaces eleven hand-built actor objects in the services.recordActivitywritesviaClientIdinto the row payload when it is set. No new column.Tests
activityActormapping (3 tests).viaand the workspace fields.Run locally on this branch:
🤖 Generated with Claude Code
https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN