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
48 changes: 46 additions & 2 deletions api-reference/openapi/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"post": {
"operationId": "contextOperation",
"summary": "Ingest, read, or compile context briefs",
"description": "Save reusable music context, read progress, or compile a task-specific evidence brief. This reference documents the ingestion, read, brief, save_brief and read_brief actions of the shared HTTP/MCP operation. Brief compilation combines up to ten completed or partial requests in one authorized workspace, reuses saved evidence without provider or model calls, and returns bounded Markdown plus the selected input versions. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Shared artist evidence appears once, with coverage reported separately for each request. Briefs are evidence packets, not generated creative concepts or finished outreach. Inspect readiness, request_coverage and gaps. The brief action is read-only; use save_brief with the same inputs and an idempotency_key to freeze the server-compiled output, then read_brief with its brief_id to retrieve it without recompilation. A newer document revision marks the snapshot superseded without rewriting it. Withdrawn/unavailable evidence, cancelled requests, or removed subject scope withhold the payload. Saving rechecks current evidence before committing. Apply the companion snapshot migration before using save_brief/read_brief. Ingestion dispatches a durable workflow; retry the same input and idempotency key after dispatch failure.",
"description": "Save reusable music context, read progress, or compile a task-specific evidence brief. This reference documents the ingestion, read, brief, save_brief and read_brief actions of the shared HTTP/MCP operation. Brief compilation combines up to ten completed or partial requests in one authorized workspace, reuses saved evidence without provider or model calls, and returns bounded Markdown plus the selected input versions. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Shared artist evidence appears once, with coverage reported separately for each request. Briefs are evidence packets, not generated creative concepts or finished outreach. Inspect readiness, request_coverage and gaps. The brief action is read-only; use save_brief with the same inputs and an idempotency_key to freeze the server-compiled output, then read_brief with its brief_id to retrieve it without recompilation. A newer document revision marks the snapshot superseded without rewriting it. Withdrawn/unavailable evidence, cancelled requests, or removed subject scope withhold the payload. Saving rechecks current evidence before committing. Apply the companion snapshot migration before using save_brief/read_brief. Ingestion dispatches a durable workflow; retry the same input and idempotency key after dispatch failure. read_document_history reads the immutable revision history of one saved context document in the authorized workspace, without provider or model calls.",

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 operation description still enumerates the documented actions as "ingestion, read, brief, save_brief and read_brief" while the same PR adds and documents read_document_history. Update the enumeration to include read_document_history so the contract's action list matches the new oneOf variant.

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 35:

<comment>The operation description still enumerates the documented actions as "ingestion, read, brief, save_brief and read_brief" while the same PR adds and documents `read_document_history`. Update the enumeration to include `read_document_history` so the contract's action list matches the new oneOf variant.</comment>

<file context>
@@ -32,7 +32,7 @@
         "operationId": "contextOperation",
         "summary": "Ingest, read, or compile context briefs",
-        "description": "Save reusable music context, read progress, or compile a task-specific evidence brief. This reference documents the ingestion, read, brief, save_brief and read_brief actions of the shared HTTP/MCP operation. Brief compilation combines up to ten completed or partial requests in one authorized workspace, reuses saved evidence without provider or model calls, and returns bounded Markdown plus the selected input versions. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Shared artist evidence appears once, with coverage reported separately for each request. Briefs are evidence packets, not generated creative concepts or finished outreach. Inspect readiness, request_coverage and gaps. The brief action is read-only; use save_brief with the same inputs and an idempotency_key to freeze the server-compiled output, then read_brief with its brief_id to retrieve it without recompilation. A newer document revision marks the snapshot superseded without rewriting it. Withdrawn/unavailable evidence, cancelled requests, or removed subject scope withhold the payload. Saving rechecks current evidence before committing. Apply the companion snapshot migration before using save_brief/read_brief. Ingestion dispatches a durable workflow; retry the same input and idempotency key after dispatch failure.",
+        "description": "Save reusable music context, read progress, or compile a task-specific evidence brief. This reference documents the ingestion, read, brief, save_brief and read_brief actions of the shared HTTP/MCP operation. Brief compilation combines up to ten completed or partial requests in one authorized workspace, reuses saved evidence without provider or model calls, and returns bounded Markdown plus the selected input versions. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Shared artist evidence appears once, with coverage reported separately for each request. Briefs are evidence packets, not generated creative concepts or finished outreach. Inspect readiness, request_coverage and gaps. The brief action is read-only; use save_brief with the same inputs and an idempotency_key to freeze the server-compiled output, then read_brief with its brief_id to retrieve it without recompilation. A newer document revision marks the snapshot superseded without rewriting it. Withdrawn/unavailable evidence, cancelled requests, or removed subject scope withhold the payload. Saving rechecks current evidence before committing. Apply the companion snapshot migration before using save_brief/read_brief. Ingestion dispatches a durable workflow; retry the same input and idempotency key after dispatch failure. read_document_history reads the immutable revision history of one saved context document in the authorized workspace, without provider or model calls.",
         "security": [
           {
</file context>
Suggested change
"description": "Save reusable music context, read progress, or compile a task-specific evidence brief. This reference documents the ingestion, read, brief, save_brief and read_brief actions of the shared HTTP/MCP operation. Brief compilation combines up to ten completed or partial requests in one authorized workspace, reuses saved evidence without provider or model calls, and returns bounded Markdown plus the selected input versions. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Shared artist evidence appears once, with coverage reported separately for each request. Briefs are evidence packets, not generated creative concepts or finished outreach. Inspect readiness, request_coverage and gaps. The brief action is read-only; use save_brief with the same inputs and an idempotency_key to freeze the server-compiled output, then read_brief with its brief_id to retrieve it without recompilation. A newer document revision marks the snapshot superseded without rewriting it. Withdrawn/unavailable evidence, cancelled requests, or removed subject scope withhold the payload. Saving rechecks current evidence before committing. Apply the companion snapshot migration before using save_brief/read_brief. Ingestion dispatches a durable workflow; retry the same input and idempotency key after dispatch failure. read_document_history reads the immutable revision history of one saved context document in the authorized workspace, without provider or model calls.",
"description": "Save reusable music context, read progress, or compile a task-specific evidence brief. This reference documents the ingestion, read, brief, save_brief, read_brief and read_document_history actions of the shared HTTP/MCP operation. Brief compilation combines up to ten completed or partial requests in one authorized workspace, reuses saved evidence without provider or model calls, and returns bounded Markdown plus the selected input versions. Creative direction prioritizes lyrics and artwork; playlist pitching prioritizes catalog/audio metadata. Shared artist evidence appears once, with coverage reported separately for each request. Briefs are evidence packets, not generated creative concepts or finished outreach. Inspect readiness, request_coverage and gaps. The brief action is read-only; use save_brief with the same inputs and an idempotency_key to freeze the server-compiled output, then read_brief with its brief_id to retrieve it without recompilation. A newer document revision marks the snapshot superseded without rewriting it. Withdrawn/unavailable evidence, cancelled requests, or removed subject scope withhold the payload. Saving rechecks current evidence before committing. Apply the companion snapshot migration before using save_brief/read_brief. Ingestion dispatches a durable workflow; retry the same input and idempotency key after dispatch failure. read_document_history reads the immutable revision history of one saved context document in the authorized workspace, without provider or model calls.",

"security": [
{
"ApiKey": []
Expand Down Expand Up @@ -253,6 +253,42 @@
"description": "Optional organization that owns the private context. Current membership is checked."
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"action",
"document_id"
],
"properties": {
"action": {
"type": "string",
"const": "read_document_history"
},
"document_id": {
"type": "string",
"format": "uuid",
"description": "A context document ID from a brief or saved brief response: documents[].id or input_manifest.documents[].documentId."

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 new document_id description directs consumers to documents[].id, but the 200 response contract in this same file never establishes that field: it only says a brief returns "documents and their serialized characters count", while it enumerates every manifest document field (documentId, resultId, subjectId, topic, version, sourceVersionIds). documents[].id is now the only occurrence of that field name in the entire spec, so a consumer reading the contract cannot verify the primary source for document_id. Add id to the 200 description's document item fields (for example, "documents, each with id and characters, ...") so the request description references an actually documented field, or confirm the real field name if it differs.

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 272:

<comment>The new `document_id` description directs consumers to `documents[].id`, but the 200 response contract in this same file never establishes that field: it only says a brief returns "documents and their serialized characters count", while it enumerates every manifest document field (`documentId`, `resultId`, `subjectId`, `topic`, `version`, `sourceVersionIds`). `documents[].id` is now the only occurrence of that field name in the entire spec, so a consumer reading the contract cannot verify the primary source for `document_id`. Add `id` to the 200 description's document item fields (for example, "documents, each with id and characters, ...") so the request description references an actually documented field, or confirm the real field name if it differs.</comment>

<file context>
@@ -269,7 +269,7 @@
                         "type": "string",
                         "format": "uuid",
-                        "description": "A context document ID from a brief manifest (documentId) or read result (id)."
+                        "description": "A context document ID from a brief or saved brief response: documents[].id or input_manifest.documents[].documentId."
                       },
                       "organization_id": {
</file context>

},
"organization_id": {
"type": "string",
"format": "uuid",
"description": "Optional organization that owns the private context. Current membership is checked."
},
"before_revision": {
"type": "integer",
"minimum": 1,
"description": "Exclusive cursor: return revisions below this number. Use next_before from the previous page; revision 0 is never recorded."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50,
"description": "Page size, newest revision first."
}
}
}
]
},
Expand Down Expand Up @@ -284,6 +320,14 @@
"action": "read_brief",
"brief_id": "33333333-3333-4333-8333-333333333333"
}
},
"readDocumentHistory": {
"summary": "Read the revision history of one saved document",
"value": {
"action": "read_document_history",
"document_id": "44444444-4444-4444-8444-444444444444",
"limit": 20
}
}
}
}
Expand All @@ -294,7 +338,7 @@
"description": "Saved ingestion request; inspect request.status and use read to poll. Existing completed/partial requests return without provider work."
},
"200": {
"description": "Read returns request. Brief returns request_id, request_ids, purpose, readiness, bounded Markdown text and text_characters, documents and their serialized characters count, missingTopics, guidance, gaps, request_coverage, and input_manifest. Each coverage entry includes requestId, readiness and missingTopics; overall readiness remains partial if any request has a gap or partial evidence. The manifest includes compilerVersion, method, requestIds, excludedTopics, and selected documents with documentId, resultId (null only if unavailable), subjectId, topic, version and sourceVersionIds. The result is returned without creating a saved brief record. Save/read brief return {snapshot: {id, created_at, purpose, state, superseded, brief}}. state is saved or unavailable; unavailable snapshots return brief: null. saved snapshots return the exact compiled response including its input manifest. Another workspace cannot read the record."
"description": "Read returns request. Brief returns request_id, request_ids, purpose, readiness, bounded Markdown text and text_characters, documents and their serialized characters count, missingTopics, guidance, gaps, request_coverage, and input_manifest. Each coverage entry includes requestId, readiness and missingTopics; overall readiness remains partial if any request has a gap or partial evidence. The manifest includes compilerVersion, method, requestIds, excludedTopics, and selected documents with documentId, resultId (null only if unavailable), subjectId, topic, version and sourceVersionIds. The result is returned without creating a saved brief record. Save/read brief return {snapshot: {id, created_at, purpose, state, superseded, brief}}. state is saved or unavailable; unavailable snapshots return brief: null. saved snapshots return the exact compiled response including its input manifest. Another workspace cannot read the record. read_document_history returns {state, document, versions, has_more, next_before}. state is found or not_found; another workspace's or an unknown document is not_found with document: null and no versions, never confirming existence. document carries id, subject_id, topic, current_revision, current_result_id and updated_at. versions are newest first; each has revision, result_id (null for a cleared revision), change (accepted or cleared), backfilled, recorded_at, the result's current result_status and evidence_kind, source_version_ids and source_state (live, withdrawn, removed, or null when cleared). A superseded brief's manifest version resolves to the result that was current at that revision. History rows are immutable; the current pointer stays on the document. Apply the companion document-version migration before using read_document_history."
},
"400": {
"description": "Invalid input"
Expand Down