chore: remove shadow policy machinery (ADR-0013 step 10)

Deletes shadowPolicies map, getShadowPolicies, setPolicyActive from
recommender.ts; removes /api/admin/policies routes from admin.ts; removes
getPolicies, togglePolicy, PolicyInfo from admin api.ts; removes the
policy toggle section from the ops page.

168 API tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 10:45:32 +00:00
parent 8e9718e8ba
commit 05f748159b
4 changed files with 5 additions and 104 deletions

View File

@@ -41,23 +41,6 @@ function randomPolicy(candidates: TipCandidate[]): TipCandidate | null {
return candidates[Math.floor(Math.random() * candidates.length)];
}
// ---------------------------------------------------------------------------
// Shadow-policy registry — kept for step-10 cleanup; no active shadows.
// ---------------------------------------------------------------------------
const shadowPolicies = new Map<string, { active: boolean }>([
['egreedy-v2-shadow', { active: false }],
]);
export function getShadowPolicies() {
return Array.from(shadowPolicies.entries()).map(([name, s]) => ({ name, ...s }));
}
export function setPolicyActive(name: string, active: boolean): boolean {
if (!shadowPolicies.has(name)) return false;
shadowPolicies.set(name, { active });
return true;
}
// ---------------------------------------------------------------------------
// Orchestrator: fetch agent snippets + call ml/serving /recommend
// ---------------------------------------------------------------------------