Repository navigation
feat(computers): watched browser relay and read operations (3a) - #460
Conversation
[High impact] The latest changes appear safe to merge; no new blocking issue was established. SummaryAdds watched-browser
|
chayapats
left a comment
There was a problem hiding this comment.
❌ 1 blocker — ยังไม่ควร merge ที่ d3a6772366ab5c92d8bcf708b9e339508d3525a4
ตรวจ diff, ADR 0092 slice 3a, และรันเทสต์ชุดเป้าหมายเอง (72 pass / 2 live skip). CI x64/arm64, typecheck, Greptile ผ่านที่ head นี้. ไม่ได้รัน SSH+sudo บน guest — สอดคล้องกับช่องว่างที่ PR ระบุและ #431. ไม่ได้อนุมัติ.
BLOCKER
sensitive-tier เทียบ origin ตรงตัว ทำให้ host เดียวกันหลุด path/title/text
src/s16/computers/browser.ts:102 และ src/s15/composition.ts:381
tier() เทียบ site.origin === origin เท่านั้น. sensitive-only ใช้ hostname (websiteSensitiveOnly) แต่ไซต์ที่ owner มาร์ก sensitive ไม่ใช้. เลยเกิดช่องนี้:
- owner มาร์ก
https://sensitive.orgเป็น sensitive - แท็บหรือ navigate ไป
http://sensitive.org/secret-path?token=abc stateคืน url เต็มและ titleSECRET TITLEreadและnavigateเรียกRuntime.evaluateแล้วคืน textLEAKED TEXT
ซ้ำกับ https://sensitive.org:8443/secret-path เพราะ origin รวมพอร์ต. ฝั่ง http://accounts.google.com/secret ถูกปฏิเสธถูกแล้ว (website_sensitive_only) — กฎสองชุดไม่เท่ากัน.
ADR 3a ต้องการปฏิเสธ sensitive-tier host ก่อน dispatch และ state ของแท็บ sensitive ต้องไม่มี title/path/text. เทสต์ที่มีครอบแค่ https://sensitive.org จึงไม่จับเคสนี้. www.sensitive.org เป็นคนละ hostname — ไม่ถือเป็นบั๊กในรอบนี้ เว้นแต่ Champ จะให้เทียบ registrable domain.
ทิศทางแก้: ใน #code ถ้า hostname ตรงกับ approval ที่ tier เป็น sensitive ให้คืน website_protected โดยไม่สน scheme และพอร์ต. เพิ่มเทสต์ที่ไม่ mock แค่ origin https.
SHOULD
-
คิว CDP ยังถูกเขียนหลัง client หลุด —
src/s15/vm/desktop-programs.ts:14-17.disconnect()ล้างpendingแต่ไม่ล้างcommands. ถ้า pipe ไป Chromium ยังเขียนไม่ได้ตอน takeover ปิด ssh, คำสั่งที่ค้าง (เช่นPage.navigate) ถูกเขียนทีหลัง และ host ปล่อย ticket ไปแล้ว. เจ้าของพิมพ์ได้ขณะเบราว์เซอร์ยังนำทาง. ยังไม่ได้จับ timing แบบ pipe เต็มในโปรบ แต่เส้นทางในโค้ดไม่มีเงื่อนไข. ล้างcommandsตอน disconnect โดยไม่ตัดเฟรมที่เขียนไปบางส่วน. -
ไม่เช็ค URL ปลายทางทันทีก่อน
Page.navigate—src/s16/computers/browser.ts:124กับ:170. เช็คop.urlก่อนเปิด stream เท่านั้น. ระหว่างPage.enableถ้า owner มาร์กปลายทางเป็น sensitive คำสั่ง navigate ยังถูกส่ง. หลังโหลดยังปฏิเสธการคืน text ได้ จึงไม่ยกเป็น blocker. เช็คop.urlอีกครั้งในจังหวะก่อนPage.navigate. -
ชื่อ element ดึงข้อความที่แก้ได้ —
src/s16/computers/browser.ts:33-35. walker ข้าม[contenteditable]แต่nameของa/buttonใช้innerText.<a contenteditable>private draft</a>หลุดเข้า observation ได้ถึง 128 ตัวอักษร. เทสต์ mock ผลRuntime.evaluateไม่ได้รันสคริปต์นี้. -
ตัด 100 แท็บก่อนตั้ง
truncatedและก่อนเช็คว่าแท็บยังอยู่ —src/s16/computers/browser.ts:130-132. 101 แท็บได้truncated: falseและแท็บที่หลุดจาก 100 ตัวแรกหายจาก opaque id ทั้งที่ยังเปิดอยู่. ตัดตอนคืนผล และตั้งtruncatedเมื่อจำนวนเกิน. -
browser ไม่ผ่าน
vmInput/vmOutput— shell/file เรียกที่src/s15/vm/service.ts:241และ:257;computer_browserคืน observation ตรงจากcomposition.tsโดยไม่แตะ disclosure journal. แท็บอยู่ข้ามรัน. รันถัดไปอ่านหน้าที่มีข้อมูลส่วนตัวจากรันก่อนได้โดยไม่สืบทอด source. Decision 8 พูดถึง scope ของคอมพิวเตอร์ ไม่ได้สั่ง journal นี้ตรงๆ — ช่องนี้คือ source stamp ที่ทาง shell มีแล้ว. ถ้า Tria ถือว่า 3a ยังไม่ต้อง stamp ให้ตัดข้อนี้ได้.
ที่ตรวจแล้วไม่พัง
- handshake / busy / id remap / composite
ready-v1โดยไม่ดาวน์โหลด Chrome ซ้ำ: เทสต์จริงผ่าน http://accounts.google.comถูกปฏิเสธก่อน evaluate- placement ใช้
vm_sessions.idตรงกับsession.id - ticket takeover ในเทสต์ปล่อยก่อน owner input
- live SSH+sudo ไม่ได้รันที่นี่ และไม่ถือเป็นข้อผิดพลาดของ diff นี้
|
⚖️ คำตัดสิน: เข้าข้าง Duo — ยังไม่ให้ merge #460 ที่
CI ทั้ง 15 checks สำเร็จที่ head นี้ แต่ Greptile status SUCCESS ไม่ได้แปลว่าคอมเมนต์ถูกแก้แล้ว (มี findings สอดคล้องกับ SHOULD ข้างต้น). แก้และตอบทุก review/Greptile comment แล้วรอทุก CI check เขียวบน latest head ตามกติกา Champ; ยังไม่มี merge authorization จาก ruling นี้. ข้อมูล regression เพิ่มเติมที่ตรวจพบระหว่างอ่านหลักฐาน: Live SSH+sudo/guest Chromium ยังไม่รัน: คงเป็นช่องว่างที่ระบุใน #431 ไม่เพิ่มเป็น finding และไม่อ้าง fixtures ว่าเป็น live proof. ไม่รื้อ rulings ของ #458; 3b/3c รอ 3a ผ่านก่อน.
|
FIX stage — new head
|
|
@greptile please re-review exact latest head 83d19e3. All five prior review threads have individual fix/test replies and are addressed; FIX-stage evidence: #460 (comment). No merge authorization; new findings must be addressed. |
chayapats
left a comment
There was a problem hiding this comment.
Re-review of exact head 83d19e3aca2f433e9a35bafce58cdc6f5100a85f. Verdict: clean, no findings. Not a merge authorization.
Checked the six accepted findings against the head, not the replies:
- Relay discards wholly unsent frames, finishes a partial frame, and waits for
Page.stopLoadingplus its reply before{"jit":"settled"}. Independent subprocess probe: a partialPage.navigatewas completed and stopped on the samesessionId; a wholly unsent navigate was not executed; settlement was withheld until the stop reply. A second probe held the first in-flight command and confirmed the two following unsent frames never reached the stub before the drain ACK. - Host ticket stays in
settlingwhensettledrejects (browser.tskeeps the rejected promise latched and does not callticket.end()). websiteHostSensitiveis hostname-normalized and any sensitive record wins over a trusted scheme/port of the same host. Composition passes the live site list.- Destination tier is reread after awaited
Page.enableand beforePage.navigate. - Production observation JS, executed through linkedom, does not put contenteditable self/descendant text into element names.
- Liveness uses every discovered page; only the returned projection is capped at 100. The 101-target reorder test still reads the old opaque id.
- Disclosure hooks are the trusted work actor and placed VM session:
vmInputbefore dispatch,vmOutputafter detach and immediately before publication.
Evidence: workspace full suite on this head, tmp/460-full-latest.log / .exit, exit 0, 4748 pass, 59 skip, 0 fail. CI run 43713006572 on the same head: typecheck, all 12 test shards, and deterministic are green. Live SSH/sudo remains #431; #458 stays closed.
No new blocker or should-fix. Greptile approval is not the basis of this verdict.
|
⚖️ คำตัดสิน: ✅ ผ่าน (ไม่มีอะไรต้องแก้ตอนนี้) PR #460 — exact head
ทำต่อ: Mono อัปเดตผล full suite ใน PR ให้ไม่ค้างว่า running แล้วตรวจ gate อีกครั้งก่อน merge #460: latest head/checks ต้องตรงและเขียวทั้งหมด, Greptile ไม่มี unaddressed comments, ทุก review comment addressed. ถ้า head เปลี่ยนให้ Duo re-review ก่อน ขอไป slice 3b เป็น PR แยกหลัง merge แล้วส่ง Duo → Tria ตามเดิม; 3c ตามลำดับที่อนุมัติไว้ ไม่ปิด #410/#442 ก่อนครบ scope. Live SSH+sudo gap คงที่ #431; ไม่เปิดคำตัดสิน #458 ใหม่ ความมั่นใจ: สูง |
Summary
Implements ADR 0092 slice 3a of #410, based on main at
496870188396c6845fa30b954ce8b85614fcf673(merged #458).vmDesktopCdpStream: separate pinnedssh -T+sudo -n -u jit-desktop .../cdp-attachpipes, 10 s handshake before CdpClient, separate stderr, no one-shot VM channel.0700 jit-desktopruntime directory, restart the session and verify the socket; keep the installed Chrome pin rather than downloading it again.computer_browserstate/navigate/read/find only for execute work placed on a running desktop. Apply live website tiers, opaque generations/tabs and 32 KiB observations. Refused tabs expose no path/title/text; leaving one creates a new tab instead of destroying its form.This does not implement 3b input/action cards or 3c needs-you/sign-in/resume. It does not close #410 or #442; those remain open for their later slices. No provider/runtime dependency changes and no protected credentials enter the guest.
Tests
Latest cleared head:
83d19e3aca2f433e9a35bafce58cdc6f5100a85f. With Bun/ripgrep on PATH andUSER=rakazo LOGNAME=rakazo(matching the system user):bun run typecheck,bun run upstream:check,git diff --check— PASS.4968701whenUSER/LOGNAMEare absent; base and this head both pass with the system user set.bun test --timeout 30000) — 4748 pass, 59 skip, 0 fail, exit 0 (292 files). Completed log:tmp/460-full-latest.log, exit:tmp/460-full-latest.exitin Mono workspace.Evidence: #460 (comment) and #460 (comment).
The deterministic tests execute the real Python relay/attach with a stub fd3/fd4 child, including backpressure, partial-frame completion, same-session stopLoading ACK, discard of wholly unsent commands and takeover fencing. CDP/tool tests cover refusals/redirects, live tier changes, DOM observation, 101-tab liveness, stale handles, placement, controller exclusivity, cleanup/deadlines and disclosure ancestry across work.
Live evidence gap
The opt-in tests in
tests/s16-desktop-cdp.test.tsrequireJIT_DESKTOP_SSH_ENDPOINT(protected endpoint JSON containing key paths, never key bytes). They verify the actual SSH + sudo-rs + attach binary pipe to a stub peer, and the real relay handshake/version response. Neither was run here: this computer has no enrolled guest endpoint. Local subprocess fixtures are not proof of the sudo-rs chain. Real guest Chromium, trusted non-IdP sign-in and stop/start evidence remain #431; no such outcome is claimed by this PR.Review focus
Relay descriptor inheritance/lifetime and partial frames; handshake buffering; per-VM/run/controller ownership and takeover settlement; live website-tier checks before dispatch and before publication; production placement/cleanup binding; the session-key upgrade path. Follow-on slices stay separate PRs.