Repository navigation
feat!: add optional terminal and readiness callback to library run - #150
Conversation
|
Process note (interface-frozen surface): Suggestion: Please confirm the explicit pre-approval the freeze requires was obtained, and that the PR carries the appropriate API-review label. The description already names the caller-visible break (callers must add |
|
Issue: The "Use Box as a Rust library" section in let exit_code = strands_box::run("/absolute/box.toml".into(), Vec::new());After this change that call no longer compiles, and the surrounding prose ("It uses the process's terminal") no longer describes the new Suggestion: Update the README example to pass the third argument (e.g. |
|
Assessment: Request Changes The core mechanism — gating signal registration/ Review themes
Nice refactor extracting |
|
Assessment: Comment (code findings resolved; one process item for a human to confirm) Re-reviewed at Resolved
Remaining, not blocking from a code standpoint:
Nice work turning the ordering guarantees into executable assertions rather than prose. |
The host application must keep its banner responsive during one in-process Box run. The inherited terminal and blocking call do not provide the terminal routing or post-hardening startup point that its UI needs. Add RunOptions with optional terminal and on_ready fields. Route the supplied terminal to the workload and invoke the callback after hardening and signal registration. Preserve parent-death protection and let the host finish terminal restoration after runtime teardown. Existing Rust callers must pass a third argument; default options preserve inherited stdio. The CLI flags and configuration schema do not change. The host application build and all-features compilation passed on macOS. External terminal probes passed interactive shell and session launches, input, resizing, policy denial, shutdown, output draining, and terminal restoration. Headless input/output and a library callback-order probe passed. Changed-file formatting checks passed. No tests or comments are modified by request. Existing library test callers still use the old signature; full repository gates and Linux coverage remain deferred in this draft.
d94e27d to
850764b
Compare
Description
Allow Rust applications to call
strands_box::run()once while keeping their terminal UI responsive. The existing API lacks a separate workload terminal and a startup hook after signal registration, risking overlapping output and incomplete terminal cleanup.Changes
RunOptionswith an optional workload terminal andon_readycallback.Default::default()as the third argument.Testing
850764b2: Linux/macOS workspace tests, lint, containment, and native filesystem checks.