Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
528d567
test(routing): forbid heuristic batch and embedding decisions
seonghobae Sep 1, 2026
503c25f
chore(ci): add one-shot no-heuristic batch repair driver
seonghobae Sep 1, 2026
8e7b762
fix(routing): add evidence-bounded batch policy
seonghobae Sep 1, 2026
1126165
fix(routing): bind evidence-only decision surfaces
seonghobae Sep 1, 2026
9528c0b
chore(ci): remove unused source-fix workflow
seonghobae Sep 1, 2026
7818f48
test(routing): retire implicit batch selection contracts
seonghobae Sep 1, 2026
ceaf615
test(routing): fail closed on cost ties and pseudo-embeddings
seonghobae Sep 1, 2026
cde4b4b
test(embeddings): require explicit local semantics
seonghobae Sep 1, 2026
ca840d7
docs(adr): replace heuristic routing with evidence boundary
seonghobae Sep 1, 2026
66decc0
fix(routing): require unique embedding evidence
seonghobae Sep 1, 2026
ff58354
fix(routing): bind coordinator to evidence-only selection
seonghobae Sep 1, 2026
c17600d
test(routing): cover ambiguous embedding selection
seonghobae Sep 1, 2026
25250ff
test(routing): reject psychometric transfer heuristics
seonghobae Sep 1, 2026
b2cd27e
fix(routing): fail closed on psychometric transfer ambiguity
seonghobae Sep 1, 2026
c3f55b1
docs(routing): retire static evidence heuristics
seonghobae Sep 1, 2026
f335cce
test(routing): prohibit static model-selection fallbacks
seonghobae Sep 1, 2026
811d5bc
fix(routing): require identified model-selection evidence
seonghobae Sep 1, 2026
6e3babb
fix(routing): activate fail-closed model selection
seonghobae Sep 1, 2026
8163ea7
fix(routing): keep group admin order non-authoritative
seonghobae Sep 1, 2026
0e457c2
fix(routing): separate group diagnostics from inference order
seonghobae Sep 1, 2026
2c4ee1c
test(routing): retire model-group composite score
seonghobae Sep 1, 2026
5704e06
fix(routing): retire composite model-group score authority
seonghobae Sep 1, 2026
af1ed62
chore(ci): add exact-head NIM cost repair
seonghobae Sep 1, 2026
f3fec91
ci: trigger NIM cost dominance repair
seonghobae Sep 1, 2026
5f64c95
fix(ci): validate PR1000 repair against live branch ref
seonghobae Sep 1, 2026
7c61081
ci: retrigger NIM cost dominance repair
seonghobae Sep 1, 2026
cb037d6
chore(ci): extend PR 1000 source fix to token evidence
seonghobae Sep 1, 2026
7d49840
chore(ci): trigger PR 1000 token evidence repair
seonghobae Sep 1, 2026
159020b
chore(ci): retire failed PR 1000 repair driver
seonghobae Sep 1, 2026
f7ef118
chore(ci): remove failed PR 1000 repair trigger
seonghobae Sep 1, 2026
5b9918f
test(benchmark): require evidence-only token and price decisions
seonghobae Sep 1, 2026
1a108be
chore(ci): add PR 1000 evidence repair driver
seonghobae Sep 1, 2026
b1432d1
chore(ci): add PR 1000 evidence repair workflow v2
seonghobae Sep 1, 2026
2292cc2
chore(ci): trigger PR 1000 evidence repair v2
seonghobae Sep 1, 2026
bd1cce6
chore(ci): make PR1000 source fix diagnostic
seonghobae Sep 1, 2026
d7b459c
chore(ci): rerun PR1000 source fix with diagnostics
seonghobae Sep 1, 2026
ab68d67
chore(ci): add PR1000 NIM repair reconciliation
seonghobae Sep 1, 2026
22221c9
chore(ci): add corrected PR1000 NIM reconciliation
seonghobae Sep 1, 2026
0ef3883
fix(ci): make PR1000 source fix fail closed
seonghobae Sep 1, 2026
2a16172
chore(ci): rerun PR1000 reconciled source fix
seonghobae Sep 1, 2026
7309dca
chore(ci): retrigger PR1000 NIM evidence repair
seonghobae Sep 1, 2026
f5044a7
chore(ci): make PR1000 repair executable on synchronize
seonghobae Sep 1, 2026
bccf61e
fix(ci): execute PR1000 repair as module
seonghobae Sep 1, 2026
1b2a736
fix(ci): reconcile PR1000 repair test indentation
seonghobae Sep 1, 2026
0356492
chore(ci): retrigger PR1000 NIM evidence repair
seonghobae Sep 1, 2026
f3ce8bc
fix(ci): tolerate already-repaired NIM usage stubs
seonghobae Sep 1, 2026
7165274
chore(ci): retrigger NIM evidence repair
seonghobae Sep 1, 2026
7c8f930
fix(ci): route NIM dry-run through explicit usage evidence
seonghobae Sep 1, 2026
3db12e6
chore(ci): retrigger NIM evidence repair with explicit dry-run usage
seonghobae Sep 1, 2026
524155c
fix(ci): reconcile PR1000 NIM repair driver
seonghobae Sep 1, 2026
a4314a0
fix(ci): run reconciled PR1000 NIM repair
seonghobae Sep 1, 2026
c78704d
docs(routing): retire deterministic heuristic authority
seonghobae Sep 1, 2026
da9d659
ci: retrigger PR1000 evidence repair
seonghobae Sep 1, 2026
2804669
fix(ci): diagnose repaired PR1000 dry run
seonghobae Sep 1, 2026
886b475
fix(ci): run PR1000 RCA reconciler
seonghobae Sep 1, 2026
10d67f4
ci: retrigger PR1000 NIM evidence RCA
seonghobae Sep 1, 2026
1437fa8
fix(ci): align NIM tests with fail-closed routing evidence
seonghobae Sep 1, 2026
79d04e8
ci: retrigger fail-closed NIM evidence repair
seonghobae Sep 1, 2026
81724be
fix(ci): reject unsupported NIM paired comparisons
seonghobae Sep 1, 2026
cee0403
ci: rerun complete fail-closed NIM contract
seonghobae Sep 1, 2026
e6b000b
fix(ci): normalize repaired ADR EOF
seonghobae Sep 1, 2026
2cc3362
ci: rerun NIM repair after diff hygiene fix
seonghobae Sep 1, 2026
6263def
fix(benchmark): require reported token evidence
opencode-agent[bot] Sep 1, 2026
28b9cd9
docs(routing): retire composite measured-ranking claims
seonghobae Sep 1, 2026
c997d4b
test(reasoning): reject synthetic effort heuristics
seonghobae Sep 1, 2026
b454662
chore(ci): add bounded reasoning-effort repair driver
seonghobae Sep 1, 2026
6096a3e
ci: add one-shot reasoning-effort repair workflow
seonghobae Sep 1, 2026
e6676ac
ci: trigger reasoning-effort heuristic repair
seonghobae Sep 1, 2026
adc8287
test(nim): reject heuristic evidence sufficiency floors
seonghobae Sep 1, 2026
944f565
ci: add NIM evidence-threshold repair driver
seonghobae Sep 1, 2026
90fa7bf
ci: add NIM evidence-threshold source fix
seonghobae Sep 1, 2026
ee6d1f7
ci: trigger NIM evidence-threshold repair
seonghobae Sep 1, 2026
3bb90fe
fix(ci): pin NIM threshold repair dependencies
seonghobae Sep 1, 2026
ca4c0ff
chore(ci): retrigger NIM threshold repair
seonghobae Sep 1, 2026
8c8ec80
fix(ci): reconcile reasoning-effort no-heuristic repair
seonghobae Sep 1, 2026
6e0f779
fix(ci): harden reasoning-effort repair workflow
seonghobae Sep 1, 2026
b9133e5
chore(ci): retrigger reasoning-effort repair
seonghobae Sep 1, 2026
196b699
fix(ci): scope reasoning repair write permission
seonghobae Sep 1, 2026
04432ba
fix(ci): scope NIM evidence repair write permission
seonghobae Sep 1, 2026
0482d75
chore(ci): retrigger reasoning heuristic repair
seonghobae Sep 1, 2026
50298b9
chore(ci): retrigger NIM evidence heuristic repair
seonghobae Sep 1, 2026
235dfe5
docs(research): refresh learned routing evidence
seonghobae Sep 1, 2026
76fdf58
test(nim): require explicit output-token allocation
seonghobae Sep 1, 2026
0803bac
test(nim): reject implicit policy token budget
seonghobae Sep 1, 2026
7e86b79
fix(nim): extend source repair to output-token defaults
seonghobae Sep 1, 2026
7a81b8b
ci(nim): prove output allocation regression before repair
seonghobae Sep 1, 2026
72fb3a4
chore(nim): trigger no-heuristic decision repair
seonghobae Sep 1, 2026
f36119e
docs(adr): align index with no-heuristic routing
seonghobae Sep 1, 2026
0085382
test(nim): forbid capped candidate admission and name tie-breaks
seonghobae Sep 2, 2026
4063080
fix(nim): stage evidence-complete candidate admission repair
seonghobae Sep 2, 2026
8e6e8b1
ci(nim): extend no-heuristic source fix to candidate admission
seonghobae Sep 2, 2026
4a7e145
ci(nim): trigger candidate-admission RED-GREEN repair
seonghobae Sep 2, 2026
27283ce
fix(nim): compose candidate repair after token-allocation repair
seonghobae Sep 2, 2026
41720d9
test(optimizer): require identified non-heuristic selection contract
seonghobae Sep 2, 2026
71e8904
test(optimizer): add fail-closed research-conformance repair driver
seonghobae Sep 2, 2026
d755816
ci(optimizer): add RED-GREEN research-conformance repair lane
seonghobae Sep 2, 2026
039e033
ci(optimizer): trigger no-heuristics optimizer repair
seonghobae Sep 2, 2026
efc76f8
test(optimizer): reject provenance string labels
seonghobae Sep 2, 2026
b25daf3
build(ci): add optimizer provenance repair
seonghobae Sep 2, 2026
84b84d4
ci: add optimizer provenance source fix
seonghobae Sep 2, 2026
bc2a844
ci: trigger optimizer provenance source fix
seonghobae Sep 2, 2026
715f24a
fix(nim): retire heuristic evidence sufficiency floors
opencode-agent[bot] Sep 2, 2026
512ee46
ci: retrigger PR1000 reasoning-effort source fix
seonghobae Sep 2, 2026
14fe2e5
fix(source-fix): insert reasoning fixture helper outside plan literal
seonghobae Sep 6, 2026
3f4a895
fix(source-fix): import explicit reasoning profile fixture
seonghobae Sep 6, 2026
37cf3f6
test(fuzz): remove heuristic mock-agent selection
seonghobae Sep 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/source-fix-1000-optimizer-provenance.trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
optimizer executable-provenance repair
2 changes: 2 additions & 0 deletions .github/source-fix-1000-optimizer-selection.trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trigger=2026-09-02T01:18:00Z
contract=pareto-only-no-ad-hoc-search
3 changes: 3 additions & 0 deletions .github/source-fix-1000-reasoning-effort.trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
repair synthetic reasoning-effort allocation and pseudo-ablation
attempt=v5-generated-test-helper-before-plan
rca=insert test-only helper after imports, never inside PLAN dict literal
93 changes: 93 additions & 0 deletions .github/workflows/source-fix-1000-optimizer-provenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Source fix PR1000 optimizer executable provenance

on:
push:
branches:
- fix/no-heuristic-batch-routing
paths:
- .github/source-fix-1000-optimizer-provenance.trigger

jobs:
repair:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
ref: fix/no-heuristic-batch-routing
persist-credentials: true
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d
with:
version: '0.12.5'
- name: Prove executable-provenance contract is RED before repair
shell: bash
run: |
set -euo pipefail
if uv run --locked --extra api --extra db --extra queue --group dev python -m pytest -q tests/test_no_heuristic_optimizer_contract.py; then
echo '::error::optimizer executable-provenance regression was not RED before production repair'
exit 1
fi
- name: Apply causal optimizer repair
run: uv run --locked python scripts/ci/repair_pr1000_optimizer_provenance.py
- name: Verify focused repaired contract
shell: bash
run: |
set -euo pipefail
uv run --locked --extra api --extra db --extra queue --group dev python -m pytest -q \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py \
tests/test_orchestrator_dispatch_boundaries.py \
tests/test_psychometric_routing.py
uv run --locked --group dev ruff check \
contextual_orchestrator/orchestrator.py \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py \
tests/test_orchestrator_dispatch_boundaries.py
git diff --check
- name: Remove one-shot artifacts, reconcile concurrent head, and push
shell: bash
run: |
set -euo pipefail
rm -f \
.github/workflows/source-fix-1000-optimizer-selection.yml \
.github/source-fix-1000-optimizer-selection.trigger \
scripts/ci/repair_pr1000_optimizer_selection.py \
.github/workflows/source-fix-1000-optimizer-provenance.yml \
.github/source-fix-1000-optimizer-provenance.trigger \
scripts/ci/repair_pr1000_optimizer_provenance.py
git add -A
git diff --cached --check
if git diff --cached --quiet; then
echo '::error::optimizer repair produced no tracked change'
exit 1
fi
git config user.name 'opencode-agent[bot]'
git config user.email '219766164+opencode-agent[bot]@users.noreply.github.com'
git commit -m 'fix(optimizer): require executable evaluation provenance'
git fetch --no-tags origin fix/no-heuristic-batch-routing
remote_head="$(git rev-parse FETCH_HEAD)"
if [ "$remote_head" != "$(git rev-parse HEAD)" ] && ! git merge-base --is-ancestor "$remote_head" HEAD; then
git merge --no-edit "$remote_head"
uv run --locked --extra api --extra db --extra queue --group dev python -m pytest -q \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py \
tests/test_orchestrator_dispatch_boundaries.py \
tests/test_psychometric_routing.py
uv run --locked --group dev ruff check \
contextual_orchestrator/orchestrator.py \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py \
tests/test_orchestrator_dispatch_boundaries.py
git diff --check
fi
git push origin HEAD:fix/no-heuristic-batch-routing
84 changes: 84 additions & 0 deletions .github/workflows/source-fix-1000-optimizer-selection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Source fix PR1000 optimizer selection

