feat(miner): add a pr-outcomes CLI for the hosted contributor outcome history#7998
Conversation
… history Closes JSONbored#7658. Adds 'loopover-miner pr-outcomes --miner-login <login> [--limit <n>] [--json]' calling the hosted GET /v1/contributors/:login/pr-outcomes with the existing loopover-mcp session posture (resolveLoopoverBackendSession, JSONbored#6487), following tenant-cli's structural template (exported parse fn, injectable fetch, fail-loud non-2xx). Dispatch lives in lib/cli.ts's now-async runCli so the whole path stays in-process-coverable (the bin dispatcher is subprocess-only-executed; see vitest.config.ts's coverage note); printHelp documents the command. Tests mock all HTTP per the package's *-cli.test conventions.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-22 04:32:08 UTC
Review summary Nits — 5 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.
|
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7998 +/- ##
==========================================
- Coverage 91.91% 88.57% -3.35%
==========================================
Files 739 97 -642
Lines 75876 22002 -53874
Branches 23023 3808 -19215
==========================================
- Hits 69745 19489 -50256
+ Misses 5038 2335 -2703
+ Partials 1093 178 -915
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
loopover-miner pr-outcomes --miner-login <login> [--limit <n>] [--json]CLI command that calls the hostedGET /v1/contributors/:login/pr-outcomes(the multi-tenant-safe, public-safe outcome source behindsrc/signals/contributor-pr-outcomes.ts) and prints the result — CLI only, per the issue's explicit scope (no MCP tool, no miner-ui surface).packages/loopover-miner/lib/pr-outcomes-cli.tsfollowstenant-cli.ts's structural template (exported parse function + injectablefetchImpl/session options + fail-loud non-2xx handling) and the package's established backend-call posture: the loopover-mcp session + API URL resolution fromresolveLoopoverBackendSession(feat(miner): consume ORB's live gate thresholds in self-review-context.js when available #6487), a Bearer-authed GET, andcli-error.ts's shared failure shape.--miner-loginmatchesattempt/loop's existing flag convention;--limitis validated to the route's own 1–100 integer contract client-side.lib/cli.ts'srunCli(now async; the bin fallback awaits it) rather than as anotherbin/loopover-miner.tsbranch: the bin dispatcher is subprocess-only-executed and genuinely Codecov-graded (see thepackages/loopover-miner/binnote invitest.config.ts'scoverage.include), so dispatching in the in-process-tested foundation module keeps the command's entire path measurable — the dispatch itself is covered by a real test instead of adding permanently-uncovered bin lines.printHelpdocuments the command.test/unit/miner-pr-outcomes-cli.test.ts, mirroring the package's*-cli.test.tsconventions, all HTTP via injected/stubbed fetch — no live network): parse validation (login required/valueless, limit range/integer, unknown option, stray positional), text and--jsonrendering including the null-pullNumberarm,?limitforwarding + login URL-encoding, bearer-header assertion, no-session fail-loud (real resolver against an empty temp config dir), non-2xx and thrown-fetch failure paths, the default-global-fetch arm, and therunClidispatch itself. The two existingrunCliunknown-command tests now await the async signature; the help test pins the new usage line.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:cigate was run from the repo root (it includes every check above plus the drift and miner-pack checks) and passed, followed bynpm audit --audit-level=moderate. The audit reports pre-existing advisories already present onmain's dependency tree (fast-uri, and@hono/node-servertransitively under@modelcontextprotocol/sdk/@cloudflare/codemode/agents) — this PR changes no dependencies, and those advisories are already being addressed by the open Renovate updates.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable — miner CLI surface only; no visible UI, frontend, docs, or extension change.
Notes
requireContributorAccess: a session may only read its own login's outcomes); the CLI sends the operator's existing loopover-mcp session token and fails loud with theloopover-mcp loginhint when none exists.src/**.bin/loopover-miner.tsline (awaiting the now-asyncrunClifallback) carries av8 ignorenote matching the file's documented subprocess-only-execution status; the behavior it guards is covered in-process vialib/cli.ts's dispatch test.