Skip to content

openapi: 5 repo maintainer-report routes missing from spec (maintainer-noise, ams-miner-cohort, gate-precision, outcome-calibration, activation-preview) - #9422

Closed
phamngocquy wants to merge 1 commit into
JSONbored:mainfrom
phamngocquy:miner/issue-9302
Closed

Conversation

@phamngocquy

Copy link
Copy Markdown
Contributor

Summary

Five GET /v1/repos/:owner/:repo/* maintainer-report routes in src/api/routes.ts are all live,
maintainer-authenticated, and each already has an MCP tool with its own Zod output shape in
src/mcp/server.ts — but none of the five appears in src/openapi/spec.ts:

  • .../maintainer-noiseloopover_get_maintainer_noise. Its response schema,
    MaintainerNoiseReportSchema, is even already imported into spec.ts and
    registry.register("MaintainerNoiseReport", MaintainerNoiseReportSchema)'d as a component — it is
    simply never attached to a registerPath, so it's orphaned in the components section and
    unreachable from paths.
  • .../ams-miner-cohortloopover_get_ams_miner_cohort. Same situation: AmsMinerCohortComparisonSchema
    is registered as a component but never attached to a path.
  • .../gate-precisionloopover_get_gate_precision (outputSchema: gatePrecisionOutputSchema,
    no OpenAPI schema exists yet).
  • .../outcome-calibrationloopover_get_outcome_calibration (outputSchema: maintainerMeasurementReportOutputSchema, no OpenAPI schema exists yet).
  • .../activation-previewloopover_get_activation_preview (outputSchema: activationPreviewOutputSchema, no OpenAPI schema exists yet).

All five share the same owner/repo path params and maintainer-only auth boundary as their
already-documented sibling .../gate-config/effective and .../live-gate-thresholds (#6611 fixed
this same class of gap for .../gate-config/effective).

Deliverables

  • registerPath entries added for all five routes in src/openapi/spec.ts.
  • Three new response schemas added to src/openapi/schemas.ts for gate-precision,
    outcome-calibration, and activation-preview, matching their MCP tools' output shapes
    field-for-field.
  • apps/loopover-ui/public/openapi.json regenerated via npm run ui:openapi and committed.
  • npm run ui:openapi:check passes in CI.

All deliverables are required in this one PR — there is no follow-up issue.

Test plan

99%+ Codecov patch target (codecov/patch, unsharded via npm run test:coverage) on any new schema
helper code. Add a regression test asserting all five paths appear in buildOpenApiSpec()'s output
with the correct method and a response schema whose keys match each route's MCP tool output shape.

Fixes #9302

@phamngocquy
phamngocquy requested a review from JSONbored as a code owner July 27, 2026 17:47
…r-noise, ams-miner-cohort, gate-precision, outcome-calibration, activation-preview)

Fixes JSONbored#9302
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-27 18:07:52 UTC

5 files · 1 AI reviewer · no blockers · CI green · dirty

⏸️ Suggested Action - Manual Review

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 4 non-blocking
  • The external brief's 'magic numbers' flags (200/401/403 HTTP status codes) are standard OpenAPI response-key literals matching every other route in spec.ts, not a real style issue.
  • src/openapi/schemas.ts uses z.unknown() for several nested fields (perGateType items, overall, slop, recommendations, findingCodeCounts, samples) rather than fully-typed shapes, which is consistent with the existing maintainerMeasurementReportOutputSchema pattern per the code comment but means the OpenAPI schema for those fields stays opaque (`nullable`-only) in the generated JSON.
  • Confirm `npm run ui:openapi:check` was actually run against this exact openapi.json commit (CI passed, so this is likely already satisfied) to ensure the checked-in JSON has zero drift from spec.ts.
  • Since three of the five schemas are net-new response shapes (GatePrecisionResponse, OutcomeCalibrationResponse, ActivationPreviewResponse) built by hand rather than derived via `.openapi()` chaining like their siblings, double check they'll stay in sync if the underlying `gatePrecisionOutputSchema` etc. in server.ts changes shape in the future — the new parity test in openapi.test.ts should catch this given it checks property-key equality.

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 #9302
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: 14 registered-repo PR(s), 7 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor phamngocquy; Gittensor profile; 14 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The diff adds registerPath entries for all five routes, defines the three new response schemas (GatePrecisionResponse, OutcomeCalibrationResponse, ActivationPreviewResponse) sourced from the MCP tool output shapes, attaches the two previously-orphaned component schemas, regenerates and commits openapi.json, and adds a regression test asserting all five paths and schema field parity with their MCP

Review context
  • Author: phamngocquy
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 14 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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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.

Decision record
  • action: merge · clause: success
  • config: 1b5f3c7880afd46e26935e1852e5facc32833c2c26611ec00837101e1e2a271d · pack: oss-anti-slop · ci: passed
  • record: 53cbece3c1b8ff80107f98911f103a85eded5afed34bf6041b74df3d0b3c3acc (schema v5, head 41d147f)
Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 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

@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.09%. Comparing base (71aad1a) to head (41d147f).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9422       +/-   ##
===========================================
- Coverage   89.53%   76.09%   -13.44%     
===========================================
  Files         843      278      -565     
  Lines      109938    59615    -50323     
  Branches    26184     8446    -17738     
===========================================
- Hits        98436    45367    -53069     
- Misses      10239    13955     +3716     
+ Partials     1263      293      -970     
Flag Coverage Δ
backend 97.72% <100.00%> (+2.47%) ⬆️

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

Files with missing lines Coverage Δ
src/mcp/server.ts 97.13% <100.00%> (ø)
src/openapi/schemas.ts 100.00% <100.00%> (ø)
src/openapi/spec.ts 99.54% <100.00%> (+0.01%) ⬆️

... and 703 files with indirect coverage changes

@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 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openapi: 5 repo maintainer-report routes missing from spec (maintainer-noise, ams-miner-cohort, gate-precision, outcome-calibration, activation-preview)

1 participant