Skip to content

Commit c36d5be

Browse files
committed
Fix EvalTier narrowing and exclude the tier fixtures from typecheck
Merging this branch with main exposed two typecheck failures that the branch alone could not show, because it never touches tsconfig.json and PR #578 widened typecheck scope to tests/ and evals/ after this branch was cut. parseCaseJson narrowed raw.tier with a `tier as EvalTier` cast, which is not a type guard, so it returned string where the EvalCase field is EvalTier. Replaced with a real isEvalTier predicate. The four tier-* sandbox fixtures now fall inside typecheck scope. They have their own package.json and tier-hard is intentionally buggy, so they join the existing eval-sandbox exclusions. crash-run and plugins/implement-feature stay in scope deliberately — they import production modules and #578 carved them out for that reason. Also swept the exclusion entries for fixtures this branch deletes.
1 parent 3e169a6 commit c36d5be

4 files changed

Lines changed: 10 additions & 17 deletions

File tree

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ vendor/
44
scratch/
55
node_modules/
66
CHANGELOG.md
7-
# Intentionally invalid source: the broken-toolchain eval fixture.
8-
tests/fixtures/broken-toolchain/
97

evals/capability/lib.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function sampleResult(over: Partial<CaseResult> = {}): CaseResult {
4848
return {
4949
resultKey: over.resultKey ?? makeResultKey(variantId, id),
5050
id,
51-
tier: over.tier ?? "simple",
51+
tier: over.tier ?? "easy",
5252
title: over.title ?? "Health",
5353
variantId,
5454
provider: over.provider ?? "default",

evals/capability/lib.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export type EvalTier = "easy" | "med" | "hard" | "xhard";
2626

2727
export const EVAL_TIERS: readonly EvalTier[] = ["easy", "med", "hard", "xhard"];
2828

29+
function isEvalTier(value: string): value is EvalTier {
30+
return EVAL_TIERS.includes(value as EvalTier);
31+
}
32+
2933
/**
3034
* A bait declaration marks a case that exists to reproduce a known
3135
* misbehavior. The case misbehaves when the aggregate median of `metric`
@@ -255,7 +259,7 @@ export function parseCaseJson(raw: unknown, caseDir: string): EvalCase {
255259
if (typeof id !== "string" || id.length === 0) {
256260
throw new Error(`case.json missing id (${caseDir})`);
257261
}
258-
if (typeof tier !== "string" || !EVAL_TIERS.includes(tier as EvalTier)) {
262+
if (typeof tier !== "string" || !isEvalTier(tier)) {
259263
throw new Error(`case ${id}: tier must be ${EVAL_TIERS.join("|")}`);
260264
}
261265
if (typeof title !== "string" || title.length === 0) {

tsconfig.json

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,19 @@
3131
// of that code. Excluding them would recreate exactly the silent-drift gap
3232
// this config change exists to close.
3333
"exclude": [
34-
"tests/fixtures/broken-toolchain/**",
35-
"tests/fixtures/buggy-service/**",
36-
"tests/fixtures/cart-service/**",
3734
"tests/fixtures/codex-sse/**",
38-
"tests/fixtures/demo-comparison/**",
39-
"tests/fixtures/env-config-build/**",
4035
"tests/fixtures/flaky-baseline/**",
41-
"tests/fixtures/flaky-cache/**",
42-
"tests/fixtures/inventory-service/**",
43-
"tests/fixtures/large-read/**",
4436
"tests/fixtures/marketplace/**",
45-
"tests/fixtures/multi-file-service/**",
46-
"tests/fixtures/multiline-edit/**",
4737
"tests/fixtures/plugins/exa/**",
4838
"tests/fixtures/plugins/example-agent/**",
4939
"tests/fixtures/plugins/example-commands/**",
5040
"tests/fixtures/plugins/example-tool/**",
5141
"tests/fixtures/rawmode-sigint/**",
52-
"tests/fixtures/report-pipeline/**",
5342
"tests/fixtures/skill-workspace/**",
54-
"tests/fixtures/slow-command/**",
55-
"tests/fixtures/web-note/**",
43+
"tests/fixtures/tier-easy/**",
44+
"tests/fixtures/tier-hard/**",
45+
"tests/fixtures/tier-med/**",
46+
"tests/fixtures/tier-xhard/**",
5647
"evals/capability/cases/**"
5748
]
5849
}

0 commit comments

Comments
 (0)