You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[agent] Filed by the scheduled architecture audit routine (CLI and core). Register: register comment.
Kind: tracking. Source: review Part 6.4 and Part 8.5 D; register C30.
Problem (re-counted on 045d7ec)
The CLI already has a shared tests/common/mod.rs (every test target can reach it through #[path = "../common/mod.rs"]), but most files keep their own copies:
fn binary() in 103 files, 7 variants (PathBuf, &'static str, one env-overridable); common::binary exists at L35-L37.
fn git_sha256 in 86 files, 10 variants, although common::git_sha256 exists and core exports compute_git_sha256_from_bytes.
xorshift64* is written four times in core (test_rng.rs, oracle_support.rs, npm_crawler/oracle.rs, patch/copy_tree.rs); test_rng is the intended shared one.
The VEX e2e helpers are split across vex_e2e_common, vex_pdm_hatch_common, vex_pipenv_pip_common, vex_pypi_real_common and common/yarn_classic_vex.rs.
Target design
One test-support surface: tests/common for the CLI (it already reaches every target), which can later become a socket-patch-test-support dev crate if core and CLI tests need to share it. It owns the hermetic Command builder, binary(), git_sha256 (delegating to core), the envelope parsers and the seeded RNG. Each child deletes the copies it replaces, and none touches production code.
[agent] Filed by the scheduled architecture audit routine (CLI and core). Register: register comment.
Kind: tracking. Source: review Part 6.4 and Part 8.5 D; register C30.
Problem (re-counted on
045d7ec)The CLI already has a shared
tests/common/mod.rs(every test target can reach it through#[path = "../common/mod.rs"]), but most files keep their own copies:fn binary()in 103 files, 7 variants (PathBuf,&'static str, one env-overridable);common::binaryexists at L35-L37.fn git_sha256in 86 files, 10 variants, althoughcommon::git_sha256exists and core exportscompute_git_sha256_from_bytes.scrub_socket_envcopies with 14 bodies, and 10 files that spawn the binary with no scrub at all. This one is a correctness problem, not just duplication: on045d7ecan ambientSOCKET_DRY_RUN=trueturns 18 of the 19 unscrubbedrepair_vendor_e2etests red while every scrubbed test in the same target is unaffected (details in Spawn every CLI test child through one hermetic Command builder; 10 test files inherit ambient SOCKET_* today #823).test_rng.rs,oracle_support.rs,npm_crawler/oracle.rs,patch/copy_tree.rs);test_rngis the intended shared one.vex_e2e_common,vex_pdm_hatch_common,vex_pipenv_pip_common,vex_pypi_real_commonandcommon/yarn_classic_vex.rs.Target design
One test-support surface:
tests/commonfor the CLI (it already reaches every target), which can later become asocket-patch-test-supportdev crate if core and CLI tests need to share it. It owns the hermeticCommandbuilder,binary(),git_sha256(delegating to core), the envelope parsers and the seeded RNG. Each child deletes the copies it replaces, and none touches production code.Children (in order)
Commandbuilder; delete the 15scrub_socket_envcopies and cover the 10 unscrubbed files.binary()withcommon::binary(mechanical;e2e_redirect_pnpm_build.rskeeps its env override as a named helper).git_sha256withcommon::git_sha256, built oncompute_git_sha256_from_bytes.test_rng.Only the first child is filed; the rest are mechanical and can be filed as the first lands.
Acceptance criteria
grep -rn "fn binary()\|fn git_sha256\|fn scrub_socket_env" crates/socket-patch-cli/testsmatches onlytests/common.Dependencies
Unblocked. C31 (fewer test executables) and #793 (
RunCtx, removing#[serial]) are easier after it.