Skip to content

Brand registry: ownership transfer flow for acquired/renamed orgs #3152

Closed

Description

@bokelley

Context

#3137 cemented "first writer wins forever" for brand domain ownership. The transaction in `brand-identity.ts` does:

```
SELECT id, workos_organization_id FROM brands WHERE domain = $1 FOR UPDATE
-- if existing.workos_organization_id !== caller_org → 403
```

That's safe for the current use case (members register their own brands) but adtech-product-expert flagged:

Real-world acquisitions, org renames, and "the original uploader left and nobody at the new org can edit our own brand" are inevitable. Until then, every ownership dispute is a database surgery ticket.

Proposal

Two new admin tools:

  1. `transfer_brand_ownership` — admin-only. Takes `domain` + `new_org_id` + `reason`. Updates `brands.workos_organization_id` and writes a revision. Out-of-band verification (legal/correspondence) happens before invocation.

  2. `claim_disputed_brand` — member-callable. When a member tries to write to a domain owned by another org, instead of 403, file an escalation ticket with both orgs surfaced for admin review.

Plus a soft-claim model: until a domain is verified via `brand.json`, ownership is provisional and can be transferred without admin intervention if the new org passes domain verification.

Files

  • `server/src/addie/mcp/admin-tools.ts` — new `transfer_brand_ownership` tool
  • `server/src/services/brand-identity.ts` — replace 403 with escalation create
  • `server/src/db/brand-db.ts` — `transferBrandOwnership` with revision audit
  • New service: `server/src/services/brand-ownership-disputes.ts`

Activity

  1. added
    enhancement
    claude-triaging
    on Apr 25, 2026
  2. bokelley commented on Apr 25, 2026

    @bokelley
    ContributorAuthor

    Triage

    Classification: Feature request
    Bucket(s): admin / ops tools, addie
    Status: drafting-pr (partial)

    What the experts said:

    • internal-tools-strategist: transfer_brand_ownership admin tool is proportionate and clearly needed; the new brand-ownership-disputes.ts service is overbuild — existing escalation-db.ts handles this with a new dispute type; soft-claim race condition is a blocker (no mutual exclusion for concurrent verification).
    • adtech-product-expert: admin-mediated transfer matches real-world M&A workflows; soft-claim is a spoofing vector when brand_manifest is non-empty and generateVerificationToken is orphaned (no challenge/response wired); claim_disputed_brand is better modeled as a dispute_type: 'brand_ownership' escalation, not a standalone MCP tool.

    My take: The three-part proposal splits cleanly: part 1 is ready, parts 2–3 need design work before they're safe to ship.

    Shipped in #3159: transfer_brand_ownership admin tool + BrandDatabase.transferBrandOwnership with full-row revision audit.

    Remaining in this issue:

    • claim_disputed_brand — redesign as a dispute_type: 'brand_ownership' escalation on the existing schema; no new service needed.
    • Soft-claim model — two blockers to resolve first: (1) deleteHostedBrand clears workos_organization_id but not brand_manifest, so a domain takeover silently inherits the prior org's logo/colors/agent declarations — needs a guard when manifest is non-empty; (2) generateVerificationToken has no caller — domain verification is currently pointer-only and cannot safely gate a provenance takeover. @bokelley: the verification token infra in brand-db.ts:generateVerificationToken looks like it was stubbed for a DNS-TXT or file-placement challenge that never shipped — is that right, or was it wired somewhere else?

    Triaged by Claude Code. Session: https://claude.ai/code/session_01XmWfbQQkuuX3DB8VpukZsu


    Generated by Claude Code

  3. added
    addie
    claude-triaged
    and removed
    claude-triaging
    on Apr 25, 2026
  4. bokelley commented on Apr 26, 2026

    @bokelley
    ContributorAuthor

    Done across three PRs:

    Together these cover all three items from this issue. The #3176 follow-up captures the remaining "auto-resolve" tightening if more friction surfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    addieclaude-triagedenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions