.gitignore holds no Python bytecode rule #249

Closed
opened 2026-11-23 15:57:21 +01:00 by motoko · 0 comments
Collaborator

Defect

.gitignore holds no Python bytecode rule, so git add -A commits
compiled bytecode of the eval readers.

Location

.gitignore, repository root. It ignores .worktrees/, .plans/,
local instruction files, and .env, and holds no __pycache__/
entry.

Evidence

grep __pycache__ .gitignore finds nothing. Anything that imports or
compiles evals/evidence.py — python3 -m py_compile, a tool
importing it as a module — leaves evals/__pycache__/evidence.cpython-*.pyc,
and the next git add -A tracks it. This happened while preparing
#248: its first draft commit dbe3dbd tracked a 27,716-byte
evals/__pycache__/evidence.cpython-314.pyc; the reviewers caught it
and the fold removed it, so the pushed branch is clean. Seen at main
09e9524, where the gap is the same.

Scenario

A maintainer checks evidence.py compiles, stages everything, and
commits a stale bytecode copy of a security-boundary reader. The
graders run it as a script, which ignores __pycache__, so nothing
catches it; a tool that imports it as a module would silently use the
stale copy wherever the recorded source mtime and size are preserved
alongside it, as tar and image copies do.

Smallest fix

One __pycache__/ line in .gitignore.

## Defect `.gitignore` holds no Python bytecode rule, so `git add -A` commits compiled bytecode of the eval readers. ## Location `.gitignore`, repository root. It ignores `.worktrees/`, `.plans/`, local instruction files, and `.env`, and holds no `__pycache__/` entry. ## Evidence `grep __pycache__ .gitignore` finds nothing. Anything that imports or compiles `evals/evidence.py` — `python3 -m py_compile`, a tool importing it as a module — leaves `evals/__pycache__/evidence.cpython-*.pyc`, and the next `git add -A` tracks it. This happened while preparing #248: its first draft commit `dbe3dbd` tracked a 27,716-byte `evals/__pycache__/evidence.cpython-314.pyc`; the reviewers caught it and the fold removed it, so the pushed branch is clean. Seen at main `09e9524`, where the gap is the same. ## Scenario A maintainer checks `evidence.py` compiles, stages everything, and commits a stale bytecode copy of a security-boundary reader. The graders run it as a script, which ignores `__pycache__`, so nothing catches it; a tool that imports it as a module would silently use the stale copy wherever the recorded source mtime and size are preserved alongside it, as tar and image copies do. ## Smallest fix One `__pycache__/` line in `.gitignore`.
Sign in to join this conversation.
No description provided.