interplane.Get Omega
Read in your language

hop

Hop: a small native macOS launcher. Clipboard history, find, on-device dictation and your coding agent behind one key.

Brought by drakestapleton

branch main Branches Tags History

hop / Omega / FUSE.md

167 lines · 23390 bytes Raw Blame History Source

hopfuse: how Hop picks minds and judges their answers

Hop chooses who answers, for every message; there is no model or agent to pick. You say what you want; Hop sorts the request, hands it to the cheapest mind that should be good enough (your own model first, when it is there and the request is something to answer), hands it on to a stronger one when the answer is not sure, and for open-ended work asks several minds from different makers at once and fuses what they say. The choosing is done by one piece of seeded Omega, Omega/hopfuse.om, linked into Hop as native code through the binding in Generated/, the same way as hopfact (see Omega/README.md).

The design follows spec/cognitive-routing.md in omega-mv: a requirement, the cheapest ladder expected to meet it, a bounded number of escalations, an ensemble class, and a refusal in place of a silent approximation. It does not use that spec's measured profiles: Hop has no labelled trials for the tools on your Mac, so tiers and costs are stated in the settings and the plan says when it is working without what it wanted (word 12 below).

Who does what

The core (Omega/hopfuse.om) decides the shape of the work among the seats it is shown (PLAN) and whether a round of replies is agreement (JUDGE). It runs nothing, holds no state between calls and allocates nothing.

The host is Swift (Sources/Fusion.swift; the Agent screen reaches it through Sources/Pick.swift, the command line through hop fuse). It finds the seats, runs them, reads their replies and shows the result. It also decides things the core does not, and each of them is listed under "What the host does" below: which mind sorts a request, that the person's own model is shown to the core alone first, when a reply counts as unsure, what "Stronger" hides from the core, and that a plan the minds did not agree on is not carried out.

What the minds say to each other

A mind ends its reply with a small Omegese record, and the next step is decided from its numbers, not from its prose:

note hop record
fn confidence to ulong
ret 870000
end

The host reads only fn NAME to ulong, ret N, end after the marker line note hop record; anything else ends the record. A record is a valid Omega unit body: the same lines compile with omc. The host does not run a compiler on it.

Records in use:

StepFunctionsMeaning
Sortingkind 1..3, difficulty 1..5, stakes 1..3, confidencewhat the request is
An answer or a proposalconfidencehow sure the mind is, in parts per million
A reply to a fused draftdeltas, agree 0 or 1, confidencehow many changes it asks for, and whether the draft should stand

In a reply to a draft, silence is agreement: a mind that agrees writes nothing but the record, and only the changes asked for travel back to the mind that fuses.

What this is not: the minds are separate programs, each either a model server asked over HTTP or an agent tool started as a command, of different makers or of one. They exchange text. Nothing of one model's internal state reaches another.

Native ABI (bridge native call ABI v1, profile OM-1)

/* fn hopfuse inp view ulong 256 res edit ulong 256 to ulong */
uint32_t omega_hopfuse(uint64_t *result, const void *o_inp, uint64_t o_inp_len, void *o_res, uint64_t o_res_len);

Lengths, alignment, status codes and threading are as for omega_hopfact (Omega/README.md). The host shows any nonzero status as INVALID.

Input inp[256]

WordPLAN (word 2 = 1)JUDGE (word 2 = 2)
0, 1magic 1212568915, version 1the same
3number of seats, 0 to 16number of replies, 0 to 8
4kind: 1 answer, 2 make, 3 act (changes things)rounds already done, 0 to 3
5difficulty: 0 unknown, 1 trivial, 2 simple, 3 standard, 4 hard, 5 open-endedmost rounds, 0 to 3
6stakes: 0 unknown, 1 low, 2 normal, 3 high0
7how sure the sorting was, 0 to 10000000
8most seats at once, 1 to 80
9most escalations, 0 to 30
10flags: bit 0 the host already has the exact answer, bit 1 fuse, bit 2 never fuse0
11..1500
16+6r .. 21+6rseat r: id (unique, at most 65535), tier 1..4, family 1..31, cost up to 1000000, state (0 unknown, 1 ready, 2 limited, 3 down), capabilities (bit 0 answers, bit 1 acts)reply r: seat id, status (0 unknown, 1 answered, 2 failed, 3 timed out, 4 no record), confidence, deltas up to 1000, agree 0 or 1, 0
rest00

