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
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)
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 asGET /<slug>/internal/parity. The only real/v1/internal/parityroute 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 asGET /<slug>/internal/decision?repo=....handleInternalCalibration(src/review/ops.ts:476) — documented asGET /<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
handleParity: first determine whether it's a genuine duplicate ofparity-wire.ts's existing/v1/internal/parityroute (compare their logic) or a distinct, still-needed endpoint. If it's a true duplicate, removehandleParityinstead of routing it (note this finding in the PR). If it's genuinely distinct, route it under a non-colliding path.handleInternalDecisionandhandleInternalCalibration: register both insrc/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).Test Coverage Requirements
99%+ Codecov patch coverage on
src/api/routes.ts's new registrations; the handlers' existing unit tests should continue passing.Deliverables
handleParityeither routed (if genuinely distinct fromparity-wire.ts) or removed (if a confirmed duplicate), with the decision documented in the PR.handleInternalDecisionrouted at its documented path.handleInternalCalibrationrouted at its documented path.Expected Outcome
An operator can actually reach the documented
/internal/decisionand/internal/calibrationendpoints; 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,476src/api/routes.ts(where routing needs to be added)parity-wire.ts(the possibly-canonical/v1/internal/parityimplementation to compare against)