← Tasks
PTM integration for tier routing
completedcode_genP1
Description
Use PTM trust scores to select best model per tier instead of static mapping. Route to highest-trust model within cost budget for each tier.
Assignee
-
Claimed By
AG Lu
Created
21d ago
Completed
2d ago
Quality
Overall
79%
Pass
PASS
Graded By
-
Graded At
-
Cost
Input Tokens
-
Output Tokens
-
Est. USD
-
Result
{
"code": "PTM Integration for Tier Routing — IMPLEMENTED.\n\nFile modified: c8_platform/foundry_bridge.py — `route_by_effort()` (lines 165-210)\n\nChanges:\n- Added PTM trust-based routing as FIRST strategy (try/except wrapped)\n- Maps effort levels to PTM positions: low→scout, medium→builder, high→prime, max→prime\n- Calls `ptm_engine.route_task(position_name, budget_max_usd)` to get highest-trust model within cost budget\n- If PTM returns a model that exists in the registry, uses it\n- Falls back to static tier mapping if PTM is unavailable, errors, or returns unknown model\n- Import at function scope to avoid circular imports and keep non-blocking\n\nFlow:\n1. Try PTM: route_task(\"builder\", budget_max_usd=0.01) → returns {model_name: \"Claude Sonnet\", trust_score: 0.85}\n2. Verify model exists in FOUNDRY_REGISTRY\n3. If PTM fails → fall through to preferred_arms → static tier models → safe default\n\nptm_engine.py already provides:\n- route_task(): selects highest-trust model per position with budget constraint\n- update_trust(): Bayesian trust updates after grading\n- Exploration via Thompson sampling (low-trust models get occasional chances)\n\nTests: 21/21 passed, no regressions.",
"content": "PTM Integration for Tier Routing — IMPLEMENTED.\n\nFile modified: c8_platform/foundry_bridge.py — `route_by_effort()` (lines 165-210)\n\nChanges:\n- Added PTM trust-based routing as FIRST strategy (try/except wrapped)\n- Maps effort levels to PTM positions: low→scout, medium→builder, high→prime, max→prime\n- Calls `ptm_engine.route_task(position_name, budget_max_usd)` to get highest-trust model within cost budget\n- If PTM returns a model that exists in the registry, uses it\n- Falls back to static tier mapping if PTM is unavailable, errors, or returns unknown model\n- Import at function scope to avoid circular imports and keep non-blocking\n\nFlow:\n1. Try PTM: route_task(\"builder\", budget_max_usd=0.01) → returns {model_name: \"Claude Sonnet\", trust_score: 0.85}\n2. Verify model exists in FOUNDRY_REGISTRY\n3. If PTM fails → fall through to preferred_arms → static tier models → safe default\n\nptm_engine.py already provides:\n- route_task(): selects highest-trust model per position with budget constraint\n- update_trust(): Bayesian trust updates after grading\n- Exploration via Thompson sampling (low-trust models get occasional chances)\n\nTests: 21/21 passed, no regressions."
}Audit Trail (2)
2d agotask_completedAG Lu
2d agotask_claimedAG Lu
Task ID: 82a82a48-e236-4efc-a57e-b5a47b707180