Repository navigation
Description
Parent epic: #2116
Priority and sequence
P0 within the Context Engine epic · CE08. Required for the first two-song/two-brief checkpoint.
Customer journey
A manager corrects an artist detail or removes a private source. Future briefs reflect the change, unrelated good research remains useful, and a slow older job cannot overwrite the correction.
Customer value and architecture
Make the engine improve over time instead of accumulating conflicting or stale text.
Scope
- Validate each topic independently for schema, identity, evidence, coverage and readiness; an HTTP 200 or raw-string parse fallback is not acceptance.
- Select compatible reusable results by source version/fingerprint, topic, recipe/schema version, coverage and authorized scope.
- Publish current documents using input/revision checks; stale completions remain historical and partial failure preserves the last accepted version.
- Implement scoped corrections, source withdrawal/deletion and targeted invalidation through recorded input relationships; suppress affected derived reads immediately and handle recomputation within authorized budget.
- Keep roster removal separate from canonical artist deletion. Preserve dependency manifests while honoring removal/retention of private content; do not promise immutable content after deletion.
- Expose freshness and gaps; no unrequested paid recurring refresh, global era authority or automatic identity merge/split.
Acceptance criteria
- An old job cannot replace context based on newer evidence or a customer correction.
- Failed/partial topics cannot erase accepted unrelated topics or be reused as complete knowledge.
- Withdrawn/private sources disappear from future authorized reads and derived briefs; stale cached/exported service responses are invalidated within a documented bound.
- Roster removal does not delete shared canonical history; customer deletion follows documented scoped retention rules.
- Duplicate articles and creative proposals cannot be treated as independent factual corroboration.
- Lifecycle, retention, readiness and reuse tests pass before using real private sources.
Blocking dependencies
- [Context] Enforce context ownership consistently across API, MCP and workers #2120
- [Context] Persist versioned sources, module results and context document lineage #2121
- [Context] Run durable context requests with recoverable per-module execution #2122
These are completion prerequisites, mirrored by native GitHub blocked-by links. Contracts, fixtures and independent scaffolding may begin earlier.
Execution gates
Required before accepting and reusing real adapter output. Live retention/removal settings must be explicit.
Validation
Full-versus-preview races, recipe changes, correction-vs-completion, source withdrawal across dependent briefs/caches, last-roster removal, private reuse denial and partial-results tests.
Owning implementation
API topic acceptance/reuse/lifecycle domain operations
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
sidneyswift commentedon Nov 6, 2026
Partly done. Source versions and results are immutable, older fetches cannot overwrite newer snapshots, withdrawn evidence is excluded from briefs, and saved snapshots report superseded or unavailable (recoupable/database#72, recoupable/database#78, recoupable/api#921). Catalog cases redact withdrawn sources from history (recoupable/database#120).
Still open: scoped customer corrections, source withdrawal over HTTP/MCP (recoupable/api#1008, recoupable/database#102, unmerged), document version history (recoupable/database#99), and a documented invalidation bound for cached or exported responses.