on:
push:
branches:
- fix/no-heuristic-batch-routing
paths:
- .github/source-fix-1000-optimizer-selection.trigger

jobs:
repair:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 0
ref: fix/no-heuristic-batch-routing
persist-credentials: true
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d
with:
version: '0.12.5'
- name: Prove optimizer contract is RED before repair
shell: bash
run: |
set -euo pipefail
if uv run --locked --extra api --extra db --extra queue --group dev python -m pytest -q tests/test_no_heuristic_optimizer_contract.py; then
echo '::error::optimizer no-heuristics regression was not RED before production repair'
exit 1
fi
- name: Apply exact-source optimizer repair
run: uv run --locked python scripts/ci/repair_pr1000_optimizer_selection.py
- name: Verify focused repaired contract
shell: bash
run: |
set -euo pipefail
uv run --locked --extra api --extra db --extra queue --group dev python -m pytest -q \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py
uv run --locked --group dev ruff check \
contextual_orchestrator/orchestrator.py \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py
git diff --check
- name: Remove one-shot artifacts, reconcile concurrent head, and push
shell: bash
run: |
set -euo pipefail
rm -f \
.github/workflows/source-fix-1000-optimizer-selection.yml \
.github/source-fix-1000-optimizer-selection.trigger \
scripts/ci/repair_pr1000_optimizer_selection.py
git add -A
git diff --cached --check
if git diff --cached --quiet; then
echo '::error::optimizer repair produced no tracked change'
exit 1
fi
git config user.name 'opencode-agent[bot]'
git config user.email '219766164+opencode-agent[bot]@users.noreply.github.com'
git commit -m 'fix(optimizer): retire ad-hoc routing search heuristics'
git fetch --no-tags origin fix/no-heuristic-batch-routing
remote_head="$(git rev-parse FETCH_HEAD)"
if [ "$remote_head" != "$(git rev-parse HEAD)" ] && ! git merge-base --is-ancestor "$remote_head" HEAD; then
git merge --no-edit "$remote_head"
uv run --locked --extra api --extra db --extra queue --group dev python -m pytest -q \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py
uv run --locked --group dev ruff check \
contextual_orchestrator/orchestrator.py \
tests/test_no_heuristic_optimizer_contract.py \
tests/test_optimizer.py \
tests/test_evolve_optimizer.py \
tests/test_batch_optimizer.py
git diff --check
fi
git push origin HEAD:fix/no-heuristic-batch-routing
88 changes: 88 additions & 0 deletions .github/workflows/source-fix-1000-reasoning-effort.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Source fix PR1000 reasoning effort

on:
push:
branches:
- fix/no-heuristic-batch-routing
paths:
- .github/source-fix-1000-reasoning-effort.trigger

jobs:
repair:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # actions/checkout@v7
with:
fetch-depth: 0
ref: fix/no-heuristic-batch-routing
persist-credentials: true
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: "0.12.5"
- name: Prove regression is RED before repair
shell: bash
run: |
set -euo pipefail
if uv run pytest -q tests/test_no_heuristic_reasoning_effort_contract.py; then
echo '::error::reasoning-effort regression was not RED before production repair'
exit 1
fi
- name: Apply exact-source production repair
run: uv run python -m scripts.ci.repair_pr1000_reasoning_effort
- name: Verify focused repaired contract
shell: bash
run: |
set -euo pipefail
uv run pytest -q \
tests/test_no_heuristic_reasoning_effort_contract.py \
tests/test_reasoning_effort_profile.py \
tests/test_cli_role_effort_catalog.py \
tests/test_mixed_pool_role_effort_selection.py \
tests/test_tool_loop_role_effort_catalog_http.py \
tests/test_generated_workflow.py \
tests/test_passthrough_provider_failover.py
uv run ruff check \
contextual_orchestrator/reasoning_effort_profile.py \
contextual_orchestrator/__main__.py \
tests/test_no_heuristic_reasoning_effort_contract.py \
tests/test_reasoning_effort_profile.py \
tests/test_cli_role_effort_catalog.py \
tests/test_mixed_pool_role_effort_selection.py \
tests/test_tool_loop_role_effort_catalog_http.py \
tests/test_generated_workflow.py \
tests/test_passthrough_provider_failover.py
git diff --check
- name: Remove one-shot repair artifacts, reconcile concurrent head, and push
shell: bash
run: |
set -euo pipefail
rm -f \
.github/workflows/source-fix-1000-reasoning-effort.yml \
.github/source-fix-1000-reasoning-effort.trigger \
scripts/ci/repair_pr1000_reasoning_effort.py
git add -A
git diff --cached --check
if git diff --cached --quiet; then
echo '::error::repair produced no tracked change'
exit 1
fi
git config user.name 'opencode-agent[bot]'
git config user.email '219766164+opencode-agent[bot]@users.noreply.github.com'
git commit -m 'fix(reasoning): retire synthetic effort heuristics'
git fetch --no-tags origin fix/no-heuristic-batch-routing
remote_head="$(git rev-parse FETCH_HEAD)"
if [ "$remote_head" != "$(git rev-parse HEAD)" ] && ! git merge-base --is-ancestor "$remote_head" HEAD; then
git merge --no-edit "$remote_head"
uv run pytest -q \
tests/test_no_heuristic_reasoning_effort_contract.py \
tests/test_reasoning_effort_profile.py \
tests/test_cli_role_effort_catalog.py \
tests/test_mixed_pool_role_effort_selection.py \
tests/test_tool_loop_role_effort_catalog_http.py \
tests/test_generated_workflow.py \
tests/test_passthrough_provider_failover.py
git diff --check
fi
git push origin HEAD:fix/no-heuristic-batch-routing
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [0.2.0] - Unreleased

