test(process): persistent stdin acceptance + un-stub write-stdin/close-stdin WIT#871
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request completes the implementation of persistent stdin functionality for the process registry. It introduces robust testing to ensure that stdin pipes remain valid across pooled-instance resets and updates the WIT interface documentation to reflect that these features are now stable and production-ready. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The pipe is held while instances fade, Persistent streams in registry laid. With tests now green and tags removed, The stdin flow is well-improved. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements and documents the persistent tier stdin capabilities, updating the WIT definitions to reflect that the persistent registry has landed and its shapes are frozen. It also adds a comprehensive integration test for writing to and closing stdin. The feedback recommends replacing the fixed tokio::time::sleep calls in the new tests with a polling loop to prevent test flakiness and improve execution speed in different environments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…e-stdin WIT The id-keyed persistent write-stdin/close-stdin landed implemented in #867 but were never test-locked and the WIT still tagged them (NOT YET IMPLEMENTED). - Adds a registry test proving the acceptance: write-stdin delivers bytes to a persistent child, a second by-id write (needing only the registry + id, i.e. what a post-reset instance has) still reaches the same child, close-stdin yields a clean EOF exit, over-cap -> too-large, wrong-owner -> no-such-process, post-close -> closed. - Bumps the wit submodule to drop the stale (NOT YET IMPLEMENTED) tags on the id-keyed forms and correct the two persistent-tier banners (registry has landed). Restages wit-staging. The ProcessHandle (ephemeral) form, attach, and watch/unwatch stay deferred and keep their tags.
e72e079 to
74c04cc
Compare
There was a problem hiding this comment.
Pull request overview
This PR closes #870 by aligning the astrid-process WIT contract docs with the now-landed persistent-process stdin support, and by adding an integration test that exercises the persistent-tier id-keyed write-stdin/close-stdin behavior against a real child process.
Changes:
- Updates the staged WIT to remove stale “NOT YET IMPLEMENTED” tagging for id-keyed persistent stdin functions and refreshes persistent-tier banner text.
- Adds a new registry integration test covering: successful stdin delivery, cross-“instance reset” by-id writes, EOF exit on
close-stdin, and edge cases (too-large,no-such-process,closed).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/astrid-capsule/wit-staging/deps/astrid-process/process@1.0.0.wit | Updates persistent-tier documentation and removes stale “NOT YET IMPLEMENTED” notes for id-keyed stdin ops. |
| crates/astrid-capsule/src/engine/wasm/host/process/persistent/registry_tests.rs | Adds an acceptance-style tokio test validating persistent stdin behavior and related error edges. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Review feedback on the persistent-stdin finalize: - Replace the two fixed sleep(250ms) waits on the live child's echo with a bounded poll loop (drain_stdout_until) — robust under slow CI, instant on fast machines. Post-exit reads stay one-shot since wait() already fenced the flush. - Correct the write-stdin contract doc: it claimed "all-or-nothing per call, so framed stdin is never torn", but write_all over a pipe can deliver a prefix before erroring and then marks the stream closed. Pipe writes aren't atomic past PIPE_BUF, so the contract can't promise this. Restated accurately; wit-staging mirror + submodule pointer track the canonical (unicity-astrid/wit de89b14).
## Linked Issue Closes #853 ## Summary `chore: release` — bumps all workspace crates **0.7.0 → 0.8.0** and rolls `CHANGELOG [Unreleased]` into `[0.8.0] - 2026-06-10`. Consolidates the ~50 PRs landed since v0.7.0: - **HTTP admin gateway** (#756 + follow-ups) — `astrid-gateway`: principals/caps/quotas/groups/invites/env over HTTP, audit SSE + historical queries, agent-prompt SSE, OpenAPI emission, bus-direct admin path (285× throughput), rustls TLS, CORS, metrics, invite + keypair CLI verbs. - **Runtime concurrency overhaul** (#813/#816/#819/#820) — routed per-(capsule, topic, principal) IPC with DRR fairness, async Wasmtime, dynamic instance pools, split blocking/IO semaphores, per-principal fuel + memory ledgers with enforcement and usage reporting. - **Host process + introspection surface** — `astrid:process` persistent tier (#866/#867/#871/#873), capability introspection (#868/#869), `astrid mcp serve` (#879/#880), `astrid-emit` (#814/#842). - **Security** — macOS 15+ sandbox no longer silently disabled (#855/#857), audit-feed principal scoping (#850/#851), failed-redeem audit rows (#846), `self:agent:list` roster leak (#848), pair-device redeem rate-limit (#844), bearer revocation + wire format v2 (#772). Breaking: `Capsule.toml` `[publish]`/`[subscribe]`-only IPC surface (#858/#864/#865, `[[interceptor]]` / `ipc_*` arrays / `[[topic]]` removed), bearer v2, MSRV 1.95, `astrid-openclaw` removed (#833). ## Changes - `[workspace.package].version` `0.7.0` → `0.8.0` + the 23 in-workspace path-dependency pins (now including `astrid-emit`; `axum`/`axum-server` stay on their external 0.7). - CHANGELOG: `[Unreleased]` → `[0.8.0] - 2026-06-10` with a release **synopsis** (extracted into the GitHub release body by release.yml on tag). Keeps the earlier roll's curation (canonical section order, bullets verbatim) and merges the 13 entries added to `[Unreleased]` by the 12 PRs that landed after the branch was first cut (#851–#885) — verified both directions that no bullet was lost. Branch history note: rebuilt on current `main` (was `CONFLICTING` and 12 commits behind); previous tip was `54c7294`. ## Release steps (maintainer) 1. Merge this PR. 2. Tag `v0.8.0` on the merge commit → release.yml creates the GitHub release from the CHANGELOG block. 3. Publish/distribute the new `astrid` binaries as usual. ## Test Plan Release PR — no code changes. `cargo check --workspace` passes on the rebuilt branch; full test/clippy/MSRV matrix runs in CI. The changelog merge was verified bullet-by-bullet in both directions: every `[Unreleased]` bullet on `main` appears in the rolled `[0.8.0]` section, and every bullet from the earlier curated roll is preserved verbatim.
Linked Issue
Closes #870
Summary
The id-keyed persistent
write-stdin/close-stdinwere implemented in #867 (the registry retains the child's stdin pipe host-side, survives pooled-instance reset, 1 MiB-capped, backpressured, ownership-checked, audited) but had no test, and the WIT still tagged them(NOT YET IMPLEMENTED). This adds the acceptance test and un-stubs the now-accurate WIT docs. Doc-only on the contract — no signature change.Changes
registry_tests.rs): write-stdin delivers bytes to a persistent child; a second by-id write (needing only registry + id — exactly what a post-reset instance holds) still reaches the same child;close-stdin→ clean EOF exit; over-cap →too-large; wrong-owner →no-such-process; post-close →closed.(NOT YET IMPLEMENTED)tags on the id-keyed forms and corrects the twoPERSISTENT TIER"stubbed until the registry lands" banners. Restageswit-staging. Signatures unchanged.ProcessHandleform,attach, andwatch/unwatchstay genuinely deferred and tagged.[Unreleased].Test Plan
Automated
cargo test --workspacepassesSpecifically:
cargo test -p astrid-capsule registry_tests(the new acceptance test + existing registry tests pass); build green (WIT parses via bindgen).Checklist
[Unreleased]