feat(engine): represent idea targetRepo as an existing-vs-provision union - #7710
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7710 +/- ##
==========================================
- Coverage 88.56% 88.55% -0.01%
==========================================
Files 725 725
Lines 76266 76271 +5
Branches 22705 22707 +2
==========================================
+ Hits 67544 67545 +1
Misses 7680 7680
- Partials 1042 1046 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…nion IdeaSubmission.targetRepo was a plain string, assuming a repo already exists (BYOR only). With auto-provisioned repos (JSONbored#7589) confirmed direction, this pure IO-free bridge module needs to represent both cases so downstream consumers know which path a submission takes. Introduce IdeaTarget = { kind: "existing"; repo: string } | { kind: "provision" } and retype targetRepo to it. Validation stays backward-compatible: a bare "owner/name" string is the existing-repo wire form (format-checked as before), a { kind: "provision" } object requests a not-yet-created repo. Same error codes (target_repo_required / target_repo_malformed), and the zod request schemas are unchanged so an existing BYOR caller POSTing the bare string keeps working. buildClaimPlan now accepts IdeaTarget | string and resolves it to a repo string internally ("" for a not-yet-provisioned target), so every caller threading a submission's targetRepo compiles unchanged -- no consumer file touched, ClaimStep/ClaimPlan.targetRepo stays a plain string. Closes JSONbored#7635
745357e to
7994ebf
Compare
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 10:36:33 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
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.
|
Problem
IdeaSubmission.targetRepo(packages/loopover-engine/src/idea-intake.ts) is a plainstring, assuming a repo already exists (BYOR only). With auto-provisioned repos (#7589) confirmed direction, this pure IO-free bridge module needs to represent both cases so downstream consumers know which path a submission takes.Change
IdeaSubmission.targetRepois retyped toIdeaTarget.Backward-compatible input (no wire-contract break). Validation still accepts a bare
"owner/name"string as the existing-repo form (same regex/error codes) and resolves it to{ kind: "existing", repo }; a{ kind: "provision" }object requests a not-yet-created repo. The zod request schemas are deliberately unchanged — an existing BYOR caller POSTing the historical bare string keeps working.No consumer file touched.
buildClaimPlannow acceptsIdeaTarget | stringand resolves it to a repo string internally (""for a not-yet-provisioned target). Every caller threading a submission'stargetRepointo it (the/v1/loop/plan-idea-claimsroute, the remote MCP server, the MCP CLI bin) compiles unchanged —ClaimStep/ClaimPlan.targetRepostays a plain string. The whole diff is the engine module + its test.Verification
packages/loopover-engine/src/idea-intake.ts: 100% — 90/90 statements, 98/98 branches (both validation forms incl. provision + malformed + object-without-provision-kind rejection, and all threebuildClaimPlanargument shapes: bare string, existing target, provision target).npm run typecheckexits 0;@loopover/enginebuild exits 0; the mcp bin is untouched socheck-build-driftstays clean.idea-intake-bridge,routes-intake-idea,routes-plan-idea-claims,mcp-cli-plan-idea-claims-tool. Bare-string input still validates, so the intake tests need no changes.Closes #7635