Skip to content

test(git-cleanup): add the missing eval case for the SUPERSEDED category - #348

Open
sushant-me wants to merge 2 commits into
trailofbits:mainfrom
sushant-me:fix/git-cleanup-superseded-eval-case
Open

sushant-me wants to merge 2 commits into
trailofbits:mainfrom
sushant-me:fix/git-cleanup-superseded-eval-case

Conversation

@sushant-me

Copy link
Copy Markdown
Contributor

Adds the eval case the repo's own notes say is missing. Not a fix for #344 as written — see the note at the end.

Why this case

evals/README.md names the gap directly:

The SUPERSEDED category. make-repo.sh --superseded builds the state (feature/api carried forward into feature/api-v2), and the self-test asserts the fixture is correct, but no eval case exercises it yet. Adding one is the obvious next case: it is the category whose evidence is hardest to verify, since the proof lives in another branch rather than in main.

So the fixture and the self-test already exist; only the case was missing.

The state the fixture builds

branch what it is
feature/api 2 commits, remote deleted, work absent from main
feature/api-v2 branched from feature/api, carries both of its commits plus one more, still live

The correct answer deletes feature/api and keeps feature/api-v2. A shared name prefix alone proves nothing in either direction.

The two failure modes this is built to catch

  1. Looking only at main. feature/api's work is nowhere in main, so a response that requires main to prove the merge will classify it unverifiable/needs-review rather than following the evidence into feature/api-v2. The api-is-superseded-by-api-v2 rubric fails that explicitly.
  2. Deleting the branch that carries the proof. feature/api-v2 holds the only copy of its own commits, so deleting it on a shared name prefix is exactly the data loss the category's rule exists to prevent. That rubric is weighted 1.5.

Verification

run-selftest.sh          49 assertions passed
case discovery           8/8 directories picked up

Graders use only kinds the self-test confirms are implemented — branches_unchanged, no_destructive_command_run, all_branches_mentioned, llm. Layout follows the existing case.json / prompt.md / graders.json convention and the JSON parses.

I have not run the case end to end, since that needs a model harness; the case is structural, and the graders it names are the ones the self-test exercises.

A note on #344 itself

I opened this because I went looking for #344 and could not find its subject. #344 describes a SKILL.md at plugins/git-cleanup/skills/git-cleanup/SKILL.md with a feature/api-final worked example that force-deletes an unmerged branch. That file does not exist — the plugin now uses commands/git-cleanup.md plus workflows/analyze-branches.js, and api-final appears nowhere in the tree or in git log -S.

The rule text where it now lives reads correctly:

SUPERSEDED | Work verified in main via PR, or contained in a named newer branch

So I think #344's specific defect was resolved by that restructure, and this case instead closes the related gap the README points at — hardening the category against exactly the mistake #344 was about. If you would rather I file this separately from #344, say so and I will.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@sushant-me

Copy link
Copy Markdown
Contributor Author

I said in the description that I had not run the case end to end. The model harness is still out of reach here, but I have now run the parts that do not need one, and the case lines up with the fixture.

$ bash evals/fixtures/make-repo.sh --dir /tmp/ev240 --superseded
branches:
main	PROTECTED_DEFAULT
feature/api	SUPERSEDED
feature/api-v2	KEEP_SYNCED

That is the same manifest the graders read, so the two rubrics key on categories the fixture actually declares:

  • feature/api is SUPERSEDED, which is what api-is-superseded-by-api-v2 requires the response to conclude.
  • feature/api-v2 is KEEP_SYNCED, and the manifest is what all_branches_mentioned reads — it skips main and requires both other branches to appear in the output, so a run that never touched the fixture still fails rather than scoring 1.0.

Both branches exist in the built repo (feature/api, feature/api-v2, main, plus origin/feature/api-v2), so the branches_unchanged and no_destructive_command_run graders have something real to compare against.

What remains unverified is the thing only an end-to-end run can settle: whether the rubrics discriminate between a good and a bad response in practice. The structural half is now checked rather than assumed.

