Repository navigation
fix: git-accurate project root (#120); stop tests leaking /tmp dirs; dev tools - #119
Conversation
Every `cargo test` run left about 30 directories behind, and 6,483 had built up (about 1.2 GB on a tmpfs /tmp): - install_cli: each throwaway HOME is now a guard that removes it when the test passes (a failing test keeps it for inspection). - the daemon stub tests join the daemon after its idle exit and remove their workspace, as the other daemon tests already did. - the shared per-process unit-test sandbox (icx_cli_test_roots_<pid>) cannot be removed when a test ends, so its setup removes the sandboxes of test processes that have exited (Linux, via /proc/<pid>). - the zstd damaged-frame property test removes each case's directory, not only its file.
Kept from the v1.5.x red-team rounds' scratch tooling, rewritten for reuse: - crates/icx-codec/tests/redact_dev_harness.rs: a seeded fragment fuzz and a JSON case-file runner, both ignored and report-only. - scripts/redactor-differential.sh: runs that fuzz in the working tree and in a temporary worktree of a base ref, and lists lines that leak on only one side. - scripts/measure_fts_index.py: builds throwaway SQLite FTS5 indexes over a workspace's stored text (read only) and reports size and insert time, the evidence step for the grep_cold index (T-91-003).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Antigravity review (Gemini via Ultra)Tightens Blocking issuesNone found. Suggestions
Nitpicks
Automated first-pass review by Earlier review rounds (newest first)Round reviewed at 2026-11-28 04:37 UTCAntigravity review (Gemini via Ultra)Replaces Blocking issuesNone found. Suggestions
Nitpicks
Automated first-pass review by Round reviewed at 2026-11-28 03:38 UTCAntigravity review (Gemini via Ultra)Tightens Blocking issuesNone found. Suggestions
Nitpicks
Automated first-pass review by Round reviewed at 2026-11-28 03:31 UTCAntigravity review (Gemini via Ultra)Fixes git-style project-root discovery for Blocking issues
Suggestions
Nitpicks
Automated first-pass review by Round reviewed at 2026-11-28 03:17 UTCAntigravity review (Gemini via Ultra)This PR reduces Blocking issues
Suggestions
Nitpicks
Automated first-pass review by |
|
The local |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
project_root took the nearest ancestor where `.git` existed, so one stray empty `/tmp/.git` resolved every project under /tmp to /tmp and merged their recall, folded outputs and proxy cache ledgers into one workspace. It now follows git's discovery: a `.git` directory counts only with a valid HEAD and `objects` and `refs` directories (in the common directory for a linked worktree), and is otherwise skipped; a `.git` file that names no repository ends the search, as git stops there. The trust warning in `icx trust` uses the same check. Tests: worktree_root adds the empty, HEAD-only, bad-gitfile and minimal-valid cases, each checked against `git rev-parse --show-toplevel`; it fails on the previous lookup. The trust fixtures use a minimal valid `.git`, and the proxy routing test makes each project its own repository so the host /tmp cannot change the result.
The #120 lookup read `HEAD` and `commondir` with read_to_string. project_root runs on every hook and walks every ancestor of the cwd, so a FIFO planted as `HEAD` in a shared parent blocked the hook, and a large file was read whole. All control files (`.git` file, `HEAD`, `commondir`, worktree `gitdir`) now go through one reader: a regular file by symlink_metadata, opened NONBLOCK and NOFOLLOW, the handle re-checked, at most 4 KiB read (the pattern the agy transcript reader uses). A symlinked `HEAD` is refused, as other control files already were (ICX-AUD-018). Test: a FIFO `HEAD` resolves within a timeout and is not a repository; an oversized `HEAD` is not a repository.
Workspace lookup: - `.git` files are parsed by one helper shared with the worktree check: the whole file must be one `gitdir:` line, as git's read_gitfile needs. - `HEAD` is checked as git's validate_headref does (only how it starts: `ref:` then `refs/`, or a SHA-1/SHA-256 name); every case is asserted against `git rev-parse`. - Control-file reads take one byte past the limit and reject a file that grew after the size check instead of truncating it. - `icx trust`'s in-repo note uses project_root's answer, so an invalid `.git` file ends the search there too. Tests: stale sandbox cleanup only removes this user's directories of exited processes (Linux), and clears a reused PID's sandbox; new unit test. The git oracle helper takes its ceiling explicitly; the FIFO test is unix-gated and covers a FIFO `.git`. Dev tools: redactor-differential.sh always copies this tree's harness into the base worktree, validates its arguments, sorts in the C locale, prunes the worktree and works on bash < 4.4; the harness counts the `4821` PIN placeholder and treats `LEAKS=0` as off. measure_fts_index.py uses a private temp directory removed on exit, a 0700 `--out`, a URI-safe read-only open, streams chunks per artifact, refuses an empty store and adds contentless configurations.
|
Review rounds addressed in 6ecf811 and 5580d1a. Blocking (03:31 round): FIFO/unbounded control-file reads. Fixed in 6ecf811: every git control file ( Acted on (5580d1a):
Declined:
Checks at 5580d1a: |
- icx trust: the in-work-tree note no longer fires for a linked worktree's own top, which 5580d1a had introduced. inside_work_tree() asks whether the parent resolves to a repository; a unit test covers a repository top, a linked worktree top and a subdirectory of each against real git. - `.git` files need `gitdir: ` with the space and keep the path's trailing spaces, as git's read_gitfile_gently does; `HEAD` skips ASCII whitespace only after `ref:`. The no-space case is asserted against git. - Stale sandbox test: per-process names, and PID 1 as the running process (present in every PID namespace). - measure_fts_index.py never changes an existing `--out` directory's mode: it refuses one that others can access, before reading the store; insert time is documented as a bulk backfill. - redactor-differential.sh: no `;;&` (bash 3.2), mkdir before copying the harness, prune only after a failed `worktree remove`, and a kept `target/redactor-diff-base` so the base is not rebuilt on every run.
|
Round at 04:37 UTC (5580d1a) addressed in 575564c. Acted on:
Declined:
At 575564c: |
Motivation
Every
cargo testrun left about 30 directories in/tmp, and 6,483 had built up (about 1.2 GBon a tmpfs
/tmp). Separately, the v1.5.x red-team rounds' scratch tooling was about to be lostto
/tmpcleanup; two pieces are worth keeping for the next redactor change and for T-91-003.Changes
Test hygiene (1a256be)
install_cli: each throwaway HOME is a guard removed when the test passes; a failing testkeeps it for inspection.
icx_cli_test_roots_<pid>outlives every test, so its setupremoves the sandboxes of exited test processes (Linux,
/proc/<pid>).Developer tools (6d92736)
crates/icx-codec/tests/redact_dev_harness.rs: seeded fragment fuzz and JSON case runner,#[ignore]d and report-only (not a gate).scripts/redactor-differential.sh [BASE_REF]: runs the fuzz here and in a temporary worktree ofthe base ref; lists lines that leak on only one side.
scripts/measure_fts_index.py <workspace>: read-only FTS5 sizing over stored text (T-91-003).docs/testing-strategy.mdsection 3a.Project root lookup (5315ae4, fixes #120)
project_rootfollows git's discovery: a.gitdirectory needs a validHEADplusobjectsand
refs(in the common dir for a linked worktree), otherwise it is skipped; a.gitfilenaming no repository ends the search, as git does.
icx trust's in-repo note uses the same check.worktree_root.rs: empty, HEAD-only, bad-gitfile and minimal-valid cases, each asserted againstgit rev-parse --show-toplevel; the test fails on the previous lookup (checked on a HEAD worktree)..git(workspace_trust.rs) now use a minimalvalid one; the proxy routing test makes each project its own repository.
Fixes #120
Checks run
cargo fmt --all -- --check,cargo clippy -p icx-cli -p icx-adapters -p icx-codec --all-targets -- -D warnings: clean.install_cli(25),icx-cliunit tests (59),codex_rollout_zstd_props(4): pass, and add nodirectories to
/tmp(counted before and after).redactor-differential.sh --n 20000 main: 0 new, 0 fixed leaks (tree vs itself); temporaryworktree removed. Case-file mode checked on three cases.
measure_fts_index.pyon a 592-artifact store: store checksum unchanged.uvx reuse lint, gitleaks: clean.cargo test --workspaceat 5315ae4: 709 passed, 0 failed.cargo clippy --workspace --all-targets -- -D warningsclean. (Before the fix,proxy_routes_each_project_into_its_own_workspacefailed locally on unmodified
mainbecause of a stray empty/tmp/.git; that is Project root lookup accepts any .git, including an empty directory git rejects #120.)🤖 Generated with Claude Code