chore(computer-use): remove confirmed dead code in the computer-use and voice surface - #6952
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Confirmed-dead residue of a documented non-feature, removed with zero behavior change; every deletion claim verified against the tree, guards demonstrably carried by live supersets. Grep confirms zero residual references to all 11 deleted symbols; [DESIGN-REVIEWED] 712b93b |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of Verification complete. All 11 deleted symbols have zero remaining references anywhere in the tree (one grep across all deleted names returned a single hit — a docstring mention of First-Principles-Verdict: PASS Pure subtraction: eleven zero-reference symbols deleted, every claim in the description independently re-verified against the tree, no guard weakened, nothing rides along. What this change shipsIntent: shrink the computer-use surface by deleting confirmed-dead symbols — a FIX (removing residue), shipping only deletions.
WatchOne residue of the same root cause (the never-built path-scrub channel) survives: the docstring at Subtractions
[FIRST-PRINCIPLES-REVIEWED] 712b93b |
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: chore (3 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: removal of confirmed dead code in computer_use (overlay/tools/types) — no runtime behaviour change.
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: chore (3 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: pure dead-code deletion in the computer-use surface (points_payload, _KEYBOARD_TOOLS, unused refusal/suppression constants and scrub patterns); zero references repo-wide verified by grep against main tip d7b7d65, no behaviour change. Auto-merge arming is unavailable to this pipeline agent (command denied by its hardened allowlist), so merging is deferred to a human maintainer with branch protection as the gate.
NicholasRBowers
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: chore (3 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: dead-code removal in computer_use/{overlay,tools,types}.py -- removed symbols verified unreferenced outside their defining files, no runtime impact.
bolichen97
left a comment
There was a problem hiding this comment.
Independently verified every removed symbol (grep across full repo + PR head, string/dynamic/registry lookup checks) has zero remaining references anywhere -- no dangling handler/registry entry (the #6876 defect class). CI all green. Approving.
Dead-code audit of the computer-use / voice / connectors group (≈36k lines:
computer_use/,browser/,stt/,apple_speech/,connections/,providers/,mcp_computer.py,transcribe.py,voice_reply.py,imaging.py,qr.py). One commit, 47 deletions, no behaviour change, no refactor, no reformatting.Candidate generation
Three independent scanners; only the intersection was carried forward.
--min-confidence 60self.xmarks a symbol aliveEach survivor then went through: repo-wide search across
*.py *.ts *.tsx *.js *.md *.json *.yml *.yaml *.toml *.sh *.ps1includingtests/,docs/,system-specs/,builtin_skills/,.github/, baselines andpyproject.tomlentry points (never truncated throughhead); a bare-string / value-dispatch sweep; a reverse-direction reachability proof; a public-surface check (__all__, docs, SKILL.md); the 30-day new-code gate; and a cross-platform reachability proof for every Windows-only and macOS-only candidate.Deleted (11 symbols)
computer_use/types.py— observation-ceiling and refusal residue (9)Root fact:
gate.permitted_observation_channels()returnsfrozenset(ALL_OBSERVATION_CHANNELS)unconditionally andgate.apply_observation_ceiling()isreturn dict(payload)(gate.py:164-187) — no branch on platform, edition, config, session or policy, and neither consults the realGovernanceCeilingmodel inplatform/governance.py. The layer was already a pass-through at the commit that introduced the package (verified withgit show d6d8a0da4:.../gate.py), and the removal is documented indocs/system-specs/modules/computer-use.md:606-607,:2433-2437andgovernance.md:2504-2510. These constants are residue of a documented non-feature, not an unfinished control.OBS_VALUES_SUPPRESSED_NOTE"Element values suppressed"only at its own def. Theelement_valuesdeny path (tools.py:1039) drops detail viaGOVERNED_VALUE_PLACEHOLDERandtools.py:1029-1032states explicitly that ceiling notes are deliberately not appended.OBS_TITLES_SUPPRESSED_NOTEOBS_WINDOW_TITLESis never membership-tested, only declared into the pass-through gate (tools.py:1260).OBS_TREE_SUPPRESSED_NOTEOBS_A11Y_TREEnever membership-tested (tools.py:1258only).OBS_PATHS_SUPPRESSED_NOTEOBS_FILE_PATHShas no consumer at all beyond its def and the channel tuple.GOVERNED_PATH_PLACEHOLDER"<redacted:path>"appears nowhere else. Live siblingGOVERNED_VALUE_PLACEHOLDERis consumed attools.py:1071— kept.PATH_SCRUB_PATTERNS_scrub_pathsdoes not exist in the tree. No inlined duplicate of either regex.SCREENSHOT_MIMEscreencast.FRAME_FORMATand the browser hardcodes the data-URL prefix (useComputerUseFrame.ts:65). The four spool siblings are all alive — kept.REFUSAL_UNATTENDEDgovernance.md:1230-1233("Neither exists."). Not inerror-code-baseline.json, no i18n catalog entry, no prose-enumerating test.REFUSAL_GOVERNANCErequire_computer_useisreturn Noneon every path (gate.py:88), so its one caller'sif denial:branch can never be entered — a propertytest_computer_use_gate.py:286pins.computer_use/overlay.py(1)points_payload— zero refs. Its docstring claimed "used by tests and diagnostics"; that is false, there were zero test refs and zero diagnostic callers at the parent commit. Superseded by the inline comprehension in_move_command(overlay.py:423), which is the actual wire path. Not inoverlay.py.__all__. Removing it leftSequenceunused, so that import went too (no other use remains in the file).computer_use/tools.py(1)_KEYBOARD_TOOLS— zero refs, a dead duplicate. Superseded by_ELEMENT_REQUIRED_TOOLS(tools.py:244-251), a strict superset whose own comment says so ("keyboard tools included"). The live "keyboard tool refused without an index, so a keystroke cannot land on a password box" control is carried by_ELEMENT_REQUIRED_TOOLSplus_SECURE_TARGET_TOOLS(tools.py:268, used at:715) — both containTOOL_TYPE_TEXTandTOOL_PRESS_KEY, both active. No guard is weakened. (One blank line was restored under the removed block to satisfy E302; that is the single+line in the diff.)Post-deletion: zero residual references for all 11 across every scanned file type.
Deferred (13)
30-day new-code gate (10). All from
f4e31653b(#4530, 10d) and14775e490(#3260, 13d):_SMOOTHING_NONE(capture_windows.py:98) — dead on evidence including on Windows: its consumerGdipSetSmoothingModeis not bound in the FFI table (capture_windows.py:264-265), and the dynamicgetattr(lib, symbol)loop iterates that same table.ACTION_COLLAPSE(windows_driver.py:243) — local alias only;WINDOWS_ACTION_COLLAPSEis alive and the value"collapse"still reaches the driver by string viaSUPPORTED_ACTIONS.registry_slugs(connections/tool_aliases.py:183) — dead on evidence (13d); every real consumer callsget_all_registry_providers()directly.windows_ffi.py):TreeScope_Element,TreeScope_Descendants,ExpandCollapseState_PartiallyExpanded,ScrollAmount_SmallDecrement,DPI_AWARENESS_CONTEXT_{UNAWARE,SYSTEM_AWARE,PER_MONITOR_AWARE}. Held for a second reason too: each is one member of a faithful mirror of a documented UIA/Win32 enum whose other members are load-bearing, and deleting a middle ordinal makes the block read as a mistranscription — the exact failure theUIA_IsPasswordPropertyIdcomment (windows_ffi.py:151-157) documents at length.Test-referenced with no production caller — refactor, not deletion (3):
exposed_server_keys(tool_aliases.py:270, superseded by a direct_parse_tool_refscall at:321),unsupported_snapshot(backend.py:525, its stated consumer never materialized),char_keystroke(keymap.py:391, its per-character path was deliberately rejected for Unicode key events atmacos_driver.py:495-499).Rejected as alive — worth recording
DriftVerdict.prior_state_loaded/_recorded_at/_discarded(connections/l0_drift.py:58-60) —DriftVerdictis a TypedDict, so the field names are the runtime dict keys, written literally atl0_drift.py:158-160and asserted intest_connections_l0_probe.py. The scanners saw one identifier occurrence because the values flow throughStateLoadwhile the keys are string literals. This is the expected false-positive class for serialized shapes._packaged_ffmpeg_version_probe(transcribe.py:586) — imported at build time bypackaging/build-desktop.sh:184and pinned bywebsite/electron/test/packaging.test.js:342-343.alias_record.py,mint.py,ownership.py,status.py,command_bus.py,enable_state.py,stt/engine.py,voice_reply.py,transcribe.py,qr.py,imaging.py,mcp_computer.py,backend.py— all have production callers, mostly indashboard/handlers/connections.py,dashboard/handlers/messaging.py,agent.py, or a CLI verb (run_mcp_serveris thekirocrew mcp-computerverb atcli.py:2675).Needs a decision (not in this diff)
PAYLOAD_SCREENSHOT_META(gate.py:54, in__all__) — a real correctness finding rather than dead code.gate.py:50-53says these payload keys are named constants "becausetoolsandrenderboth build and destructure these dicts, and a typo would silently drop a field rather than fail" — yettools.py:1123-1125builds all three keys with bare string literals. Worse, the three keys are write-only:_render_snapshot's rebuild (tools.py:1132-1145) reads back only window-title/elements/screenshot and takes width and height fromsnap, never fromshaped. A typo is silently harmless today and silently lossy the day the ceiling stops being a pass-through. Fix is either to wiretools.py:1123-1125through the constant, or to delete the constant and the three write-only keys together.is_mutating_action(gate.py:155, in__all__, named ingovernance.md:2441) — retained-by-design accessor. The spec is accurate and does not claim a consumer: "it currently has no caller in the package: it is retained as the accessor an edition would use." The "one live consumer" ishooks, which reads the SSOT table directly (hooks.py:1409). Not an inlined duplicate — the predicates genuinely differ, sinceend_turnisCU_CLASS_CONTROL, makingis_mutating_action("end_turn")Falsewhile hooks' predicate isTrue. Deleting it would require changing a spec paragraph in the same commit.tools.py:1014-1037describes an active file-path scrub via_scrub_paths(absent from the tree) and claimspermitted_observation_channels"returns the empty set on an error" — it cannot, there is notry/exceptand the return is unconditional. Pre-existing drift on main; left untouched because this PR makes no prose or behaviour changes.expire_dead_mints(connections/warm.py:106) — half-wired, documented deferral. The withdrawal half is wired (dashboard/handlers/connections.py:411) but the loop skips every row withoutentry.get("shared"), and nothing in the repo ever writesshared: True— the only occurrence is the TypedDict field declaration (mint.py:113).warm.py:19-21anddocs/architecture/design-notes/connections-warm-table.mdboth say this is deferred to slice N2b. Not deletable: it answers correctly the moment N2b starts filling the table.BrowserCommandBus.is_registered(browser/command_bus.py:189) — half-wired read accessor. The write half_register_lockedis called fromdrain(:350) andcomplete(:403); the public query half has zero production readers. The endpoint that logically wants it re-derives liveness inline (submit→_panel_alive_locked,:232), anddashboard/handlers/messaging.py:2963-2965's docstring claims that check is the registration when it is actually the private predicate. No unregister counterpart exists at all — deregistration is TTL-only (:81).Also noted, no action here:
find_brew(transcribe.py:758) has zero production callers while the one site that resolvesbrewuses bareshutil.which("brew")(cloud/ssm.py:231) with no fixed-prefix fallback — exactly the GUI-launched-gateway failure_BREW_CANDIDATE_PATHSexists to prevent. A hardened resolver that was never adopted; keep it.Verification
flake8,isort --check,black --checkclean on all three touched files.test_computer_use_gate.py,test_computer_use_overlay.py,test_mcp_computer.py,test_computer_use_snapshot.py,test_computer_use_backend.py,test_computer_use_api.py,test_computer_use_capture.py,test_computer_use_unsupported.py,test_computer_use_registration.py). No test was deleted or adjusted — nothing referenced any deleted symbol.