Skip to content

feat(api): REST + CLI mirror for loopover_check_improvement_potential#6955

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:feat/improvement-potential-rest-cli-6748
Jul 17, 2026
Merged

feat(api): REST + CLI mirror for loopover_check_improvement_potential#6955
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:feat/improvement-potential-rest-cli-6748

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Add POST /v1/lint/improvement-potential delegating to buildStructuralImprovementAssessment (schema parity with the MCP tool).
  • Add loopover-mcp improvement-potential CLI subcommand mirroring slopRiskCli (HTTP → API, no source upload).
  • Unit tests for the route and CLI, plus fixture-server support.

Closes #6748.

Test plan

  • CI validate-code / unit tests green
  • codecov/patch ≥ 99%
  • Route parity: identical input yields same assessment as the builder
  • CLI: plain + --json + --help + invalid --patch-coverage-delta

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 17, 2026 15:30
@superagent-security

Copy link
Copy Markdown
Contributor

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

Closes JSONbored#6748.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.71%. Comparing base (8fa47d1) to head (62fc726).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6955   +/-   ##
=======================================
  Coverage   93.71%   93.71%           
=======================================
  Files         685      685           
  Lines       68373    68379    +6     
  Branches    18729    18730    +1     
=======================================
+ Hits        64074    64080    +6     
  Misses       3302     3302           
  Partials      997      997           
Flag Coverage Δ
shard-1 43.75% <33.33%> (-0.01%) ⬇️
shard-2 36.80% <33.33%> (-0.01%) ⬇️
shard-3 32.79% <33.33%> (+0.06%) ⬆️
shard-4 34.60% <100.00%> (-0.02%) ⬇️
shard-5 32.13% <33.33%> (-0.01%) ⬇️
shard-6 45.74% <33.33%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
src/api/routes.ts 94.81% <100.00%> (+0.01%) ⬆️

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

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-17 15:39:37 UTC

5 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · unknown

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This adds a REST route (POST /v1/lint/improvement-potential) that thin-delegates to the existing buildStructuralImprovementAssessment builder, and a CLI subcommand mirroring the established slopRiskCli HTTP-proxy pattern, with schema parity claimed against the MCP tool's shape. The route, CLI, and fixture-server wiring all follow existing sibling conventions (slop-risk) closely, tests cover route pass-through, 400s on invalid input, CLI plain/--json/--help/invalid-flag paths, and no-source-upload/no-leaked-terms assertions. The PR closes #6748 as stated, and CI is green including codecov/patch, so this looks like a clean, well-targeted parity addition with no logic of its own to get wrong.

Nits — 5 non-blocking
  • The improvementPotentialSchema in src/api/routes.ts:582-616 repeats the same literal bounds (400, 2000) seen in the sibling slopRiskSchema — consider extracting shared limit constants if this pattern grows further.
  • packages/loopover-mcp/bin/loopover-mcp.js:3541 nests to depth 5 in improvementPotentialCli's option-building; consider extracting the payload-building block into a small helper for readability.
  • The route/CLI doc comments claim 'VERBATIM' parity with checkImprovementPotentialShape in src/mcp/server.ts, but that file isn't in the diff — worth a reviewer double-check that the shapes truly match rather than trusting the comment.
  • Consider adding a schema-parity test that imports checkImprovementPotentialShape directly and diffs it against improvementPotentialSchema, rather than relying on comment-asserted parity.
  • If more REST/CLI mirror routes follow this pattern, factor the repeated max(400)/max(2000) bounds into named constants shared across schemas.

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 #6748
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High 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: 389 registered-repo PR(s), 194 merged, 33 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 389 PR(s), 33 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 389 PR(s), 33 issue(s).
  • Related work: Titles/paths share 6 meaningful terms. (issue #6744)
  • Related work: Titles/paths share 6 meaningful terms. (issue #6747)
  • Related work: Titles/paths share 6 meaningful terms. (issue #6746)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 27c7c59 into JSONbored:main Jul 17, 2026
16 checks passed
This was referenced Jul 17, 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.

REST + CLI mirror for loopover_check_improvement_potential

1 participant