emrg: GUI workspace panel P1 — daemon list_files/read_file + IPC passthrough (rant 2026-08-11T12:20:35) - #661
Conversation
…through (rant 2026-08-11T12:20:35) P1 of the multi-tab workspace panel rant: data source layer first. - daemon: list_files → files_list (dirs-first sort, 5000-entry cap + truncated, absolute-path-only, symlinks never expandable); read_file → file_content (start_line/line_limit paging, binary detection, 1MB cap) - GUI: RESPONSE_TYPES + _classify files_list whitelist, preload listFiles/ readFile, main.js IPC passthrough via requireConn - tests: +6 pytest e2e, +1 build-config preload-existence guard, RESPONSE_TYPES mapping extended; doc counts synced (pytest 688→694, GUI 187→188)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Verified in a local worktree: pytest tests/test_ws_e2e.py::TestWSWorkspacePanel tests/test_doc_counts.py → 9 passed. Review notes:
- daemon
list_files/read_file: absolute-path-only, exists/dir checks, 5000-entry + 1MB caps withtruncated/error signals, symlinks not followed (follow_symlinks=False), OSError guarded — positive & negative states covered by e2e tests (sorted dirs-first, relative-path rejected, symlink, truncation, paging, binary, oversized). - IPC chain RESPONSE_TYPES (list_files→files_list, read_file→file_content) +
files_listin list_result whitelist + main/preload passthrough with 10s timeout — tests updated accordingly. - Doc counts consistent (pytest 688→694, GUI 187→188) — doc-count guard will pass.
|
I tested this PR end-to-end on the branch head (de3202c) and it verifies cleanly. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed P1 of the workspace panel rant: daemon list_files/read_file commands (abs-path-only, symlink-safe, 5000-cap + truncated, binary detection + 1MB cap, paging) + full GUI IPC passthrough (RESPONSE_TYPES, _classify whitelist, preload, main). Local verification: pytest 694 ✓, GUI 188/188 ✓, doc guard 3/3 ✓, import + --help ✓. CI test run green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3rd)
Re-confirmed against branch head: P1 workspace panel (list_files/read_file) covers absolute-path-only, symlink-safe listing, 5000-entry truncation, 1MB + binary guards, paging; IPC passthrough complete (RESPONSE_TYPES + list_result whitelist + preload + main). Local verification from prior cycles: pytest 694 + GUI 188 + doc guard green. No ❌ on record — merge condition satisfied.
P1 of the multi-tab workspace panel rant (2026-08-11T12:20:35): data-source layer first, per the staged P1-P3 plan.
P1.1 daemon commands (emrg/server/daemon.py read loop, mirroring list_sessions/read_memory):
list_files→files_list: entries{name, path, type}only (no size/mtime), dirs-first name sort (aligned with ReadTool), 5000-entry cap withtruncated: true, absolute-path-only (relative paths rejected), symlinks never expandable (not followed — no loops), errors return{type: "files_list", error}without crashing.read_file→file_content: UTF-8 text read, 1MB cap (error hint to open with system tool), UnicodeDecodeError →binary: truewith empty content (image preview uses file:// URL, no base64),start_line/line_limitpaging aligned with ReadTool params.P1.2 GUI passthrough (⚠️ RESPONSE_TYPES + whitelist + preload + main must all be synced):
list_files: "files_list",read_file: "file_content"_classifylist_result whitelist +files_list(defends against late frames after pending timeout)listFiles/readFilecontextBridge APIsemrg:listFiles/emrg:readFileIPC viarequireConn().sendCommandAndWait(current-session connection is inherently authenticated)P1.3 tests:
Verified: pytest 694 ✓, GUI 188 ✓, doc guard 3/3 ✓, import + --help ✓. P2 (panel framework) and P3 (tab content) follow in later cycles.