Skip to content

feat: client-neutral model-effort routing (run 106) - #302

Merged
try-works merged 38 commits into
devfrom
recursive/106-client-neutral-model-effort-routing
Oct 6, 2026
Merged

try-works merged 38 commits into
devfrom
recursive/106-client-neutral-model-effort-routing

Conversation

@try-works

Copy link
Copy Markdown
Owner

Client-neutral model-effort routing (run 106)

Implements run 106, which makes the router's reasoning-effort routing client-neutral: the client's requested effort and effort policy (strict | preferred | router) are normalized losslessly, and the four effort-source states (named | disabled | provider_default | none) are distinguished at the decision layer while the occurrence/telemetry layer keeps the binary vocabulary the Track-B workers require.

What changed (R1-R15)

  • R1/R3 — normalizeReasoningEffortPolicy + resolveEffortPolicy (policy normalization + resolution kind) wired at both chat and responses ingress.
  • R2 — expandReasoningEffortArms wired into buildEndpointRegistry, gated on adapter executability (a catalog declaration alone never makes an arm routable).
  • R4 — four-state EffortSource (named/disabled/provider_default/none) + lossless migration/round-trip; decision four-state, occurrence binary.
  • R5 — resolveRelatedEffortOverallScore producer + resolveBorrowedQualityPrior consumer; borrowed priors are never relabeled "benchmark" and never establish non-inferiority.
  • R6 — controller/advisory/cache/circuit effort-awareness.
  • R7 — turn-aware difficulty (current-turn signals).
  • R8 — shouldPreferNonInferiorChallenger + non_inferiority_promotion receipt.
  • R9 — computeEffortUnionAndIntersection + provider-default declared levels in discovery.
  • R10 — decision provenance: requested_effort, requested_policy, exact-arm counts, effort_resolution, effective_effort.
  • R11 — operator/UI truthfulness (effort+evidence co-display across surfaces).
  • R12 — packaged SEA (Effect-first, no new external deps).
  • R13 — strict TDD (RED/GREEN evidence).
  • R14 — delegated audits.
  • R15 — packaged SEA + real Pi QA.

Real behavior proof

  • Packaged SEA: role-model-dev.exe sha256 e181c6011a50a7e9681d6f16314ae7cefcbe7ca26bb21eeac34343b3befc7364 (commit 9260a10b), launched on isolated port 3462.
  • Real Pi CLI (ROLE_MODEL_ENDPOINT=http://127.0.0.1:3462) routed through role-model, producing matching IDs in runtime telemetry: requestId req-9d68e76b-dbe3-417c-8cfa-022f6c000e51 + routingDecisionId decision-req-9d68e76b... -> deepseek.personal.deepseek-api-key.global.deepseek-v4-pro.
  • Strict-vs-router contrast (second client, HTTP): strict + effort=max -> ...-v4-flash-max (exact arm); router/omitted -> provider-default arm.

Verification

  • pnpm run schemas:validate - 37 schema files + 30 fixtures validated.
  • Full build (pnpm -r --if-present build) - green.
  • @role-model-router/core - 113 tests green.
  • @role-model/conformance - 53/53.
  • Full host-bridge suite - 2063/2068 passed, 5 skipped (3 conditional: private kw artifacts absent, packaged-standalone-restart).
  • lint-recursive-run - FAIL:0 WARN:0; all run-106 phases LOCKED.

What I did not test

  • Moonshot kimi-k3 live execution (its OAuth token is stale; deepseek api-key was verified end-to-end).
  • The two conditional-skip suites (kw-private-loader, kw-prompt-inject-map-surface) which require private kw artifacts.

…y at occurrence boundary, four-state at decision)
Merge origin/dev (run 105 + the release-pipeline fixes) into the run-106 branch.

Conflicts (2):
- .recursive/STATE.md: hand-merged. Run 106 keeps the "current increment" slot and
  run 105's paragraph and four closeout caveats are preserved beneath it.
- apps/runtime-host-bridge/src/index.ts (failure telemetry): union of both changes -
  run 105's persistFailureTelemetrySafely wrapper carrying run 106's effortCoerced
  field, matching the success path that already emits it.

Pre-existing branch breakage repaired so the quality gate can pass (the branch CI was
already red before this merge): biome formatting across the run-106 files, and seven
lint/style/useTemplate fixes - one of them in production code
(packages/adapter-execution/src/index.ts).
Biome formatting for the query-time projection added in 953e6e7 (collapse the mapped-value return to a single line). No semantic change.
@try-works
try-works merged commit de1c04a into dev Oct 6, 2026
20 of 21 checks passed
@try-works
try-works deleted the recursive/106-client-neutral-model-effort-routing branch October 6, 2026 04:59
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant