P-59's trial tests bring their own timeout, and leave HOME empty on macOS
Merged
DO
5d ago+26+26+01234567890123456789-5-5-0123456789
Closes #544.
Since #532, three ReadConfinementTrial tests failed on macOS under PATH=/usr/bin:/bin. Two things caused it, and a third came from review:
- No
timeouton macOS's own PATH.tools/trial_p59_read_confinement.shrefuses to start without one. The stand-in folder now holds abin/timeoutthat runs its command after the duration (execaftershift), asNarrowedToken's stand-incurlandopenssldo, andenvironment(folder)puts thatbin/first on PATH. - Bytecode in the empty HOME. Once the script ran, macOS's own
python3cached the stand-in CLI's bytecode underHOME/Library/Caches/com.apple.python, whichtest_the_engine_configuration_is_judged_by_the_conditionholds empty. The stand-in'sclaudewrapper now runspython3 -B. - The stand-in checks its duration, as GNU's does. On Linux CI the stand-in now replaces the real
timeoutin these tests, so it takes what GNUtimeouttakes (a number with an optionals,m,hord) and refuses anything else, or no command, with 125.test_the_stand_in_timeout_runs_what_gnu_timeout_runsholds it on eleven durations, and runs the realtimeoutin/usr/binor/binbeside it where there is one, so on CI the two must agree; on this Mac all eleven agree with Homebrew's coreutils 9.12. With line 212's180made18O,test_each_configuration_is_given_the_read_tools_and_its_own_flagsfails.
The script is unchanged: a real trial still needs a real timeout. Because the stand-in execs, the /proc/<parent>/environ a leaking call reads on Linux is now the CLI's own rather than a separate timeout's; both start with the same environment and marker, so no assertion changes.
No record, no rule changed: a test-only change.
Verify
PATH=/usr/bin:/bin python3 -m unittest tests.test_tools.ReadConfinementTrial: 5 tests OK (3 failed before).PATH=/usr/bin:/bin SIM_SEEDS=40 make verifyon an export of5b01bd7: 1569 tests OK (8 expected failures).- The P-59 mutants (
tools/mutants.py, theP59block), run alone onb9f6ef5: 18 of 18 killed.5b01bd7changes only the stand-in and adds its test.
Reviews
| Reviewer | Head | Unread parts | Blocking | Major | Minor | Info |
|---|---|---|---|---|---|---|
| astra | 88c7e2e | none | 0 | 1 | 0 | 0 |
| muse | b9f6ef5 | none | 0 | 0 | 1 | 0 |
| claude-review | 88c7e2e | none | 0 | 0 | 1 | 1 |
| claude-security | 88c7e2e | none | 0 | 0 | 0 | 0 |
| Finding | Severity | Criterion | Where | What | Disposition |
|---|---|---|---|---|---|
| astra#1 | major | PR-3 | tests/test_tools.py:8087 | The timeout double hides invalid duration arguments | Fixed in b9f6ef5: the stand-in refuses a malformed duration with 125; line 212's 180 made 18O now fails the tests |
| muse#1 | minor | PR-3 | tests/test_tools.py:8088 | Stand-in timeout's refusal rule is untested and rejects valid GNU durations | Fixed in 5b01bd7: it takes GNU's durations (1.5, 90s, 3m) and a new test holds it, beside the real timeout where there is one |
| claude-review#1 | minor | PR-3 | tests/test_tools.py:8087 | The stand-in timeout accepts any first argument, so Linux CI no longer checks how the script calls timeout | Fixed in b9f6ef5, as astra#1; the reviewer's 18O mutant is killed |
| claude-review#2 | info | none | the change | The PR body says the stand-in CLI reads no parent's environ, but on Linux it does when a call leaks | Fixed in the PR body: the parent environ a leaking call reads is now the CLI's own, with the same environment |
Bots: Codex reviewed b9f6ef5 with no findings; SonarCloud's gate passed on 5b01bd7; CodeRabbit skipped (auto reviews off).
Argon: not run (quota), owed; Astra read 88c7e2e as its stand-in.
š¤ Generated with Claude Code