@@ -27,6 +27,7 @@ import {
2727 SCENARIO_MAX_LINKED_ISSUE_NUMBERS ,
2828 SCENARIO_MAX_REPO_FULL_NAME_CHARS ,
2929} from "@loopover/contract" ;
30+ import { validateIdeaSubmission } from "@loopover/engine" ;
3031import { MAX_NOTIFICATION_DELIVERY_ID_LENGTH as SRC_DELIVERY_ID , MAX_NOTIFICATION_MARK_READ_IDS as SRC_MARK_READ } from "../../src/db/repositories" ;
3132import { MAX_FOCUS_MANIFEST_BYTES as SRC_MANIFEST_BYTES } from "../../src/signals/focus-manifest" ;
3233import { MAX_LOCAL_SCORER_WARNING_CHARS as SRC_WARNING_CHARS , MAX_LOCAL_SCORER_WARNING_COUNT as SRC_WARNING_COUNT } from "../../src/signals/local-scorer-diagnostics" ;
@@ -108,6 +109,18 @@ describe("the moved schemas accept and reject what they always did (#9750)", ()
108109 // empty submission must REACH the handler rather than be rejected by the schema.
109110 expect ( intakeIdeaSchema . safeParse ( { } ) . success ) . toBe ( true ) ;
110111 expect ( intakeIdeaSchema . safeParse ( { constraints : Array . from ( { length : 51 } , ( ) => "c" ) } ) . success ) . toBe ( false ) ;
112+ expect ( intakeIdeaSchema . safeParse ( { targetRepo : { kind : "provision" } } ) . success ) . toBe ( true ) ;
113+ expect ( intakeIdeaSchema . safeParse ( { targetRepo : { kind : "existing" , repo : "acme/widgets" } } ) . success ) . toBe ( true ) ;
114+ expect ( intakeIdeaSchema . safeParse ( { targetRepo : "acme/widgets" } ) . success ) . toBe ( true ) ;
115+ expect ( intakeIdeaSchema . safeParse ( { targetRepo : 42 } ) . success ) . toBe ( false ) ;
116+ } ) ;
117+
118+ it ( "#10064: malformed object targetRepo passes the schema but is rejected by validateIdeaSubmission" , ( ) => {
119+ const body = { targetRepo : { kind : "existing" } } ;
120+ expect ( intakeIdeaSchema . safeParse ( body ) . success ) . toBe ( true ) ;
121+ const validated = validateIdeaSubmission ( body ) ;
122+ expect ( validated . ok ) . toBe ( false ) ;
123+ if ( ! validated . ok ) expect ( validated . errors ) . toContain ( "target_repo_required" ) ;
111124 } ) ;
112125
113126 it ( "leaves check-before-start entirely optional — the repository is the path param, not the body" , ( ) => {
0 commit comments