Skip to content

Strengthen spawn ownership and align the quality gates - #9

Merged
P4suta merged 1 commit into
mainfrom
agent/spawn-ownership-and-gate-alignment
Aug 3, 2026
Merged

Strengthen spawn ownership and align the quality gates#9
P4suta merged 1 commit into
mainfrom
agent/spawn-ownership-and-gate-alignment

Conversation

@P4suta

@P4suta P4suta commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Completes the in-flight ownership work and closes the gaps that separated this crate from its siblings.

Ownership and ConPTY

  • Private running/suspended typestates, unified handle-transfer ownership, and value-based pseudoconsole storage.
  • ConPTY startup sets STARTF_USESTDHANDLES with all ordinary standard handles null, matching Microsoft Terminal, so a hosted child can no longer reach the parent's redirected streams. A 32-bit CI leg runs the regression because the failure mode is pointer-width sensitive.
  • SuspendedChild::resume requires the primary thread's previous suspend count to be exactly one; external changes are rejected and rolled back.
  • Output capture joins both reader threads even when one errors or panics.

Quality gates

  • Deny clippy::undocumented_unsafe_blocks. CONTRIBUTING already required a specific safety justification on every unsafe block, but nothing enforced it and five blocks had none.
    • multiple_unsafe_ops_per_block is deliberately not enabled: several blocks adopt two OS resources together to stay exception-safe (see pipe), and splitting them would widen the window in which one handle can leak. The reason is recorded in Cargo.toml.
  • Add a compiled and executed Command example. The crate previously had only compile_fail boundary pins, so no usage example was ever type-checked, and the README example had never been compiled at all.
  • Add _typos.toml so the spell-check gate has a checked-in configuration like the sibling repositories.

Dependency handling

The release checksum helper no longer relies on LowerHex being implemented for the digest output, so it builds against sha2 0.10 and 0.11 alike.

The bump itself stays deferred, and the reason is now recorded in dependabot.yml: sha2 0.11 requires Rust 1.85, while this crate targets 1.75. Both just msrv and the Rust 1.75 test legs cover the whole workspace, so taking the bump breaks CI even though xtask never ships. That is the real reason #8 fails — the LowerHex compile error was only the first of several failures. #8 should be closed rather than merged.

Verification

Run locally on Windows: fmt, clippy -D warnings, test --workspace --all-targets, test --doc, typos, reuse lint, cargo deny check, and the public-api snapshot check all pass. MSRV and mutation re-audit were not run locally (the toolchain here is mise-pinned); CI covers MSRV.

Completes the in-flight ownership work and closes the gaps that separated
this crate from its siblings.

Ownership and ConPTY:

- Private running/suspended typestates, unified handle-transfer ownership,
  and value-based pseudoconsole storage.
- ConPTY startup now sets STARTF_USESTDHANDLES with all ordinary standard
  handles null, matching Microsoft Terminal, so a hosted child can no longer
  read or write the parent's redirected streams. A 32-bit CI leg runs the
  regression, because the failure mode is pointer-width sensitive.
- SuspendedChild::resume requires the primary thread's previous suspend
  count to be exactly one; external changes are rejected and rolled back.
- Output capture joins both reader threads even when one errors or panics.

Quality gates:

- Deny clippy::undocumented_unsafe_blocks. CONTRIBUTING already required a
  specific safety justification on every unsafe block, but nothing checked
  it; five blocks had none. multiple_unsafe_ops_per_block is deliberately
  left off, because several blocks adopt two OS resources together to stay
  exception-safe and splitting them would widen the leak window.
- Add a compiled and executed Command example. The crate had only
  compile_fail boundary pins, so no usage example was ever type-checked and
  the README example had never been compiled.
- Add _typos.toml so the spell-check gate has a checked-in configuration.

Dependency handling:

- The release checksum helper no longer depends on LowerHex being
  implemented for the digest output, so it builds against sha2 0.10 and
  0.11 alike. The bump itself stays deferred and is now recorded in
  dependabot.yml: sha2 0.11 requires Rust 1.85, and both `just msrv` and
  the 1.75 test legs cover the whole workspace, so taking it would break
  CI even though xtask never ships.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@P4suta
P4suta enabled auto-merge (squash) August 3, 2026 11:28
@P4suta
P4suta merged commit 7932e0e into main Aug 3, 2026
14 checks passed
@P4suta
P4suta deleted the agent/spawn-ownership-and-gate-alignment branch August 3, 2026 11:32
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