Skip to content

Validate headless requests and repair hosted creative contracts - #1028

Merged
sidneyswift merged 6 commits into
mainfrom
codex/reconcile-priority-1-7
Oct 11, 2026
Merged

sidneyswift merged 6 commits into
mainfrom
codex/reconcile-priority-1-7

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 11, 2026 6:45pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: recoupable/api/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e89fef64-e54b-4225-acd8-eacba71c1f1f

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 issues found across 21 files

Confidence score: 3/5

  • validateCreateImageBody.ts still accepts valid aspect_ratio values, and buildImageInput forwards them to Muse despite the PR description saying they’re rejected. Reject them before forwarding if rejection is the intended behavior.
  • published-docs.json includes sourceHashes for OpenAPI files that aren’t in the repository, and publishedDocs.test.ts only 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";

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

Comment thread lib/chat/runs/validateChatRunRequest.ts Resolved
{
"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",

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: 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({

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

Comment thread app/api/content/video/route.ts Resolved
Comment thread lib/content/__tests__/schemas.test.ts Resolved
Comment thread lib/content/__tests__/schemas.test.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@sidneyswift
sidneyswift merged commit 139d002 into main Oct 11, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 40fc247d Deployed Oct 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant