Skip to content

git.status caps its frame; find streams to the caller - #129

Merged
CMGS merged 4 commits into
mainfrom
feat/status-cap-find-seq
Sep 3, 2026
Merged

git.status caps its frame; find streams to the caller#129
CMGS merged 4 commits into
mainfrom
feat/status-cap-find-seq

Conversation

@CMGS

@CMGS CMGS commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Supersedes #128 (same two commits rebuilt on main after #127, plus the disconnect fix its review asked for).

git_status on a large tree (about 100k changed or untracked files) rendered one frame past the 8 MiB cap, so the writer failed and the connection dropped with no terminal frame. The entry list now stops at an eighth of the frame cap in estimated bytes and the result carries truncated: true; the head of the list still arrives, and the field is absent when nothing was cut. Fixture resp_git_status_result_truncated.json pins the shape on both sides.

Find accumulated every match on the host with no bound. The Go SDK gains FindSeq (an iter.Seq2 over the same stream; breaking out closes the connection) and the Python SDK find_iter; Find/find keep their slice APIs on top of the stream. In silkd, find now selects on the request side the way watch does, so a client that went away ends the walk even when no further match would have tried to write; the e2e tests keep their write half open until the terminal frame, as the SDKs do.

Gates: cargo fmt/clippy/test (macOS and a rust:1.98.0 linux/arm64 container), make lint both GOOS, Go tests in every module, Python suite 154 passed, ruff check clean.

CMGS added 4 commits September 3, 2026 13:26
A status of a large tree rendered one frame past the cap and dropped the
connection with no terminal frame. The entry list now stops at an eighth
of the frame cap in estimated bytes and the result carries truncated: true,
so the head of the list still arrives. The Go SDK gains FindSeq and the
Python SDK find_iter: matches stream to the caller, and leaving the loop
closes the connection, which ends the walk in the guest, so the caller
bounds the result instead of accumulating it. Find keeps its slice API on
top of the same stream.
A caller that stops reading after an early match left silkd scanning the
rest of the tree whenever no further match tried to write; the writer now
selects on the request side as watch does, so EOF or a stray frame ends the
walk without a done frame. The find e2e tests keep their write half open
until the terminal frame, the way the SDKs do. The SDK examples handle the
error before the result-limit break, and the Python one closes the
generator explicitly.
Ending the writer loop closed the budget, but a walker scanning a tail with
no matches only noticed at its next send, so an abandoned find still read
the whole tree. The walk now tests the channel before each entry and
reports whether it completed. The Python example imports closing and the
docstring names contextlib.closing as the portable cleanup.
@CMGS
CMGS merged commit e8ac632 into main Sep 3, 2026
4 checks passed
@CMGS
CMGS deleted the feat/status-cap-find-seq branch September 3, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant