Skip to content

Commit f82e062

Browse files
committed
refactor: run 20261009T131841Z (PR #1272)
1 parent 4b7ef4a commit f82e062

3 files changed

Lines changed: 19 additions & 11 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[agent] 2026-10-09: architecture refactor run
2+
3+
- main: `a80b89e` (unchanged; nothing merged since the last entry).
4+
- Ranking: 35 open PRs change 144 production files. Every production candidate with B ≥ 1 or D ≥ 4 was skipped by file overlap: the manifest-load cluster, #705, #717/#882 (`redirect/mod.rs`, `gradle.rs`), #761/#836 perf (`redirect/mod.rs`), #823, #675 and #1220. Among free work, #1089 child 1 won, the shared `--json` envelope readers (C32: U 1, D ≈25 test copies, R L). #905 slice 4 (D ≈3) came next.
5+
- PR: [#1272](https://github.com/SocketDev/socket-patch/pull/1272), `state: ready`, Bugbot requested. Test-only, +575/−462 across 28 files. That includes the 109-line `common/envelope.rs` and the 268-line ratchet plus self-tests in `cli/envelope_helper_copies.rs`. `parse_json_envelope` and the `envelope_error_*` readers move from `common/mod.rs` into `envelope.rs` and are re-exported. 24 files lose their private copies. Clippy is clean, and every CLI test target compiles with no warnings. The touched suites pass, apart from 3 root-only chmod tests in `covgap_commands_vendor` that also fail on `main`.
6+
- Claimed: #1089 (child 1 helpers; `remove/covgap_commands_remove.rs` waits on #1258). Released: none.
7+
- Register: C32 → child 1 helpers in PR #1272. `doc/08` already carries `{{C32}}`.
8+
- Lessons: the sandbox disk filled mid-run (a 23 GB target dir plus a worktree), so running suites failed spuriously. To check a failure against `main`, run `git checkout origin/main -- <tests dir>` in place and re-run, instead of adding a second worktree.

‎register/20-audit-core.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _Last updated 2026-10-09T09:55Z · main @ a80b89e_
3434
| C29 | 3 | The `client.rs` split (2.8K lines) into client, vendor_service and credentials; the debug-ordering machinery (`HeldBack`) has 45 call sites. | 7.2; 7.6 #8 | #913 | filed #913; #871 deferred (closed not planned) |
3535
| C30 | 2 | No shared test-support: `binary()` is defined in 103 files and `git_sha256` in 86, there are 15 `scrub_socket_env` (14 bodies), xorshift is implemented four times, and the VEX helpers are forked. | 6.4; 8.5 D | #824, #823 | filed #824, #823; #850 deleted 8 of 15 `scrub_socket_env`; #824 children 2–3 partly fixed (#1124); slice 2 in PR #1258 |
3636
| C31 | 3 | 240 test executables on `f3c6313` (review: 207); target ~25. Needs C10 first. | 8.5 A | | to verify; count confirmed, not filed: blocked on #794 (env-mutating `#[serial]`) |
37-
| C32 | 3 | Tracking: ~478 one-line 4+-word `.contains` sentence assertions (245 in the 27 covgap files, 26,086 lines, 391 tests on `05ecc6e`) become `--json`/`errorCode` checks plus render suites; `_json`/`_human` twins collapse. | 2.5; 8.5 G/H | #1089 | filed #1089; tracking #1089 (#1090 folded in) |
37+
| C32 | 3 | Tracking: ~478 one-line 4+-word `.contains` sentence assertions (245 in the 27 covgap files, 26,086 lines, 391 tests on `05ecc6e`) become `--json`/`errorCode` checks plus render suites; `_json`/`_human` twins collapse. | 2.5; 8.5 G/H | #1089 | filed #1089; tracking #1089 (#1090 folded in); child 1 helpers (`common::envelope`, ~25 private copies) in PR #1272 |
3838
| C33 | 3 | Tracking: `CLI_CONTRACT.md` (417 KB on `431b818`; 332 KB at review) should be a checked reference (flags, env vars, codes, exit codes) plus ≤300 lines of prose, with freshness tests. | 8.3; 8.5 F/I | #948 | filed #948; tracking #948 (#949, #678 folded in) |
3939
| C34 | 3 | Decide: the command model. A read-only `scan`, plus `fix`, `undo`, `sync` and `check`, with mode inferred from project state (or an explicit `--mode` for takeovers). This folds `remove`, `rollback` and `vendor --revert`. | §4; 2.9; R6/R8 | #1088 | decision #1088; recommends mode-as-project-state now (Q1 option 2), new verbs next major |
4040
| C36 | 3 | Decide: the future of the self-update binary swap. | §6 Q2; 7.5 | #983 | rejected; #983 kept the swap and the notifier, to be hardened |

‎register/90-refactor.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
### Refactor routine (`refactor`, hourly, highest leverage first)
2-
_Last updated 2026-10-09T12:45Z · main @ a80b89e_
2+
_Last updated 2026-10-09T13:45Z · main @ a80b89e_
33

44
**In flight:**
5+
- [#1272](https://github.com/SocketDev/socket-patch/pull/1272): `tests/common/envelope.rs` owns the `--json` envelope readers (parse, `events`, `find_event`, event/warning codes); ~25 private copies in 24 test files deleted, ratchet `cli/envelope_helper_copies.rs`. #1089 child 1 helpers (C32). 0 prod. `state: ready`.
56
- [#1264](https://github.com/SocketDev/socket-patch/pull/1264): Gradle (vendored + hosted) and the Maven reactor pick inserted-line terminators through `line_endings::terminator`; `gradle/eol.rs` deleted (`eol_eq` and `respell` in `line_endings`). #815 slice 3 (E16). +67/−97 prod, +67/−37 tests. `state: ready`.
67
- [#1262](https://github.com/SocketDev/socket-patch/pull/1262): the OpenVEX document is written through `utils::fs::write_user_output` (stage + rename; links through, devices in place). #1144 (C77). +57/−1 prod, +185 tests; CI green, Bugbot clean. `state: ready`.
78
- [#1258](https://github.com/SocketDev/socket-patch/pull/1258): 40 more CLI test files import `tests/common`'s `binary()` / `git_sha256` (31 + 25 copies deleted). #824 children 2–3 slice 2 (C30). +142/−401 tests, 0 prod. `state: ready`.
@@ -14,19 +15,20 @@ _Last updated 2026-10-09T12:45Z · main @ a80b89e_
1415

1516
**Merged:** #1227 (E16 slice 2), #1221 (E19 hosted gem), #1230 (E93 `PurlKey`), #1217/#1209/#1205/#1183 (E05 Deno, Go, cargo, NuGet crawls); 32 earlier PRs (#572 … #1191, see `entries/refactor/`). Leftovers: `blob_hash_matches` (#1163), dead `eco == "maven2"` arm in `commands/vendor.rs` (#1015).
1617

17-
**Queue** (score = 3B + 2U + 2D + S − risk). Since the 2026-10-08 backlog review, standalone refactor issues are closed as `not_planned` and kept as checklist items of their tracker; rank the tracker's next unchecked item.
18+
**Queue** (score = 3B + 2U + 2D + S − risk). Standalone refactor issues closed `not_planned` live on as tracker checklist items; rank the tracker's next item.
1819

1920
| # | Candidate | B | U | D | R | Score | Note |
2021
|---|---|:-:|:-:|:-:|:-:|:-:|---|
21-
| 1 | #815 slice 3 (E16): Gradle first-line rule + `maven_reactor.rs` ×2 through `line_endings::terminator` | 0 | 1 | ≈4 | L | ≈10 | **taken: #1264**; hosted Gemfile in `redirect/mod.rs` remains |
22-
| 2 | #931 + #998 + #1063 + #1123: one manifest load + error mapper for every command | 4 | 1 | ≈6 | M | ≈24 | skipped: `apply.rs`, `vendor.rs` (#1009, #1049), `rollback.rs`, `remove.rs` (#1034, #1049), `repair.rs` (#1049) |
23-
| 3 | #705 (C18): one `utils::uuid` grammar | 0 | 0 | ≈5 | L | ≈10 | skipped: `cli/lib.rs` (#1034), `api/client.rs` (#1026, #1034, #1049), core `apply.rs` (#1049) |
24-
| 4 | #717 (E10): hosted pom edits + restore through `formats::maven` | 3 | 1 | ≈4 | M | ≈17 | skipped: `redirect/mod.rs` (#1009, #1026, #1180, #1242, #1254, #1259) |
25-
| 5 | #823 (C47): last 5 free `scrub_socket_env` copies onto `hermetic::command` | 0 | 0 | ≈5 | L | ≈10 | skipped: `spawn_env_hygiene.rs` (#1049) |
22+
| 1 | #1089 child 1 (C32): shared `common::envelope` readers | 0 | 1 | ≈25 (tests) | L | ≈12 | **taken: #1272**; remove covgap file waits on #1258 |
23+
| 2 | #905 slice 4 (E64): `formats/pnpm/lines.rs`, `redirect/npmrc.rs`, `vex/discover/pypi_other.rs` onto `formats::text` | 0 | 0 | ≈3 | L | ≈6 | free |
24+
| 3 | #1098 (E90): one Bundler-homes answer in `ruby_crawler.rs` | 1 | 0 | ≈1 | M | ≈3 | free in core; `vex_consumed.rs`/`ecosystem_dispatch.rs` busy |
25+
| 4 | #931 + #998 + #1063 + #1123: one manifest load + error mapper | 4 | 1 | ≈6 | M | ≈24 | skipped: `apply.rs`, `vendor.rs`, `rollback.rs`, `remove.rs`, `repair.rs` (#1009, #1034, #1049) |
26+
| 5 | #761/#836 (C69, S 3): parse/serialize the cargo and uv locks once per run | 0 | 0 | ≈2 | M | ≈5+S | skipped: `redirect/mod.rs` (6 PRs) |
2627

27-
Re-ranked 2026-10-09T12:00Z at `a80b89e` against 32 open PRs (131 production files changed). #989's remaining backends, #1220 and #675 (`scan/mod.rs` #1211, #1049) stay skipped. Also skipped by file overlap: #1114/E91 (`vendor/pypi.rs` #1026, `lock_inventory/tests.rs`), #1129/E92 (`npm_crawler.rs` #1009), #1098/E90 (`ecosystem_dispatch.rs`, `vex_consumed.rs`), E12 (`pnpm_lock.rs` #1245). Free but low: #905 slice 4 (`npmrc.rs`, `pypi_other.rs`), E37 composer `normalize_version`, #782 slice 2 (`go_sum_edit::remove_lines`, `copy_manifest_tag`).
28+
Re-ranked 2026-10-09T13:00Z at `a80b89e` against 35 open PRs (144 production files). Still skipped by file overlap: #705, #717, #882 (E63), #823, #675, #1220, #1114, #1129, #1098's CLI half. #1270 (E95) is a pure fix for the fixer. Free but low: E37 composer `normalize_version`, C17 `yarn_berry_lock.rs` digest.
2829

2930
**Notes:**
31+
- CLI tests read `--json` through `common::envelope` since #1272 (`parse_json_envelope`, strict `events`, `find_event`, `event_triples`, lenient `event_codes`/`codes_in`, recursive `all_codes`); `cli/envelope_helper_copies.rs` fails on new private copies, stale entries allowed.
3032
- Gradle line endings (#1264): `gradle::eol` is gone; Gradle writers insert with `line_endings::terminator` and find what they wrote with `line_endings::respell(text, terminator(current))`, compare owned files with `line_endings::eol_eq`. Keep forward and revert on the same rule.
3133
- User-named output paths (`--output`, `--vex <path>`) go through `utils::fs::write_user_output` since #1262; do not stage-and-rename over `/dev/stdout` or a FIFO with the commit-point writers. `RLIMIT_FSIZE` + ignored `SIGXFSZ` in `pre_exec` gives a root-proof part-way write failure; set `LLVM_PROFILE_FILE=/dev/null` on that child or `coverage` fails on a truncated `.profraw`.
3234
- Revert finish (#1245): new backends end their revert with `revert::finish(outcome, root, rel, opts, KeepPolicy::…)`; the npm family keeps its bare `cannot remove <rel>` failure (warnings dropped), the rest keep warnings with `failed to remove <abs>`. Yarn berry/classic and npm add a still-wired refusal before the delete: extend the policy, do not re-copy the sequence.
@@ -41,11 +43,9 @@ Re-ranked 2026-10-09T12:00Z at `a80b89e` against 32 open PRs (131 production fil
4143
- The skip rule names `arch-refactor/*` and `agent/fix-*` PRs only; still check `arch-fix/*` and `ci*` hunks before touching the same lines.
4244
- Test-helper migrations (#824): directory binaries import via `crate::common`. `spawn_env_hygiene` scans test text, literals included: never spell a bare binary spawn in a new test file; run it before pushing.
4345
- Equivalence goldens (`tests/equivalence/*.golden`, bless with `SOCKET_PATCH_BLESS_GOLDEN=1`) include mixed-ending inputs: prove only mixed cases move before re-blessing a line-ending change.
44-
- Upstream gem `restore_manifest` pins CRLF output for a CRLF Gemfile with an LF block; migrate it only together with the forward Gemfile writer in `redirect/mod.rs`.
4546
- The sandbox runs as root, so 4 core lib tests fail on main and on branches alike: `copy_tree::relax_loop_must_not_traverse_symlinked_root`, `vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry`, `pypi_poetry::wire_write_failure_maps_error_and_leaves_lock_untouched`, `pypi_requirements::wire_failure_rolls_back_already_written_files`.
4647
- `redirect/pipenv.rs`, `vendor/pypi.rs` and `vendor/lock_inventory/vlt.rs` aren't rustfmt-clean on main: format only your own hunks there. Check `rustfmt --check` on the `main` copy before formatting a whole file.
4748
- `lock_inventory/mod.rs` `architecture_tests` forbid `hosted_patch_uuid*` in a format file's model section. Origin-policy helpers go after the `// ── registry view ──` marker.
48-
- 2026-10-08: ~40 refactor issues were closed `not_planned` into trackers (scheduling, not rejection); claim the item's issue if still open, else reference the tracker.
4949
- NuGet identity (#1230): `PurlKey` folds versions through `vendor::nuget_feed::normalize_nuget_version` (a utils→vendor import until `nuget_feed.rs` frees for the `formats::nuget` move). `test_support::service_fixture` builds its NuGet grant from `<id>.<purl version>.nupkg`, so a test vendoring a non-normalized version needs that file too.
5050
- NuGet crawl identity (#1239): `find_by_purls` runs main's probes first (`<id>/<as-written>`, exact legacy, case-insensitive legacy) and the normalized ones only after (`<id>/<normalized>`, `legacy_dir_is`), so a cache with two spellings keeps main's pick. The `oracle.rs` equivalence keeps main's rule; its randomized versions are all normalized, so it still agrees.
5151
- Steering (2026-10-02, #569/#571): no size caps on trusted upstream data; stream, don't buffer.

0 commit comments

Comments
 (0)