volt: tool_map grades the tree it lives in, not the one it was written in

DEFAULT_REPO was the absolute /root/troupe-standup, so a copy's
`--selftest` -- the invocation selftest_sweep.py uses, no --repo, cwd =
the tree under sweep -- graded the home checkout and reported the copy
clean. Derived from __file__ instead: the default is the checkout the
tool lives in. Measured on a clone at c3058d5 with drifted docs: before,
repo-less --selftest 20/20 rc 0 vs --repo . 19/20 rc 1; after, 19/20
rc 1 both ways.

Also in this commit:
- verify.run_leg: one elapsed-ms clock (_elapsed_ms) and one except arm
  for TimeoutExpired/OSError, instead of three copies of the arithmetic;
- write_probe c13: roster read from FLAG_PROBES rather than a hardcoded
  three, and selftest_sweep.py --write-baseline added to the table;
- docs/TOOLS.md: the selftest_sweep row grows the flags it now prints.
This commit is contained in:
volt committed 2026-10-22 17:08:40 +00:00
1 parent 2a1ef2feaf
commit b859ad6464
4 files changed
+70 -36

No files matched your search

+21 -5
View File
@@ -58,10 +58,26 @@ THE PRE-COMMIT BLIND SPOT, AND THE MODE THAT CLOSES IT
The gate did not catch it either. `selftest_sweep.py --repo .` at `4602bd5`
reads **21 tools, 21 OK, 0 fatal**, because the sweep runs each tool as
`[python, path, "--selftest"]` with no `--repo` (`selftest_sweep.py:449`) and
this tool's `DEFAULT_REPO` is an absolute path, so its selftest graded
/root/troupe-standup -- a different, clean tree. That is a second defect, and
it is NOT fixed here: the sweep's selftest axis can grade the wrong tree. It
is recorded because it is why the pre-commit runs stayed green.
this tool's `DEFAULT_REPO` was an absolute path, so its selftest graded
/root/troupe-standup -- a different, clean tree. That was a second defect:
the sweep's selftest axis could grade the wrong tree, and it did.
FIXED 2026-10-22 (volt). `DEFAULT_REPO` is now derived from this file's own
location -- `dirname(dirname(abspath(__file__)))` -- so the default target is
the checkout the tool lives in: the same path in place, a different path in a
copy. Measured on a clone at `c3058d5`, whose `docs/TOOLS.md` is drifted
(`--check` reads **rc 1, DRIFT at line 30**):
- before the fix, `--selftest` with no `--repo` -- the sweep's own
invocation, `cwd` = the clone -- read **20/20, rc 0**: it graded
/root/troupe-standup, the clean tree, and called the clone's drift clean;
- the same clone under `--selftest --repo .` read **19/20, rc 1**, the one
failure being the currency cell below;
- after the fix, the repo-less run reads **19/20, rc 1** -- the same
verdict as `--repo .`, because the default now names the copy.
`selftest_sweep.py` needed no edit: `cwd` was already the tree under sweep,
so the fix alone is enough for the sweep's axis to grade what it walks.
`--rev WORKTREE` derives the map from the files on disk, discovered through
`git ls-files -- tools/` -- the index, which is what a commit of tracked
@@ -103,7 +119,7 @@ import subprocess
import sys
import tempfile
DEFAULT_REPO = "/root/troupe-standup"
DEFAULT_REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_DOC = "docs/TOOLS.md"
HELP_TIMEOUT = 30