Repository navigation
Validate headless requests and repair hosted creative contracts - #1028
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
3 issues found across 21 files
Confidence score: 3/5
validateCreateImageBody.tsstill accepts validaspect_ratiovalues, andbuildImageInputforwards them to Muse despite the PR description saying they’re rejected. Reject them before forwarding if rejection is the intended behavior.published-docs.jsonincludessourceHashesfor OpenAPI files that aren’t in the repository, andpublishedDocs.test.tsonly checks the fixture, so published examples can drift without CI catching it. Tie the fixture to the actual published sources or generate it from them.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. 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. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/contracts/__tests__/publishedDocs.test.ts">
<violation number="1" location="lib/contracts/__tests__/publishedDocs.test.ts:10">
P2: These tests validate only the checked-in fixture, so changes to the published OpenAPI examples can drift without failing CI. Tie the fixture to the published sources by verifying its `sourceHashes` or generating the examples from those sources.</violation>
</file>
<file name="lib/contracts/fixtures/published-docs.json">
<violation number="1" location="lib/contracts/fixtures/published-docs.json:4">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**
These `sourceHashes` entries reference three `content/docs/source/api-reference/openapi/*.json` files that do not exist in this repository, so the fixture contains fabricated integrity references. Remove them or update them to checked-in source files and verify the digests.</violation>
</file>
<file name="lib/content/image/validateCreateImageBody.ts">
<violation number="1" location="lib/content/image/validateCreateImageBody.ts:8">
P2: Custom agent: **Flag AI Slop and Fabricated Changes**
The PR description claims image validation rejects `aspect_ratio`, but this image schema still accepts valid values and `buildImageInput` forwards them to Muse Image. Update the description to distinguish the video-only obsolete control, or remove `aspect_ratio` from the image contract if rejection is intended.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| import { validateChatRunRequest } from "@/lib/chat/runs/validateChatRunRequest"; | ||
| import { validateGetResearchTrackStatsRequest } from "@/lib/research/validateGetResearchTrackStatsRequest"; | ||
| import { creditsToUsd } from "@/lib/credits/creditsToUsd"; | ||
| import fixture from "../fixtures/published-docs.json"; |
There was a problem hiding this comment.
P2: These tests validate only the checked-in fixture, so changes to the published OpenAPI examples can drift without failing CI. Tie the fixture to the published sources by verifying its sourceHashes or generating the examples from those sources.
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 lib/contracts/__tests__/publishedDocs.test.ts, line 10:
<comment>These tests validate only the checked-in fixture, so changes to the published OpenAPI examples can drift without failing CI. Tie the fixture to the published sources by verifying its `sourceHashes` or generating the examples from those sources.</comment>
<file context>
@@ -0,0 +1,63 @@
+import { validateChatRunRequest } from "@/lib/chat/runs/validateChatRunRequest";
+import { validateGetResearchTrackStatsRequest } from "@/lib/research/validateGetResearchTrackStatsRequest";
+import { creditsToUsd } from "@/lib/credits/creditsToUsd";
+import fixture from "../fixtures/published-docs.json";
+
+vi.mock("@/lib/auth/validateAuthContext", () => ({
</file context>
| { | ||
| "evidence": "Copyable syntax only. URLs are placeholders; no provider, payment or customer workflow is exercised.", | ||
| "sourceHashes": { | ||
| "content/docs/source/api-reference/openapi/accounts.json": "f1bdfe7150f4bda12381a16c4a89da2322b6a871e204e1e1da48c87ed1b95a64", |
There was a problem hiding this comment.
P2: Custom agent: Flag AI Slop and Fabricated Changes
These sourceHashes entries reference three content/docs/source/api-reference/openapi/*.json files that do not exist in this repository, so the fixture contains fabricated integrity references. Remove them or update them to checked-in source files and verify the digests.
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 lib/contracts/fixtures/published-docs.json, line 4:
<comment>These `sourceHashes` entries reference three `content/docs/source/api-reference/openapi/*.json` files that do not exist in this repository, so the fixture contains fabricated integrity references. Remove them or update them to checked-in source files and verify the digests.</comment>
<file context>
@@ -0,0 +1,51 @@
+{
+ "evidence": "Copyable syntax only. URLs are placeholders; no provider, payment or customer workflow is exercised.",
+ "sourceHashes": {
+ "content/docs/source/api-reference/openapi/accounts.json": "f1bdfe7150f4bda12381a16c4a89da2322b6a871e204e1e1da48c87ed1b95a64",
+ "content/docs/source/api-reference/openapi/content.json": "ebe0ced0ee49d1394a5275e9cd57f451d27c2fd1d667b963c299a382ada87f5e",
+ "content/docs/source/api-reference/openapi/research.json": "320cfd7dac57be22a8e2da95f48f2888bbff8c3dfe5016cf0773c0a24201459d"
</file context>
| import { validateAuthContext } from "@/lib/auth/validateAuthContext"; | ||
|
|
||
| export const createImageBodySchema = z.object({ | ||
| const imageParamsSchema = z.strictObject({ |
There was a problem hiding this comment.
P2: Custom agent: Flag AI Slop and Fabricated Changes
The PR description claims image validation rejects aspect_ratio, but this image schema still accepts valid values and buildImageInput forwards them to Muse Image. Update the description to distinguish the video-only obsolete control, or remove aspect_ratio from the image contract if rejection is intended.
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 lib/content/image/validateCreateImageBody.ts, line 8:
<comment>The PR description claims image validation rejects `aspect_ratio`, but this image schema still accepts valid values and `buildImageInput` forwards them to Muse Image. Update the description to distinguish the video-only obsolete control, or remove `aspect_ratio` from the image contract if rejection is intended.</comment>
<file context>
@@ -5,7 +5,7 @@ import { getCorsHeaders } from "@/lib/networking/getCorsHeaders";
import { validateAuthContext } from "@/lib/auth/validateAuthContext";
-export const createImageBodySchema = z.object({
+const imageParamsSchema = z.strictObject({
prompt: z.string().min(1).optional(),
image_urls: z.array(z.string().url()).min(1).max(10).optional(),
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 15 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 7 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.
View guided diff | Turn on auto-fix | Re-trigger cubic
Headless runs reject malformed parts-based AI SDK UIMessage payloads before provisioning sessions, keys or workflows. Creative validators translate supported legacy image references and reject obsolete semantic controls before paid generation; image aspect_ratio remains supported, while direct video uses integer duration, resolution and first/last-frame inputs.
A bounded audio-driven lipsync endpoint restores the existing hosted preset's worker integration with a fixed supported model, rate limiting and credit preflight/accounting. Research responses preserve nested generic artist/track IDs without dropping raw metadata; blank or non-string values cannot mask valid nested IDs, and milestones retain the adapter's activity feed instead of returning an empty list.
Validation: 102 focused tests passed, including seven published-doc examples and 18 research adapter tests with no provider calls. The earlier full suite passed 6,348 tests with 12 skipped; the production build and scoped lint passed. After merging current main, the sidebar and adapter tests passed (14). Marketing's contract CI checks the example fixture and specification hashes against this pinned API commit.
Release API before Tasks #157. Then inspect a real selected-clip lipsync artifact for audio and perceptual alignment; local tests do not establish that customer outcome. OAuth host discovery and live headless verification remain separate. Keep acceptance tickets open until deployed verification.
Coordinates epic #318, packages 1, 4–7; mono#334, mono#348, mono#325 and mono#360.