Skip to content

fix(eval): benchmark harness writes valid JSON on an unborn HEAD - #6

Merged
SaulBuilds merged 2 commits into
mainfrom
fix/benchmark-harness-unborn-head
Nov 29, 2026
Merged

SaulBuilds merged 2 commits into
mainfrom
fix/benchmark-harness-unborn-head

Conversation

@SaulBuilds

Copy link
Copy Markdown
Contributor

Summary

scripts/eval/benchmark_harness.sh (lines 47-48) had the same unborn-HEAD bug that #5 fixed in bootstrap: with no commits yet, git rev-parse HEAD 2>/dev/null || echo unknown prints HEAD, fails, and appends unknown. The commit field then holds a newline inside a JSON string and the result file is invalid. --abbrev-ref HEAD did the same for the branch.

  • The commit comes from rev-parse -q --verify HEAD (prints nothing on failure, so the unknown fallback stands alone).
  • The branch comes from symbolic-ref -q --short HEAD, which works before the first commit. A detached HEAD still reports HEAD, as before.
  • The branch is JSON-escaped, because a ref name may contain ".

Tests

tests/test_benchmark_harness.py (added to SKELETON_TESTS) runs the real harness in a throwaway repo and parses latest.json in four states: no commits, a branch, a detached HEAD, and a branch named odd"name. The no-commits and quote cases fail on the previous script. All 4 pass on macOS bash 3.2 and Homebrew bash, and the workflow hygiene tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw

SaulBuilds and others added 2 commits November 29, 2026 09:46
…ched HEAD and odd branch names (red)

Signed-off-by: Larry Klosowski <larryklosowski@proton.me>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw
With no commits yet, `rev-parse HEAD || echo unknown` gave
"HEAD\nunknown" (and --abbrev-ref did the same), which broke the JSON
result file. Use `rev-parse -q --verify HEAD` and `symbolic-ref -q
--short HEAD` (detached HEAD still reports "HEAD"), and JSON-escape
the branch name, which may contain a double quote.

Signed-off-by: Larry Klosowski <larryklosowski@proton.me>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPJzHNqGLdTVoFzde3Sxbw
@github-actions

Copy link
Copy Markdown

Claim grader (shadow mode)

Each commit / PR-text element scored against the claim-compression rubric. Shadow mode: this comment is informational; merge is not blocked.

Kind Id Score Verdict Reasons
pr_title PR #6 — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured
pr_body PR #6 — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured
commit b5a5454d — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured
commit 4e9c8e33 — grader-unavailable no API key in env (set ANTHROPIC_API_KEY or OPENAI_API_KEY); grader returns informational no-op until configured

@SaulBuilds
SaulBuilds merged commit 0e77067 into main Nov 29, 2026
17 checks passed
@SaulBuilds
SaulBuilds deleted the fix/benchmark-harness-unborn-head branch November 29, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant