Skip to content

feat(review): wire handleParity/handleInternalDecision/handleInternalCalibration into real routes (fully built, documented, never routed) #6166

Description

@JSONbored

Context

Three handlers are fully implemented and unit-tested, each carrying route-shaped JSDoc describing an intended endpoint, but none is actually registered in src/api/routes.ts:

  • handleParity (src/review/stats.ts:486) — documented as GET /<slug>/internal/parity. The only real /v1/internal/parity route in production is served by a different module (parity-wire.ts), so this one may be a superseded duplicate rather than a true gap — verify which is meant to be canonical before wiring both.
  • handleInternalDecision (src/review/ops.ts:425) — documented as GET /<slug>/internal/decision?repo=....
  • handleInternalCalibration (src/review/ops.ts:476) — documented as GET /<slug>/internal/calibration.

Zero production callers anywhere in src/** for any of the three; only their own tests exercise them. These are documented endpoints an operator can never actually hit today.

Requirements

  • For handleParity: first determine whether it's a genuine duplicate of parity-wire.ts's existing /v1/internal/parity route (compare their logic) or a distinct, still-needed endpoint. If it's a true duplicate, remove handleParity instead of routing it (note this finding in the PR). If it's genuinely distinct, route it under a non-colliding path.
  • For handleInternalDecision and handleInternalCalibration: register both in src/api/routes.ts, matching their own documented method/path, following this repo's existing pattern for other /internal/* operator routes (check auth/access-control conventions used by sibling internal routes).
  • Do not change the handlers' own logic — only wire routing (or, for the parity case, resolve the duplication).

Test Coverage Requirements

99%+ Codecov patch coverage on src/api/routes.ts's new registrations; the handlers' existing unit tests should continue passing.

Deliverables

  • handleParity either routed (if genuinely distinct from parity-wire.ts) or removed (if a confirmed duplicate), with the decision documented in the PR.
  • handleInternalDecision routed at its documented path.
  • handleInternalCalibration routed at its documented path.

Expected Outcome

An operator can actually reach the documented /internal/decision and /internal/calibration endpoints; the parity-handler duplication (if confirmed) is resolved instead of left as dead code.

Links & Resources

  • src/review/stats.ts:486, src/review/ops.ts:425,476
  • src/api/routes.ts (where routing needs to be added)
  • parity-wire.ts (the possibly-canonical /v1/internal/parity implementation to compare against)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions