Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions api-reference/openapi/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,104 @@
}
}
},
{
"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. 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.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The variant description says to save "artists, songs, releases and catalogs" first, but the subject_id description in this same brief schema defines the accepted kinds as "artist, recording, release or catalog" and rejects every other kind ("video, campaign, company, songwriter or material"). "Song" is not the accepted-kind term, so readers cannot tell whether a "song" subject passes the kind check. Align the wording, e.g. "artists, recordings, releases and catalogs".

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At api-reference/openapi/context.json, line 115:

<comment>The variant description says to save "artists, songs, releases and catalogs" first, but the `subject_id` description in this same brief schema defines the accepted kinds as "artist, recording, release or catalog" and rejects every other kind ("video, campaign, company, songwriter or material"). "Song" is not the accepted-kind term, so readers cannot tell whether a "song" subject passes the kind check. Align the wording, e.g. "artists, recordings, releases and catalogs".</comment>

<file context>
@@ -112,7 +112,7 @@
                       "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": {
</file context>

"properties": {
"action": {
"type": "string",
"const": "ingest_campaign_brief"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Documentation and Naming Conventions for Maintainable Code

The operation-level description still omits ingest_campaign_brief from its action list, so the public overview contradicts the newly added oneOf variant. Add it to that list.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At api-reference/openapi/context.json, line 119:

<comment>The operation-level description still omits `ingest_campaign_brief` from its action list, so the public overview contradicts the newly added `oneOf` variant. Add it to that list.</comment>

<file context>
@@ -104,6 +104,102 @@
+                    "properties": {
+                      "action": {
+                        "type": "string",
+                        "const": "ingest_campaign_brief"
+                      },
+                      "organization_id": {
</file context>

},
"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,
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
"uniqueItems": true,
"items": {
"type": "string",
"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. 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",
"maxItems": 20,
"uniqueItems": true,
"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. 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. 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."
}
}
}
}
},
{
"type": "object",
"additionalProperties": false,
Expand Down