Output res[256], PLAN

-1 means all bits set: none.

WordMeaning
0, 1magic, version
2verdict (equal to *result)
3reason: INVALID see below; REFUSED 80 no seat is ready, 81 seats are ready but none can do it
4INVALID: the first faulting input word
5wanted tier
6the difficulty the plan meets, after raising
7number of chosen seats
8the seat that fuses (-1 when none)
9the seat that carries out fused work that changes things (-1 when none)
10rounds of replies to the draft: 1, or 2 when the stakes are high
11sum of the chosen seats' costs
12why the plan is what it is: 1 the difficulty was unknown, 2 the sorting was unsure, 4 high stakes, 8 a fusion was wanted and could not be formed, 16 no seat of the wanted tier, 32 a limited seat is used
16+ichosen seat ids, in the order they are asked
32+srole of input seat s: 0 not used, 1 chosen, 2 fuses only, 3 carries out only, 4 may not be chosen (unknown or down)

Verdicts:

VerdictNameWhen
1INVALIDthe input is malformed; only words 0 to 4 are set
2REFUSEDno seat can do it; nothing is approximated
3DIRECTthe host already has the exact answer; no seat is asked
4SINGLEone seat
5LADDERone seat, then stronger ones if its answer is not accepted
6FUSIONseveral seats at once, one that fuses

Rules, in order:

  1. An unknown difficulty counts as standard, never less. A sorting that was not sure (under 600000) raises the difficulty one step, to hard at most. High stakes raise it one more step.
  2. The wanted tier is the difficulty, and 4 for hard and open-ended.
  3. A seat whose state is unknown or down is never chosen. A limited seat is chosen only when no ready seat can do the work.
  4. Work that changes things goes only to a seat that can act.
  5. A fusion is wanted for open-ended work or when the user asks for one, unless the user forbids it or only one seat at a time is allowed. Its proposers are seats of tier 3 or 4 that can answer, one per family first (ready before limited, then the higher tier, then the cheaper), at most as many as allowed; if that gives fewer than two, one more of a family already used may join. With fewer than two it is not a fusion: the plan falls back to a ladder and says so (word 12, value 8).
  6. A ladder starts at the cheapest seat that has the wanted tier. Each escalation is the cheapest seat of a higher tier than the rung before. When no seat reaches the wanted tier the strongest one is used and the plan says so (word 12, value 16).

INVALID reasons: 1 magic, 2 version, 3 operation, 4 a word with bit 63 set, 5 a count over its limit, 6 tier, 7 family or agree flag, 8 duplicate id, 9 capability mask, 10 nonzero padding, 11 too many rows, 12 a header word out of range, 13 a reserved header word is not 0, 14 state or status code, 15 id over 65535.

Output res[256], JUDGE

WordMeaning
2verdict
5usable replies (status 1)
6changes asked for, in all
7lowest confidence among the usable replies (-1 when none)
8replies that do not agree
16+iseat ids of the usable replies
32+rreply r: 1 agrees, 2 does not agree, 3 not usable

A reply agrees only when it says so and asks for no change. A reply that says it agrees and still asks for changes does not agree. An unknown status is never agreement.

VerdictNameWhen
7CONSENSUStwo or more usable replies, all agree
8ANOTHER_ROUNDsome do not agree and rounds are left
9SETTLEsome do not agree and no round is left: the changes are applied once more and what stays unsettled is said
10ONE_VOICEone usable reply
11NONEno usable reply

What the host does

Before the plan:

With a plan:

Limits