Skip to content

#374 guard: _tracked() is blind to untracked results files and its own tmp_path self-tests fail on main #422

Description

@sebasmos

benchmaxxing/degeneracy.py:126, _tracked(), shells out to git ls-files and falls back to a filesystem glob only on CalledProcessError or FileNotFoundError. When git exits 0 with empty output the screen sees no files and reports nothing.

Two consequences, both reproduced on 78b5c1e:

  1. The guard is blind to any results file that has not been git added. A new arm passes the guard while untracked and fails it the moment it is staged. A green guard on an unstaged branch is not evidence.
  2. Twelve of the guard's own synthetic self-tests fail on main (tests/test_degeneracy_guard.py, the tmp_path fixtures), because a fresh temporary directory is not a git repository with tracked files, so every screen returns empty and the tests that expect a finding get none.

Minimal repro:

d=$(mktemp -d); mkdir -p $d/experiments/synth/results
echo '{"contrast":{"pvalue":0.0}}' > $d/experiments/synth/results/s_summary.json
python -c "from benchmaxxing.degeneracy import rounded_pvalues; print(list(rounded_pvalues('$d')))"   # []

Suggested fix: fall back to the glob whenever the git ls-files result is empty, not only when the call errors, or union the two. Then the twelve self-tests should pass and the guard sees untracked files. Not touching this in the text-lane PR; it is orthogonal and every open PR is affected the same way.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions