Skip to content

[Context] Expose context requests and lifecycle operations through shared API and MCP #2125

Open

Description

@sswiftdrtv

Parent epic: #2116

Priority and sequence

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

Customer journey

A customer or external agent submits one URL, follows progress using a durable request ID, retrieves allowed context and requests a correction or refresh without needing a Recoup Site.

Customer value and architecture

Make the engine independently usable from the first milestone.

Scope

  • Provide start/status/read/cancel plus scoped correction, selected-topic refresh and source-withdrawal operations against the same domain implementation.
  • Return durable IDs, partial results, topic readiness, missing coverage, accepted version references, authorized cost information and actionable errors.
  • Specify idempotency, access, cancellation, retry, budget and refresh semantics in validated HTTP inputs and MCP descriptions.
  • Publish agent-readable examples for URL-only ingestion, reconnect, reading partial results and customer correction. Brief compilation is added in CE14.
  • Finalize route/tool names against the current API documentation; preserve existing endpoint/category behavior rather than inventing a transport-specific engine.

Acceptance criteria

  • UI, REST and MCP use the same ownership, authorization, execution and billing paths.
  • Caller can recover after a lost response without issuing duplicate paid work.
  • Permission failure, conflict, unsupported URL, unavailable media, partial result and budget exhaustion are explicit and tested.
  • Sensitive source content and internal traces are available only through scoped private reads, never public site payloads.
  • The first milestone can run through actual API/MCP operations; it must not rely on a separate test harness.

Blocking dependencies

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

Execution gates

Interface scaffolding and docs may start after CE02; integration completion requires the listed domain prerequisites.

Validation

API/MCP parity contract tests with mocked providers plus unauthorized/cross-owner, retry, refresh, cancel and withdrawal journeys.

Owning implementation

API routes/MCP tools + owning API documentation repositories

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.

Implementation checkpoint — 2026-09-22

Catalog ingestion adapter gap fixed in recoupable/api#917; 9 targeted tests and lint pass. Not deployed. Member expansion and general entry operations remain separate work.

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. One shared HTTP/MCP Context operation covers ingest, read, plan and execution reads, release and catalog cases, briefs and saved snapshots, supporting-text receipts and evidence links (recoupable/api#915, recoupable/api#973, recoupable/api#1048, recoupable/api#1049, recoupable/api#1112), with exported response contracts (recoupable/api#1075).

    Still open: cancel, correction, selected-topic refresh and withdrawal operations; typed errors (draft recoupable/api#1215 with recoupable/docs#31); explicit budget-exhaustion handling; and hosted web/MCP parity.

    recoupable/api#1005 is superseded by recoupable/api#1215.

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