summaryrefslogtreecommitdiffstats
path: root/src/sandbox/wire.rs
Commit message (Collapse)AuthorAgeFilesLines
* sandbox, pipeline: close what only your own module was ever meant to namedev11 days1-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sandbox exported 35 items and 8 of them were named by nobody at all — not by a caller, not by a test. `Frame`, `read_frame`, `write_frame`, `hex_bytes`, `unhex` and `MAX_FRAME_BYTES` are the wire protocol, and the protocol is sandbox's: the agent, the remote client and the loopback all speak it from inside. Exporting it advertised a second way in that nothing used and everything would have had to keep compatible. `LoopbackSandbox` and `RemoteSandbox` are the same story — handles handed out by a constructor nobody calls by name. Pipeline exported its step machine. `run_step`, `log_line`, `sweep_render_dirs`, `from_candidate`, `from_release` and the four types they pass around (`Collect`, `CollectedPkg`, `SourceIdentity`, `StepResult`) were all internal plumbing reachable from `main`, which only ever wanted `run`, `Outcome`, `enqueue_for_candidate`, `enqueue_manual_rebuild`, `publish::reconcile` and `dispatch::Pool::spawn`. sandbox.pub 35->27, pipeline.pub 30->21, and both modules now have zero items named by nobody: what is left public is public because a test names it, which is the allowlist the budget records rather than a hole in it. Clippy caught what the tests did not: `Ctx::src` was a `pub` field of the newly private `SourceIdentity`, a public face on a private type. The field narrowed with the type. Re-widening `SourceIdentity` to silence it would have undone the point. The diff is visibility keywords only — no step id literal, no frame variant, no wire byte changed. 277 passed / 0 failed across 36 binaries, including remote_agent, failure_modes and the kata tier; clippy -D warnings clean.
* comments: keep only what the code cannot showaur-build12 days1-7/+0
| | | | | | | | | | | Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound.
* comments: say why, not whataur-build12 days1-29/+7
| | | | | | | | | | | | | | Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath.
* sandbox: ephemeral agent, wire protocol, and the hub's remote backendaur-build12 days1-0/+141
The seam from the previous commits only had one body. This adds the other one: a sandbox-agent binary that dials the hub (outbound rendezvous — the hub never needs a route into an untrusted box), serves Run/Put/Get frames over length-prefixed JSON, streams the child's stdout/stderr as they fill, and dies — taking its child with it — when the connection drops or its TTL expires. The TTL watchdog is the backstop under every leak: hub crash, partition, a forgotten destroy. Hub side, RemoteBackend implements the same SandboxBackend: acquire waits for a dial-in and verifies the shared token and profile before a lease exists; a vanished sandbox fails the step, which is already the shape of an expired lease (I5), so the remote path adds no new failure vocabulary. Run frames carry the hub's child environment, so the §16a shim protocol reaches remote children exactly as local ones — which is what makes the end-to-end test honest: a real build, real frames, real log streaming into the SSE-tailed file, no root and no container. Workspace sync over the wire is deliberately not here: Run carries a hub-side cwd, honest for loopback-shaped deployments and this test tier, and the module says so rather than pretending.