# HyperTwist Phase 6R-AI first-party provider-neutral custom-endpoint runtime routing preparation packet

Created on `2026-05-26`

## Status

- first-party HyperTwist packet
- source-backed `Phase 6R-AI` preparation/control slice

## Purpose

This packet scopes the next bounded first-party slice above the landed speech
session, payload-custody, provider-profile/BYOK custody, provider-routing,
usage/cost governance, real device-permission workflow, native capture-route
workflow/control, and operator-facing native capture-route shell seams.

The granted slice is:

- first-party provider-neutral custom-endpoint runtime routing only

It is not:

- a provider-specific overlay or settings-panel packet
- a managed gateway replacement packet
- an actual payment execution packet
- a provider-portal ownership packet
- an actual payload-shipping packet
- a broad assistant-platform packet

## Current authority basis

This control pass stands on:

- `docs/ops/HYPERTWIST_PROVIDER_NEUTRALITY_AND_BYOK_DOCTRINE_2026-05-21.md`
- `docs/arch/HYPERTWIST_PHASE6R_X_FIRST_PARTY_PROVIDER_PROFILE_AND_BYOK_CUSTODY_IMPLEMENTATION_PACKET_2026-05-24.md`
- `docs/arch/HYPERTWIST_PHASE6R_Y_FIRST_PARTY_PROVIDER_ROUTING_AND_POLICY_IMPLEMENTATION_PACKET_2026-05-24.md`
- `docs/arch/HYPERTWIST_PHASE6R_AH_FIRST_PARTY_OPERATOR_FACING_NATIVE_CAPTURE_ROUTE_WORKFLOW_SHELL_IMPLEMENTATION_PACKET_2026-05-26.md`
- `docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md`
- `docs/v6_5_deep_manual_pack/HyperTwist/ROADMAP.md`

The preserved owners do not change here:

- first-party HyperTwist remains the top-level provider/session owner
- first-party HyperTwist remains the provider-profile and BYOK custody owner
- first-party HyperTwist remains the provider routing/policy owner
- first-party HyperTwist remains the bounded custom-endpoint runtime routing
  owner for this slice
- `ggml-org/whisper.cpp` remains bounded to offline STT donor seams
- `SYSTRAN/faster-whisper` remains bounded to complementary Python
  orchestration/service-lane seams

## Granted family

The bounded `Phase 6R-AI` slice may land:

1. per-session provider-profile endpoint resolution for provider-backed HTTP
   speech session-open, utterance, close, and health flows
2. fallback health reflection that preserves the last requested provider
   profile and endpoint after failed provider-backed session-open attempts
3. bounded timeout/cancel safety hardening for provider-backed HTTP delegate
   completion
4. focused automation for:
   - custom-endpoint session-config retention
   - custom-endpoint fallback-health reflection
   - direct-client custom-endpoint health reflection
5. bounded contract-alignment updates for adjacent provider-profile and
   routing fallback expectations when a provider-profile endpoint exists but
   the provider-backed sidecar is unavailable

The packet must stay out of:

- provider-specific overlay or settings-panel ownership
- actual payment execution
- provider-portal ownership
- actual payload shipping
- actual OS permission-grant execution
- low-level native capture-route takeover

## Proposed implementation shape

Land the narrower first-party boundary through:

- retained speech-client state for the last requested session config
- provider-profile endpoint and label resolution in:
  - `UHyperTwistHttpSpeechClient`
- per-session runtime routing for:
  - speech session open
  - utterance submission
  - speech session close
  - service-health fetch
- fallback-health routing posture that preserves:
  - provider profile id
  - provider profile endpoint
  - provider-route decision posture
  - custom-endpoint route selection state
- focused automation in:
  - `HyperTwistWhisperCppPhase6RAICustomEndpointRuntimeContractTest.cpp`
- retroactive bounded contract alignment in:
  - `HyperTwistWhisperCppPhase6RXProviderProfileByokContractTest.cpp`
  - `HyperTwistWhisperCppPhase6RYProviderRoutingPolicyContractTest.cpp`

## Validation target

Validate with:

- Unreal build for `UnrealHyperTwistEditor Win64 Development`
- focused automation:
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.AI.CustomEndpointSessionConfig`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.AI.CustomEndpointHealthFallback`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.AI.DirectClientHealthReflection`
- regressions:
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.X.ProviderProfileServiceHealth`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.X.ProviderBackedByokFallback`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.Y.ProviderRoutingPolicyServiceHealth`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.Y.ProviderBackedRoutingFallback`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.AG.NativeCaptureRouteWorkflowPreparationState`
  - `HyperTwist.Permissive.WhisperCpp.Phase6R.AH.NativeCaptureRouteShellPreparationState`

## Queue effect

If this packet lands cleanly, OpenAI-compatible custom-endpoint support should
no longer remain a custody-only doctrine target. A bounded first-party runtime
routing seam becomes live above the landed provider-profile/BYOK and
provider-routing lanes.

Do not open `Phase 6R-AJ` by default after this packet.

If a later speech/provider-adjacent first-party packet is justified, it must
prove a narrower remaining downstream provider-neutral runtime or
operator-facing consumer gap before widening into:

- provider-specific overlays or settings ownership
- actual payment execution
- provider-portal ownership
- actual payload shipping
- actual OS permission-grant execution
- broad assistant-platform scope
