Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
|
Independent review carried forward from #165 to I verified that every worker source, test, dependency declaration, and worker documentation file is byte-identical to the reviewed The final-output blocker is resolved. After natural shell exit, the worker preserves the PTY, stops/reaps descendants that could retain its slave, and drains buffered output under one five-second deadline and a 64-KiB budget. Timeout or overflow reports failure instead of successful truncation. I independently reran all five production-binary PTY tests and my original pause/release probe on the identical reviewed worker; they pass, with No remaining concrete blocker in this layer. Minimalism 9/10, elegance 9/10, correctness 9/10. The upcoming relay consumer still needs its own review and combined runtime exercise. Human confirmation remains outstanding; this PR remains draft. |
Behavior
Relay terminal access needs a PTY whose jobs stop when the attachment ends, including jobs that detach with
setsidor double-fork. This layer adds a contained local worker insidebuzz-acp. The relay authorization and audit consumer follows above it; this PR does not open a relay terminal by itself.Replaces #165 while preserving its published history. The reviewed worker and final-output fix are copied unchanged onto terminal CLI #163, creating one linear foundation for the snapshot and relay consumers. No merge commit or shared-history rewrite was used.
Depends on #163, which depends on the protocol in #159 and gateway foundation #154.
sequenceDiagram participant Harness participant Worker participant Kernel Harness->>Worker: Workspace, bounded expiry and Open Worker->>Kernel: Verify subreaper and pidfd support Worker->>Kernel: Spawn PTY shell Worker-->>Harness: Ready and bounded data Harness->>Worker: Close, EOF or termination Worker->>Kernel: Stop, kill and reap owned descendants Worker-->>Harness: End metadata and containment statusThe worker runs as a separate Linux subreaper, so adopted descendants belong to that terminal and harness siblings remain outside its tree. A safe maintained PTY crate provides native async I/O; the lock retains existing Tokio and Rustix versions. No new image helper or network channel is required.
The shell still has the sandbox user's filesystem privileges. Explicit per-session owner approval is required in the upcoming relay consumer; a global gateway grant alone never authorizes it. Worker documentation describes the local protocol and failure contract.
Validation
The worker source, tests and documentation are byte-identical to 15b80d6. The only lockfile difference versus that revision is the already-published CLI dependencies. Locked offline metadata, formatting and diff checks pass on this replacement; the combined CLI/worker source was also built in the isolated integration worktree. Independent review of the final-output fix is resolved.