- Remove the NIM benchmark character-count token heuristic and weighted cheapest-worker selector. Benchmark token/cost evidence now requires complete provider-reported usage, and ambiguous or incomplete price vectors fail closed.

### Deprecated

- Internal callers now use
Expand Down
50 changes: 46 additions & 4 deletions contextual_orchestrator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Public package exports for the contextual orchestration runtime."""

from . import batch_routing as _batch_routing
from .batch_routing import (
BatchDownloadError,
BatchJob,
Expand All @@ -8,17 +9,32 @@
EmbeddingBatchRequest,
EmbeddingBatchResultItem,
LocalBatchBackend,
LocalEmbeddingBatchBackend,
PgLlmBatchBackend,
PgLlmBatchEmbeddingBackend,
ProviderEmbeddingBatchBackend,
RoutingDecision,
RoutingHints,
RoutingPolicy,
build_embeddings_jsonl_body,
)
from .evidence_batch_routing import (
LocalEmbeddingBatchBackend,
RoutingPolicy,
cheapest_upstream,
heuristic_embedding,
prohibited_heuristic_embedding,
resolve_embedding_target_evidence_only,
)

# Patch the already-loaded protocol module before downstream modules import its
# decision surfaces. Direct ``contextual_orchestrator.batch_routing`` imports
# also observe these fail-closed replacements because Python initializes the
# package before returning a submodule to callers. The legacy SHA-derived
# implementation remains unreachable and is exposed only as a tombstone that
# raises instead of fabricating a semantic vector.
_batch_routing.RoutingPolicy = RoutingPolicy
_batch_routing.cheapest_upstream = cheapest_upstream
_batch_routing.LocalEmbeddingBatchBackend = LocalEmbeddingBatchBackend
_batch_routing.heuristic_embedding = prohibited_heuristic_embedding

from .cost_ledger import (
ATTRIBUTION_DIMENSIONS,
AttributionDimensions,
Expand All @@ -39,6 +55,13 @@
)
from .metering import CanonicalUsageRecordSink
from .cost_router import CostRoutingCoordinator

# The legacy coordinator still contains a price/order ranking helper used by
# historical tests and non-authoritative diagnostics. Production embedding
# target resolution is replaced at class load so both package and submodule
# imports require explicit or uniquely eligible routing evidence.
CostRoutingCoordinator._resolve_embedding_target = resolve_embedding_target_evidence_only

from .cefr_language_observation import (
CEFR_LANGUAGE_ASSESSMENT_CONTRACT_V1,
FAST_MLSIRM_SCORING_SCHEMA_VERSION,
Expand All @@ -53,6 +76,26 @@
from .credentials import NotConfigured, get_credential, register_credential
from .kv_config import InMemoryConfigStore, get_config_store
from .orchestrator import ModelAgent, TaskOrchestrator, WorkflowStep, load_agents
from .evidence_model_selection import (
get_model_group_diagnostic,
measured_member_order_fail_closed,
prohibited_static_rank_key,
ranked_agents_evidence_only,
requested_agent_evidence_only,
)

# Runtime model selection must not fall through to the historical static
# priority/cosine/id key or the hand-composed transport score. Keep the
# compatibility source available for incremental deletion, but make every
# package/submodule import observe the fail-closed selection boundary now.
TaskOrchestrator._ranked_agents = ranked_agents_evidence_only
TaskOrchestrator._requested_agent = requested_agent_evidence_only
TaskOrchestrator._static_rank_key = prohibited_static_rank_key
TaskOrchestrator._measured_member_order = measured_member_order_fail_closed
# Admin group serialization remains available without pretending its canonical
# identifier order is an inference preference.
TaskOrchestrator.get_model_group = get_model_group_diagnostic

from .release_authorization import evaluate_release_authorization
from .reasoning_effort_profile import (
EffortProfileError,
Expand Down Expand Up @@ -152,7 +195,6 @@
"LocalEmbeddingBatchBackend",
"PgLlmBatchEmbeddingBackend",
"ProviderEmbeddingBatchBackend",
"heuristic_embedding",
"build_embeddings_jsonl_body",
"cheapest_upstream",
"CostRoutingCoordinator",
Expand Down
Loading
Loading