* Fix#1947: hex restart waits for the old Hex to exit before relaunching
* hex restart: watch the old process from before the quit, and keep a forwarder's wait
- `ExitWatch` takes the Windows SYNCHRONIZE handle while the old Hex still
runs, before the restart is sent, and closes it on drop; Unix keeps the pid
and polls liveness. `wait(timeout)` covers both, and `hex restart` waits on
it instead of on the local API, whose discovery file is retracted earlier in
the drain.
- `hex start` no longer treats an exited child as failure by itself: a Linux
`hex app` forwards to the systemd unit (or a 2.3.1 install's handoff) and
exits once the forward is accepted, so a successful forwarder keeps the
ordinary 20 s wait. Any other exit gets a 2 s grace for a successor to
answer, then fails with a message that fits why the child exited.
- docs: the pid-wait test is Unix only, and the Windows path is compiled in
CI without one.
* the restart watch's test is Linux only
macOS never takes an ExitWatch (it relaunches itself), so the test must not
name one there; Windows waits on a process handle and is compiled only.
* start: treat a 2.3.1 install's handoff as a start in progress
A Windows `hex app` from a legacy layout starts the managed copy in the
background and exits, so that exit is not a failure. `legacy::will_take_over`
is the predicate `take_over` already uses, checked here before the spawn, so a
successful child keeps the ordinary 20 s wait instead of only the 2 s grace.
The comments now say where a handoff actually exits: Windows, since Linux's
legacy relaunch execs and never returns; Linux's forwarder is the systemd
unit.
* restart's watch: refuse pid 0, clamp the Windows timeout, and test it everywhere
- `ExitWatch::new` refuses pid 0 (on Unix `kill(0, …)` means the process
group), and the Windows wait clamps to `u32::MAX - 1` so a huge timeout can
never become INFINITE.
- The wait's test moves out of the Unix-only module and runs on Linux and
Windows, with the child halves taken from this same test binary by `--exact`
and an environment variable, as `desktop::process_exit` does. Check Windows
runs it under nextest.
- The docs now name `control/cli/launch.rs` and say where the discovery file,
Linux's service lock, and Windows' instance event really go relative to the
process, and the wait test's Linux-and-Windows reach.
- `will_take_over` is Windows-only and asked before the spawn, which is the
launch it describes.
* comments: spell out when the old Hex's locks and files go, per OS
On Linux the host worker's drop of the service Server joins before
LocalApi::shutdown removes the discovery file, so the lock goes first; on
Windows the file goes first, then the tray, and the instance event last, at
process exit. The test comment also names the parent's wait_with_output as the
reap.
* restart's watch: loop the Windows wait on a clock, and gate the child on a pipe
`WaitForSingleObject` timeouts are tick-quantized and can report a timeout
before the requested interval has passed, which made the test's elapsed-time
assertion flaky. The Windows branch now loops against an `Instant` deadline,
asks once more with no timeout when the clock says the time is up, and returns
false on `WAIT_FAILED`.
The test's child no longer sleeps: it blocks on one byte of stdin, which the
parent holds open while it takes the watch and closes to end it, so neither
case races the clock. It also asserts pid 0 is refused.
* make the labs card copy plain
Rewrite the Labs card titles and lines in words a regular user understands:
YOLO mode says the message sends itself, Live text and Failure notices name
the small recording indicator, Vocabulary help says which speech models it
affects, and the key-side cards name Option, Command, Shift, and Control.
Audit every other card, updating the CLI descriptions, all nine translated
languages, the website lab catalog, the feature docs, and the render goldens.
* fix labs copy review findings
Restore the ISO qualifier on the section-key card, spell out that
double-tap and hold-through shortcuts contain no letter or number key,
cover all Global mode stages in the API text card, and name the print
command in the print-start copy. Restore the developer API card titles,
fix the Annotate capture wording, and retranslate the affected strings.
Remove every replaced translation key and stale lab-name reference.
* fix second labs copy review
Update the live typing test and YOLO goldens. Add a Windows variant of the
hold-through-keys copy naming Ctrl, Alt, Shift, and the Windows key. Remove
the last unused rewrite-by-voice translation key, keep Annotate untranslated
in the replay title, and clean the remaining old lab-name comments.
* use the Polish Annotate pane name in its replay title
Polish calls the Annotate pane Adnotacje, so the Annotate last 15 seconds
title says Ostatnie 15 sekund w Adnotacjach again. Other languages keep
Annotate because their pane name is Annotate.
* capture: stream audio to disk so long captures keep all of it
A capture's timeline now writes 16 kHz mono PCM16 to its bundle's
audio.wav as it records, with the leading offset and gaps as silence, so
memory stays flat and the 20-minute drop is gone. An 8-hour guard bounds
disk use only; past it the rest is one recorded gap.
A finished capture is transcribed from the WAV in 30 s pieces, the
reader hex transcribe already used (lifted to transcription/pieces.rs),
and each piece's words move onto the capture clock. The Parakeet, Apple
(path-based), and GGUF paths keep every word without holding the
session. The pipeline never rewrites a streamed audio.wav from empty
samples, an iPhone narration is read back where it must be re-based,
and a cancelled capture closes and removes its file.
* capture: say where a capture's audio stopped
A streamed capture keeps all of its audio, but the 8-hour disk guard (or
a failed audio write) still stops it early, and only the process log
said so. The timeline now carries the stop point onto RecordedAudio,
the bundle stores it as audioStoppedAtMs (serde default, so old bundles
load unchanged), and three places say it plainly: summary.md, `hex
capture show`, and `hex capture status`.
The guard records its point at a 1 s test limit, and the summary line is
tested at 12:34 and 8:00:00 so both clock shapes are covered.
* capture: fill the replay's stop point from its bundle
The 15 s replay builds Written too, on macOS only, so the new field
broke the macOS clippy job while Linux never compiled that function.
* capture: keep a recording out of recovery until it stops
Review fixes for the streamed timeline.
A capture now streams to `audio.wav.partial` and renames it to `audio.wav`
in `Timeline::finish`, so a bundle with a movie and an in-progress audio
file is never mistaken for a capture whose build never ran (recover's
orphan rule, Scrawl.app's `scrawl recover`) and retention cleans a crashed
one like any other bundle. Cancel and discard remove the partial; a failed
publish reads it back into memory rather than pointing at a missing file.
Also: a write failure's stop point is the last sample that reached the
file, not the end of the failed chunk; a trim failure counts every written
sample; the capture's words keep one running frame total instead of
adding truncated per-piece millis; an iPhone narration's `since` drains the
decoded samples instead of copying them and treats a missing file as no
audio; the phone and replay paths carry the audio stop point into their
bundles; and empty audio answers `source: "none"`, as `transcribe_with`
does.
Tests: a movie plus partial audio is never owed, retention trashes a
crashed bundle's media, a write failure records its stop point, a missing
streamed file shifts to no samples, and the replay shift moves the stop
point with the clock.
* capture: publish audio.wav only once its build journals the capture
Follow-ups from review.
A capture now streams to audio.wav.partial and keeps that name after it
stops: the partial is renamed to audio.wav right after the build writes
unfinished.json, so audio.wav never exists without a journal, and a
stopped capture waiting in the finish queue no longer looks like an
orphan to Scrawl.app's recover. A partial that cannot take the name is
read back and written by the build, and its partial name removed; the
replay removes the unshifted partial once the narration is read for
shifting.
Also: a periodic header flush error is now a write failure (the rest of
the capture is a gap) rather than a log line; the midpoint of a failed
write records where the file stopped; and the words test cuts pieces at
odd sample counts and computes offsets from the running frame total, so
per-piece millisecond drift would fail it.
Tests: a streamed audio takes its final name only when the build settles
it (and falls back when it cannot), a capture that has not been
journaled is never owed a rebuild, a mid-capture write failure stops
where the file stopped, and the word offsets are exact at odd piece
lengths.
* capture: consume a streamed recording's partial when it is read
Follow-ups from review.
`RecordedAudio::since` and `into_memory` now remove the partial once its
samples are read: an iPhone narration (capture.rs's `host_narration`
path) used to leave the whole streamed file in the finished bundle. The
replay relies on the same path instead of removing it by hand, and the
light zip leaves `audio.wav.partial` out defensively. A read that fails
is an error to `into_memory` (so a build keeps the only copy) while
`since` still treats a missing file as no audio for an iPhone.
A failed publish now reads the audio back only when it produced the
samples the recording had; a failed read keeps the partial and removes
any half-copied `audio.wav`. `publish_audio` takes `&mut self` and points
the recording at the published file.
A journaled bundle whose `audio.wav` is missing adopts `audio.wav.partial`
before rebuilding. Docs say the guarantee is a streamed capture's, and
that a crash while recording or queued is retention's job, not
recovery's.
Tests: reading a streamed recording consumes the partial; a finished
iPhone bundle keeps none; a streamed audio is published only when its
build settles it, including the read-back and unreadable-partial cases; a
journaled capture adopts its partial.
* capture: keep a failed audio publish recoverable
Follow-ups from review.
The publish fallback read the partial with `into_memory`, which deletes
it, and then ignored whether its own write landed: a failed write left
the audio nowhere. It now reads through `read_streamed` (no deletion),
writes `audio.wav` and checks the result, and removes the partial only
once that write succeeded. A failed read or write removes any half
`audio.wav` and fails the build, which is the pipeline's existing failed
path: `recover::finished` runs only for an `Ok` build, so `unfinished.json`
stays and the next launch's recovery adopts the partial instead of the
capture quietly finishing without its audio.
`publish_audio` also treats a landed copy as success even when deleting
the partial fails, logging it rather than reporting failure and letting
the fallback overwrite a good `audio.wav`.
Tests: a blocked target keeps the partial and fails the build; a
fallback write that lands consumes the partial and writes `audio.wav`;
an unreadable partial is kept.
* fix(cli): transcribe long files in pieces (#1769)
* fix(cli): skip silent pieces and refuse truncated files up front
* fix(cli): unique test files, honest read refusals, no detector download
* fix(settings): merge edits through one persistence owner (t1533)
* fix(modes): focus the adopted correction without duplicating it (t1533)
* fix(settings): publish reversions even before the host saw the save (t1533)
* cli: hex dictation start --print keeps a dictation from pasting (labs)
A client that starts a dictation to insert the text itself loses it when
the person finishes the locked recording with the shortcut, or when a
microphone loss salvages it: Hex pastes or copies into the focused app.
`hex dictation start --print` (macOS, behind Labs › Print-only CLI
dictation / `labs.print_start`) blocks and answers with the transcript
however the recording ends, so nothing is pasted or copied. It is busy
while a dictation records, a plain `stop` answers done, `stop --print`
joins the same transcript, no speech exits 4, a cancel or failure exits
1, and it waits at most 31 minutes. Linux and Windows answer
unsupported; CONTROL_VERSION stays 4.
# Conflicts:
# src/labs.rs
# src/rune_ui/labs.rs
# tests/golden/rune-mac-labs-dark.png
# tests/golden/rune-mac-labs-light.png
# tests/golden/rune-mac-labs-link-dark.png
# tests/golden/rune-mac-labs-link-light.png
* cli: harden hex dictation start --print's endings
# Conflicts:
# src/labs.rs
* cli: bind the printing-start test's shortcut to Option
* labs: regenerate the Labs goldens for both new cards
* add hex transcribe for saved wav files (labs)
`hex transcribe <file> [--model] [--language]` prints a WAV recording's
transcript from Labs › Transcribe files, off by default. A running Hex
transcribes it on its dictation engine over the local API; with Hex stopped,
Linux and Windows load the model here and macOS answers not-running.
* fix hex transcribe refusals, read cap, and docs (labs)
- name a failed POST /transcriptions by the code in Hex's JSON body,
with one message per server code and status only as a fallback
- say the lab is managed instead of naming `hex labs on` under a lock
- read through the 64 MiB cap and reuse those bytes offline
- document that clips up to 30 s use the engine's model and longer
ones the service's own copy
- cover an early refusal during a large upload with a loopback test
* cli: select the model after an offline `model install`
With Hex stopped, `hex model install` downloaded and verified the model but
never wrote the selection, so `model status`, `check`, and `transcribe` kept
using the previous one, and no message said so.
The offline branch now selects it as the app's own switch would: a Hex that
started while the download ran takes the choice over `model use`, otherwise
the selection is saved under the Linux service lock `settings apply` uses,
so a starting Hex is never written behind. An already selected model is left
alone, so login-time installs don't rewrite settings.json.
Docs say the offline install selects now, and a new app_settings test covers
the persisted round trip keeping unrelated settings.
* cli: wait for a starting Hex before selecting an installed model
`model install` with no Hex running saved the selection under the
service lock, and failed at once when a Hex already held it. Wait for
that Hex to answer instead, as `settings apply` does, through one
shared hand-off so the two paths can't drift. An unchanged selection
answers without taking the lock.
* Add Labs terminal paste shortcut for Windows and Linux
* fix windows build: drop the unused key_down from input/modifiers
* allow the terminal-paste shortcut code to go unused on macos
* mask the second shortcut's menu modifier on auto-repeats
the mask was only set on the first press, so process_button cleared it on each
repeat key-down and a held capture over the repeat delay leaked a bare alt/win
release. set it on every trigger key-down like the dictation key and paste
last do.
* keep side_matches private
* keep the shortcut and dictation helpers under the source cap
windows/dictation.rs, rune_ui/general.rs, and linux/dictation.rs crossed 1,500
non-test lines after the rebase. move the registered-shortcut tables and the
General pane's shortcut rows into submodules, and refresh the Linux Labs
golden for Transform typed text and Terminal paste shortcut.
* call the global setting Terminal paste in typed text's refusal
the lab now owns the name Terminal paste shortcut, so the typed-text errors
and log line must name the global paste_with_shift setting instead.
* drop the terminal paste lab's unused encoded bit
no accessor reads it and no other lab has a bit without a reader; the feature
reads its saved switch directly through Feature::on.
* raw dictation has a hex command; the terminal paste shortcut does not
* feat(linux): labs transform typed text shortcut (#1519)
* fix(linux): harden typed-text clipboard handling
* fix(linux): keep dictation clipboard fallback, sync typed-text keybinding
* refactor(control): keep shortcut text in its own settings module
settings.rs crossed the 1,500-line limit when Labs added the typed-text
key; the shortcut text parsing and formatting is the one self-contained
concern, so it moves to settings/hotkeys.rs unchanged.
* fix(linux): name the missing wl-copy before a Wayland paste
* fix(linux): address review on wl-copy warning
* fix(settings): show the wl-copy notice apart from dictation failures
* Remove dictation cancel: Escape ends nothing (#786)
* Format and refresh the sound sets and commands goldens
* Release Escape before finishing in the held-capture test
Records like the dictation shortcut and pastes the transcript as heard,
skipping replacements, corrections, transformations, and rewriting. Unbound
by default; set in the Output pane, raw_dictation_hotkey, or
hex dictation start|toggle --raw. History keeps it as Raw.
Suggested by @ksajan.
Linux and Windows now hand the local API's POST /control to the shared
control host, so the CLI reaches every OS through local-api.json and
call_control. The Linux socket's Request::Control and the Windows named
pipe (windows_control) are gone.
* One hex control CLI and protocol on every OS
One command tree (control::cli) on macOS, Linux, and Windows, carried by
each OS's owner-only transport: the macOS local API, the Linux socket's
Request::Control, and a new Windows named pipe (windows_control) that only
this user's SID can open and whose server the client verifies. Linux and
Windows share one host (control::host) through thin adapters; what an OS
can't do answers unsupported at runtime.
Windows gains dictation (with stop --print), paste-last, quit, restart,
start, a live status, and every annotate command; Linux and Windows gain
settings, model, window, vocabulary, history clear, check-for-updates,
launch-at-login, onboarding reset, logs, commands init|check, and annotate
status. hex status reports the OS's capabilities, settings name the
capability they need (set refuses, list marks), and a parity test requires
a recorded reason for every capability that differs across OSes.
* Windows control pipe: always hold an unconnected instance; check the client's user
* Shared control: meetings, history, and mcp on every OS now that the meetings store does
* Labs: a flat list of per-feature toggles, each off by default
* wip
* Labs: playground item from the window's launch state; Windows terminal paste test
* Labs: docs, AGENTS.md, goldens
* Rename voice-control to hex everywhere, without migrations
The Cargo package and binary are now hex, every OS keeps its data in a
hex folder, and VOICE_CONTROL_* variables are HEX_*. Hex is a fresh
app: the macOS voice-control rename, its symlink, and the Windows and
Linux beta settings imports are gone. The Windows installer gets a new
AppId so it never takes over an old voice-control install's entry.
* Format
* Drop the Windows paste-last default only the beta import used
Settings becomes General: Dictation, Output, and Application cards that fit
the default macOS window, with Microphone mode and Double-tap only behind an
Advanced disclosure. Shortcut mode and Double-tap to lock stay separate;
Double-tap to lock shows only for Hold. Check for updates moves under the
sidebar version, and the Voice Action shortcut lives only in its pane.
Each feature owns its settings: Meetings is always in the macOS sidebar
with a Recordings | Settings switch (Call recording, Calendar, Detected
calls) and an opt-in card while off; `hex window show meetings` opens it
instead of refusing. Commands gets an enable card and its model-failure
notice. Fun becomes Voice Filter, the only home of the Hex Microphone,
under a new Experiments sidebar group behind the `voice-filter` experiment
(or when the microphone is already on or installed), beside the debug HUD
Lab and Activity.
No setting changes meaning or loses its `hex settings` key. Captions that
restated their label are cut; new strings carry all five translations.
`hex window show settings` and status `window.pane` keep "settings".
Hex polls anoma.ly/release/hex/desktop/<channel>.json on every OS and decides
with the release protocol's client rules (the service's shared test vectors in
tests/fixtures/release-protocol): strictly newer unless revoked, the minimum
version before rollout, and a device-local rollout bucket that is never sent.
Direct installs (Linux and Windows with the installer's receipt, macOS a
replaceable Hex.app) download resumably, check size and SHA-256, then the OS
code signature (macOS app/update-requirement.txt: Developer ID 5NZ4Q7NXJ4,
anomaly.hex, notarized; Windows Authenticode from Anomaly's Artifact Signing
identity), and stage the update for Restart to update. macOS swaps the bundle
in with renamex_np(RENAME_SWAP) at restart or quit; a read-only location links
to the DMG. Package-managed installs show their manager's command; source and
test builds never check; DisableUpdates (macOS defaults, Windows policy key)
turns checks off.
Sparkle, its framework, Info.plist keys, appcast generation, and the ed25519
feeds are gone. release-app.sh prepare leaves Hex-<v>-macos-arm64.dmg and .zip
(root Hex.app). Macs on 2.3.1 get packaging/macos/legacy-appcast.xml: one
informational item linking to anoma.ly/hex.
- CLI dictation and Voice Action starts are intentional at once: the
recording environment and live stream start, the start tone plays once the
microphone is open, and a stop that discards the clip replies `discarded`
instead of "transcribing".
- `hex model use` takes the installed-only path with the model's remembered
language and hints; `--language` is checked with `validate`, so wildcard
models no longer accept any string.
- `hex start` and `hex restart` forward every HEX_* variable through
`open --env` (start from the caller, restart from the running app).
- An unforced quit or restart refuses when the listener can't answer.
- An idle cancel refuses while the other capture records, keeping Escape's
order.
- Paste Last needs a ready listener and refuses while anything records or a
shortcut gesture is pending.
One versioned protocol (src/control.rs) carried over the authenticated
POST /control route: status, start/quit/restart, dictation and Voice Action,
paste-last, meetings record/stop/copy-last, every persisted setting, models,
window, Commands, history clear, update checks, launch at login, and logs.