Skip to content

Commit aee4471

Browse files
committed
refactor(routing): drop unused excludedByLimit from cost evidence (RI-08 simplify)
1 parent 2e9a5fe commit aee4471

4 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎devlog/_plan/260804_router_intelligence/000_master_plan.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ Evidence shapes:
194194
incompleteStreamRate?, recentLatencyMs?, sampleCount?, recencyWeight? }`.
195195
- `quota`: `{ known, headroomTokens?, exhausted?, resetAtMs?,
196196
reauthOrCooling?, reservedHeadroomTokens?, source }`.
197-
- `cost`: `{ estimatedUsd?, priceSource?, incomplete?, limitUsd?,
198-
excludedByLimit? }`.
197+
- `cost`: `{ estimatedUsd?, priceSource?, incomplete?, limitUsd? }`.
199198
- `score`: `{ total, components: { capability?, health?, quota?, cost?,
200199
latency?, configuredPriority? } }`.
201200

‎src/routing/cost.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ export function costEvidenceForCandidate(input: CostEvidenceInput): RouteCostEvi
6060
priceSource,
6161
incomplete: estimate.estimated || priceSource === "expected",
6262
...(limitUsd !== undefined ? { limitUsd } : {}),
63-
...(limitUsd !== undefined
64-
? { excludedByLimit: estimate.cost.total > limitUsd }
65-
: {}),
6663
};
6764
}
6865

‎src/routing/trace.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export interface RouteCostEvidence {
8383
priceSource?: string;
8484
incomplete?: boolean;
8585
limitUsd?: number;
86-
excludedByLimit?: boolean;
8786
}
8887

8988
export interface RouteScoreEvidence {
@@ -533,7 +532,6 @@ function parseCost(raw: unknown, caps: ParseCaps): RouteCostEvidence | undefined
533532
}
534533
if (typeof raw.incomplete === "boolean") out.incomplete = raw.incomplete;
535534
if (finiteNumber(raw.limitUsd)) out.limitUsd = raw.limitUsd;
536-
if (typeof raw.excludedByLimit === "boolean") out.excludedByLimit = raw.excludedByLimit;
537535
return Object.keys(out).length > 0 ? out : undefined;
538536
}
539537

‎tests/cost-scoring.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ describe("cost-aware scoring (RI-08)", () => {
5757
// is the fallback. Both carry a stable source code.
5858
expect(["jawcode", "expected"]).toContain(evidence.priceSource);
5959
expect(evidence.incomplete).toBe(evidence.priceSource === "expected");
60-
expect(evidence.excludedByLimit).toBeUndefined();
6160
expect(costScore(evidence)).not.toBeNull();
6261
});
6362

@@ -92,7 +91,6 @@ describe("cost-aware scoring (RI-08)", () => {
9291
limitUsd: 0.000001,
9392
});
9493
expect(evidence.limitUsd).toBe(0.000001);
95-
expect(evidence.excludedByLimit).toBe(true);
9694

9795
const result = evaluatePolicyProfile(limited, "cost", {}, [
9896
{ provider: "anthropic", model: "claude-opus-5", capability: { contextWindow: 200000 }, cost: evidence },

0 commit comments

Comments
 (0)