Skip to content

feat(mcp) 1/5: attribute connected-app changes in the activity log - #229

Merged
richshaw merged 6 commits into
mainfrom
claude/mcp-1-attribution
Sep 16, 2026
Merged

richshaw merged 6 commits into
mainfrom
claude/mcp-1-attribution

Conversation

@richshaw

Copy link
Copy Markdown
Owner

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

  • The organizer actor can carry via: { clientId }. Only the bearer-token path sets it.
  • One activityActor() helper replaces eleven hand-built actor objects in the services.
  • recordActivity writes viaClientId into the row payload when it is set. No new column.
  • The bearer seam also returns the organizer's default workspace and workspace list, which the tools will need.
  • Privacy page and telemetry catalogue updated.

Tests

  • Unit: activityActor mapping (3 tests).
  • DB: payload round-trip on Postgres; the OAuth flow test now expects via and the workspace fields.

Run locally on this branch:

pnpm lint          clean
pnpm typecheck     clean
pnpm test          63 files, 676 tests passed
pnpm test:db       20 files, 185 tests passed

🤖 Generated with Claude Code

https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN

Liamond Holte and others added 5 commits September 13, 2026 15:59
… payload

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175tReSngsg1KmeaDNMDCzN
…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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.clientId metadata and persists payload.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.

Comment thread src/app/(legal)/privacy/page.tsx Resolved
@richshaw
richshaw added this pull request to stack #235 September 16, 2026 01:57
@richshaw
richshaw merged commit 636ddca into main Sep 16, 2026
6 checks passed
@richshaw
richshaw deleted the claude/mcp-1-attribution branch September 16, 2026 02:29
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.

2 participants