Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/hop/tree/main/Omega # hop Hop: a small native macOS launcher. Clipboard history, find, on-device dictation and your coding agent behind one key. Brought by drakestapleton Sign in to star 1 stars 1 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `hop / Omega` `dce324f` Answers to the tenth review of hop/pick (Codex, MERGE_AFTER_FIX on `386d0a16`, three low findings): the contract says when a seat is replaced and which Claude seats exist; the replacement test counts the proposals Drake Stapleton committed 2026-11-12 ``` .. tests/ ui/ FUSE.md 23390 README.md 44766 gen-core.sh 3519 gen-ui.sh 3506 gen.sh 3722 hopcore.om 97566 hopfact.om 7794 hopfuse.om 12289 ``` README.md # Omega in Hop Hop is being moved into Omega, piece by piece. Two pieces are Omega today: `hopcore` (the core: names, paths, text decisions, corrected words and the Swarm logic, below) and `hopfact` (the factory command-center core, after it). The windows, keys, microphone and Keychain are still Swift. # hopcore: the matching core `Omega/hopcore.om` decides what matches what you type in the one box, and how well. It is compiled by Omega NG, the next Omega compiler, which is itself Omega built by the seeded compiler: source to ΩIR (`@ng front-ir`), the optimizer (`@ng opt`), then a macOS arm64 program (`@ng a64 macho`). The result, `Generated/hopcore`, is copied into the app beside Hop and signed with it. No C and no Swift is involved in the matching rules. The old seeded compiler cannot build this unit (error 12, its 16-register limit); Omega NG can. Hop starts `hopcore` once and talks to it over a pipe. `Sources/OmegaCore.swift` is the whole host side: it lowercases the text, turns each character into one number, sends cases and reads answers. If the core cannot be started Hop shows no app matches; it never falls back to a guess. ## Protocol A request is 8 bytes, then a body: the kind and the body's length n, both 32-bit little-endian; n is at most - The answer is 8 bytes, then a body: a status and the length m. Status 0 is an answer, 1 an unknown kind, 2 a malformed body (m is then 0). A body over the limit or a short read ends the core; Hop starts a fresh one. ### Kind 1: names The body is 1 to 512 cases of 2048 bytes: 256 little-endian 64-bit words. Word Meaning 0 magic `1212568922` 1 version `1` 2 number of characters typed, 0 to 64 3 number of characters in the name, 0 to 184 4..7 `0` 8..71 the typed characters, then `0` 72..255 the name's characters, then `0` A character word: bits 0..31 an id (equal characters get equal ids, never 0; a space is 32), bit 32 set for a letter or number, bit 33 set for white space that is trimmed from the ends of what was typed. The answer is 3 bytes a case: the verdict (0 no match, 1 match, 2 the case was malformed or over the limits), then the score, low byte first. A longer text is refused, never cut short. ### Kind 2: paths Scores paths found on another machine against the typed terms. All fields are 16-bit little-endian: the number of terms (at most 64), the number of paths (at most 16000), each term as its length then its bytes, then each path as three lengths (its lowercased bytes, the lowercased bytes of its last component, the path as written), the path bytes and the name bytes. Hop does the lowercasing and finds the last component; the terms are used as given. The answer is 4 bytes a path, a 32-bit little-endian number: 0 for no match, else the score plus `1000000`. ### Kind 3: text decisions The body is four 32-bit little-endian numbers (the op, the number of characters n, at most 16384, a number the op uses, and a second such number), then one 8-byte word per character of the lowercased text: a 32-bit id (equal characters get equal ids; a character of one Unicode scalar has that scalar's number), then a flag byte (1 letter or number, 2 trimmable white space, 4 white space, 8 white space or line end, 16 the last character of a run) and three zero bytes. Op Question Answer 1 Is this a question for the model? It ends with "?" and is longer than that, or it has three words or more and starts with a question word. one byte, 0 or 1 2 Which words should be searched for? Three characters or more, common words left out, each once, the longest four, longest first. a count, then for each word where it starts and its length, as two 16-bit numbers 3 Is this a web address? The third number is the text's length in bytes. one byte: 0 no; 1 it starts with http:// or https://; 2 a bare address such as example.com/page 4 How alike are two spellings? The text is the first, then the second; the third number is the first one's length. Only letters and numbers count. two 16-bit numbers: the single-character edits between them, and the longer length. Hop divides to get 0 to 1. 5 Which typed words are the fix for what was heard? The text is what was heard (the third number is its length), then the first typed word, the first two, the first three and the first four; flag 16 marks the last character of each run. The fourth number says which runs are the very text that was heard (bit k-1). one byte: which run (1 to 4), the most alike, the shorter among equals; 0 for no fix (less than half alike, or nothing changed); 255 when a spelling has more than 4096 letters and numbers For op 3 Hop then asks macOS whether the address parses (and, with a scheme, names a machine). That last step is Apple's parser, so it stays in Swift; the word lists and every other rule are in the Omega source. ### Kind 4: corrected words After Hop types a dictation into a field, it reads the field again later. Hop splits three texts into words (what was dictated, the field before, the field after), drops the punctuation around each word and gives equal words equal numbers. The body is three 32-bit little-endian counts, then that many 32-bit word numbers for each text. The core finds the dictation in the field (its last whole occurrence), sets aside the words that are the same at both ends, lines the rest up word by word (longest common subsequence) and answers a 16-bit count, then 14 bytes a replaced run: where the removed words start in the field before (32-bit), how many (16-bit), where the typed words start in the field after (32-bit) and how many (32-bit). A run counts when 1 to 3 words were removed, all of them inside the dictation, and something was typed in their place. The answer is empty when the dictation is not in the field, when the changed part is too large (words before times words after over 250000), or when more than half of the dictation was removed (a rewrite, not a fix). Hop then asks kind 3 op 5 which of the typed words are the fix. ### Kind 5: a board line, a time A swarm's board is a text file with one post a line (`