Skip to content

Add existing-vs-provision target discriminated union to IdeaSubmission.targetRepo #7635

Description

@JSONbored

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

  • IdeaTarget type added to packages/loopover-engine/src/idea-intake.ts, IdeaSubmission.targetRepo retyped to it.
  • Every existing reference to targetRepo in this file updated to the new shape (compile-clean).
  • Existing test file for this module updated for the new shape — no test coverage regression.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions