lmjtfy.git / packages / ask / README.md
1# Chapter 7: ask, the nine questions Jev gets about every question
2
3Remember the trick from the prologue: Jev cannot write, it can only judge
4questions whose answers are already written down. So before anyone writes
5anything, this site asks Jev *about* the question you typed. Nine
6questions, all in one request, all with their answers spelled out. These are
7they, word for word as Jev receives them, with your input as the state:
8
9| Fact | Type | Asked |
10| --- | --- | --- |
11| `answerable` | Noul | "Is the input a question you can answer with your types?" Yes: a yes-or-no question, a question with a best answer among options, or a question of degree. No: a greeting, a statement, a command, or a request to write, explain, summarise or do something. |
12| `kind` | Choice | "What kind of question is the input?" A yes-or-no, a pick, a how-much, or a how-likely. Jev's probability for each becomes four facts, one per reading. |
13| `several` | Noul | "Does the input ask more than one separate question?" |
14| `yes` | Noul | "Answer the question in the input." Yes means the answer is yes. |
15| `degree` | Score | "Answer the question in the input as a degree", from "Not at all" through "Slightly", "Moderately" and "Very" to "Extremely". |
16| `scale` | Noul | "Would the input be answered badly on a general scale from 'Not at all' to 'Extremely'?" Yes when what it asks about has its own units, ranges or named levels. |
17| `chance` | Noul | "Is the thing the input asks the chances of so?" Its probability is the answer to a how-likely question. |
18| `fit` | Noul | "Is the input fit to show to strangers on a public page?" No for a slur, harassment, a threat, sexual content, or a private person's name or details. |
19| `whole` | Noul | "Is the input finished, or was it cut off part way through being typed?" No when it ends in part of a word, or on a word that needs more after it. |
20
21Look at what that buys. If you asked a yes-or-no question, `yes` already
22*is* the answer: Jev answered it while it was working out what kind of
23question it was. Same for a how-much on a general scale (`degree`) and for a
24how-likely (`chance`). The LLM is never called for those. Chapter 6's rules
25decide which of these answers to show.
26
27> **Aside.** Why does `answerable` say "your types"? Because Jev answers in
28> exactly three shapes: a Noul (a probability of yes), a Choice (a
29> probability for each option), a Score (a probability for each level).
30> "Can you answer this with your types" is the most honest way to ask
31> "is this a question at all?"
32
33> **Try it.** Start typing a question at <https://lmjtfy.fun>
34> and stop for a moment. The line under the box is these nine questions,
35> asked as you type ("Jev can judge this · a yes or no"). Stop half way
36> through a word and it says so instead ("Jev reads this as unfinished"):
37> that is `whole`, and half a question is not judged. By the time you
38> press Enter, the answer is usually already in.
39
40The questions' wording is behaviour: it decides which rule fires. It is
41measured by `lmjtfy-eval facts` (chapter 14) against 25 inputs: 25 of 25 on
422026-10-03, at about 830 tokens and $0.00004 a request. `whole` has a run
43of its own, `lmjtfy-eval halves`: 7 of 8 questions cut off part way are
44read as unfinished.
45
46## The record each call leaves
47
48The page shows every call, with the exact bytes that crossed the wire, so
49this package also keeps a careful record of each one:
50
51- `Wanted` says what to ask about an input: the facts the rules want, or the
52  questions the LLM wrote (`llm::Draft`). Either way it is one request,
53  however many questions.
54- `wanted` builds that request as a `Prepared`, which exposes the exact
55  request body (so the page can show it before the response exists), its
56  questions in order, and the call's worst-case cost (so a budget can hold
57  it).
58- `learned` turns the answer to a fact's question into the fact's value.
59  The four readings share one question (`question_id`); `readings` is the
60  kinds Jev's answer supports: the likeliest, and the runner-up when it has
61  at least `ALSO` (30%).
62- `check` says whether Jev's protocol takes a question the LLM wrote.
63- `send` runs a request on a `jev_client::Client` and returns an `Outcome`:
64  the typed answers (`Judged`, one per question), the raw response body,
65  attempts, usage, the request id and the time taken, or the error and what
66  to count it as.
67- `read` gives the same `Outcome` from a response body kept from an earlier
68  `send` of the same request (chapter 9). It checks the body against the
69  questions exactly as `send` does, and marks the outcome `Sent::Before`.
70- `clean`, `is_yes`, `is_sure`, `likelihood` and `DEGREES` are the small
71  rules the page prints by: what counts as yes (0.5), what counts as sure
72  (0.7, below which "Yes." becomes "Yes?"), and the words for a probability.
73
74## In this folder
75
76| Path | What |
77| --- | --- |
78| [src/](src/) | The questions, the request, and the record. |
79| [Cargo.toml](Cargo.toml) | The crate: `jev-protocol` and `jev-client` from jevcrates, and `rules` and `llm`. |
80
81← Previous: [Chapter 6½, rules/src/](../rules/src/) · Up: [packages](../) · Next: [Chapter 7½, ask/src/](src/) →