Open source CapCut alternative.
TypeScript
Document app harness guide
David Le099c0a9b82a7
diff --git a/AGENTS.md b/AGENTS.mdindex 0ff9b32a..d75e9441 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -27,6 +27,6 @@ Before changing `site/` UI, routes, API handlers, or data access patterns:- Over time, prefer shrinking active `plans/` by completing work and moving finished plans to `plans/done/`.- Update guides in `docs/guides/` only for major features or durable supported-behavior changes. Do not update guide docs for small styling tweaks, layout adjustments, copy changes, or implementation-only refactors.- When work completes a master-plan slice, update the master plan's supported/current-boundary language and next steps in the same change.-- Keep guides explanatory. Describe supported behavior, boundaries, and engineering intent; do not duplicate code or maintain long file inventories.-- Link to source paths only when a maintainer needs an entrypoint.+- Keep guides explanatory. They should teach what the system is, how it works, and which boundaries matter; do not turn guides into feature inventories, implementation logs, duplicated code, or long file lists.+- Keep guide source entrypoints short and readable. Do not write exhaustive file inventories. Prefer a small maintainer map by subsystem or one to seven high-signal paths, and link to a source path only when it gives someone a clear place to start.- Keep this file stable and lightweight.diff --git a/docs/architecture.md b/docs/architecture.mdindex 5bd344e6..c270b7b5 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -2,7 +2,7 @@This document is a compact map of Donkey's supported runtime architecture. Thesource of truth for behavior and boundaries remains-[`docs/guides/minimal-run-coordinator.md`](guides/minimal-run-coordinator.md).+[`docs/guides/app-harness.md`](guides/app-harness.md).## App-Level Components@@ -35,8 +35,8 @@ source of truth for behavior and boundaries remains| | ^ || v | || +----------------------+ +----------------------+ | |-| | Task Intent Resolver |<---->| Per-Task Coordinator |--------------+ |-| | validated TaskIntent | | lifecycle + policy | |+| | App Harness |<---->| Per-Task Coordinator |--------------+ |+| | context + routing | | lifecycle + policy | || +----------+-----------+ +----------+-----------+ || | | || v v |@@ -74,8 +74,8 @@ execution stay behind narrow runtime boundaries.| ^ | || | v || +----------------------+ +----------------------+ +---------------+ |-| | Core Data |<-----| Task Events |<-----| Agent Run | |-| | task/event/asset | | user/assistant/tool | | command path | |+| | Core Data |<-----| Task Events |<-----| Harness Turn | |+| | task/event/asset | | user/assistant/tool | | chat/action | || +----------+-----------+ +----------------------+ +-------+-------+ || ^ | || | v |@@ -94,12 +94,12 @@ execution stay behind narrow runtime boundaries.| Fast Local Navigation Hot Path |+--------------------------------------------------------------------------------+| |-| selected task command |+| actionable harness turn || | || v || +----------------------+ +----------------------+ +---------------+ |-| | Task Context |----->| Local LLM Parser |----->| TaskIntent | |-| | command/events/assets| | sidecar JSON schema | | validated | |+| | Harness Context |----->| Local LLM Parser |----->| TaskIntent | |+| | turn/events/assets | | sidecar JSON schema | | validated | || +----------+-----------+ +----------------------+ +-------+-------+ || | | || v v |@@ -135,9 +135,13 @@ execution stay behind narrow runtime boundaries.+--------------------------------------------------------------------------------+```-The hot path must keep working without a remote model call. Local model output is-validated into typed contracts before execution, controller output is semantic,-and the action engine is the only boundary allowed to issue guarded OS input.+Every prompt turn enters the app harness as conversation first. The harness+builds bounded context from thread history, assets, target state, memory,+runtime capabilities, policy, and trace ids, then routes the turn to+conversation, clarification, review, planning, or action execution. The hot path+must keep working without a remote model call. Local model output is validated+into typed contracts before execution, controller output is semantic, and the+action engine is the only boundary allowed to issue guarded OS input.## Local Stack And Model Sidecarsdiff --git a/docs/guides/app-harness.md b/docs/guides/app-harness.mdnew file mode 100644index 00000000..a2c25246--- /dev/null+++ b/docs/guides/app-harness.md@@ -0,0 +1,168 @@+# App Harness++## What It Is++The app harness is Donkey's boundary between the user's conversation and the+systems that can act on the Mac. It owns the question: "What should this turn do+next?" Sometimes the answer is normal conversation. Sometimes it is a+clarifying question. Sometimes it is a reviewed plan. Sometimes it is a guarded+local-app action.++A task is not just an executable command. A task is a durable conversation+thread with user turns, assistant turns, assets, memory, trace ids, and optional+action runs attached to it. This matters because a user can say "hi", ask what+Donkey can do, upload a file, revise a previous request, approve a form-fill+plan, or ask Donkey to operate another app. Those are all valid task-thread+turns, but only some of them should touch the action runtime.++The harness makes that distinction before execution. Non-actionable turns should+produce assistant responses. Ambiguous actionable turns should ask for the+specific missing information. Validated actionable turns may enter the local-app+runner, review UI, planner, or action engine. A greeting or capability question+must not become a failed task card.++## How A Turn Flows++Every prompt submission, voice transcript, follow-up, and asset event enters the+same harness intake path. Intake first attaches the turn to the right durable+thread, records the event, and builds a compact context packet. From there the+harness routes the turn by meaning, not by the fact that text was submitted.++The normal flow is:++1. Receive a turn from the pointer prompt, voice transcription, file drop, or a+ task follow-up.+2. Attach it to an existing or new task thread and persist the user-visible+ event.+3. Build a bounded context packet for this decision.+4. Classify the turn as conversation, clarification, review, actionable intent,+ planning/recovery, memory, or no-op.+5. Produce a conversational response, ask for missing details, open review, or+ execute a validated action.+6. Persist assistant/tool/lifecycle events and update the notch with the thread+ state and any action state.++The harness should make conversation feel continuous even when execution happens+inside the thread. The user should not need to know whether a turn was answered+by a chat response, a local model classifier, deterministic parsing, or a+guarded runtime path.++## Context Engineering++The harness builds context deliberately for each job. It should never dump raw,+unbounded thread history into a model or runtime adapter. Context packets should+be compact, source-linked, and explicit about what is known, what is missing,+what can be acted on, and what policies apply.++A useful context packet includes the current turn, a bounded summary of recent+thread events, relevant assets, active action state, selected app/window facts+when available, task definitions and supported capabilities, retrieved memory,+permission policy, safety state, and trace ids. The packet should be shaped for+the consumer: conversation response, intent classification, planner hint,+review-plan creation, memory retrieval, observation, and recovery do not need+the same fields.++Remote-bound context must be redacted before provider calls. Local-only context+can include richer app and observation facts, but should still stay bounded and+inspectable. Memory retrieval should use target/scope filters, relevance+thresholds, and prompt-character budgets before summaries are added.++## Routing Outcomes++Conversation is a first-class outcome. Greetings, "what can you do?", small+talk, and explanatory questions should stay in the task thread and get an+assistant response. These turns may update memory or teach the user about+available capabilities, but they should not create a failed local-app run.++Clarification is for actionable intent with missing required information. If+the user says "play music", the harness should ask what to play. If the user+says "fill this out" without a document or data source, it should ask for the+missing input or invite an upload. The prompt should name the missing detail+rather than using generic copy like "Need more detail".++Action execution is for validated, supported tasks. The local-model classifier+and deterministic fallback can produce a `TaskIntent`, but execution may only+continue after catalog validation confirms the target app/task, required+entities, app availability, and safety policy. Built-in examples such as+weather lookup, media playback, and document form-fill are benchmark definitions+inside this generic path, not separate architectures.++Review is required when the harness can propose work but should not perform it+blindly. Document form-fill is the main supported example: Donkey can inspect+fields and propose mappings, but only user-approved fields are sent to guarded+Accessibility execution.++Planning and recovery are advisory. Slow planner output can help with app+knowledge lookup or recovery, but planner text must not become direct input.+Planner hints expire, validate against known actions, and remain separate from+task-intent parsing.++## Execution Boundary++The harness is allowed to coordinate execution, but it should not bypass the+runtime safety model. Local-app work flows through typed contracts, catalog+resolution, observation, dry-run projection, guardrails, and verification before+or during live control.++Live input remains guarded. The action engine checks permission policy, target+focus, rate limits, hold duration, and backend evidence before issuing input.+The macOS keyboard and Accessibility backends are intentionally narrow. They+exist for validated local-app workflows, not arbitrary UI automation.++Observation prefers Accessibility and app/window metadata. Bounded screenshots+and local UI understanding are fallback observation context only; they do not+emit direct input actions. Captured screenshots, Accessibility snapshots, and+manual capture artifacts are trace evidence, not a general live vision loop.++The fast local path must keep working without remote model calls. Local sidecars+can classify actionable turns, transcribe voice, segment screenshots, or+summarize UI observations. Provider-backed planners and memory proposals remain+slow-path helpers and must fail without stopping local control on existing+validated state.++## State And Observability++Task-thread state and action-run state are related but distinct. A thread can be+chatting, waiting for clarification, waiting for review, running an action,+completed, or failed. The notch should communicate that distinction so normal+conversation does not look like a broken command.++The coordinator owns lifecycle and event ordering for action runs. It records+assistant, tool, lifecycle, and reflex events; handles start, pause, resume,+completion, abort, timeout, and failure; and marks aborts/timeouts that require+held-input release. Run artifacts, screenshots, Accessibility captures, latency+reports, memory records, and model-call traces should remain source-linked and+inspectable.++Latency claims must come from monotonic trace data. Provider calls, planner+work, and slow recovery should not be counted as reflex-loop latency unless they+actually block that path.++## Verification++Use `swift test` from `apps/Donkey/` for the supported runtime and harness+coverage.++Harness tests should prove that non-actionable turns receive conversational+responses, ambiguous actionable turns ask specific clarification questions,+validated actions still run through catalog and guardrail checks, follow-ups get+the right thread context, and context packets stay bounded and redacted where+needed.++Runtime tests should continue covering coordinator lifecycle ordering, event+persistence, task-intent validation, local-app catalog resolution, observation,+Accessibility control discovery, guarded input, review-first document form-fill,+model routing, memory retrieval, redaction, latency reports, artifacts, window+resolution, and manual capture.++Manual smoke checks remain useful for window enumeration, manual capture, local+runtime setup/status, and dry-run latency reports, but they should support the+guide rather than becoming the guide.++## Source Entry Points++Start in `apps/Donkey/Sources/Donkey/` for pointer-prompt integration,+`apps/Donkey/Sources/DonkeyContracts/` for shared contracts,+`apps/Donkey/Sources/DonkeyRuntime/` for runtime execution and guardrails, and+`apps/Donkey/Sources/DonkeyAI/` for model routing and adapters. Tests live in+`apps/Donkey/Tests/DonkeyRuntimeTests/`.diff --git a/docs/guides/install-donkey.md b/docs/guides/install-donkey.mdindex ff2d3264..2de7aa15 100644--- a/docs/guides/install-donkey.md+++ b/docs/guides/install-donkey.md@@ -83,7 +83,7 @@ DONKEY_RUNTIME_PACKAGE_MANIFEST_URLS="parakeet-transcriber=https://example.com/dOn first launch, Donkey shows one setup button for local runtimes. Setup downloads the configured sidecar packages, verifies their manifests/checksums/signatures, registers them in Application Support, asks them to prepare model weights, and health-checks them. The packages do not include Parakeet or YOLO model weights; they contain protocol-speaking runner entrypoints for the local command parser, Parakeet voice transcription, and YOLO screenshot segmentation. UI understanding ships as a local Swift sidecar that uses Apple's on-device Vision text recognition and does not need downloaded model weights. If setup fails, clicking the same button retries failed or not-yet-attempted runtimes while keeping completed installs. The setup window can also be reopened from the app settings.-Each sidecar supports setup-time model weight preparation. During setup, Donkey calls the sidecar with `prepareModelWeights`; the sidecar downloads or warms the configured model cache and reports cached/downloaded status before health check. The local command-parser LLM is setup-managed too: Donkey packages a `local-llm` sidecar that pulls `qwen3:8b` through Ollama by default, then submitted commands are parsed through `DONKEY_LOCAL_LLM_RUNNER` instead of a direct in-app Ollama request. The Parakeet runner can fetch the Hugging Face snapshot when `huggingface_hub` is available and transcribes through NVIDIA NeMo when the local Python backend is installed.+Each sidecar supports setup-time model weight preparation. During setup, Donkey calls the sidecar with `prepareModelWeights`; the sidecar downloads or warms the configured model cache and reports cached/downloaded status before health check. The local command-parser LLM is setup-managed too: Donkey packages a `local-llm` sidecar that pulls `qwen3:8b` through Ollama by default, then actionable prompt turns are parsed through `DONKEY_LOCAL_LLM_RUNNER` instead of a direct in-app Ollama request. The Parakeet runner can fetch the Hugging Face snapshot when `huggingface_hub` is available and transcribes through NVIDIA NeMo when the local Python backend is installed.Configure model-weight URLs when packaging:diff --git a/docs/guides/minimal-run-coordinator.md b/docs/guides/minimal-run-coordinator.mddeleted file mode 100644index 2f6e36ab..00000000--- a/docs/guides/minimal-run-coordinator.md+++ /dev/null@@ -1,222 +0,0 @@-# Minimal Run Coordinator--## Supported Behavior--Donkey supports a minimal in-memory runtime coordinator for the future off-the-shelf run loop.--The coordinator can:--- accept run sessions with a user goal, target id, runtime profile, and permission policy-- keep only the latest pending live-control session request-- publish ordered `assistant`, `tool`, `lifecycle`, and `reflex` events-- move through explicit lifecycle states for start, pause, resume, completion, abort, timeout, and failure-- deny unsafe input tool calls by default-- mark aborts and timeouts as requiring held-input release-- build bounded planner context from the current session, world-state summary, transcript summary, valid hints, and recent failures--Donkey also supports the first real reflex trace shape for the off-the-shelf run loop. Reflex traces can carry monotonic timing checkpoints for capture, preprocessing, model inference, perception, state publication, controller decision, action enqueue, and input execution. The shared contracts derive stage latency, software-loop latency, frame age, and state age from monotonic timestamps only. `RunCoordinator` can append a `ReflexTraceRecord`, retain it in a bounded in-memory trace store, and publish a matching `reflex` event with compact latency metadata.--Donkey also supports shared hot-loop contracts for deterministic reflex-loop slices. Frames, crops, coordinate spaces, perception signals, compact world states, controller actions, and action results are typed, Codable, Sendable contracts. Coordinate spaces are explicit across screen, window, crop, and normalized target space. Perception signals carry confidence and monotonic source age, and stale signals are marked on world state instead of being silently reused.--Donkey also supports a deterministic dry-run reflex loop skeleton. The loop consumes synthetic, recorded, target-window, streaming target-window, or local-navigation metadata frame batches through a latest-frame-wins buffer with queue depth 1, counts dropped frames, converts signals into compact world state through a swappable projector, chooses an inspectable semantic action, projects the action in dry-run mode without OS input, and publishes `ReflexTraceRecord` samples through `RunCoordinator`. This skeleton is for contract validation and replayable tests only; reflex-loop default OS input is not supported yet.--Donkey also supports a bounded target-window frame source for the dry-run hot-loop boundary. The frame source reuses macOS window selection and safety checks, captures selected windows through ScreenCaptureKit's desktop-independent window path, returns `HotLoopFrame` metadata for a caller-provided maximum frame count, and records capture latency and copy cost with monotonic timestamps. The frame source can carry an explicit content crop, and iPhone Mirroring windows default to a centered phone-aspect content rectangle so mirrored game perception can target the phone content inside the generic Mac window. This path does not write screenshot artifacts and does not PNG/JPEG encode or decode frames. High-resolution manual screenshot artifacts remain separate from reflex frames.--Donkey also supports the first cheap perception and deterministic controller slice. `CheapPerceptionAdapter` reads deterministic fixture or recorded-frame metadata for template-style targets, emits compact perception signals with confidence and monotonic source age, and marks that raw pixels are not exposed past the perception boundary. `HotLoopWorldStateProjector` converts those signals into compact world state and action affordances. `DeterministicControllerPolicy` selects a semantic `tapTarget` action for fresh high-confidence affordances, otherwise falls back to `wait` or `observe` with explicit rationale and fallback metadata. `DryRunActionProjector` remains side-effect free and records projected dry-run actions without OS input.--Donkey also supports the first off-the-shelf local vision evidence boundary inside the dry-run reflex loop. `RecordedOffTheShelfVisionMetadataCodec` can carry recorded detector, template, OCR, or segmentation observations with crop ids, component ids, model ids, confidence, coordinate spaces, and measured preprocessing/model latency. `OffTheShelfVisionPerceptionAdapter` converts that local evidence into compact `HotLoopPerceptionSignal` values, and `OffTheShelfVisionWorldStateProjector` exposes only typed affordances to the deterministic controller. This is a local perception contract and replay path; it does not yet run a live Core ML, ONNX, OCR, or template matcher over captured pixels.--Donkey also tracks the first screenshot segmentation model candidate for the off-the-shelf vision boundary. `OffTheShelfVisionModelCatalog` lists Ultralytics YOLO26 nano segmentation (`yolo26n-seg.pt`) as the current screenshot/crop segmentation candidate, with official docs rechecked on May 17, 2026. `YOLOScreenshotSegmentationRunner` accepts bounded crop metadata plus a crop image or artifact URL, and `ProcessBackedScreenshotSegmentationBackend` calls a local JSON stdin/stdout sidecar from `DONKEY_YOLO_SEGMENTER`. Missing executable configuration, nonzero exits, and invalid output produce explicit unavailable or decoding failures. Decoded masks become the same recorded off-the-shelf segmentation evidence used by replay and dry-run perception.--Donkey also supports the first action-engine guardrail boundary. `ActionEngineGuardrail` accepts typed tap, swipe, key, mouse, controller, and `releaseAll` commands; checks input permission policy, focus guard status, command rate, and maximum hold duration; tracks held-input state; and records replayable command traces. Live input remains disabled by default and requires explicit configuration, an input-allowing policy, a passing focus guard, and an injected input backend. `MacTargetWindowFocusGuard` can protect generic target-window input, including iPhone Mirroring, by requiring the same durable window id, process, optional bundle, focused state, stable bounds, visibility, and allowed safety status before input executes. The local-app live runner injects a narrow macOS keyboard backend for guarded key/text commands; other action-engine use still records dry-run traces unless a caller opts into live input. Allowed non-live commands are projected as dry-run traces, live commands record backend execution evidence, denied commands include explicit denial reasons, and `releaseAll` clears held-input state.--Donkey also supports reflex latency reports and a synthetic replay benchmark. `ReflexLatencyReportBuilder` summarizes reflex traces into p50/p95/p99 latency for software-loop, capture, preprocess/crop-normalize, model inference, perception, state update, controller decision, action projection, and input stages, plus component latency fields for command parse, launch/focus, observation, Accessibility action, keyboard action, verification, YOLO segmentation, UI understanding, and Parakeet transcription when traces include those metadata keys. Reports also include capture/perception/controller rates, dropped frames, stale actions, and worst traces. `ReflexReplayBenchmark` can generate deterministic dry-run traces for capture-only, controller-only, or end-to-end dry-run report modes. The installed debug entrypoint can print a CLI-friendly dry-run latency report with `--dry-run-latency-report`.--Donkey also supports the first fast local-navigation dry-run slice end to end through the dry-run reflex loop. `LocalNavigationMetadataFrameSource` can turn macOS window candidate metadata and optional browser-tab metadata supplied by callers into metadata-only hot-loop frames. `LocalNavigationDryRunPerceptionAdapter` and `LocalNavigationDryRunWorldStateProjector` keep the local-navigation path swappable while preserving the no-remote-model fallback. `LocalNavigationControllerPolicy` can choose traceable dry-run semantic actions such as `focusWindow`, `activateCandidate`, `switchTab`, `wait`, or `observe` from typed state. This slice is metadata-only and side-effect free by default; guarded live-action smoke requires an injected backend, and richer visual inference remains future work.--Donkey also supports the first generic local-app task catalog, intent, live runner, and local task-definition loading boundary. `TaskIntent` can represent a parsed task, target app, normalized entities, parser source, confidence, and confirmation state. `LocalAppTaskDefinition` describes app-task knowledge as data: target app metadata, deterministic trigger terms for offline fallback, required entities and aliases, workflow steps, observation strategies, and verification rules. `LocalAppTaskDefinitionLoader` can load additional JSON or JSONL task definitions from `~/Library/Application Support/Donkey/TaskDefinitions/` and merge them with built-ins, so new use cases do not require Swift source changes. `LocalAppTaskCatalog` resolves validated intents against known task definitions, checks target-app availability through an injected provider, and exposes built-in definitions such as Weather lookup, Music playback, and PDF/document form-fill as data rather than source-specific adapters. `ProcessBackedLocalLLMTaskIntentAdapter` is the submitted-command classifier: it sends the user command and a compact supported-capability list to the app-managed `DONKEY_LOCAL_LLM_RUNNER` sidecar, asks the fast local model to classify by capability rather than exact trigger wording, decodes a `TaskIntent`, rejects low-confidence matches, and validates the result against the catalog before execution can proceed. `OllamaTaskIntentAdapter` remains available for adapter-level tests and compatibility, while `LocalAppTaskIntentParser` remains deterministic validator and offline fallback scaffold code rather than the user-facing command model. `LocalAppTaskAdapter` can build a target-app local-navigation metadata request, project dry-run workflow steps, emit guarded keyboard command templates, and verify observed visible text against the requested entity. `LocalAppAccessibilityControlDiscovery` can index controls and form fields from bounded Accessibility snapshots, and `MacAccessibilityActionEngineInputBackend` can execute guarded `AXPress` and `AXSetValue` commands when Accessibility is trusted, focus guard passes, and input policy allows it. `ProcessBackedLocalUIUnderstandingAdapter` can call a local JSON sidecar from `DONKEY_UI_UNDERSTANDER` for bounded screenshot/crop context and return visible text, controls, form fields, and confidence as a `LocalAppTaskObservation`; those results feed observation only and never direct input actions. `LocalAppTaskLiveRunner` publishes coordinator lifecycle/tool events, can launch or focus the resolved app, prefer discovered Accessibility commands when available, fall back to guarded keyboard templates, observe visible Accessibility text when trusted, include bounded screenshot understanding only when Accessibility/metadata are insufficient, and return a final verification plan. Review-only tasks, such as document form-fill with external data, resolve into a local context snapshot and `DocumentFormFillPlanner` review plan. The pointer prompt opens a user-visible review window for proposed document field mappings; only user-approved fields are sent to the guarded Accessibility input runner.--Donkey also supports a guarded live-action smoke boundary for local-navigation behavior. `GuardedLiveActionSmokeRunner` requires an end-to-end dry-run result, a latency report with p95 evidence, a non-fallback latest action, explicit input policy allowance, and a passing action-engine focus guard before mapping semantic local-navigation actions to typed action-engine commands. The smoke path records replayable action traces and can execute only through an injected backend.--Donkey also supports slow-path planner hint contracts. `StructuredPlannerHint` carries a goal, policy, priorities, regions of interest, preferred and avoided semantic actions, confidence, expiry, and source trace/frame/state/model-call ids. Planner hints are advisory only; they are validated for unknown actions, unsafe actions, stale state references, low-confidence replacement, and expiry before selection. `PlannerHintSelector` chooses the latest valid hint, and the reflex loop remains able to run without any planner hint.--Donkey also supports the first slow-planner sidecar beside the dry-run reflex loop. `DryRunSlowPlannerSidecar` can trigger on scene changes, low confidence, repeated fallback/failure, already-complete local-navigation goals, or explicit user instruction. It builds compact planner snapshots from the latest world state, action, bounded trace summaries, optional screenshot artifact references, and run memory. Planner work is notified from the dry-run loop after reflex trace publication in a fire-and-forget task, so model latency is not included in reflex p95. `ValidatedPlannerHintBus` publishes only validated hints, and `PlannerHintAwareControllerPolicy` can expose the latest still-valid hint to a controller without letting planner output become direct input.--Donkey also supports the first AI harness model registry and router boundary. `AIModelRegistry` stores model roles, providers, literal model ids, endpoints, capabilities, timeouts, prompt versions, eval status, docs URLs, and rollback ids as registry data. `AIModelRouter` routes slow-path jobs by job type, risk, privacy mode, latency tolerance, capabilities, failed-model history, and allowed providers. Privacy-sensitive planner routes prefer local Ollama-compatible entries when they are available. Privacy-sensitive voice-transcription routes prefer local runtime entries and select NVIDIA Parakeet TDT 0.6B v3 only; Whisper fallback has been removed. `ProcessBackedParakeetTranscriptionRuntime` calls a local JSON stdin/stdout sidecar from `DONKEY_PARAKEET_TRANSCRIBER`, and missing configuration or nonzero exits fail clearly instead of silently falling back. `LocalVoiceTranscriptionAdapter` accepts bounded local audio buffers, normalizes pointer-prompt `pcm_f32le` capture into Parakeet-compatible 16 kHz mono WAV, routes to the selected local runtime model, returns transcript text plus timing/confidence trace metadata, and marks transcripts as inputs to the normal command parser rather than actions. Literal provider model ids should stay in registry entries, not planner/controller logic.--Donkey also supports a reusable local JSON sidecar runner for local model processes. `ProcessBackedLocalJSONSidecarRunner` reads executable paths from environment variables first, then from Donkey's app-managed local runtime registry, validates executability, sends request JSON on stdin, captures stdout/stderr, records exit status and latency metadata, and returns explicit unavailable or failed statuses. Current model sidecars use `DONKEY_LOCAL_LLM_RUNNER`, `DONKEY_YOLO_SEGMENTER`, `DONKEY_PARAKEET_TRANSCRIBER`, and `DONKEY_UI_UNDERSTANDER`. Submitted pointer-prompt commands prefer the local LLM sidecar and validated `TaskIntent` schema. If that runtime is unavailable, the built-in deterministic parser may resolve known built-in commands as a local fallback; this keeps benchmark commands local and traceable while still requiring catalog validation before execution.--Donkey's live local-app observation path uses Accessibility and bounded screenshots only. `MacLocalAppTaskController` captures Accessibility controls/visible text first and, when the task definition includes screenshot local-model observation, captures a bounded target-window screenshot only if Accessibility/metadata did not provide the verification text or required controls. That screenshot is sent to `ProcessBackedLocalUIUnderstandingAdapter`. The adapter output is merged into `LocalAppTaskObservation` as visible text, controls, form fields, confidence, and metadata. Screenshot understanding is observation context only and never emits direct input actions.--Donkey also supports the first post-install local runtime setup boundary. The app package does not ship local runtime packages or Parakeet/YOLO model weights, but `scripts/package-donkey-app.sh` creates Donkey-compatible sidecar runner package artifacts under `dist/LocalRuntimePackages/` for release hosting. Each Python-backed package contains a small executable wrapper plus `donkey_runtime_runner.py`, and manifests checksum both files. Parakeet and YOLO packages also include a manifest-tracked `requirements.txt`; the runner creates a managed virtual environment under Application Support and installs those dependencies there from the Python package index. UI understanding ships as a Swift sidecar using Apple's on-device Vision text recognition, so it does not need downloaded model weights. `LocalModelRuntimeSetupManager` describes the required Parakeet, YOLO26, UI-understanding, and local command-parser LLM runtime packages, provides user-facing setup instructions, downloads configured manifest-backed package files, validates user-downloaded runtime folders, enforces SHA-256 checksums and required signature metadata, verifies Curve25519 manifest signatures when trusted release keys are configured, caches verified package files under Application Support, asks each installed sidecar to prepare model weights in Application Support, and records executable paths in `~/Library/Application Support/Donkey/LocalModelRuntimes/runtime-installations.json`. The `local-llm` runner uses Ollama `qwen3:8b` when available so intent classification stays on the supported local LLM path, but reports a non-blocking external-unavailable state during setup when Ollama is absent; submitted commands still have the deterministic local-app parser fallback. The Parakeet runner can prepare a Hugging Face snapshot and calls NVIDIA NeMo for transcription when available; YOLO installs its managed Ultralytics dependency and prepares the selected segmentation model. After registration, sidecar calls can resolve app-managed executables without shell environment variables. The first-run setup window exposes one setup button that installs/downloads, verifies, registers, prepares model weights, and health-checks all required runtimes, with one overall ready or retryable needs-attention state. Retry keeps completed runtime installs and resumes at failed or not-yet-attempted runtimes. Settings can reopen setup, and runtime lifecycle helpers can repair or remove managed installs and export user-data-free support status. Developer launch arguments can print setup instructions, show install status, export support status, repair, remove, or register a downloaded runtime folder.--Donkey also supports the first provider-neutral planner-hint adapter boundary using OpenAI's Responses API. `OpenAIPlannerHintAdapter` reads `OPENAI_API_KEY` from the environment, routes through the model registry, sends a structured-output Responses request with `store: false`, decodes a strict JSON response containing a planner hint plus optional memory write proposals, and records a model-call trace with role, provider, model id, prompt version, schema id, latency, timeout, validation status, and source trace/state ids. Missing credentials, cancellation, timeout, rate limit, invalid output, and provider outage return traceable failures without stopping the reflex loop. Official OpenAI docs were rechecked on May 16, 2026 for the Responses API, `text.format` JSON schema structured outputs, `store: false`, and current model registry default guidance.--Donkey also supports an Ollama-compatible local planner-hint adapter and provider-backed slow planner generator. `OllamaPlannerHintAdapter` sends a local `/api/generate` request with `stream: false` and the same strict planner-hint-plus-memory-proposal JSON schema, decodes the local model response into `StructuredPlannerHint` and approved memory decisions, and records the same model-call trace shape as the OpenAI adapter. `ProviderBackedSlowPlannerHintGenerator` can try local planning first and fall back to the online adapter; either provider can publish only validated hints through the existing slow-planner sidecar and hint bus. Official Ollama docs were checked on May 16, 2026 for the `/api/generate` endpoint, JSON schema `format`, and non-streaming response shape.--Donkey also supports the first memory boundary for slow-path context. Short-term run memory is in-process and bounded; it can retain the current goal, active valid hints, recent world states, recent failures, user instructions, safety stops, and target records for context assembly. Target memory is stored as scoped, source-linked JSONL records under Application Support by default, with tests and tools able to pass an explicit base directory. Semantic memory retrieval contracts include target/scope filters, max-record and prompt-character budgets, minimum relevance, and an embedding-provider protocol. Pointer-prompt command handling loads target-scoped JSONL records after catalog resolution and records the selected semantic memory ids in run metadata; slow-planner snapshots can carry selected semantic results in `RunContextPackage`, and provider prompts include only the bounded selected memory summaries. Provider-backed planner outputs may include memory write proposals beside the validated hint. Proposals are decoded independently from hints, run through the deterministic approver, and approved target memories are persisted through `TargetMemoryJSONLStore` when a store is available. Target and user scoped records require either an expiry timestamp or an explicit durable flag, and records can be listed or deleted by target, run, user, or record id.--Donkey also supports a replay/eval scaffold for model and prompt changes. Planner-hint replay cases summarize recorded traces, decoded hints, validation issues, model-call latency, estimated cost, fallback count, recovery success, and memory-write decisions. `PlannerHintReplayEvaluator` aggregates schema validity, hint acceptance, memory write acceptance and rejection, latency, cost, fallbacks, and recovery success into a promotion report. `AIModelObservabilityReportBuilder` aggregates model-call latency, status, provider, schema validity, acceptance, estimated cost, and recovery success across arbitrary `AIModelCallTrace` samples. `AIHarnessRedactor` provides hooks for remote-bound screenshot summaries, DOM summaries, and model context before provider calls. `AIModelUpdateChecklist` records the model entry, prompt version, `last_verified_at`, docs URLs, eval suite id, rollback model id, and optional report id before model or prompt promotion.--Donkey also supports a local run artifact store for durable trace data. Installed app runs are stored under `~/Library/Application Support/Donkey/Runs/<run-id>/`; tests and development tools may pass an explicit base directory override. Each prepared run creates:--```text-events.jsonl-summary.json-screenshots/-accessibility/-```--The artifact store can append ordered event records, reserve safe screenshot or Accessibility artifact paths, record artifact metadata, and keep `summary.json` current.--Donkey can also resolve visible macOS target-window metadata for the manual capture path. The resolver enumerates on-screen app windows, builds a runtime map of known running applications from `NSWorkspace`, enriches each window with app identity when available, and describes window id, pid, app name, bundle id, title, bounds, focus/frontmost state, iPhone Mirroring hints, and conservative safety metadata. iPhone Mirroring is treated as an ordinary visible window candidate; the hint is derived dynamically from the same app identity and window metadata used for every other app, not from a separate selection path. Callers can request a candidate-list snapshot with ephemeral labels such as `window 1` and `window 2`; labels are valid only for that enumeration snapshot and should be converted to the candidate's durable `windowID` for follow-up capture commands. Callers can select an explicit window id or fall back to the focused/frontmost visible window.--Donkey can create a single read-only target-window screenshot artifact after a run folder has been prepared. The screenshot service resolves the target, refuses blocked or review-required safety surfaces, captures the selected window with ScreenCaptureKit's desktop-independent window path, writes PNG bytes under `screenshots/`, and records flattened target/capture metadata in `summary.json`. Overlap-sensitive fallback capture backends must refuse occluded targets instead of silently recording pixels from another window.--Donkey can also create a shallow read-only Accessibility snapshot artifact after a run folder has been prepared. The Accessibility snapshot service resolves the same target-window selection, refuses blocked or review-required safety surfaces, checks Accessibility trust without prompting, races tree capture against a short timeout, detects native macOS dialogs in the resulting tree as safety stops, writes a bounded JSON tree under `accessibility/` when trusted and safe, and records artifact metadata in `summary.json`. If Accessibility trust is missing, the service appends a clear partial-run tool event to `events.jsonl` and does not create an artifact. If capture times out or a native dialog is detected, no artifact is created.--Donkey supports a runtime-level manual target context capture service that wires one read-only capture run through `RunCoordinator`. The service prepares the run folder, starts the session, resolves the target once, passes explicit durable `windowID` selection to screenshot and Accessibility capture services, records coordinator-assigned lifecycle and tool events, persists those events to `events.jsonl`, and completes the run after screenshot success. Missing Accessibility trust is a partial completion: the coordinator records one permission-denied tool event, the screenshot artifact remains, and no Accessibility artifact is created.--The installed executable also supports a developer-only launch-argument entrypoint for manual verification. `--list-window-candidates` prints the current candidate-list labels and durable `windowID` values. `--manual-capture` runs one manual capture, optionally with `--window-id <id>`, `--run-id <safe-id>`, and `--trace-id <safe-id>`, then prints the run folder and artifact paths. These commands are non-interactive and exit before showing the pointer prompt overlay.--This is a coordination, in-memory reflex trace, hot-loop contract, deterministic dry-run skeleton, bounded target-window frame-source, streaming target-window frame-source, cheap metadata perception, recorded off-the-shelf local vision evidence, screenshot segmentation model-candidate catalog and sidecar runner boundary, local UI-understanding sidecar observation boundary wired into live local-app observation, post-install local runtime setup/registration boundary, deterministic controller, local-navigation dry-run, generic local-app task catalog/intent/live-runner boundary, local JSON/JSONL task-definition loading, local task-context intake, Accessibility control discovery/action execution boundary, document form-fill review planning and approval UI, sample task definitions across weather/media/document domains, guarded live-action smoke boundary, slow-planner sidecar, action-engine guardrail, latency-report, planner-hint contract, model-registry/router, Parakeet-only local voice-transcription sidecar boundary wired from pointer-prompt microphone buffers, OpenAI and Ollama-compatible planner adapters, semantic memory/redaction/model-observability scaffolding, replay/eval, target-metadata, single-screenshot artifact, read-only Accessibility snapshot, and manual capture orchestration foundation only. It does not bundle live transcription or vision model binaries, run OCR over captured pixels by default, provide a manual capture UI, persist high-volume reflex traces to disk, or make model calls required for reflex ticks.--## Technical Guidelines--- Keep shared event, policy, lifecycle, and context types in `DonkeyContracts`.-- Keep coordinator state and append ordering in `DonkeyRuntime`; UI code should read status through narrow provider boundaries.-- Treat `RunCoordinator` as the owner of lifecycle and event ordering, not as the owner of perception, controller internals, or input backends.-- Treat `LocalRunArtifactStore` as a persistence sink for trace records and artifact metadata. It should not own lifecycle state or decide whether tool calls are allowed.-- Treat macOS window resolution as read-only metadata collection. Build app identity from the current runtime environment, keep app-specific hints additive, and continue selecting targets through generic window ids. Safety classifications should be conservative and used by later capture code to refuse or stop on sensitive surfaces.-- Treat target-window screenshot capture as a one-shot artifact write, not a continuous capture loop. ScreenCaptureKit desktop-independent window capture is preferred because overlapping windows do not contaminate the selected target artifact.-- Treat target-window content calibration as window metadata, not target discovery. iPhone Mirroring can use the default centered phone-aspect crop, while callers may pass an explicit crop or calibration when the target requires a different content rectangle.-- Treat Accessibility snapshot capture as read-only inspection. Keep trees bounded, timeout-protected, dialog-aware, and redacted for long text values; avoid permission prompts in the capture service, and never perform AX actions from this path.-- Treat manual target context capture as orchestration. `RunCoordinator` owns event order and policy decisions, while screenshot, Accessibility, and artifact-store services remain capture/persistence workers.-- Treat the launch-argument debug entrypoint as developer tooling. It should stay plain text, non-interactive, and should never accept ephemeral labels as capture input.-- Keep mutable installed-app run artifacts in Application Support, not inside the `.app` bundle and not relative to process working directory.-- Keep input actions denied unless a caller provides a policy that explicitly allows them.-- Preserve latest-request-wins behavior for live-control sessions so stale work cannot build up behind the reflex loop.-- Keep hot-loop data flowing through `DonkeyContracts` types. Controllers should consume `HotLoopWorldState`, not raw screenshots, detector tensors, or untyped metadata.-- Keep dry-run action projection side-effect free. It records semantic action intent and trace evidence, but never calls the input capability.-- Keep dry-run world-state projection swappable. Local-navigation metadata, cheap template metadata, and future local inference adapters should share the loop boundary instead of requiring planner or remote-model output.-- Keep reflex frame buffers at queue depth 1. Dropped frames are expected under pressure and should be counted.-- Keep target-window reflex frames bounded by caller-provided frame count unless a caller explicitly selects the streaming frame source.-- Keep manual screenshot artifacts and high-resolution planner snapshots separate from reflex frames. The reflex frame source should not encode PNG/JPEG or write screenshot artifacts.-- Keep cheap perception deterministic and compact until real pixel/model adapters exist. Perception may summarize fixture metadata, recorded off-the-shelf detector/template/OCR/segmentation evidence, or model-candidate catalog choices, but controllers must only see typed signals, world state, and action affordances.-- Keep controller fallback explicit. Low confidence, stale signals, missing affordances, and missing signals should produce traceable `wait` or `observe` actions, not silent no-ops.-- Keep every chosen controller action trace-linked with action id, state id, frame id, policy name, confidence, rationale, fallback metadata, and any compact source-evidence metadata needed to explain the rule.-- Keep action-engine commands typed and replayable. Guardrails must run before live input and record permission, focus, rate-limit, hold-duration, release, backend, issued time, backend completion time, and execution status. Live held-input tracking starts only after the backend reports execution.-- Keep live OS input disabled unless a caller explicitly configures live mode, allows input in policy, passes focus guard, and supplies an input backend. Use `MacTargetWindowFocusGuard` for generic window targets before synthetic input. The macOS keyboard backend is narrow: it is for guarded local-app key/text commands, not arbitrary controller output. The macOS Accessibility backend is narrow too: it may execute only timeout-bounded, traceable `AXPress` or `AXSetValue` commands against discovered nodes in the focused target app.-- Use monotonic timestamps for latency math. Wall-clock timestamps are for human labels and trace correlation only.-- Use latency reports for any p50/p95/p99 claim. Reports should include dropped frames, stale actions, tick rates, and worst traces.-- Keep local-navigation decisions typed and side-effect free until the guarded live-action slice. Metadata projectors may use window, browser-tab, and Accessibility facts when available, but controllers should emit semantic actions only.-- Keep local-model task intents separate from planner hints. A supported local command should first try to parse to a validated `TaskIntent` through the app-managed local LLM sidecar. The deterministic parser may act as a local fallback for known built-in benchmark commands when the sidecar is unavailable; both paths must resolve through catalog validation before execution. Slow planner output may only help app-knowledge lookup or recovery after validation.-- Keep local-app task adapter output inspectable before live control. Dry-run steps should show the normalized entities, target app identity, observation boundary, guarded command templates, and verification status before the live runner is allowed to launch, focus, type, or submit.-- Keep local task definitions data-driven. Built-ins are examples; local JSON/JSONL definitions in Application Support are the extension point for more apps and workflows.-- Keep document form filling review-first. Field detection, data mapping, proposed values, unmapped required fields, unused data keys, and approval IDs must be inspectable before any live fill action is enabled.-- Prefer Accessibility and metadata for app observation. When visual interpretation is needed, route bounded screenshot/crop context to a local model UI-understanding path before introducing OCR-specific plumbing; OCR remains an optional measured adapter, not the default fallback.-- Treat planner hints as validated, expiring advice. Controllers may use the latest valid hint, but planner output must never become direct input.-- Keep slow planner work beside the reflex loop. Trigger it from compact state, trace, memory, and artifact references; never await model calls from the hot tick before recording the reflex trace.-- Keep model selection in `AIModelRegistry` data. Do not scatter provider model ids through planner code.-- Keep local voice transcription as a Parakeet-only model-routed local runtime job. Normalize pointer-prompt audio into Parakeet-compatible 16 kHz mono WAV before calling the sidecar. Transcription output is transcript text only and must enter the same validated command path as typed input before any task can run. If `DONKEY_PARAKEET_TRANSCRIBER` is missing or fails, the voice path fails clearly; it must not silently fall back to Whisper or any remote transcription provider.-- Keep local model runtimes behind JSON sidecars. Use `DONKEY_YOLO_SEGMENTER`, `DONKEY_PARAKEET_TRANSCRIBER`, and `DONKEY_UI_UNDERSTANDER` for developer overrides, then Donkey's app-managed runtime registry for normal user installs. Return explicit unavailable results when executables are absent.-- Do not bundle model weights in the app. Users download compatible runtime packages after app install; Donkey validates manifests, checksums, signature metadata or configured cryptographic signatures, executable paths, and health checks, then records executable paths under Application Support.-- Keep privacy-sensitive Responses API calls configured with `store: false` unless an explicit later policy changes that default.-- Treat provider failures as sidecar failures. Missing credentials, timeout, rate limit, invalid output, or outage should leave the controller running on local state and existing valid hints.-- Keep memory writes source-linked and scoped. Model-proposed memory writes must pass the deterministic approver before storage; target and user records require TTL or explicit durable retention.-- Keep provider-decoded memory proposals on the same deterministic approval path as runtime-created proposals. Decode proposals independently so malformed proposal payloads do not invalidate a valid planner hint.-- Keep semantic memory retrieval bounded by target/scope filters, max record count, prompt-character budget, and minimum relevance before adding selected summaries to model context.-- Redact remote-bound screenshot summaries, DOM summaries, and model context before online provider calls.-- Keep target memory inspectable and deleteable by target, run, user, and record id. Do not use memory JSONL as an opaque cache.-- Promote model or prompt changes only after replay/eval records schema validity, hint acceptance, memory acceptance, latency, cost, fallback count, recovery success, docs URLs, and rollback model id.-- Keep reflex trace retention bounded. The current in-memory store is for recent status and tests, not high-volume replay persistence.-- Use sampled or summarized reflex events until a measured disk trace sink exists.--## Verification--From `apps/Donkey/`:--```sh-swift test-```--The runtime tests should cover lifecycle ordering, abort and timeout safety, latest-session queue drops, tool permission denial, event-store ordering, context compaction, reflex trace latency math, bounded in-memory reflex trace retention, reflex event publication, hot-loop contract Codable round trips, coordinate conversion, stale-signal marking, deterministic dry-run trace publication, queue-depth-1 dropped-frame counting, bounded target-window frame capture, target-frame safety and overlap refusal, target-frame no-artifact/no-encoding metadata, iPhone Mirroring content-rectangle calibration, generic target-window focus guarding, cheap perception signal projection, recorded off-the-shelf vision evidence projection, screenshot segmentation model-candidate selection, YOLO sidecar decoding and unavailable states, local UI-understanding observation decoding, local runtime setup instructions/status/registration, manifest-backed runtime download, checksum/signature enforcement, managed package cache install, health recheck, app-managed sidecar executable resolution, controller confidence/staleness fallback, controller p95 replay timing under 20ms, local-navigation metadata projection and action selection, local-navigation browser-tab metadata projection, loop-integrated local-navigation dry-run action selection, local-model task intent request shaping and validation, deterministic local-app task parser validation and alias expansion, local task-definition loading, local-app catalog resolution and app availability checks, local task-context intake, Accessibility control discovery, document form-fill review planning, local-app navigation request construction, generic dry-run step projection, guarded keyboard and Accessibility command templates, observed visible-text verification, guarded local-navigation live-smoke gating and trace evidence, abort/timeout release traces, slow-planner trigger/snapshot/validated-hint publication, planner-latency isolation from reflex reports, action-engine permission/focus/rate/hold/release guardrails, latency report percentiles, component latency fields, replay benchmark formatting, planner hint validation/expiry/latest-selection, model registry routing, Parakeet-only local voice-transcription routing, Parakeet sidecar decoding and unavailable states, local JSON sidecar missing-env/nonzero-exit states, OpenAI Responses request shaping and failure handling, semantic memory retrieval, remote-bound redaction, model-call observability, provider-decoded memory proposal approval, memory approval/storage/list/delete/context snapshots, replay/eval metric aggregation and model update checklist fields, artifact path validation, trace folder layout, JSONL event persistence, summary updates, deterministic window resolver behavior through fixture providers, runtime app-identity-enriched window hints, candidate-list label snapshots, screenshot artifact metadata, bounded Accessibility serialization, Accessibility timeout handling, native dialog safety stops, missing Accessibility trust partial events, unsafe target refusal, overlap-sensitive capture refusal, manual capture event ordering through persisted coordinator events, and debug launch-argument parsing/formatting.--Manual smoke commands:--```sh-swift run Donkey -- --list-window-candidates-swift run Donkey -- --manual-capture --window-id <id>-swift run Donkey -- --dry-run-latency-report --frame-count 30-swift run Donkey -- --local-runtime-instructions-swift run Donkey -- --install-local-runtime --runtime-id yolo-segmenter --runtime-source <downloaded-runtime-folder>-swift run Donkey -- --local-runtime-status-swift run Donkey -- --local-runtime-support-swift run Donkey -- --repair-local-runtime --runtime-id yolo-segmenter-swift run Donkey -- --remove-local-runtime --runtime-id yolo-segmenter-```--Manual verification on May 16, 2026 confirmed that the list command enumerates current visible Mac windows and that manual capture against a normal Mac app window creates a run folder with 9 ordered coordinator events, one screenshot artifact, and one Accessibility artifact. The verified run targeted a non-frontmost, non-focused Fork window by durable `windowID`.--Manual verification also confirmed an overlapped-window case: a Code window overlapped by the higher z-order Codex window was captured by durable `windowID`, used `screenCaptureKitDesktopIndependentWindow`, recorded `overlapStatus=notRequired`, and produced 9 ordered coordinator events with screenshot and Accessibility artifacts.--Remaining live verification is environment-dependent. On May 16, 2026, iPhone Mirroring was not present in the visible-window candidate list, and the current process was already Accessibility-trusted, so the missing-trust partial path was not live-verified to avoid changing macOS privacy permissions.--## Source Entry Points--- Runtime contracts live in `apps/Donkey/Sources/DonkeyContracts/RunLoopContracts.swift`.-- Hot-loop contracts live in `apps/Donkey/Sources/DonkeyContracts/HotLoopContracts.swift`.-- Planner hint contracts live in `apps/Donkey/Sources/DonkeyContracts/PlannerHintContracts.swift`.-- Window target contracts live in `apps/Donkey/Sources/DonkeyContracts/WindowTargetContracts.swift`.-- Runtime coordination lives in `apps/Donkey/Sources/DonkeyRuntime/`.-- The deterministic dry-run reflex skeleton lives in `apps/Donkey/Sources/DonkeyRuntime/DryRunReflexLoop.swift`.-- Bounded target-window reflex frame capture lives in `apps/Donkey/Sources/DonkeyRuntime/TargetWindowFrameSource.swift`.-- Continuous target-window reflex frame streaming lives in `apps/Donkey/Sources/DonkeyRuntime/TargetWindowFrameSource.swift`.-- Cheap perception, world-state projection, deterministic controller policy, and dry-run action projection live in `apps/Donkey/Sources/DonkeyRuntime/CheapPerceptionAndController.swift`.-- Recorded off-the-shelf detector/template/OCR/segmentation evidence projection lives in `apps/Donkey/Sources/DonkeyRuntime/OffTheShelfVisionPerception.swift`.-- Action-engine guardrails live in `apps/Donkey/Sources/DonkeyRuntime/ActionEngineGuardrails.swift`.-- Guarded live-action smoke lives in `apps/Donkey/Sources/DonkeyRuntime/GuardedLiveActionSmoke.swift`.-- Reflex latency reports and synthetic replay benchmarks live in `apps/Donkey/Sources/DonkeyRuntime/ReflexLatencyReport.swift`.-- Local-navigation contracts live in `apps/Donkey/Sources/DonkeyContracts/LocalNavigationContracts.swift`.-- Task intent and local-app task dry-run contracts live in `apps/Donkey/Sources/DonkeyContracts/TaskIntentContracts.swift`.-- Local-navigation metadata projection and dry-run action selection live in `apps/Donkey/Sources/DonkeyRuntime/LocalNavigationController.swift`.-- Local-navigation dry-run frame source, loop adapter, world-state projector, and generic controller wrapper live in `apps/Donkey/Sources/DonkeyRuntime/LocalNavigationDryRunLoop.swift`.-- Local-app task catalog resolution and built-in benchmark definitions live in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskCatalog.swift`.-- Local task-definition loading lives in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskDefinitionLoader.swift`.-- Local task context intake lives in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskContext.swift`.-- Local Accessibility control discovery and Accessibility action planning live in `apps/Donkey/Sources/DonkeyRuntime/LocalAppAccessibilityControls.swift`.-- Document form-fill review planning lives in `apps/Donkey/Sources/DonkeyRuntime/DocumentFormFillPlanner.swift`.-- Guarded document form-fill approval execution lives in `apps/Donkey/Sources/DonkeyRuntime/DocumentFormFillApprovalLiveRunner.swift`.-- The user-visible document form-fill approval window lives in `apps/Donkey/Sources/Donkey/DocumentFormFillReviewWindowController.swift`.-- Deterministic local-app task parsing lives in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskIntentParser.swift`.-- Generic local-app dry-run adapter and guarded keyboard command templates live in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskAdapter.swift`.-- Local-app screenshot fallback policy lives in `apps/Donkey/Sources/DonkeyRuntime/LocalAppTaskObservationFallbackPolicy.swift`.-- Ollama-compatible local task-intent parsing lives in `apps/Donkey/Sources/DonkeyAI/OllamaTaskIntentAdapter.swift`.-- Local voice transcription adapter boundary lives in `apps/Donkey/Sources/DonkeyAI/LocalVoiceTranscriptionAdapter.swift`.-- YOLO screenshot segmentation runner boundary lives in `apps/Donkey/Sources/DonkeyRuntime/YOLOScreenshotSegmentationRunner.swift`.-- Local JSON sidecar running lives in `apps/Donkey/Sources/DonkeyRuntime/LocalJSONSidecarRunner.swift`.-- Local model runtime setup lives in `apps/Donkey/Sources/DonkeyRuntime/LocalModelRuntimeSetup.swift`.-- First-run local runtime setup UI lives in `apps/Donkey/Sources/Donkey/LocalRuntimeOnboardingWindowController.swift`.-- Local UI-understanding observation lives in `apps/Donkey/Sources/DonkeyRuntime/LocalUIUnderstandingAdapter.swift`.-- The packaged UI-understanding sidecar lives in `apps/Donkey/Sources/DonkeyUIUnderstandingSidecar/main.swift`.-- Slow-planner sidecar triggers, snapshots, validated hint bus, and hint-aware controller wrapper live in `apps/Donkey/Sources/DonkeyRuntime/SlowPlannerSidecar.swift`.-- AI model registry and routing live in `apps/Donkey/Sources/DonkeyAI/AIModelRegistry.swift`.-- The OpenAI Responses planner-hint adapter lives in `apps/Donkey/Sources/DonkeyAI/OpenAIPlannerHintAdapter.swift`.-- The Ollama-compatible local planner-hint adapter and provider-backed slow-planner generator live in `apps/Donkey/Sources/DonkeyAI/OllamaPlannerHintAdapter.swift`.-- Memory contracts live in `apps/Donkey/Sources/DonkeyContracts/MemoryContracts.swift`.-- Short-term run memory and target-memory JSONL storage live in `apps/Donkey/Sources/DonkeyRuntime/RunMemoryStore.swift`.-- Semantic memory retrieval lives in `apps/Donkey/Sources/DonkeyRuntime/SemanticRunMemoryRetriever.swift`.-- AI redaction, model-call observability, and provider-decoded memory proposal handling live in `apps/Donkey/Sources/DonkeyAI/AIHarnessCompletion.swift`.-- Replay/eval scaffolding lives in `apps/Donkey/Sources/DonkeyAI/AIReplayEvaluation.swift`.-- Recent reflex trace retention lives in `apps/Donkey/Sources/DonkeyRuntime/InMemoryReflexTraceStore.swift`.-- macOS window resolution lives in `apps/Donkey/Sources/DonkeyRuntime/MacWindowResolver.swift`.-- Generic target-window focus guarding lives in `apps/Donkey/Sources/DonkeyRuntime/MacTargetWindowFocusGuard.swift`.-- Target-window content calibration lives in `apps/Donkey/Sources/DonkeyRuntime/TargetWindowContentCalibration.swift`.-- Target-window screenshot capture lives in `apps/Donkey/Sources/DonkeyRuntime/WindowScreenshotCaptureService.swift`.-- Accessibility snapshot contracts live in `apps/Donkey/Sources/DonkeyContracts/AccessibilitySnapshotContracts.swift`.-- Read-only Accessibility snapshot capture lives in `apps/Donkey/Sources/DonkeyRuntime/MacAccessibilitySnapshotCaptureService.swift`.-- Accessibility timeout helpers live in `apps/Donkey/Sources/DonkeyRuntime/MacAccessibilityTimeout.swift`.-- Manual target context capture orchestration lives in `apps/Donkey/Sources/DonkeyRuntime/ManualTargetContextCaptureService.swift`.-- Manual capture debug command parsing lives in `apps/Donkey/Sources/DonkeyRuntime/ManualCaptureDebugCommand.swift`.-- Local artifact persistence lives in `apps/Donkey/Sources/DonkeyRuntime/LocalRunArtifactStore.swift`.-- The manual capture source plan is complete in `plans/done/manual-target-context-capture-master-plan.md`.diff --git a/docs/guides/pointer-prompt-overlay.md b/docs/guides/pointer-prompt-overlay.mdindex 0fe93ff1..219dfb15 100644--- a/docs/guides/pointer-prompt-overlay.md+++ b/docs/guides/pointer-prompt-overlay.md@@ -2,13 +2,14 @@## Supported Behavior-Donkey supports a floating macOS overlay for quick local-app commands:+Donkey supports a floating macOS overlay for conversational task threads and+quick local-app actions:- Double-tap Command and release to open a centered prompt with keyboard focus.- Double-tap Command and hold the second press to open the prompt in voice mode.- Show a top-center notch status surface for task progress, recent tasks, follow-up input, file drops, updates, and per-task pause/resume.-- Keep prompt submissions, voice transcripts, and follow-ups on the same command path: task-thread routing, catalog-backed command parsing, task validation, and guarded local-app execution.-- Persist submitted commands as searchable Core Data task runs with event history, task assets, and per-run runtime coordination.+- Keep prompt submissions, voice transcripts, and follow-ups on the same app-harness path: task-thread routing, context assembly, conversational response, clarification, review, catalog-backed action parsing, task validation, and guarded local-app execution when a turn is actionable.+- Persist task threads as searchable Core Data conversations with event history, task assets, and per-run runtime coordination for any action work attached to the thread.- Keep the overlay non-invasive. It may request microphone permission for local waveform capture and voice commands, but it must not capture the screen, synthesize input directly, or require Accessibility permission.## Technical Guidelines@@ -19,7 +20,7 @@ Donkey supports a floating macOS overlay for quick local-app commands:- Notch geometry comes from the active `NSScreen`, preferring safe-area and auxiliary-top metrics over hardcoded notch sizes. Content must stay out of the physical notch void; displays without a physical notch should use the same top-center composition without reserving unavailable space.- `PointerPromptNotchLayout` is the shared source for notch surface frames, content frames, corner radii, and notch-safe offsets. `canRenderTextInTopRow` describes whether text can draw in the top row, not whether that row exists.- The prompt is a compact black composer: single-line text is pill-shaped, multiline text becomes a bounded rounded rectangle, Return submits, Shift-Return inserts a newline, Escape and outside clicks dismiss, and non-input capsule areas can drag the modal.-- Voice capture and transcription remain separate. The controller records bounded local audio and publishes levels; transcription uses the Parakeet-only adapter before submitting transcript text through the typed-command path.+- Voice capture and transcription remain separate. The controller records bounded local audio and publishes levels; transcription uses the Parakeet-only adapter before submitting transcript text through the app-harness turn path.- Task actions in the notch, including follow-up submission and pause/resume, must cross the model/controller command boundary with the selected task ID.## Verification@@ -28,7 +29,7 @@ Manually verify:- The notch renders at the top center, respects physical notch safe areas, expands only from visible notch hover, and accepts expanded controls/clicks.- Double-Command release opens a centered focused text prompt; double-Command hold opens voice mode; unrelated Command use does not activate the overlay.-- Typed, voice, and follow-up submissions create or update durable task runs, show status in the notch, and preserve per-task pause/resume behavior.+- Typed, voice, and follow-up submissions create or update durable task threads, answer non-actionable conversation without showing action failure, show action status in the notch when work runs, and preserve per-task pause/resume behavior.- The prompt supports wrapping, Shift-Return newline insertion, Return submission, Escape dismissal, outside-click dismissal, and dragging from non-input areas.- File drops on the notch attach to the active or most recent task.diff --git a/plans/done/22-local-runtime-onboarding.md b/plans/done/22-local-runtime-onboarding.mdindex bcdb1d59..bc11cb92 100644--- a/plans/done/22-local-runtime-onboarding.md+++ b/plans/done/22-local-runtime-onboarding.md@@ -31,7 +31,7 @@ The supported behavior is documented in:- `docs/architecture.md`- `docs/guides/install-donkey.md`-- `docs/guides/minimal-run-coordinator.md`+- `docs/guides/app-harness.md`## Follow-Up Workdiff --git a/plans/done/manual-target-context-capture-master-plan.md b/plans/done/manual-target-context-capture-master-plan.mdindex 7d1d6746..7f166daf 100644--- a/plans/done/manual-target-context-capture-master-plan.md+++ b/plans/done/manual-target-context-capture-master-plan.md@@ -3,7 +3,7 @@> Archived status: historical context only. This file is not an active implementation queue. Supported behavior lives in `docs/`; future work from this idea needs a fresh active plan created deliberately.This file records the completed manual target context capture milestone.-Supported behavior and engineering guidance belong in `docs/guides/minimal-run-coordinator.md`.+Supported behavior and engineering guidance belong in `docs/guides/app-harness.md`.## Completed Tasks@@ -34,4 +34,4 @@ Supported behavior and engineering guidance belong in `docs/guides/minimal-run-c## Completion-This milestone is complete. Supported behavior and engineering guidance live in `docs/guides/minimal-run-coordinator.md`; future implementation should continue from the active capture, Accessibility, benchmarking, and off-the-shelf run-loop plans.+This milestone is complete. Supported behavior and engineering guidance live in `docs/guides/app-harness.md`; future implementation should continue from the active capture, Accessibility, benchmarking, and off-the-shelf run-loop plans.