|
2 | 2 |
|
3 | 3 | ## Part 7: Core infrastructure and agent (in-place) mode |
4 | 4 |
|
5 | | -_Last checked against main @ f3c6313 on 2026-10-09 by audit-core. Owner: audit-core._ Re-checked on `f3c6313` (03:40Z run): public-registry fan-out against `utils::concurrent` (C78), and dead `pub fn`s in `utils/`, `api/` and `update/`. Re-checked on `830749f` (21:40Z run): `apply.lock` after #1030 (interrupt cleanup), the HTTP client builders and timeouts, the FIFO-safe readers of every `.socket` store, and lock acquisition per command (all through `lock_cli`). Re-checked on `823810a` (15:40Z run): production file writes outside `utils::fs` (only the VEX document, C77, plus self-update, `apply.lock` and blob-fetch staging), PATH resolution of spawned tools (all through `resolve_tool`), the GC retention split (C50, unchanged), and the C60/C63 passages after #887's close and #1045. Re-checked on `b96a785` (09:40Z run): env truthiness and home-directory resolvers after #1038, and the test-telemetry boundary after #1046. Re-checked on `b762f41` (03:40Z run): 7.3 atomic writes and the 7.7 containment and credentials rows after #1042 and #1070, hash-case verify sites, and the TLS trust roots of every HTTP client (C75). Earlier: `431b818` by the October 7 reconciliation (7.3 spawn deadlines, the 7.4 safety model and the new 7.7 security boundaries); `c5be5d1` by audit-core. Re-checked on `c5be5d1` (15:50Z run): 7.2 retry table and registry timeouts after #889 and #876. Re-checked on `9c43dfc` (09:56Z run): the 7.4 agent-mode footprint, the sidecar list (Maven rewriter from #646) and which ecosystems need agent mode. Re-checked on `9c43dfc`: the self-update footprint and its overlap with `install.sh` (7.5), the credentials block of `client.rs`, agent-mode jar member verification, the apply/rollback store-copy fold and the artifact-retention (GC) policies. Re-checked on `0d302dc`: the `api/*` size row, the `client.rs` breakdown, the retry table, the registry-client timeout, process spawning and hash case. The timeout, blob/diff body, zip-read, process-spawning, API-pacing, URL-builder, retry, batching, hashing, UUID, env/home-dir, atomic-write, purl, dead-code, telemetry, apply/rollback-engine, diff-download, `apply.lock`, Maven-sidecar, group-commit-reader, socket.yml and spawn-deadline passages were re-checked on `045d7ec`; the rest is as of `2463257`. 2026-10-07 14:00Z: 7.2, 7.4, 7.5 and 7.6 record the maintainer's decisions on #648, #792, #808, #983 and #1000 (no code re-check). |
| 5 | +_Last checked against main @ a80b89e on 2026-10-09 by audit-core. Owner: audit-core._ Re-checked on `a80b89e` (09:40Z run): the URL-builder passage after #1041 (one `ApiRoute` per run, client construction per command), HTTP body reads (only the self-update, vendor, Maven and vlt downloads are capped; uncapped blob/JSON bodies are the maintainer's #571 call), production process spawns (all bounded) and the failpoint/switch-off hooks (debug or `failpoints`-feature builds only). Re-checked on `f3c6313` (03:40Z run): public-registry fan-out against `utils::concurrent` (C78), and dead `pub fn`s in `utils/`, `api/` and `update/`. Re-checked on `830749f` (21:40Z run): `apply.lock` after #1030 (interrupt cleanup), the HTTP client builders and timeouts, the FIFO-safe readers of every `.socket` store, and lock acquisition per command (all through `lock_cli`). Re-checked on `823810a` (15:40Z run): production file writes outside `utils::fs` (only the VEX document, C77, plus self-update, `apply.lock` and blob-fetch staging), PATH resolution of spawned tools (all through `resolve_tool`), the GC retention split (C50, unchanged), and the C60/C63 passages after #887's close and #1045. Re-checked on `b96a785` (09:40Z run): env truthiness and home-directory resolvers after #1038, and the test-telemetry boundary after #1046. Re-checked on `b762f41` (03:40Z run): 7.3 atomic writes and the 7.7 containment and credentials rows after #1042 and #1070, hash-case verify sites, and the TLS trust roots of every HTTP client (C75). Earlier: `431b818` by the October 7 reconciliation (7.3 spawn deadlines, the 7.4 safety model and the new 7.7 security boundaries); `c5be5d1` by audit-core. Re-checked on `c5be5d1` (15:50Z run): 7.2 retry table and registry timeouts after #889 and #876. Re-checked on `9c43dfc` (09:56Z run): the 7.4 agent-mode footprint, the sidecar list (Maven rewriter from #646) and which ecosystems need agent mode. Re-checked on `9c43dfc`: the self-update footprint and its overlap with `install.sh` (7.5), the credentials block of `client.rs`, agent-mode jar member verification, the apply/rollback store-copy fold and the artifact-retention (GC) policies. Re-checked on `0d302dc`: the `api/*` size row, the `client.rs` breakdown, the retry table, the registry-client timeout, process spawning and hash case. The timeout, blob/diff body, zip-read, process-spawning, API-pacing, URL-builder, retry, batching, hashing, UUID, env/home-dir, atomic-write, purl, dead-code, telemetry, apply/rollback-engine, diff-download, `apply.lock`, Maven-sidecar, group-commit-reader, socket.yml and spawn-deadline passages were re-checked on `045d7ec`; the rest is as of `2463257`. 2026-10-07 14:00Z: 7.2, 7.4, 7.5 and 7.6 record the maintainer's decisions on #648, #792, #808, #983 and #1000 (no code re-check). |
6 | 6 |
|
7 | 7 | > Scope: `api/*`, `manifest/*`, `ledgers.rs`, `constants.rs`, `patch/` (excluding `redirect/`), `policy/*`, `rollout*`, `update/*`, the CLI `update_notifier.rs`/`update.rs`, `telemetry.rs`, and the generic `utils/*` and `hash/*`. |
8 | 8 |
|
@@ -39,7 +39,7 @@ That is about **19.6K production lines.** Comments are a large share of them: 25 |
39 | 39 |
|
40 | 40 | The vendor policy also has three separate hand-written retry loops, plus a first-attempt/resume split that exists only to keep the request sequence identical under prefetch. Two near-identical downloaders (`download_vendor_archive_once` and `download_artifact_capped_once`) differ only in return type and message strings. |
41 | 41 |
|
42 | | -**Three URL builders with two different policies.** `patches_path` sends an authenticated client without an org slug to `/v0/orgs/default/...`, but `binary_url` and `vendor_package_url` send the same client to the public proxy. Telemetry has a fourth copy of the decision. So when org auto-resolve fails, JSON calls go to the "default" org while blob downloads silently go to the proxy. Re-verified by execution on `045d7ec`: view and batch go to `/v0/orgs/default/patches/…` with the bearer, while blob, diff, vendor references and telemetry go anonymously to `patches-api.socket.dev/patch/…`. Decided in #648: the org is resolved once, when the client is built, into one route (`Org{slug}` or `Proxy`) that all builders and telemetry read; a failed auto-resolve sends the whole run to the public proxy anonymously with one warning, never `/v0/orgs/default`; embedded `--vex` reuses the run's client instead of resolving again. Landed in #1041 (`ApiRoute` in `api/client.rs`). {{C07}} |
| 42 | +**One API route per run (#1041).** `get_api_client_with_overrides` resolves the org once, when the run's client is built, into one `ApiRoute` (`Org{slug}` or `Proxy`). `patches_path`, the batch 404 message, `binary_url`, `vendor_package_url` and telemetry (`TelemetryAuth::for_client`) all read it. A token whose org auto-resolve fails sends the whole run to the public proxy anonymously (a proxy client never keeps the token), with one stderr warning and an `api_auth_fallback` entry in `warnings[]`, never `/v0/orgs/default`. Embedded `--vex` reuses the host's client. On `a80b89e` every command builds at most one client per run (`repair`, vendored repair and `rollback` build theirs lazily or pass it down). Commands with no client (`list`, standalone `vex` before a fetch) route telemetry through `GlobalArgs::telemetry_auth`, which still depends on `apply_env_toggles` mirroring `--api-url`/`--proxy-url` (C10). The mid-run 401/403 proxy swap is separate (C09). {{C07}} |
43 | 43 |
|
44 | 44 | **Timeouts on the main paths (#581).** |
45 | 45 | - `ApiClient::new` and `plain_client()` build both reqwest clients through one policy, `api::retry::ApiTimeouts`: `API_CONNECT_TIMEOUT` (10 s) and `API_READ_TIMEOUT` (60 s of silence, reset per chunk), with no total deadline. Tests override it with `ApiClient::with_api_timeouts`. {{C02}} |
|
0 commit comments