Skip to content

[Context] Define context contracts, ownership rules and acceptance fixtures #2118

Open

Description

@sswiftdrtv

Parent epic: #2116

Priority and sequence

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

Customer journey

A manager pastes a song URL and later a related video URL. Each request has a clear subject, owner and payer, and the engine can explain what it knows and what is missing.

Customer value and architecture

Give every adapter and consumer the same vocabulary and prevent a second Sites-only data model.

Scope

  • Specify actor, authorized owner scope, payer and subject separately; distinguish shared public identity/evidence from customer-private instructions, corrections and derived results.
  • Define artist, recording, release, video and era associations; preserve songs.isrc and keep unmatched media unresolved. Specify recording-to-release membership and credited artist roles/order.
  • Define source observations, model estimates, interpretations, customer assertions and creative proposals; module/request outcomes, coverage/readiness, time precision and source/version fingerprints.
  • Define lifecycle and correction authority, consumer topic/size/media requirements, cancellation/idempotency semantics and recipe/schema versions. Finalize names against existing routes and docs.
  • Create fixtures for same-name artists, collaborations, reissues, wrong/partial audio, unavailable/full/multilingual lyrics, throwbacks, source injection, private evidence and two songs by one artist.

Acceptance criteria

  • Versioned validated contracts cover URL-only input with optional direction/assets and single-track/single-video scope.
  • Unknown duration, dates, identity and lyric completeness remain explicitly unknown; HTTP success does not imply accepted context.
  • Shared canonical identity cannot be changed by an ordinary customer override; creative output cannot become factual research.
  • Every proposed persisted concept has a concrete initial use and fixture.
  • Pilot configuration fields are defined for spend ceilings, paid-but-unusable output, retention/withdrawal, freshness and readiness behavior; unresolved values block paid pilot activation, not all engineering.
  • Albums/playlists get explicit routing/unsupported semantics while existing Sites support remains compatible.

Blocking dependencies

None. Start now.

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

Execution gates

Can start alongside CE01; agree contracts before dependent migrations and adapters.

Validation

Contract fixtures round-trip through validation; decision table includes failure, privacy, correction and coverage cases.

Owning implementation

API domain contracts + database design + API/MCP docs

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

Contracts must cover all eight input journeys and separate source representation, requested purpose and account/workspace scope. Define public/private evidence and explicit relationship intent.

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. Validated request and response contracts are on main, including exported response contracts with verified examples (recoupable/api#1075).

    Still open: the versioned URL-only envelope, the correction-authority decision table, the five pilot configuration fields and the edge-case fixture catalogue, all in recoupable/api#1002 (unmerged).

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