Repository navigation
[CTX-1316] test(runtime): isolate destructive live clipboard validation (#2205) - #2211
Conversation
Restore the two leading spaces verified by compiling the exact unmodified parent help function. Correct the byte regression assertions and retain narrow WSL scratch-path exemptions. Task: CTX-1306 Refs #2200
Explain the no-execution fixture using the existing per-hit PTY gate exemption. Preserve Linux cfg, executable tokens, and global gate behavior. Task: CTX-1311 Refs #2203
Map the current Ubuntu runner, use bounded local disk caching under act while preserving remote GHA caching, and serialize bind-mounted matrix checkouts. Bind the local cache endpoint to loopback and cover dispatch, backend setup, locks, and failure propagation. Refs #2201
Task: CTX-1317; Refs #2203. Preserve original CTX-1311 source history.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Xuepoo
left a comment
There was a problem hiding this comment.
Independent review — separate agent (ctx-1316-reviewer, provider custom), HEAD c85f94b
Verdict: LGTM (findings: none blocking; four observations, all "not a defect").
Checks run by the reviewer:
git diff --name-status origin/main c85f94b0→ exactly 6 files (clipboard_live.rs, clipboard_live_guard.rs, support/clipboard_isolation.rs, scripts/clipboard-isolated.sh, scripts/clipboard.justfile, scripts/tests/clipboard-isolated.test.sh).- Static read of the fail-closed gate:
run_if_isolated(_evidence, _native)unconditionally returnsErr(BLOCKED)and never calls_native;IsolationEvidencehas a private field and no caller-constructible path;current()readsBITTY_CLIPBOARD_XVFB_PIDonly as a diagnostic hint and never authorizes on it — so the "#2205 environment opt-in cannot prove isolation" constraint holds. - Static read of
clipboard_live.rs: all five scenario identities preserved (clipboard-roundtrip, -encoding, -bound, -backend-presence, -primary), each invoked only insidewith_isolated_display; on refusal it emitsskipped/not-accessedbefore any native constructor/read/write. - Independent reproduction of the pure guard: extracted the committed sources and compiled with the
scripts/clipboard.justfileguard-unitrecipe (rustc --edition=2024 --test clipboard_live_guard.rs) → 7 passed, 0 failed. scripts/clipboard-isolated.shrefuses with exit 77 ("connection-bound disposable runner unavailable") and never launches Xvfb/bwrap; its self-test asserts refusal and the absence of averified-localmarker.
Accepted-constraint note: native clipboard evidence remains NOT EXECUTED by design (Xvfb unavailable; R-004 stays Open). This PR closes #2205's safety requirement (no native access without proven isolation; ordinary gui-tests report skipped without touching the owner display) but must not be cited downstream as "live clipboard verified".
Head note: reviewed against c85f94b; the reviewed worktree was sitting on main, so the PR files were read via git show c85f94b0:<path> and the guard recipe was reproduced out-of-tree.
Recorded by the guard tick; this is a reviewer-of-record comment because the environment shares a single GitHub identity (gh pr review --approve on an own-PR is refused).
|
Post-merge disposition of the two CodeRabbit warnings in
This reply is a post-merge correction, not evidence that these warnings were |
Priority: P1 | Area: runtime | Labels: fix,P1,area:runtime | Milestone: 0.0.24 | RFC: R-004 | Task: CTX-1316
Summary
The live clipboard tests (
crates/bitty-platform/tests/clipboard_live.rs, gated behind the default-offgui-testsfeature) previously constructed the nativearboardclipboard directly against whatever display the operator had — i.e. the owner's live session. Anygui-testsrun could overwrite the real selection.This change makes destructive live clipboard validation fail closed until a reviewed, connection-bound, disposable runner exists:
crates/bitty-platform/tests/support/clipboard_isolation.rs. Proc / mount / namespace observations are diagnostics only and can never mint authorization:run_if_isolatedunconditionally returnsBLOCKEDwithout invoking the native closure.clipboard_live.rsroutes every native access throughwith_isolated_display; an ordinarygui-testsrun now emitsskipped/not-accessedbefore any native constructor, read, or write.scripts/clipboard-isolated.shis a refusal-only entry point exposed throughscripts/clipboard.justfile: it returns77before launching any display or supplied executable. It does not provide a functioning isolated native harness.crates/bitty-platform/tests/clipboard_live_guard.rs(7 tests) prove that neither synthetic nor real evidence authorizes native access.Gate evidence (this branch)
just --justfile scripts/clipboard.justfile guard-unit→ 7/7 passcargo test -p bitty-platform --locked --test clipboard_live_guard→ 7 passedcargo test -p bitty-platform --locked --test clipboard_live --features gui-tests→ 5 passed, allskipped, 0 native operationsjust --justfile scripts/clipboard.justfile runner-check(shellcheck + shfmt + refusal self-test) → PASSjust --justfile scripts/clipboard.justfile clippyand workspacejust clippy→ clean (-D warnings)just fmt-check,just test-support-gate,just actionlint, gitleaks diff + history → cleanScope / honesty
This PR closes only #2205's safety-guard scope: pure refusal regressions and ordinary
gui-testsreportingskipped/not-accessedbefore native access. The runner returns77and is not a functioning native isolation harness. Native execution was NOT EXECUTED; R-004 stays Open and #2206 remains Open/P0 (production CTX-1315). Connection-bound native isolation, success, assertion-failure/timeout cleanup, replacement-race freedom, and three-platform native proof remain unproven and require separately scoped implementation and independent evidence. Closing the safety-guard issue does not close those residual gaps.Closes #2205
Summary by CodeRabbit