feat: add benchmark checker and scoring spec (task 0024) #25
Reference in New Issue
Block a user
Delete Branch "task-0024-bench-checker-and-scoring-spec"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0024-bench-checker-and-scoring-spec.mdSummary
Adds the benchmark harness's pure scoring seam and the scoring-spec contract it consumes, in
bench/(dev-only, excluded from the npm package):bench/scoring-spec.ts— the contract:RepoState(labels, issues, pull requests, with comments/reviews/assignees and volatile id/timestamp fields),RequiredFact, and theScoringSpecdiscriminated union (mutationexpected end state |readrequired answer facts).bench/checker.ts— the logic:checkMutation(full-state diff),checkReadAnswer(deterministic, no LLM judge), andscorewhich dispatches on task kind. Mirrors the existingresult.ts(shape) /store.ts(logic) split.Mutation scoring diffs the entire post-run state against the expected end state, so both the intended change and collateral damage are caught. Normalization drops volatile ids/timestamps, matches comments by author and body, and compares label/assignee/review sets order-independently. Read scoring matches each required fact's
anyOfrenderings against the report (case/whitespace-normalized). Failures carry human-readabledifferencesnaming the diverging entity/label/comment/fact.Built test-first (44 bench tests). No acceptance criteria dropped; all five satisfied.
Deviations
Review
Overall: Low
bench/files plus tests; nothing imports them yet (later slices consume the seam).checkMutation,checkReadAnswer,scoredispatch, error paths, and the contract shape.bench/is dev-only tooling, excluded from the published npm package.Standards (unaddressed)
scoremismatch guards (judgement call) — left as-is: the two throw arms read clearly and explicitly; extracting a helper for two three-line guards adds indirection for little gain. (The other two Duplicated-Code findings — issue/PR field diffing and the repeated order-independent-collection matching — were addressed by extractingdiffConversationand a sharedmatchByKeyprimitive.)Spec (unaddressed)
"#42"matches inside"#420") — deliberate: kept as deterministic case/whitespace-normalized substring matching with per-factanyOfalternatives, no LLM judge. Disambiguation is the task suite's job (choosing robustanyOfrenderings), not the checker's. Documented in the task's Implementation Notes.ScoringSpecare the read task's ground truth; this is the intended contract shape.