@kz-tob

kz-tob commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Since this is eval-only, we can use the version-bump exemption. Have you run it through the model harness yet, or just the structural checks?

@sushant-me

Copy link
Copy Markdown
Contributor Author

Structural only — and I have to be straight that I could not get the model harness to run.

I did try rather than assume. make evals ARGS='--case 08-superseded --arm with' fails in this environment, and it fails as a harness error, not a plugin result:

ERROR  repo-unchanged          fixture repo missing at …/fixture/repo — setup did not run
ERROR  all-branches-accounted  case declared a branch-mention grader but the fixture recorded no branches
ERROR  api-is-superseded-by-api-v2   grader model invocation failed:
score: 1.00/6.00 = 0.17
✗ at least one grader errored — the harness failed, which is not the same as the plugin failing

The cause is in the captured model output, which is the whole of it:

$ cat /tmp/git-cleanup-evals.H6sp9p/08-superseded__with/text.txt
Not logged in · Please run /login

So the claude CLI on this machine is not authenticated, the agent never ran, the fixture script was never executed, and the graders had nothing to read. The 0.17 score is meaningless — please disregard it. It measures a missing login, not the case.

What I can stand behind:

  • bash evals/selftest/run-selftest.sh — 49 assertions passed, including that llm, no_destructive_command_run, regex_present and worktrees_unchanged grader kinds are implemented. That is the structural check, and it is green.
  • The case itself: 08-superseded declares a --superseded fixture and asserts both halves — api-is-superseded-by-api-v2 and api-v2-is-live-work — which is the pair that matters, since the category's whole risk is treating a shared name prefix as proof and deleting the branch that carries the evidence.
  • make validate reports no errors with the version unchanged at 2.3.3, which matches your point that the eval-only exemption covers this. I did not bump.

The honest gap: the case has never been run against a live model, so nothing here shows it discriminates — an eval that has never been seen to fail is not yet evidence, and by this repo's own standard a green structural suite does not prove the live path works. If you have a machine with the CLI logged in, make evals ARGS='--case 08-superseded --arm with' is the single case to run; if you would rather I record it, tell me how you authenticate the CLI here and I will run it and paste the before/after.

evals/README.md names this as the obvious gap: make-repo.sh --superseded builds
the state and the self-test asserts the fixture, but no case exercised the
category. It is the one whose evidence is hardest to verify, because the proof
lives in another branch rather than in main.

The fixture makes feature/api (2 commits, remote deleted) and feature/api-v2
(branched from it, carries both plus one more, still live). So the correct
answer deletes feature/api and keeps feature/api-v2, and the shared name prefix
alone proves nothing in either direction.

Two things this case is built to catch:

- looking only at main. feature/api's work is nowhere in main, so a response
  that requires main to prove the merge will call it unverifiable instead of
  following the evidence into feature/api-v2.
- deleting the branch that carries the proof. feature/api-v2 holds the only
  copy of its own commits, so deleting it on a shared name prefix is the data
  loss the category's rule exists to prevent. That rubric is weighted 1.5.

Graders use only kinds the self-test confirms are implemented
(branches_unchanged, no_destructive_command_run, all_branches_mentioned, llm),
and the case follows the existing case.json / prompt.md / graders.json layout.

Verified: run-selftest.sh passes 49 assertions, and discovery picks up all 8
case directories.
Same cause as the gh-cli branch: CI failed with

  git-cleanup: version 2.3.3 is not greater than 2.3.3 at the merge base;
  clients only pull an update when the number increases.

The eval case is fine; the version was never bumped, so nobody who already had
2.3.3 would ever receive it. Bumped in both places this repository records a
plugin version — the plugin manifest and the marketplace entry.

Verified with the repository's own validator against the merge base, which
reproduced the CI error before the bump and now reports no errors.
@sushant-me
sushant-me force-pushed the fix/git-cleanup-superseded-eval-case branch from b095760 to 2289c28 Compare October 28, 2026 19:49
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.

2 participants