Skip to content

feat(engine): IdeaTarget existing|provision union for idea intake#7646

Closed
kai392 wants to merge 6 commits into
JSONbored:mainfrom
kai392:feat/idea-target-union-7635
Closed

feat(engine): IdeaTarget existing|provision union for idea intake#7646
kai392 wants to merge 6 commits into
JSONbored:mainfrom
kai392:feat/idea-target-union-7635

Conversation

@kai392

@kai392 kai392 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • tsc --noEmit clean
  • Smoke: existing / provision / legacy string shapes via validateIdeaSubmission
  • CI validate-code + validate-tests green
  • Superagent clean (type-only; no shell spawn)

Closes #7635

@kai392
kai392 requested a review from JSONbored as a code owner July 21, 2026 06:00
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.53%. Comparing base (e78a03d) to head (00eced9).

Files with missing lines Patch % Lines
packages/loopover-mcp/bin/loopover-mcp.js 0.00% 5 Missing ⚠️
packages/loopover-mcp/bin/loopover-mcp.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7646   +/-   ##
=======================================
  Coverage   88.52%   88.53%           
=======================================
  Files         725      726    +1     
  Lines       76052    76081   +29     
  Branches    22640    22647    +7     
=======================================
+ Hits        67326    67357   +31     
+ Misses       7681     7679    -2     
  Partials     1045     1045           
Flag Coverage Δ
shard-1 33.20% <2.27%> (-3.17%) ⬇️
shard-2 36.28% <45.45%> (+0.62%) ⬆️
shard-3 36.01% <45.45%> (+4.61%) ⬆️
shard-4 40.83% <22.72%> (+1.77%) ⬆️
shard-5 29.66% <50.00%> (-2.22%) ⬇️
shard-6 31.23% <2.27%> (-2.70%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-engine/src/idea-intake.ts 100.00% <100.00%> (ø)
packages/loopover-mcp/lib/plan-idea-claims.ts 100.00% <100.00%> (ø)
src/api/routes.ts 95.09% <100.00%> (+<0.01%) ⬆️
src/mcp/server.ts 96.46% <100.00%> (+0.01%) ⬆️
packages/loopover-mcp/bin/loopover-mcp.ts 0.00% <0.00%> (ø)
packages/loopover-mcp/bin/loopover-mcp.js 0.00% <0.00%> (ø)

RealDiligent and others added 6 commits July 21, 2026 00:10
Co-authored-by: Cursor <cursoragent@cursor.com>
…jection

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@JSONbored
JSONbored force-pushed the feat/idea-target-union-7635 branch from de4ff6e to 00eced9 Compare July 21, 2026 07:10
@JSONbored

Copy link
Copy Markdown
Owner

This PR has taken an hour+ to be reviewed because it looks like CI keeps being retriggered by your commits...

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-21 07:27:27 UTC

18 files · 1 AI reviewer · no blockers · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This swaps `targetRepo: string` for a discriminated `IdeaTarget` union (`existing`/`provision`) to let APR ideas be submitted before a repo exists, and plumbs the new shape through `idea-intake.ts`, `existingTargetRepo`, the REST/MCP/stdio claim-plan surfaces, and the new shared `planIdeaClaimsPayload` handler. The change is well-targeted to #7635, correctly rejects `provision` targets at the claim/code/submit boundary (which still needs a concrete `owner/name`) while allowing `provision` through plain intake, and every touched call site (routes.ts, mcp/server.ts, both loopover-mcp.ts/.js CLI mirrors) was updated in lockstep with matching tests. Test coverage of `parseIdeaTarget`'s branches (missing, non-object, array, unknown kind, blank repo, malformed slug, valid existing/provision) looks thorough for the visible diff.

Nits — 5 non-blocking
  • codecov/patch is at 81.81% vs the 99% target for this diff — worth checking which branch in src/** (likely something in `idea-intake.ts` or one of the route/tool wiring sites) isn't hit by the added tests before merge.
  • `src/mcp/server.ts`'s target_repo_required error path casts `data` with `as unknown as Record<string, unknown>` (pre-existing pattern in this file, but worth a shared helper if it recurs further).
  • The compiled `.js`/sourcemap files (`plan-idea-claims.js`, `loopover-mcp.js`) are committed alongside their `.ts` sources — confirm this mirrors the repo's existing build/commit convention rather than being accidentally checked-in build output.
  • Consider extracting the `400` status literal at `src/api/routes.ts:3720` into the same named constant style used elsewhere in that file for consistency.
  • `packages/loopover-engine/src/idea-intake.ts`'s `parseIdeaTarget` (idea-intake.ts:~90) is at nesting depth 5 per the size scan — a small early-return restructure (switch on `input.kind` after the object check) would flatten it without changing behavior.

CI checks failing

  • codecov/patch — 81.81% of diff hit (target 99.00%)

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7635
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 27 registered-repo PR(s), 16 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 27 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: significant
Linked issue satisfaction

Addressed
The PR adds exactly the specified IdeaTarget discriminated union, retypes IdeaSubmission.targetRepo, updates all in-file references/validation logic (parseIdeaTarget) purely without IO, and comprehensively updates the test file with cases covering both 'existing' and 'provision' variants plus edge cases like legacy strings and malformed input.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Kotlin, Perl, TypeScript, Vue
  • Official Gittensor activity: 27 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants