Repository navigation
Closed
Labels
bugSomething isn't working
Description
This was generated by AI during triage.
From the host cleanup after the 2026-11-09 retro. The research note for #569 named this source from reading the code and did not reproduce it. This reproduces it and counts it.
What was found
- On 2026-11-09, the four hosts that run this repository's Ticket runs held 8,100
thirdshift-skills-*directories at the top of/tmp: between 946 and 3,074 per host, about 0.6 MB each, about 4.7 GB together. - They arrive in bursts. On one host, 74 of the minutes that have any have 23 or 24 new ones.
- On that host, every day that has them is a day a session ran the test suite. The four days with no suite run have none.
Reproduction
Verified during triage on main at 1888168, on Ubuntu 24.04.
- The unit-test binary, run once with an empty private
TMPDIR, the waycargo test --bin thirdshiftruns it: 1,663 tests in one process. AfterwardsTMPDIRholds 24thirdshift-skills-*directories. - Each unit test run in its own process with its own
TMPDIR, the way nextest runs them: 15 tests leave 25 directories. - 71 of the 94 integration test binaries, each run once the same way: none leaves one. The other 23,
security_reviewtouser_configin alphabetical order, were not run.
| Tests | Directories each leaves |
|---|---|
session::execution_tests::keeps_review_reports_beside_each_harness_session_log and session::execution_tests::shell_git_fixtures_ignore_global_and_system_config |
6, one per Harness |
ten more in session::execution_tests, and session::private::tests::scoring_maps_sandbox_startup_failure_after_a_successful_probe |
1 |
skills::tests::links_factory_skills_in_existing_and_missing_directories_for_every_adapter and skills::tests::links_in_ordinary_directories_without_directory_read_permission |
1 |
The ten more in session::execution_tests
a_failed_session_still_keeps_whichever_review_report_it_lefta_resumes_review_reports_are_kept_beside_its_own_session_loga_symlink_review_report_is_not_kept_and_the_run_carries_oncompleted_stdout_is_reported_after_a_broken_promptinterruption_suppresses_recovered_interpretation_and_retained_readsmissing_review_reports_get_a_progress_line_and_the_run_carries_onpartial_stdout_is_reported_after_log_failure_with_a_blocked_promptstartup_failure_never_reaches_an_installed_harnessstartup_failure_preserves_its_cause_without_completion_reportingunavailable_report_setup_warns_and_the_run_carries_on
Why:
written_out()keeps the extraction in a process-wide static. Only a Command's finishing paths callremove_written(), and a static is not dropped when a process exits.- The session tests re-run the test binary as a subprocess for each fixture. Each subprocess runs a Session in-process, writes the skills out and exits. A system-call trace of
keeps_review_reports_beside_each_harness_session_logshows six processes each creating one directory, and none removing one. These subprocesses account for 23 of the 24. - The two
skills::testscalllink_intoin the test process itself. That leaves one directory per test process: one undercargo test, two under nextest.
Agent Brief
Category: bug
Summary: A unit-test run leaves no Factory skills extraction behind in TMPDIR.
Current behavior:
- One run of the unit tests leaves 24
thirdshift-skills-*directories inTMPDIRundercargo test, and 25 under nextest. Each is about 0.6 MB. - 23 come from the subprocesses of the test binary that the session tests start. Each runs a Session in-process and exits with its extraction still there.
- The rest come from tests that write the skills out in the test process itself.
- A Command removes its extraction when it finishes. That is unaffected.
Desired behavior:
- After the unit tests finish, the
TMPDIRthey ran with holds nothirdshift-skills-*entry, undercargo testand under nextest. - A test that needs the extraction finds it for as long as it runs. Tests in one process run in parallel and share one extraction, so it stays until the last of them is done.
- A Command keeps one extraction and removes it when it finishes, as now.
Key interfaces:
written_out(),remove_written()and the static they share.- The session tests' subprocess entry points: the tests that re-run the test binary with a fixture variable set.
- A regression test that runs one of those entry points with a private
TMPDIRand fails when an extraction is left.
Acceptance criteria:
- The unit-test binary, run once with an empty private
TMPDIR, leaves nothirdshift-skills-*entry there. Today it leaves 24. - Each of the 15 tests above, run alone in its own process with its own
TMPDIR, leaves none. - A test in the suite fails when a session test's subprocess leaves its extraction behind.
- The unit tests pass in one process and under nextest.
- A
Scenariotest asserts that an ordinary Run leaves nothirdshift-skills-*entry in itsTMPDIR. - The pull request reports what the 23 integration test binaries not run here leave in a private
TMPDIR.
Out of scope:
- A Command killed with SIGKILL, which leaves its extraction, and any sweep of old extractions at startup.
- The
fakes-<hash>directory the unit tests build their fakes in. It is one per build and is reused. - Processes and fixture directories that a killed test harness leaves (Scenario test children survive a killed test harness and keep polling #1912).
- Where a Command writes the skills out.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity