Repository navigation
Finish native window, menu, and dialog workflows #73
Description
Activity
Draft implementation: #74, stacked on #67. It adds explicit application activation, exact window focus, and background window restore using generation-bound targets from inventory. The native client checks the signed operation outcome and exact target, and an app-only activation refreshes inventories without selecting a window. Passive inspection remains unchanged; failed later observations preserve completed action evidence.
Type checks, formatting/lint, a signed development build, and deep/strict signature verification pass. A temporary smoke of the actual result-formatting functions verifies unavailable inventory, metadata overflow, and truncation preserve completed outcomes; it makes no native calls and uses no mocked transport.
The PR remains draft: real signed app activation/focus/minimized restore, stale generation/window/bounds, interruption/restart, real pi, and hosted workspace validation are pending an unlocked desktop. The broader applications/windows/menus/dialogs slice remains open under #8. The issue description now distinguishes foreground activation/focus from background unminimize, which does not promise focus.
The first native validation of the focused #74 build caught a refusal before its first activation dispatched. The client had already completed its explicit signed bridge handshake; the guard was incorrectly requiring optional source-commit build identity metadata. This was not a missing permission or a lazy-connection failure.
#74 now uses the existing read-only application mutation inventory's verified operation receipt before proceeding, followed by the same exact process-generation check. This adds no transport call or fallback, and leaves per-action signed receipt/outcome validation intact. Independent source review, type/lint checks, the signed development rebuild, and strict app/client signature verification passed.
The failed attempt is preserved as pre-input evidence: the disposable two-window fixture had zero Saves and no action callbacks. Corrected native behavior still needs validation; the PR remains draft. No successful activation/focus/restore, real-model, Stop/restart, or hosted result is claimed by this fix.
The focused activation/focus/restore implementation has merged in #74, independently of literal insertion.
Real signed native checks on
ffb47ccc071cbdd2e974ec1478d0cf3ff33d3c0averified explicit activation, already-active no-op, exact window focus, actual minimize/restore, already-restored no-op, hidden-app activation, and stale-generation/bounds refusals. AppKit callbacks and Save output confirmed the selected receiver; document text stayed unchanged. Repeated already-key focus also completed with an exact receipt and verified resulting state; this operation does not promise a no-op outcome.A real pi/Anthropic run passed activate → restore → focus. The exact tool text/images and outcomes survived reopening the same pi store with unchanged usage and no repeated native calls. Types, lint/formatting, signed build/signatures, and independent review passed. Final head
5c0dfb16283cd6382a2146ded36f3f6f17f3848dadds the already-merged #84 app search integration; static checks and independent review passed again, and native source is unchanged from the validated build.Keeping this issue open for the remaining requested validation: management-specific Stop/crash recovery, the hosted workspace route, and delayed-response/target-closure behavior. The optional delayed-response wrapper had an invalid executable signature and failed before its start marker; no management result is claimed for that attempt. Generic preservation of a completed action after failed follow-up inspection was validated in #71. The original failed and partial run artifacts were preserved instead of replaying successful actions.
Application launch/quit, other window controls, menus, and dialogs remain later #8 work.
Landed focused locked-desktop feedback in PR #87, merge
c89f87ba0450a6b05455da914f2909739ebeda3donfeat/github-cache.A known locked session now produces typed
target_unavailable, no-dispatch evidence, and guidance to unlock then refresh inventory before choosing another action. This fixes the observed focus failure that previously looked like an unsupported Accessibility operation. Request-shape checks still precede the lock preflight; false/unknown lock state follows the existing path.Static checks, independent review, isolated signed-client build/signature verification, and real locked-session activate/focus/restore checks passed. All three returned
dispatch_state: noneand kept the disposable receiver unchanged. The requests deliberately used stale process generations, preventing input even if the desktop unlocked between observation and execution. This verifies the real explicit-locked branch, not unlocked/unknown or mid-operation lock behavior. No desktop bundle was replaced or launched for this check.This broader issue remains open for its remaining scope; #8 tracks subsequent focused landings.
During PR #85 validation on the unlocked Mac, exact-window focus returned
operation_unsupported,dispatch_state: none, and “Timeout while waiting for condition.” The same receiver remained unchanged. Source inspection traces that timeout to the foreground-settlement predicate; it does not establish why macOS refused the attempt.A separately observed explicit
desktop_activaterequest succeeded. The drag checks then passed, and the fresh hosted check used explicit activation followed by exact-window focus successfully before the model ran. This is a useful recovery path, not a fallback inside focus or a retry after uncertain input. The original failure is retained at/tmp/ace-drag-remaining-unlocked-live.log; subsequent activation and native evidence are in/tmp/ace-drag-remaining-activated-live.loganddrag-current-FkQMdR.Keep the focus timeout's misleading unsupported-operation classification in #73's remaining diagnostic work. Locked-session diagnosis itself already landed separately in #87.
A further unlocked reproduction occurred during #67 setup.
desktop_activatecompleted for the exact Ace-dev process, and fresh inventory reportedis_active:trueand the requested Ace windowis_key:true.desktop_focusnevertheless returnedrefused,dispatch_state:none,operation_unsupported, withTimeout while waiting for conditionbefore any selection, clipboard preparation, or insertion.The later insertion check used explicit activation plus fresh active/key-window and focused-editor evidence, without retrying the failed focus call. No production fallback was added. Evidence:
/tmp/ace-literal-composer.EEotCj/validation/events.jsonl. This remains separate from literal insertion in #67.Merged #133 as
f9e0db3:desktop_minimizebinds one window to its observed process generation, window ID and bounds. A real window minimized after one background Accessibility write; repeating with its refreshed already-minimized target confirmed no change with zero dispatch. Explicit restore passed. Stale generation/bounds and pre-dispatch cancellation made no input.A real pi channel used minimize once, then a different worker reopened the same store with identical result/usage and no new execution or native callback. The signed build, independent source/helper review and CI passed. Every owned fixture/app/host/worker is gone, and the temporary project/channel, port and socket are removed. In-flight cancellation, other machines and broader hosted workflows remain unverified. Close and clipboard image read continue as separate PRs.
PR #140 has now passed the real model and distinct-worker reopen checks on
cd54a8b: one scoped menu read and one command produced exactly one fixture callback, with no key/click events; exact tool results, usage and execution counts survived reopening under another worker. The earlier failed provider attempt was preserved and its empty validation channel was backed up and deleted before switching to an existing working credential.The self-Ace check found a remaining gap:
File → Open Folder…is visible in native menu inventory, but the command refuses before dispatch with “The complete menu sibling set exceeds the native traversal budget or is unavailable.” Its signed outcome isrefused/dispatch_state:none; no folder panel opened. All owned runtimes, channels, projects and settings were cleaned up.I am adding content-free native AX status/count diagnostics to distinguish a leaf with no children from a traversal failure before changing the admission rule. The completed direct and model cases will not be repeated; only the remaining self-Ace case will run on a fresh process generation. This remains draft work under #8, not a claim of complete dialog support.
PR #143 adds focused
desktop_open: one existing absolute path or complete URL, with an optional explicit application. Without a selector, macOS uses its default handler. The existing signed launch route binds the request and returned process generation. Accepted opening reportsdispatched_unverified/delivery_accepted, keeping OS acceptance separate from actual document/page effect. No implicit retry, fallback, extra instance or dialog handling.Exact head
2aea91a928ad4f649a8fda2e0a5edb5be8424847passes types, CI, Swift parse, independent source/helper review, signed development build and strict signatures. Real native checks refused relative/missing paths, a malformed URL and pre-cancel without a receiver callback. One explicit-app Unicode document and one default-handler custom URL each delivered exactly once to the owned fixture. A real pi/Anthropicclaude-opus-5-5channel then opened a second document using the bundle-ID selector. Exact result, usage, execution counts and the total of three callbacks survived actual worker exit/reopen under a different worker.The first document verifier assumed byte-identical Unicode URLs; macOS returned a decomposed filename. The original successful delivery and failed verifier remain preserved. A read-only check proved both URLs refer to the same device/inode, and only the remaining URL/model/reopen checks continued on the same revalidated runtime. The successful document open was never repeated.
All owned fixture, worker, app/launcher and host processes are stopped, the handler is unregistered, and temporary channel/project/preferences, socket and port are cleaned up. No clipboard access. Evidence:
/tmp/ace-open-smoke.vERdhu/{result.json,unicode-readback.json},/tmp/ace-open-remaining-smoke.ZW62dM/result.json,/tmp/ace-open-live-XduwLD/cleanup-final.json. Ready for final review; rendering, opening-specific in-flight interruption, hosted routing, other handlers and another Mac remain unverified. This does not complete #73 or #8.Merged as
b2a400b927c6f1d5c653c70db706418fdaf9a38afrom the verified head above. The signed candidate and source are preserved in.tmp/desktop-open/frozen-2aea91a.Merged #140 (
6bddf0f9), final headd1993fe1.desktop_menuinvokes one freshly resolved, unique, enabled external-app menu leaf through the existing native process lane. The real native refusal, literal/Unicode and modal checks plus a real Anthropic menu command/distinct-worker reopen passed. The final implementation preserves that tested external path.The serving Ace process’s own menu commands explicitly refuse before input; the final signed check verified
operation_unsupported,dispatch_state: none, the exact process receipt and no new visible window. An earlier experimental own-app press returned unknown without a subsequently observed picker. Its original result and read-only recovery remain preserved, with no repeat; the cause is not established. All owned runtimes, sockets/ports/settings and temporary data were cleaned. Own-Ace delivery and broader dialog/interruption/hosted validation stay open.During #147's signed Finder receiver check, one explicit file-reference publication and one Paste copied the public file and directory successfully. The verifier reached exact content hashes, the complete NFC-equivalent top-level filename set, and unchanged clipboard generation before cleanup.
The single
desktop_closerequest for the exact owned Finder window returnedunknown, so the helper stopped. A fresh read-only inventory found the same Finder process generation and confirmed that exact window was gone. No open, write, Paste, or close was repeated.The original close response was not retained by the helper, so its native cause cannot be established. This is a validation evidence gap; later disappearance does not retroactively make the original result confirmed. Fresh inventory also does not prove the native mutation lane has drained. Recovery therefore first stopped the exact isolated Ace GUI/native clients/host/driver, then restored the privately retained original clipboard through the fixture's existing paste gate and exact generation checks. The vault retained no private backup afterward and was closed; the user's Finder was left running.
Keep this uncertain-close case with #73's broader management validation. #147 remains focused on clipboard file-reference writes. Future validation should persist bounded action outcome metadata before postcondition assertions so an uncertain result retains its diagnostic evidence.
Evidence:
/tmp/ace-clipboard-files-write-check.CIp02M/result.json(original failure),/tmp/ace-clipboard-files-write-live.miwwge/reconcile.json(same-generation read-only reconciliation), and the separate recovery records in that runtime directory. Private clipboard bytes were never written to a file, log, model, or channel history.Native dogfood follow-up (related: #8, #10). This was a bounded run that stopped at setup.
Candidate: exact combined
2ca21608ad402da796e6399317ed93ce204288d5. It was built, signed (Apple Development,dev.ace.desktop.dev) and launched withbun run devfrom its own lane. It used a fresh source-dev profile3c694d42(new data dir with 0 channels) andACE_PORT=4987.Observed with Ace native desktop tools (Ace-dev pid 2472):
- The WKWebView rendered the dashboard visually. The screenshot showed "Open a project", "Open folder… ⌘O" and the nav rail, so the renderer was not blank (screenshot
03-desktop_inspect-image0.jpg). The first accessibility inspect exposed only 7 window-chrome elements. After Cmd+O, an inspect of the main window showed 30 elements, including the web controls (Dashboard, Channels, Issues, PRs, and "Open folder… ⌘O"). - Cmd+O opened the real native Open dialog (window 9491). Targeting that dialog failed:
desktop_key(Cmd+Shift+G) was refused: "The snapshot has no exact focused control."desktop_focuson 9491 was refused asoperation_unsupported("Timeout while waiting for condition").- Point and element
desktop_click(exports 08, 13, 18) were not signed refusals. Each returnedaction.outcome: "unknown"withnative_outcomedispatch_state: "may_have_dispatched",effect: "unverifiable"andretry_safety: "unsafe", along with the error text "occluded for the pinned target window 9491: accessibility hit-testing resolved an element in a different window of the same app". No dialog action was verified as successful.
- One setup repair failed. I activated Ace-dev and moved the main window 9487 so it no longer overlapped the dialog. The next click again returned the same signed unknown outcome (
may_have_dispatched,unverifiable,unsafe) with the same occlusion text. Per the bounded plan, I stopped there.
Unverified: native draft persistence (#165), the owner sharing checkbox (#161) and project/repository grouping (#157). No project or channel was created. This is a limitation in native targeting/setup with the Open dialog. It is not a proven regression in #165, #161 or #157, or in channel transport. I did no further diagnosis and made no source changes.
Cleanup: I sent SIGTERM to the dev runner. It quit the app, then the host (
host.stop, pending 0, no error logs). Nothing of ours remains running or listening on 4987/5987. Installed Canary and normal channel data were not touched.Local evidence (on the test Mac, no secrets), from Ace channel
9937ad22f3db5239(native-dogfood-check):/tmp/ace-native-dogfood-9937ad22f3db5239/evidence/native-tool-results/: 19 exported desktop tool results as JSON (index.json, each with its arguments, result text and errors) plus the screenshots returned in this channel/tmp/ace-native-dogfood-9937ad22f3db5239/evidence/dev-runner.log,host-logs-before-stop/host.jsonl,host-after-stop.jsonl/tmp/ace-native-dogfood-9937ad22f3db5239/evidence/channel-backup/:ace backupof the channel transcript- Profile data is kept at
~/.local/state/ace-dev-3c694d42
- The WKWebView rendered the dashboard visually. The screenshot showed "Open a project", "Open folder… ⌘O" and the nav rail, so the renderer was not blank (screenshot
- added a parent issue
on Oct 6, 2026 - changed the title
[-]Activate applications and focus or restore exact windows[/-][+]Finish native window, menu, and dialog workflows[/+]on Oct 7, 2026
Status (Oct 7): activation/focus/restore (#74), move/resize (#86), minimize (#133), close (#134), quit (#132), launch (#136), open (#143), menu inventory (#138) and external-app menu commands (#140) are merged. Remaining after the current task: own-Ace menu delivery, context menus, sheets and save/alert workflows, and wider lifecycle validation (in-flight cancellation, crash, hosted routing, second machine), including the uncertain Finder close in this comment.
Current task: native Open Folder workflow
In a signed, isolated Ace built from current
main, open the native picker with the existing Cmd+O path. Delivering menus to Ace's own serving process comes later. Freshly identify the real picker by exact process and window, operate it with native tools, select an owned folder, and verify that it adds a project without creating a channel. Cancel must leave projects unchanged.First reproduce the recorded failure with the main window overlapping the picker (details). Fix only the first proven blocker. The recorded symptoms are a
desktop_focustimeout, adesktop_keyrefusal with no focused control, and clicks returningunknownwith a same-app occlusion message. They aren't assumed to share one cause; the focus timeouts are also recorded in #106.A real model run must complete the same workflow. Preserve refusal and
unknownevidence, and show no replay after a distinct-worker reopen. General #106 paste, own-Ace menus and broader lifecycle work stay separate.Original scope
Add explicit application activation and window focus/restore tools as the first focused part of #8's applications/windows slice. This also gives an agent an explicit recovery step when a target is hidden, minimized, or not on the active desktop; inspection must never activate a target implicitly.
Done when real signed native and pi runs activate the selected application, focus one exact window and restore a minimized window, with fresh evidence confirming the result. Validate stale process/window/bounds, interruption/replay, and the hosted workspace route. Keep macOS desktop lock and permission failures explicit.
Since then, application launch (#136) and quit (#132), window move/resize (#86), minimize (#133) and close (#134), document/URL opening (#143), menu inventory (#138) and external-app menu commands (#140) have merged. Own-Ace menu delivery, context menus and complete dialog workflows remain focused work under #8; this issue does not complete that whole slice.
Move and resize follow-up
PR #86 (merged) adds only
desktop_moveanddesktop_resizethrough this existing exact-window management route. Positions are finite global desktop logical points, including negative coordinates; dimensions are positive and finite. The original inventory identity/bounds, native coordination and readback, signed outcome, cancellation semantics, refreshed targets, and pi unsafe intent remain in place. Launch/quit, close, menus, and dialogs are separate work under #8.PR #86 head
8bd13eb5220f84833a8eb04df1157753060739b0now passes its signed development rebuild, strict app/client signatures, and local live validation on an unlocked Mac (October 5). A fresh real AppKit fixture verified normal move/resize with returned targets, exact negative x=-40, position/size no-ops, stale-bounds refusal, and pre-dispatch cancellation. A 400×300 request constrained to 640×450 correctly returned unknown/dispatched_unverified; fresh inventory and inspection established the actual geometry before explicit restoration. Beta, text, Save count, focus state and unrelated callbacks stayed unchanged. A real pi/Anthropic run made one move and resize using the actual refreshed target; exact results/images and usage survived same-store reopen without another native call. Raw evidence and signed receipt bundles were retained and independently audited. The temporary validation apps/host are stopped. #86 has since merged; geometry-specific in-flight cancellation, lock transitions, crash recovery, hosted routing, multiple-display/negative-y coverage and a second machine remain unverified. This completes #86's requested local live-validation arm, not the broader validation tracked here.Exact-window close follow-up
PR #134 adds
desktop_closethrough the existing exact-window management route. It selects one read-supported background AX action, rechecks original PID/generation/window/bounds, and never falls through after accepted or ambiguous input. An accepted close that leaves an unsaved-work dialog open stays unknown with unsafe retry and refreshed inventory; confirmed disappearance survives later inventory failure. No forced close or automatic dialog handling.Exact head
a2c1870f68651bb898d0d52f0c9beccba0d9c77dincludes landed minimization and passes types, CI, Swift parse, independent source review, signed development build, strict signatures and GitHub CI. Real AppKit stale-generation/bounds and pre-cancel checks refused with zero close callbacks. One actual deferred close produced a visible save sheet, one request and zero closes, with signed unknown/unsafe outcome and fresh inventory. A real pi/OpenAI run fetched the window inventory immediately before one normal close, received a confirmed result and empty window list, and recorded one actual close callback. Exact tool results, usage and execution counts survived worker exit and same-store reopen without another action.The first model attempt correctly refused stale startup geometry before input; its original outcome remains preserved. Only the remaining normal/model phase was rerun after matching real AppKit/CG geometry and two inventories. All owned fixtures, workers, app/host processes and sockets are stopped; temporary channels/projects were removed. Evidence:
/tmp/ace-close-smoke.bD8VDF,/tmp/ace-close-model-smoke.K0UnZY,/tmp/ace-close-model-live.1K1dxT/cleanup-final.json. #134 has since merged; close-specific in-flight cancellation, crash/hosted routing, self-close and a second machine remain unverified. This does not complete the broader management/dialog validation tracked here.Read-only menu inventory — PR #138
#138 adds
desktop_menusfor an exact application target. Signed menu output and pre/post application inventory must match its process generation. Optional exact literalpathreturns one uniquely observed menu/item subtree; missing or ambiguous ancestry is refused. Complete title paths, native cache possibility and unknown completeness remain distinct from Ace truncation. No input authority or menu command is added; AX reads can populate lazy menus and trigger callbacks.Exact head
1f8cde5d1a15f61023d52b22bce9bfdf5d4e0861passes types, CI, Swift parse, independent source review, signed build, strict signatures and GitHub CI. Real native checks verified literal punctuation/Unicode paths, missing and ambiguous ancestors, cached previous state followed by updated state after expiry, and the isolated Ace application'sFilemenu. One real pi/OpenAI run read the publicProofscope once; exact results, usage and execution counts survived actual worker exit/reopen without another native read. Population callbacks were recorded separately; actual menu tracking, command/key/click counters remained zero and fixture focus stayed unchanged.Earlier signed
c83b087provides the preserved stale-generation and pre-cancel refusals. Original setup/counter-verifier failures remain recorded rather than rewritten; passed native requests were not repeated. All owned fixture, worker, app/host/launcher processes are stopped, sockets/ports closed, and temporary channel/project/settings removed. No clipboard access. Evidence:/tmp/ace-menu-smoke.7GzFXu/result.json,/tmp/ace-menu-live.dXPqws/result.json. #138 has since merged; existing synchronous AX responsiveness/in-flight cancellation, hosted routing and a second machine remain unverified. Menu mutation remains separate and this does not close #73 or #8.Final menu head
a8059a519976d8a78012f35cb34c8981a7c67f53integrates landed app launch #136. Its native menu implementation is byte-identical to live-tested1f8cde5; the additive union was independently reviewed and final types/CI, signed rebuild, strict signatures and GitHub CI pass. No live repetition was needed for this integration.Exact external-app menu commands — PR #140
#140 adds
desktop_menufor one exact external application generation and literal title path. Fresh native reads require unique complete ancestry and an enabled leaf before one AXPress. There are no ancestor presses, separate activation request, fallback, or automatic retry. The app or macOS may still bring the app forward in response. Accepted delivery is distinct from the command's effect; ambiguous delivery stays signed unknown/unsafe, and the process mutation lane is retained until the native call actually returns. The read budget and native messaging timeout are finite but not hard completion guarantees.Real AppKit validation passed ordinary and literal punctuation/Unicode commands, a modal once, and missing/ambiguous/disabled/parent/cached-old-title refusal cases. A real Anthropic model read the fixture's scoped menu and invoked its command once through an Ace channel. A distinct worker reopened the durable channel with identical tool results and usage, unchanged execution counts, and no second callback. The original provider-auth failure occurred before tools and is retained separately from this successful run. Final source
d1993fe173d097baa2c68edab3c381986fab9fdbintegrates #142, #143 and current main; its external menu implementation remains unchanged from the model-tested candidate except for content-free refusal diagnostics.Commands targeting the native Ace process itself are explicitly unsupported before input; read-only menu inventory remains available. The exploratory own-app route returned signed unknown without an observed picker. Fresh read-only recovery found no sheet or Cancel, then the exact owned runtime was gracefully cleaned up without repeating the command. Its raw AXPress cause is not proven. The experimental self route is removed from this PR.
The final own-PID check passed with a signed
operation_unsupportedrefusal,dispatch_state: none, no dispatched units, and no new visible window. All five distinct owned PIDs were gone afterward; the bundle scan was empty, port closed, socket absent, channels empty, isolated settings removed, and project catalog unchanged. No Cancel, clipboard, model, or fixture was used for that final check. Types, formatting/lint, helper syntax, signed development build, strict signatures and GitHub CI passed. No in-flight Stop/crash, hosted, second-Mac, or complete dialog-workflow validation is claimed. This PR does not complete #73 or #8.