Skip to content

Commit 9116e95

Browse files
committed
refactor: #581 for #570, C02 in PR
1 parent 122efcf commit 9116e95

3 files changed

Lines changed: 18 additions & 7 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-02T17:13Z: architecture refactor run
2+
3+
- **main:** `bf0e0d1`.
4+
- **Ranking:** #561 (6) and #568 (4, new p1) were skipped because they change files that open PRs also change: #561 changes `redirect/mod.rs` (#552, #470, #465), and #568 changes `scan/hosted.rs` (#503, #470). #570 (C02, P1) and E37 tied at 4, and #570 won on register P. Maintainer steering on #569 and #571 (no size caps on trusted data, stream instead) re-scoped both as streaming changes with M risk. Both dropped in the ranking.
5+
- **PR:** [#581](https://github.com/SocketDev/socket-patch/pull/581), "Bound patch API connects and stalled reads (#570)". It adds one `ApiTimeouts` policy (10 s connect, 60 s idle read) to both `ApiClient` clients. The stall tests were red with the bound disabled and are green on the branch. Ready for review, `@bugbot review` requested, handed to the burn-down.
6+
- **Claimed:** #570. **Released:** none.
7+
- **Merged:** none (#572 and #574 are still open). **Living document:** `{{C02}}` was already in Part 1 §2 and Part 7, and register row C02 is now `in PR #581`.
8+
- **Lessons:** reqwest 0.12's `read_timeout` is an idle bound that also covers waiting for headers, so it bounds stalls without capping long downloads.

‎register/20-audit-core.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _Last updated 2026-10-02T16:20Z · main @ 1169ae6_
44
| ID | P | Problem | Source | Issues | Status |
55
|---|:-:|---|---|---|---|
66
| C01 | 1 | Unbounded zip inflate on tamperable input. `zip_bytes_match_after_hashes` pre-allocates from the archive's declared size and reads with no cap, and it runs on committed `.nupkg`/`.jar` files and service archives. There are three archive caps (512/256/128 MiB). | #569 | filed #569 |
7-
| C02 | 1 | `ApiClient::new` and `plain_client()` set no HTTP timeout, and blob and diff fetches have no retry, so `scan`, `get` and `apply` can hang in CI. | #570 | filed #570 |
7+
| C02 | 1 | `ApiClient::new` and `plain_client()` set no HTTP timeout, and blob and diff fetches have no retry, so `scan`, `get` and `apply` can hang in CI. | #570 | in PR #581 |
88
| C03 | 1 | `vendored_takeover` ignores `RevertOutcome.kept_artifact`. It deletes the ledger entry and reports the artifact as reverted on a drift-keep, while every other revert caller honors the flag. | #568 | filed #568 |
99
| C04 | 1 | Planted-binary spawn: `vendor/pypi_hatch.rs` runs `Command::new("hatch").current_dir(root)` instead of `process::resolve_tool`. Check open PR #442 first. | §1 #4; 7.3 | | to verify |
1010
| C05 | 1 | `SOCKET_FORCE` is bound to `vendor --force`, `apply --force` and `--update --force`, so forcing a self-update also forces past hash checks. | §1 #6 | | to verify |

‎register/90-refactor.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
### Refactor routine (`refactor`, hourly, highest leverage first)
2-
_Last updated 2026-10-02T16:28Z · main @ 1169ae6_
2+
_Last updated 2026-10-02T17:10Z · main @ bf0e0d1_
33

44
**In flight:**
55
- [#572](https://github.com/SocketDev/socket-patch/pull/572): one hosted-PyPI-URL recognizer for hosted and vendored Pipenv. Issues #563 (E04, E49). State: ready, handed to the PR burn-down.
66
- [#574](https://github.com/SocketDev/socket-patch/pull/574): one vlt `registry_base` following vlt's DepID hydration. Issues #562 (E02, E03). State: ready, handed to the PR burn-down.
7+
- [#581](https://github.com/SocketDev/socket-patch/pull/581): one `ApiTimeouts` policy (10 s connect, 60 s idle read) on both `ApiClient` reqwest clients. Issue #570 (C02). State: ready, handed to the PR burn-down.
78

89
**Merged:** none yet.
910

1011
**Queue** (B bugs closed, U unblocks, D duplication removed, R risk; score = 3B + 2U + D − risk):
1112

1213
| # | Candidate | B | U | D | R | Score | Note |
1314
|---|---|:-:|:-:|:-:|:-:|:-:|---|
14-
| 1 | #561 (E01): hosted NuGet sources via `formats::nuget` | 1 | 1 | 1 | L | 6 | skipped: `redirect/mod.rs` is changed by open PRs #552, #491, #470, #465 |
15-
| 2 | #571 (C37): `fetch_binary` through the shared `read_capped` | 1 | 0 | 1 | L | 4 | next |
16-
| 3 | #569 (C01): capped zip inflate, one archive-cap set | 1 | 0 | 1 | L | 4 | |
17-
| 4 | E37: byte-identical `is_safe_{cargo,gem,nuget}_coordinate` + `normalize_version` copy | 0 | 0 | 4 | L | 4 | to verify, no issue yet |
18-
| 5 | #570 (C02): API client request timeout | 1 | 0 | 0 | L | 3 | overlaps C15's retry primitive |
15+
| 1 | #561 (E01): hosted NuGet sources via `formats::nuget` | 1 | 1 | 1 | L | 6 | skipped: `redirect/mod.rs` is changed by open PRs #552, #470, #465 |
16+
| 2 | #568 (C03): takeover honors `kept_artifact` via `vendored_backend`'s revert step | 1 | 0 | 1 | L | 4 | skipped: `scan/hosted.rs` is changed by open PRs #503, #470 |
17+
| 3 | E37: byte-identical `is_safe_{cargo,gem,nuget}_coordinate` + `normalize_version` copy | 0 | 0 | 4 | L | 4 | next; to verify (holds on `bf0e0d1`), no issue yet |
18+
| 4 | #571 (C37): stream blob/diff bodies | 1 | 0 | 0 | M | 1 | maintainer: no size cap, stream instead; changes `fetch_binary`'s return shape |
19+
| 5 | #569 (C01): stream zip entry comparison | 1 | 0 | 0 | M | 1 | maintainer: data is trusted, stream for performance instead of capping |
1920

2021
**Notes:**
2122
- 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`.
@@ -25,3 +26,5 @@ _Last updated 2026-10-02T16:28Z · main @ 1169ae6_
2526
- `CLI_CONTRACT.md` lives at `crates/socket-patch-cli/CLI_CONTRACT.md`.
2627
- vlt registry semantics: cite `@vltpkg/dep-id` `hydrateTuple` and `@vltpkg/spec` (`registry ?? registries[default-registry-alias]`); the packages download from npm.
2728
- Runs overlap: two runs started within minutes of each other on 2026-10-02. Claims and the status block kept them apart; `git pull --rebase` the ledger before writing.
29+
- Maintainer steering (2026-10-02, on #569 and #571): don't add size caps on trusted upstream data; stream instead of buffering.
30+
- reqwest 0.12 `ClientBuilder::read_timeout` is an idle bound (resets per chunk) and also bounds the wait for response headers; `RequestBuilder::timeout` is total.

0 commit comments

Comments
 (0)