F: handoff for review round 3

This commit is contained in:
ari committed 2026-10-20 15:04:09 -04:00
1 parent 1d4b568a7c
commit 2a9339c673
1 file changed
+23 -1
+23 -1
View File
@@ -4,7 +4,7 @@ Part of [Phase 5: Consolidator](README.md). Contracts: [contracts.md](contracts.
| Field | Value |
|---|---|
| Status | In progress: F1 approved; F2 to F4 written, green locally, waiting on the nix gate and one fix outside this workstream (see the Handoff) |
| Status | In progress: F1 approved; F2 to F4 written; all three review rounds addressed, local gate green; waiting on the nix gate (`nix flake check -L`) |
| Owner | |
| Depends on | C, D, E (original plan). F1 (module) and F4 (docs drafts) can begin once A1 settles the config keys, since they depend only on contracts sections 6 and 9; F2/F3 need the other streams |
| Blocks | phase exit |
@@ -106,3 +106,25 @@ Shippable, documented, verified.
**Not an Owned file.** `docs/README.md`'s Reference table should list `docs/consolidator.md`; left for the fold.
**For the phase exit (orchestrator).** ARCHITECTURE.md: DEC-13 plus the DEC-11 clarification, and the F4 doc facts worth keeping (two checks and the `auth` states, `LoadCredential` token delivery, reload-vs-restart split, GET-only allowlisted proxy, per-consolidator tokens). TODO.md: F1 to F4 boxes and Backlog entries for D8 (aggregation), scoped tokens, peer health history, runtime peer management, and the B address-selection issue if the fix is deferred. `plan/phase-5-consolidator/` moves to `docs/workstreams/` per `plan/README.md`.
## Handoff 2026-10-20 (WS-F -> orchestrator, review round 3)
`loop/F/review-n6.md` had eight findings; all are addressed, one commit each on `ws/F`. No rebase, no edits to `main`.
**Product fixes (both were VM-test findings, now with regression cover).**
- *Proxy forwarded the stripped route.* `proxy::validate` still works the allowlist on the bare route but hands the transport `/api/v1/<route>`, which is what a peer serves. The two acceptance tests are un-ignored and pass (`a_plain_peer_serves_its_own_data_through_the_proxy` compares the proxied body with a direct call; `shutdown_ends_a_proxied_follow` uses a listener that holds the socket). **The WS-C fix is no longer needed**: `checks.vm-peers` gets a working proxy from this branch. Fakes in `src/api/behaviour_tests.rs`, `src/mcp/mod.rs`, `tests/mcp_peers.rs` and `tests/peers_config.rs` were re-scripted on the peer's real paths (test expectations only).
- *Only the first resolved address was tried.* `resolve_target` returns every address and still refuses the name if **any** is denied; `ReqwestTransport` pins the set with `resolve_to_addrs` (the connector falls through), `ClientKey` keys on the set and `tcp_check` tries each address with a per-attempt share of the remaining deadline. Cover: two client unit tests, a `tests/peers.rs` case declaring the peer as `http://localhost:<port>` against a peer bound to `127.0.0.1`, and the VM test's TLS peer `gamma` now binds `0.0.0.0` (IPv4 only) while `alpha`/`beta` stay dual stack. `docs/consolidator.md` (Address families, `deny_cidrs`) and contracts section 10 are rewritten; the "reported as unreachable" limitation is gone.
**Findings 1, 4 to 8.**
- `flake.nix` imports `nix/checks.nix` again, merged with the F2 additions (`package`, `vm`, `vm-peers`, `module-peers`), so `hooks-lint`, `hooks-selection`, `rust-fmt`, `rust-clippy` and `rust-no-openssl` are back in `nix flake check`. `bash dev/hooks/run.sh lint-all` passes locally.
- `dev/dev-test.nu`: `vm peers` builds `.#checks.<system>.vm-peers`; a new `check-vm-attribute` self-check fails if a vm name stops pointing at `.#checks`. `nu dev/dev-test.nu self-check` prints ok.
- Shutdown and slow loris: the test listener distinguishes a complete reply, headers plus a held socket, and headers plus one body byte per 300 ms. Shutdown now ends a held stream (no real peer involved), a slow-loris peer is a `503 timeout` inside 4 s, and the silent-peer bound dropped from 10 s to 4 s.
- Redirect test waits for the health loop's `http_302` verdict before asserting the `Location` target saw zero connections; the peer cap asserts "at most 64 peers"; a chunked oversize body is refused end to end.
- Duplication: one `serve(config, tls, prepare)` helper replaces the repeated bind/pool/migrate/mint/`serve_listener` blocks in `Peer::spawn` and `Consolidator::start`; the local `TempDir` is gone in favour of `peers::testing::TempDir`.
- Docs: `docs/consolidator.md` Testing rewritten (both layers, `checks.module-peers`, the `dev-test integration peers` command, no "written ahead of the feature" note), a new `### Shutdown` subsection backs the README's promise, the agenix examples explain `bind = "0.0.0.0"` (remote callers only), the VM hop assertion is `== 400`, and the README says rotation on NixOS also needs `systemctl reload` for the `LoadCredential` copy.
**Local gate.** `cargo fmt --check` clean; `cargo clippy --all-targets -- -D warnings` clean; `cargo test` green on every target (262 lib, 20 peers_config, 12 peers, 9 mcp_peers, 13 integration, 12 tls, 5 peers_registry, 3 plain, 1 binary_smoke; 2 pre-existing ignored journal tests); `cargo tree -i openssl` empty (covered by `dev-test lint`); `nu dev/dev-test.nu self-check` ok; `nix-instantiate --parse` on `flake.nix` and `nix/tests/peers.nix`.
**Run in the nix gate (nothing was built here).** `nix flake check -L`, now `hooks-lint`, `hooks-selection`, `rust-fmt`, `rust-clippy`, `rust-no-openssl`, `package`, `vm`, `vm-peers`, `module-peers`. `vm-peers` should pass its proxy subtests with this branch alone; its TLS peer is IPv4-only on purpose.
**Still open.** `docs/README.md` does not list `docs/consolidator.md` (not an Owned file; left for the fold). The phase-exit items in the previous Handoff stand, minus the WS-C proxy fix and the WS-B address-selection backlog entry, which are done here.