Context
IdeaSubmission.targetRepo (packages/loopover-engine/src/idea-intake.ts:27) is currently a plain required string — the schema assumes a repo already exists (BYOR only). Now that auto-provisioned repos (APR — #7589's epic) are confirmed direction, this pure, IO-free bridge module needs to represent both cases so downstream consumers (AMS discovery, the provisioning driver) know which path a given idea submission takes.
Requirements
Change targetRepo's type from string to a discriminated union with exactly these two variants — do not invent additional variants or fields beyond what's specified here:
export type IdeaTarget =
| { kind: "existing"; repo: string }
| { kind: "provision" };
IdeaSubmission.targetRepo: IdeaTarget replaces the current targetRepo: string. Every place in this file (and its test file) that currently reads submission.targetRepo as a string must be updated to match on .kind first. This module stays pure (no IO, no AI) per its own file-header comment — do not add any repo-creation or provisioning logic here, only the type change and whatever validation logic already exists for targetRepo (adapted to the new shape).
Deliverables
Test Coverage Requirements
This file is under src/ via the packages/loopover-engine workspace — confirm current coverage.include scoping for this package before assuming the 99% patch gate applies exactly as src/** does; match whatever this package's existing test file already does for its coverage target, and add a case for both the "existing" and "provision" variants of any function that branches on targetRepo.
Expected Outcome
IdeaSubmission can represent an idea targeting either an existing repo or a not-yet-created one, with no consumer left silently assuming a repo already exists.
Links & Resources
Context
IdeaSubmission.targetRepo(packages/loopover-engine/src/idea-intake.ts:27) is currently a plain requiredstring— the schema assumes a repo already exists (BYOR only). Now that auto-provisioned repos (APR — #7589's epic) are confirmed direction, this pure, IO-free bridge module needs to represent both cases so downstream consumers (AMS discovery, the provisioning driver) know which path a given idea submission takes.Requirements
Change
targetRepo's type fromstringto a discriminated union with exactly these two variants — do not invent additional variants or fields beyond what's specified here:IdeaSubmission.targetRepo: IdeaTargetreplaces the currenttargetRepo: string. Every place in this file (and its test file) that currently readssubmission.targetRepoas a string must be updated to match on.kindfirst. This module stays pure (no IO, no AI) per its own file-header comment — do not add any repo-creation or provisioning logic here, only the type change and whatever validation logic already exists fortargetRepo(adapted to the new shape).Deliverables
IdeaTargettype added topackages/loopover-engine/src/idea-intake.ts,IdeaSubmission.targetReporetyped to it.targetRepoin this file updated to the new shape (compile-clean).Test Coverage Requirements
This file is under
src/via thepackages/loopover-engineworkspace — confirm currentcoverage.includescoping for this package before assuming the 99% patch gate applies exactly assrc/**does; match whatever this package's existing test file already does for its coverage target, and add a case for both the"existing"and"provision"variants of any function that branches ontargetRepo.Expected Outcome
IdeaSubmissioncan represent an idea targeting either an existing repo or a not-yet-created one, with no consumer left silently assuming a repo already exists.Links & Resources
packages/loopover-engine/src/idea-intake.ts:27(the field being changed)