From fa3abf291cdd49cc26f1115a2603bd04a154df89 Mon Sep 17 00:00:00 2001 From: Sidney Swift <158200036+sidneyswift@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:26:49 -0400 Subject: [PATCH 1/3] Document campaign brief channels and promoted links Add the ingest_campaign_brief request variant to the shared Context operation reference so clients know a brief may carry up to ten channel names and up to twenty promoted {request_id, subject_id} pairs that must already be saved in the same workspace. The variant states that links are candidates, not ownership or rights, that raw URLs, file paths and asset references are rejected, and that supplied material inventory remains an explicit gap. Contract first, ahead of the database and API changes. Refs recoupable/app#2138 (child of recoupable/app#2116). Co-Authored-By: Claude Fable 5.1 --- api-reference/openapi/context.json | 96 ++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/api-reference/openapi/context.json b/api-reference/openapi/context.json index f65ae185..58ddf5d5 100644 --- a/api-reference/openapi/context.json +++ b/api-reference/openapi/context.json @@ -104,6 +104,102 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "action", + "brief", + "idempotency_key" + ], + "description": "Save a private music campaign brief in the selected workspace: goals, audience, dates, channels and candidate links to records the workspace has already saved. Promoted links are candidates only; they do not verify ownership, rights, roster membership or catalog interest, and no site or plan is generated. Raw URLs, file paths and asset references are rejected. Save promoted artists, songs, releases and catalogs first through ingest, ingest_artist, ingest_release or ingest_catalog, then reference their request_id and subject_id. Supplied material (artwork, audio, video, copy, documents) is not inventoried yet and stays an explicit gap. The saved request is partial with gaps listed in output.gaps. Requires the companion campaign-brief database migrations.", + "properties": { + "action": { + "type": "string", + "const": "ingest_campaign_brief" + }, + "organization_id": { + "type": "string", + "format": "uuid", + "description": "Optional organization that owns the private context. Current membership is checked." + }, + "idempotency_key": { + "type": "string", + "minLength": 1, + "maxLength": 128, + "pattern": "^[A-Za-z0-9._:-]+$", + "description": "Stable key for retrying the same brief. A brief without channels or promoted keeps its original fingerprint, so briefs saved before those fields existed replay unchanged; a changed brief under the same key is rejected." + }, + "brief": { + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "goal" + ], + "properties": { + "name": { + "type": "string", + "minLength": 2, + "maxLength": 200 + }, + "goal": { + "type": "string", + "minLength": 2, + "maxLength": 2000 + }, + "audience": { + "type": "string", + "maxLength": 500 + }, + "start_date": { + "type": "string", + "format": "date" + }, + "end_date": { + "type": "string", + "format": "date", + "description": "Must not precede start_date." + }, + "channels": { + "type": "array", + "maxItems": 10, + "items": { + "type": "string", + "minLength": 2, + "maxLength": 60 + }, + "description": "Up to ten distinct channel names, for example short-form video, radio or press. Whitespace is normalized and names are compared case-insensitively. Links and file paths are not channels and are rejected." + }, + "promoted": { + "type": "array", + "maxItems": 20, + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "request_id", + "subject_id" + ], + "properties": { + "request_id": { + "type": "string", + "format": "uuid", + "description": "A completed or partial Context request saved in the same workspace." + }, + "subject_id": { + "type": "string", + "format": "uuid", + "description": "An artist, recording, release or catalog subject listed in that request's output. Campaign, company, songwriter and material subjects are not accepted." + } + } + }, + "description": "Distinct already-saved subjects this campaign promotes. Each is stored as a promoted_candidate with ownership_verified=false. An unknown, cross-workspace, cancelled or wrong-kind target rejects the whole brief; nothing is saved partially." + } + } + } + } + }, { "type": "object", "additionalProperties": false, From fec4f52011039b8806b960a1c29581b4e23efd50 Mon Sep 17 00:00:00 2001 From: Sidney Swift <158200036+sidneyswift@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:39:21 -0400 Subject: [PATCH 2/3] Accept one-character channels and mark campaign arrays unique X is a real campaign channel, so the minimum channel length is now one. Both arrays promise distinct entries, so they declare uniqueItems for schema-validating clients. The description now says which values reject links and files (channels and promoted targets, including URI schemes and drive paths) instead of implying goal and audience text is filtered too. Co-Authored-By: Claude Opus 5.5 --- api-reference/openapi/context.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api-reference/openapi/context.json b/api-reference/openapi/context.json index 58ddf5d5..7b7fd6c9 100644 --- a/api-reference/openapi/context.json +++ b/api-reference/openapi/context.json @@ -112,7 +112,7 @@ "brief", "idempotency_key" ], - "description": "Save a private music campaign brief in the selected workspace: goals, audience, dates, channels and candidate links to records the workspace has already saved. Promoted links are candidates only; they do not verify ownership, rights, roster membership or catalog interest, and no site or plan is generated. Raw URLs, file paths and asset references are rejected. Save promoted artists, songs, releases and catalogs first through ingest, ingest_artist, ingest_release or ingest_catalog, then reference their request_id and subject_id. Supplied material (artwork, audio, video, copy, documents) is not inventoried yet and stays an explicit gap. The saved request is partial with gaps listed in output.gaps. Requires the companion campaign-brief database migrations.", + "description": "Save a private music campaign brief in the selected workspace: goals, audience, dates, channels and candidate links to records the workspace has already saved. Promoted links are candidates only; they do not verify ownership, rights, roster membership or catalog interest, and no site or plan is generated. Raw URLs, file paths and asset references are not accepted as channels or promoted targets, and keys such as promoted_url, file_path or assets are rejected; goal and audience remain free text. Save promoted artists, songs, releases and catalogs first through ingest, ingest_artist, ingest_release or ingest_catalog, then reference their request_id and subject_id. Supplied material (artwork, audio, video, copy, documents) is not inventoried yet and stays an explicit gap. The saved request is partial with gaps listed in output.gaps. Requires the companion campaign-brief database migrations.", "properties": { "action": { "type": "string", @@ -164,16 +164,18 @@ "channels": { "type": "array", "maxItems": 10, + "uniqueItems": true, "items": { "type": "string", - "minLength": 2, + "minLength": 1, "maxLength": 60 }, - "description": "Up to ten distinct channel names, for example short-form video, radio or press. Whitespace is normalized and names are compared case-insensitively. Links and file paths are not channels and are rejected." + "description": "Up to ten distinct channel names, for example X, short-form video, radio or press. Whitespace is normalized and names are compared case-insensitively. Links and file paths are not channels and are rejected, including URI schemes such as mailto: or spotify: and drive paths such as C:\\plans." }, "promoted": { "type": "array", "maxItems": 20, + "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, From 7ade5fef94b23b4da528db77e651086ca4d2d3c3 Mon Sep 17 00:00:00 2001 From: Sidney Swift <158200036+sidneyswift@users.noreply.github.com> Date: Sat, 10 Oct 2026 17:42:26 -0400 Subject: [PATCH 3/3] Describe the campaign channel and target checks precisely The campaign brief variant pointed callers at ingest actions this spec does not document, said raw URLs and file paths were rejected as channels when only obvious links are, and left video off the rejected subject kinds. It now refers to a Context ingest request, states the channel check's limits, lists every rejected kind by example, and documents that a retry of a saved brief replays after a target is cancelled. Co-Authored-By: Claude Opus 5.5 --- api-reference/openapi/context.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api-reference/openapi/context.json b/api-reference/openapi/context.json index 7b7fd6c9..19893acd 100644 --- a/api-reference/openapi/context.json +++ b/api-reference/openapi/context.json @@ -112,7 +112,7 @@ "brief", "idempotency_key" ], - "description": "Save a private music campaign brief in the selected workspace: goals, audience, dates, channels and candidate links to records the workspace has already saved. Promoted links are candidates only; they do not verify ownership, rights, roster membership or catalog interest, and no site or plan is generated. Raw URLs, file paths and asset references are not accepted as channels or promoted targets, and keys such as promoted_url, file_path or assets are rejected; goal and audience remain free text. Save promoted artists, songs, releases and catalogs first through ingest, ingest_artist, ingest_release or ingest_catalog, then reference their request_id and subject_id. Supplied material (artwork, audio, video, copy, documents) is not inventoried yet and stays an explicit gap. The saved request is partial with gaps listed in output.gaps. Requires the companion campaign-brief database migrations.", + "description": "Save a private music campaign brief in the selected workspace: goals, audience, dates, channels and candidate links to records the workspace has already saved. Promoted links are candidates only; they do not verify ownership, rights, roster membership or catalog interest, and no site or plan is generated. Promoted targets are only request_id and subject_id pairs, never URLs or files, and keys such as promoted_url, file_path or assets are rejected. Channel names that look like links are rejected, but that check catches obvious links only (see channels); channel names are never fetched or linked. Goal and audience remain free text. Save promoted artists, songs, releases and catalogs first through a Context ingest request, then reference its request_id and subject_id. Supplied material (artwork, audio, video, copy, documents) is not inventoried yet and stays an explicit gap. The saved request is partial with gaps listed in output.gaps. Requires the companion campaign-brief database migrations.", "properties": { "action": { "type": "string", @@ -170,7 +170,7 @@ "minLength": 1, "maxLength": 60 }, - "description": "Up to ten distinct channel names, for example X, short-form video, radio or press. Whitespace is normalized and names are compared case-insensitively. Links and file paths are not channels and are rejected, including URI schemes such as mailto: or spotify: and drive paths such as C:\\plans." + "description": "Up to ten distinct channel names, for example X, short-form video, radio or press. Whitespace is normalized and names are compared case-insensitively. Values that look like links are rejected: scheme URLs, URI schemes such as mailto: or spotify:, www. hosts, and absolute, home or drive paths such as /plans or C:\\plans. This is not a complete URL or file detector: a bare example.com/release or plan.pdf is accepted as a name, and no channel name is fetched or linked." }, "promoted": { "type": "array", @@ -192,11 +192,11 @@ "subject_id": { "type": "string", "format": "uuid", - "description": "An artist, recording, release or catalog subject listed in that request's output. Campaign, company, songwriter and material subjects are not accepted." + "description": "An artist, recording, release or catalog subject listed in that request's output. Every other subject kind, such as video, campaign, company, songwriter or material, is rejected." } } }, - "description": "Distinct already-saved subjects this campaign promotes. Each is stored as a promoted_candidate with ownership_verified=false. An unknown, cross-workspace, cancelled or wrong-kind target rejects the whole brief; nothing is saved partially." + "description": "Distinct already-saved subjects this campaign promotes. Each is stored as a promoted_candidate with ownership_verified=false. An unknown, cross-workspace, cancelled or wrong-kind target rejects the whole brief; nothing is saved partially. Retrying an already-saved brief with the same idempotency_key returns the stored request even if a target request was cancelled later; a new key re-checks every target." } } }