Repository navigation
fix(eval): benchmark harness writes valid JSON on an unborn HEAD - #6
Merged
Merged
Conversation
…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
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 unknownprintsHEAD, fails, and appendsunknown. The commit field then holds a newline inside a JSON string and the result file is invalid.--abbrev-ref HEADdid the same for the branch.rev-parse -q --verify HEAD(prints nothing on failure, so theunknownfallback stands alone).symbolic-ref -q --short HEAD, which works before the first commit. A detached HEAD still reportsHEAD, as before.".Tests
tests/test_benchmark_harness.py(added toSKELETON_TESTS) runs the real harness in a throwaway repo and parseslatest.jsonin four states: no commits, a branch, a detached HEAD, and a branch namedodd"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