Skip to content

[Context] Enforce context ownership consistently across API, MCP and workers #2120

Open

Description

@sswiftdrtv

Parent epic: #2116

Priority and sequence

P0 within the Context Engine epic · CE04. Required for the first two-song/two-brief checkpoint.

Customer journey

Two customers work with the same artist. Both can reuse public facts, but neither can see or change the other's private strategy, corrections, files or analysis.

Customer value and architecture

Allow useful shared knowledge without mixing customer work.

Scope

  • Enforce actor/owner authorization in domain operations used by REST, MCP and background execution, with current permission checks at sensitive reads and commits.
  • Make derived documents, citations, snippets, cache entries, exports and traces inherit the restrictions of their inputs.
  • Separate customer override authority from canonical identity authority; adapt only intersecting legacy profile/knowledge operations to the same boundary.
  • Define access-controlled deletable media/trace storage; do not send private material through permanent public knowledge-upload helpers.
  • Treat collected text as untrusted evidence in limited-capability extraction workers; source content cannot become privileged instructions.

Acceptance criteria

  • Equivalent authorized/denied operations behave the same through REST, MCP and workers.
  • Revoked membership cannot read or commit new private results just because work was queued earlier.
  • Private canary content never appears through another customer's direct reads, derived briefs, caches, search snippets or exports.
  • Customer corrections remain scoped; public artist identity does not grant private access.
  • Storage, retention and withdrawal contracts are enforceable by CE05/CE08 before private live inputs are used.

Blocking dependencies

These are completion prerequisites, mirrored by native GitHub blocked-by links. Contracts, fixtures and independent scaffolding may begin earlier.

Execution gates

Implementation can start after contracts; intended-environment access/grants must be checked before production rollout.

Validation

Cross-customer canary tests, permission revocation while queued/running, source-injection fixtures and API/MCP parity tests.

Owning implementation

API shared authorization + private storage policy + relevant legacy adapters

Delivery conventions

Shared API business logic serves HTTP, MCP and workers; clients do not duplicate it. Validate input with Zod and use the existing Supabase access layer. Database changes go through database-repository migrations and PRs. Use Vercel Workflows for new durable work. Reuse existing credits and record costs without exposing credentials or private traces. Every owning repository uses a feature branch and PR; distinguish fixture, local, merged and deployed verification.

Activity

  1. added
    enhancementNew feature or request
    priority:P0Required for the first shared Sites and external Widgets release
    on Sep 20, 2026
  2. sidneyswift commented on Nov 6, 2026

    @sidneyswift
    Collaborator

    Partly done. Brief operations recheck access after slow evidence reads and around saving (recoupable/api#1132), saves are rejected after a request's scope changes (recoupable/database#76), and source-level tests cover owner binding and denial across 33 HTTP/MCP actions, 27 delegated OAuth actions and six worker cases (recoupable/api#1220).

    Still open: cross-customer canary checks through briefs, caches and exports; scoped corrections; private storage and withdrawal contracts; and the hosted same-account web/MCP comparison named in the epic.

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

    enhancementNew feature or requestpriority:P0Required for the first shared Sites and external Widgets release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions