Repository navigation
review: whole-repo round after #329 (style, cuts −44 prod, OpenPty takes wire.PtyOpen) - #330
Merged
Merged
Conversation
files Applies the style rules: relayEnds moves above the Server methods it split and relay.go's free funcs below auditTee's method set; KeptNode and FakeAgent move above the tests; func types spelled twice get names (bulkMaker, chunkSink); multi-fact godocs and module docstrings drop to one line; belowFloor no longer shadows comparable; tests reuse breakStore and waitFor and drop a helper comment that restated its name.
…ap scan DecodeResponse calls DecodeResponseInto with a nil scratch instead of both forwarding to a private decodeResponse, and decodeReq/decodeResp inline decodeAs. The SDK's three recv helpers become one transient read: every frame it reads is either streamed out before the next read or carries no bulk Data. reapOnce collects purge checkpoints in its locked scan, ReadFile reuses ReadFileTo, and archivesAtDeadline inlines archiveEnabledFor. Tests share one upload fake and the black_hole fixture.
A candidate whose exec fails with ENOENT (a shebang interpreter that is gone) ends the spawn, where execvp would try the next PATH entry; the doc claimed full equivalence.
…copy PtyOpts duplicated wire.PtyOpen and was copied into it on every call; the SDK already returns wire types (DirEntry, FileInfo). Callers build wire.PtyOpen directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Review round over the 42 files the hygiene ledger listed as due after #315–#329 (the perf batch): style, comments, LOC/cut-list, plus correctness review of the 22 production files. No behavior change.
Three commits:
review:(6523d8c), style and layout:relayEndsmoves above theServermethods it was splitting, andrelay.go's free funcs move belowauditTee's method set.KeptNodeandFakeAgentmove above their tests.bulkMaker,chunkSink.belowFloorno longer shadowscomparable.breakStoreandwaitFor, and a helper comment that only restated its name is gone.cut:(6ad8796), cut-list and /simplify:DecodeResponsecallsDecodeResponseInto(line, nil), so the privatedecodeResponselayer goes away;decodeAsis inlined.reapOncecollects purge checkpoints inside its locked scan.ReadFilereusesReadFileTo, andarchiveEnabledForis inlined.black_holefixture.cut:(OpenPty):OpenPtytakeswire.PtyOpendirectly, and the field-for-fieldPtyOptscopy is deleted. This is a breaking change for SDK callers (sandbox.PtyOpts{...}becomeswire.PtyOpen{...}), approved for the next release; docs and the e2e smoke are updated.review:(43279d5), doc fix:resolve_program's doc no longer claims full execvp equivalence. Unlike execvp, it does not move on to the next PATH entry when a candidate's exec fails with ENOENT.Net LOC: prod −44, test −29. Comment lines in Go/Rust: +8 −13; most of the + side is relay.go comments moving with their code.
Why the recv merge is safe
Every read now goes through
RecvTransient, so a bulk frame'sDatais valid only until the next read.stdout,stderr,data) reach only streaming consumers:drainData,pumpStdio, and the pty and port drains. Each hands the bytes to anio.Writeror a pipe before reading again.ReadFilecopies into its own buffer.expect,streamRPC/collectRPC,watch) only ever see non-bulk types:Done,Info,Stat,Entries,Match,Eventand so on.Findings adjudicated but not applied
PortForward,GitClone,silkd.Conn,Client.__init__.frame.go's const-group labels stay. They map each group to its wire field and its Rust enum.resolve_programstats on the runtime thread. That is a few µs per PATH entry;spawn_blockingwould cost more than the posix_spawn it enables saves.fs.rsString parameters stay as they are: the strings are moved out of a consumed request, so nothing is copied.settlePendingSnap→resolvePendingSnapmerge is not done, because it would reorder the hibernate usage event ahead of the claims commit.shardOfempty guard stays. Without it, a wrong assumption becomes a divide-by-zero panic on the claim path.skipIdle,refillGated,benignSweepErr) were already recorded as KEPT in the ledger.Gates
make go-lint: 10×0 issues.aslon darwin and linux: clean for wire, sandboxd and sdk/go.go test -racefor wire, sandboxd, sdk/go, e2e and mcp: passes on macOS and on linux/arm64.TestCaddyTLSClusterwith Caddy 2.11.4: passes.cargo fmt --check,clippy -D warningsandcargo testpass on macOS and in a linux/arm64rust:1.98.1container.ruff format --check,ruff check,mypyandpytest(234 passed) pass on macOS and linux/arm64.