qriton 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,22 @@
1
1
  # Qriton CLI
2
2
 
3
- A coding agent for your terminal that runs on infrastructure you control. Use a local model on your own machine, or any major model API, in the same session: your conversation, approvals and project memory stay with the work when you switch models.
4
-
5
- It is also home to **[Qriton HLM](https://hlm.qriton.com/)**, our own open models: run them on your machine and teach them, correct them or make them forget, with every change checked and reversible.
3
+ A coding agent for your terminal and paired iPhone, running on infrastructure you control. Use a local model on your own machine, or any major model API, in the same session: your conversation, approvals and project memory stay with the work when you switch models.
6
4
 
5
+ Use **[Qriton HLM](https://hlm.qriton.com/)** to work with Qriton's published models in the same project: set up a Python runtime, download verified weights, edit runner code, and inspect saved results.
7
6
  ```bash
8
7
  npm install -g qriton
9
8
  ```
10
9
 
11
- ## What's new in 0.4
10
+ ## What's new in 0.5.1
11
+
12
+ - **Energy workbench on qriton-hlm 0.13.0.** Edits are written at the target, projected away from the layer's protected basins and gated by Energy Language's decision check; inject and remove accept `auto` strength. Apply approvals lead with the measured collateral and warn when the protected set is empty. Energy Language is validated as an editing method on synthetic landscapes only: on trained HLM3 checkpoints no measured edit was local enough to keep ([measurements](https://github.com/qriton/energy-lang/blob/master/RELEASE_NOTES.md#trained-weights)).
12
13
 
13
- - **Windows.** Runs natively on Windows, using PowerShell 7 or `cmd.exe`.
14
- - **A backup plan for your model.** A dropped connection or overloaded service is retried by itself, and you can list backup models to switch to, with or without asking first. [More](#choose-a-model)
15
- - **Checked changes.** After editing, the model is asked to test its change before it says it is done.
16
- - **Several qritons, one team.** Qriton instances on different machines can see each other and pass messages, end-to-end encrypted, over your local network or an internet relay. [More](#several-qritons-on-one-network)
17
- - **Safer by default.** Stricter rules for which commands run without asking, and a clearer approval for each one.
14
+ ## What's new in 0.5.0
15
+
16
+ - **Guided HLM setup.** Preview and install a Python runtime and starter project for supported HLM5 models.
17
+ - **Editable model projects.** Work on runner code, execute registered commands, and review saved outputs from the CLI or coding assistant.
18
+ - **HLM facts in coding tasks.** Discover saved facts and verify their current answers with local model inference.
19
+ - **Clearer recovery.** File tools provide guidance for recoverable path mistakes, and transient Ollama failures use the configured retry policy.
18
20
 
19
21
  ## Get started
20
22
 
@@ -43,38 +45,96 @@ On a smaller machine, `qriton --light` runs a lighter session: a smaller context
43
45
 
44
46
  ## Qriton HLM
45
47
 
46
- HLM is Qriton's own family of open language models, and qriton is where you work with them. Run an HLM model locally, then change what it knows: teach it a fact, correct one, or make it forget. The model's weights never change. Each edit is a small, separate memory that you preview before it applies: qriton shows the model's real answer before and after, checks that other facts and unrelated prompts are unaffected, and refuses edits that fail. Any edit can be undone exactly.
48
+ Create a workspace for a supported HLM5 model. Guided setup requires Python
49
+ 3.10–3.12; model weights are downloaded separately from Hugging Face.
47
50
 
48
51
  ```bash
49
- qriton hlm catalog # the HLM models available
50
- qriton hlm fetch hlm5-1b # download and verify (about 4.2 GB)
51
- qriton hlm predict hlm5-1b "The capital of France is"
52
+ mkdir my-hlm-project
53
+ cd my-hlm-project
54
+ qriton hlm setup # list supported models
55
+ qriton hlm setup hlm5-1b # preview runtime and project setup
52
56
  ```
53
57
 
54
- An edit is one line in a small file:
58
+ Review the plan, then copy its printed apply command, including the fingerprint:
55
59
 
56
60
  ```text
57
- memorize "The capital of Veldoria is" " Paris"
61
+ qriton hlm setup hlm5-1b apply <fingerprint>
58
62
  ```
59
63
 
64
+ Download the model and run it:
65
+
60
66
  ```bash
61
- qriton hlm preview hlm5-1b edit.hlm controls.json # check it before anything changes
62
- qriton hlm apply <proposal-id> # use it
63
- qriton hlm compare hlm5-1b "The capital of Veldoria is" # original model versus your edits
64
- qriton hlm restore <proposal-id> # go back exactly
67
+ qriton hlm fetch hlm5-1b
68
+ qriton hlm doctor
69
+ qriton hlm run hlm5-1b -- --prompt "Once upon a time" --tokens 16
70
+ qriton hlm runs
65
71
  ```
66
72
 
67
- | Model | Size | |
68
- |---|---|---|
69
- | `hlm5-1b` | 4.2 GB | run and edit |
70
- | `hlm5-1b-hybrid` | 4.2 GB | run and edit, with a trained memory component |
71
- | `hlm5-3b` | 10.8 GB | run |
73
+ Setup creates an environment and editable Python code inside your workspace.
74
+ Open Qriton there and ask it to inspect or change
75
+ `.qriton/hlm/project/model/run.py`, run the model, and review its output.
76
+ Start a new coding session after setup to load the updated settings.
77
+ The guided runtime uses CPU inference. See the [setup guide](docs/hlm-setup.md)
78
+ for interpreter selection, disk requirements, and supported platforms.
79
+
80
+ | Model | Download size | Workbench support |
81
+ |---|---:|---|
82
+ | `hlm5-1b` | 4.2 GB | Completion and memory edits |
83
+ | `hlm5-1b-hybrid` | 4.2 GB | Completion and memory edits |
84
+ | `hlm5-3b` | 10.8 GB | Completion |
72
85
 
73
- Learn more at [hlm.qriton.com](https://hlm.qriton.com/); the models are on [Hugging Face](https://huggingface.co/qriton). HLM runs in Python, separately from the coding assistant: run `qriton hlm` for setup and `qriton hlm doctor` to check it. The same commands work inside a session after `/hlm`. For HLM3 checkpoints, `qriton energy` offers the same preview, apply and restore workflow in Energy Language.
86
+ **Existing projects.** Select a compatible registry with `hlm.projectRegistry`
87
+ in user configuration, then run Qriton in that model workspace:
88
+
89
+ ```text
90
+ qriton hlm projects # browse registered projects
91
+ qriton hlm project <id> # inspect a runner and required files
92
+ qriton hlm run <id> # execute its registered command
93
+ qriton hlm runs # review saved outcomes
94
+ ```
95
+
96
+ The coding assistant can inspect and edit these projects and request approval
97
+ to run their commands. Other architectures and custom checkpoints need their
98
+ own loaders and registered runners. See [existing model projects](docs/hlm.md#work-with-existing-model-projects).
99
+
100
+ **Editable memory.** The 1B models support checked, reversible single-token
101
+ answers at exact prompts, with up to 32 fact addresses per overlay. Base weights
102
+ stay frozen. Preview checks the proposed answer, retained facts, and control
103
+ prompts before an edit can be applied. These checks do not establish general
104
+ learning or accuracy on paraphrased questions. Forgetting deactivates an edit
105
+ and retains its history.
106
+
107
+ ```text
108
+ memorize "The capital of Veldoria is" " Paris"
109
+ ```
110
+
111
+ Save that line as `edit.hlm`, provide a control suite, then use:
112
+
113
+ ```text
114
+ qriton hlm preview hlm5-1b edit.hlm controls.json
115
+ qriton hlm apply <proposal-id>
116
+ qriton hlm facts hlm5-1b
117
+ qriton hlm read hlm5-1b <fact-id> <revision>
118
+ qriton hlm restore <proposal-id>
119
+ ```
120
+
121
+ See the [HLM guide](docs/hlm.md) for control examples, corrections, restoration,
122
+ and [using facts in conversation](docs/hlm.md#manage-an-hlm-fact-through-conversation).
123
+ HLM supplies a separate model workbench; your selected coding provider still
124
+ handles the conversation and code changes. Saved fact routing and fresh native
125
+ model reads are separate operations.
126
+
127
+ These commands also work after `/hlm` in terminal or paired-phone chat.
128
+ On a `qriton serve` host, the models and Python runtime stay on the host; the
129
+ phone provides the conversation and approvals. See the
130
+ [phone workflow](docs/hlm.md#use-hlm-from-your-iphone).
131
+ Published models are available on [Hugging Face](https://huggingface.co/qriton).
74
132
 
75
133
  ## What stays on your machine
76
134
 
77
- With a local model, your prompts and the files Qriton reads never leave your computer. When you pick a hosted model (Claude, OpenAI, Grok), the conversation and the files it reads are sent to that provider. API keys are stored in the macOS Keychain, libsecret on Linux, or a private file, never in your project or configuration.
135
+ Running Ollama on this computer keeps chat inference local. A remote Ollama server or hosted model receives the conversation and selected code context; search, embedding, mesh and mobile services also have their own destinations. Choosing a local chat model alone does not disable those services. API keys are stored in the macOS Keychain, libsecret on Linux, or a private file, never in your project or configuration.
136
+
137
+ For a paired phone with a configured gateway, pushes contain generic status such as "Approval waiting" by default, plus session/approval identifiers. Setting `"mobile": { "preview": true }` in user configuration opts into content previews, which travel through the gateway and Apple's push service (APNs). Push requests obey Qriton's HTTP network policy. They are separate from the encrypted mesh messages.
78
138
 
79
139
  Qriton's file tools only work inside the project folder you started it in. Commands run only as your approval mode allows, and a command you approve runs with your own permissions, so read it before you say yes. Simple reads inside the project run without asking.
80
140
 
@@ -121,6 +181,32 @@ qriton --image screenshot.png "what is wrong here"
121
181
 
122
182
  While Qriton works you can type an addition or correction and press Enter; it joins the task at the next safe step. `Esc` interrupts. `Ctrl+C` twice or `/exit` quits.
123
183
 
184
+ ### Code from your iPhone
185
+
186
+ After configuring the [mesh](#several-qritons-on-one-network) and pairing the Qriton iPhone app with `qriton mesh pair`, leave a host running in the project you want to work on:
187
+
188
+ ```bash
189
+ qriton -C ~/code/your-project serve
190
+ ```
191
+
192
+ Open that host in the app, send a coding task and review its proposed changes and command approvals. The work runs on the host with its configured coding model and workspace tools. Use `/project` to see current changes and previous work, then choose a conversation to resume. Use **Stop** to interrupt an active task or workbench command.
193
+
194
+ Type `/hlm` to inspect and use the host's Qriton models alongside that coding workflow. Model files, input files and Python runtimes live on the host; the phone supplies the conversation, choices and approvals. These slash commands are available on a `qriton serve` host; a terminal session shared with `/share` has a different command interface.
195
+
196
+ ### Pick up unfinished work
197
+
198
+ Run this in your project when you return to it:
199
+
200
+ ```bash
201
+ qriton project # current Git changes, recent tasks and last recorded checks
202
+ qriton resume <session-id> # use an id from the overview to continue that conversation
203
+ qriton project json # the same overview as structured data
204
+ ```
205
+
206
+ The overview runs offline without loading a model or requesting credentials. It reads sessions for this workspace and reports missing Git or session history directly. Older conversations without a saved outcome show that the outcome is unknown. Recorded checks describe that earlier turn; they do not certify the files currently on disk.
207
+
208
+ Inside a session, use `/project`, then `/resume <session-id>`. The same commands work from a paired phone connected to a serving host; its overview offers resume choices. Resuming opens the conversation so you can continue the work under your current approvals.
209
+
124
210
  ### Approval modes
125
211
 
126
212
  | Mode | File changes | Commands |
@@ -136,18 +222,25 @@ At an approval: `y` approves once, `n` rejects, `a` always allows what the promp
136
222
 
137
223
  For `-p` runs nobody is there to approve, so actions that would need approval are rejected. Use `--mode auto-edit` to allow file edits, or `--mode full-auto` for unattended commands.
138
224
 
225
+ For changes made through file tools, the completion report records recognized check commands after the latest edit. `passed` means those commands exited zero; it does not assess test coverage or prove the change correct. Failed checks are reported, and another edit clears the earlier check results. Unrecognized commands and changes with no checks remain `unverified`; documentation-only edits do not trigger a test reminder.
226
+
139
227
  ## Memory
140
228
 
141
229
  Qriton keeps a memory of your project across sessions: conventions, decisions, facts that were hard to find. Ask it to remember something, or use `/remember`. Corrections keep the earlier wording, and forgotten facts can be restored.
142
230
 
231
+ When a proposed fact matches an existing memory, automatic capture keeps the existing wording if it differs. Agent `remember` calls also preserve matched user-supplied, pinned or higher-confidence facts; explicit corrections use `update_memory` under the current approval mode. Agent corrections record the agent as their source. Matching does not detect every contradiction, so review important memories. Forgetting retains history for restoration and is not secure deletion.
232
+
143
233
  ```text
144
234
  /remember prices are integer euro cents, never floats
145
235
  /memory what is stored, recent entries
146
236
  /recall <query> search memory
147
237
  /forget <id> drop a memory (/restore <id> brings it back)
238
+ /graph see your project memory as an interactive graph
148
239
  ```
149
240
 
150
- Memory is kept per project and stays on your machine. With the embedding model installed (`qriton pull bge-m3`), recall also finds related facts that use different words.
241
+ `/graph`, or `qriton memory graph` from the shell, opens your project's memory in the browser: what qriton knows, how the pieces connect, what was corrected and when. Select a memory to see its history and connections, or to copy the command that forgets or restores it (`qriton memory forget <id>` works from the shell too). The page itself is a single private file that works offline and cannot change anything. `qriton memory graph json`, `dot` or `mermaid` exports it for other tools.
242
+
243
+ Memory is stored locally per project. Recalled facts become context for your selected chat model, and semantic recall sends text to the configured embedding service. With the local embedding model installed (`qriton pull bge-m3`), recall also finds related facts that use different words.
151
244
 
152
245
  ## Commands
153
246
 
@@ -158,18 +251,19 @@ Type `/` for suggestions. The most used:
158
251
  | `/help` | all commands and shortcuts |
159
252
  | `/model <name>`, `/models` | switch or browse models |
160
253
  | `/mode <mode>`, `/auto [on\|off]` | change approval mode |
254
+ | `/project` | current changes, recent work and recorded checks |
161
255
  | `/sessions`, `/resume [id]` | browse and continue past conversations |
162
256
  | `/memory`, `/remember`, `/recall`, `/forget` | project memory |
163
- | `/hlm` | run and edit Qriton HLM models |
257
+ | `/hlm` | run and edit Qriton HLM models; `/hlm overview` shows local setup and next steps |
164
258
  | `/servers`, `/server <url>` | find or select an Ollama server |
165
259
  | `/image <path>` | attach a screenshot to your next message |
166
260
  | `/compact` | summarise the conversation to free space |
167
261
  | `/stats`, `/usage` | speed, context use, token and cost log |
168
262
  | `/unload` | free the memory local models are using |
169
- | `/theme light\|dark` | colours for a light or dark terminal |
263
+ | `/theme auto\|light\|dark` | colours: auto matches your terminal's background |
170
264
  | `/clear` | start over |
171
265
 
172
- From the shell: `qriton hlm`, `qriton models`, `qriton sessions`, `qriton usage`, `qriton doctor`, `qriton capabilities`.
266
+ From the shell: `qriton project`, `qriton hlm`, `qriton models`, `qriton sessions`, `qriton usage`, `qriton doctor`, `qriton capabilities`.
173
267
 
174
268
  ## Configuration
175
269
 
@@ -212,10 +306,54 @@ qriton mesh join <code> # every other machine
212
306
 
213
307
  Then set `"mesh": { "enabled": true, "name": "laptop" }` in `~/.qriton/config.json` on each machine. Interactive sessions join the mesh; one-off `-p` runs stay private. In a session, `/peers` shows who is online (machine, project, model, busy or idle, and a fingerprint), `/tell <peer> <text>` sends a message, and `/mesh scan` finds NATS servers on your network. The model can also list peers and send messages; sending asks for approval unless you run in `full-auto`.
214
308
 
215
- **Everything is end-to-end encrypted.** Each machine has its own keys, and every message is encrypted and signed before it leaves, so the NATS server, or anyone on the network, sees only random bytes on random-looking channels. Direct messages can be read by their recipient only, not even by other machines in the group. The invite code contains the group secret, so pass it only over a channel you trust. A relay on the internet also needs `tls://`, and per-machine keys (`qriton mesh status` prints the one to add to the server).
309
+ **Mesh messages are end-to-end encrypted.** Each machine has its own keys, and every mesh message is encrypted and signed before it leaves, so the NATS server, or anyone on the network, sees only random bytes on random-looking channels. Direct messages can be read by their recipient only, not even by other machines in the group. The invite code contains the group secret, so pass it only over a channel you trust. A relay on the internet also needs `tls://`, and per-machine keys (`qriton mesh status` prints the one to add to the server).
216
310
 
217
311
  A received message is shown to you and waits for `/accept`. With `"accept": "auto"` it joins the task queue on its own, so qritons can coordinate work without you in the loop. Either way it is labelled as coming from another agent, never from you: it grants no permission, and every action still goes through your approvals. The mesh is off unless you configure it, and a project can never turn it on.
218
312
 
313
+ Incoming messages also pass through the Shield. You always see every message; the Shield only decides whether it may join the task on its own:
314
+ - **Unflagged messages** behave as described above.
315
+ - **Flagged messages from machines you trust** are never held back. List those machines' ids (shown by `/peers`) in `"trusted"` in your user config, and the warning travels with the message to you and to the agent. The one exception is a possible credential: it waits for `/accept`, so a secret never reaches a model without you choosing it.
316
+ - **Flagged messages from any other member** never join by themselves. They wait for `/accept`, or cannot be accepted at all in Shield `block` mode or when they contain a possible credential.
317
+
318
+ Trust is the machine's id, which each message proves with its signature, so a message cannot borrow a trusted machine's name.
319
+
320
+ Pattern checks can be fooled, so they are not the last line of defence. Once a message from another qriton joins a conversation, trusted or not, that conversation holds **outside input**, and the status line says so:
321
+ - **Every action asks you:** writes, commands, commits, memory changes and mesh sends, in any approval mode including `full-auto`.
322
+ - **Network tools ask too:** web search, fetch and research could carry data out in their arguments, so they ask as well.
323
+ - **No session-wide approvals:** "allow for this session" is not offered, and earlier grants do not apply.
324
+ - **Local reading and thinking stay free:** the agent can still read files, reason and draft on its own.
325
+
326
+ A model that is talked into something by that text still cannot act on it without you. The mark lasts until `/clear`, because the text stays in the model's context, and a resumed conversation containing such a message is marked again.
327
+
328
+ ## A signed agent on the web
329
+
330
+ Websites are starting to tell known agents from anonymous bots. With Web Bot Auth, the IETF draft that Cloudflare, Google and others are testing, qriton can sign its page fetches (`fetch_url`, `research`). A site can then recognise this agent and apply its own policy, instead of blocking it or treating it as a scraper posing as a browser.
331
+
332
+ ```sh
333
+ qriton agent # this agent's key id, and whether signing is on
334
+ qriton agent directory ./site # the public key, ready to host
335
+ qriton agent check # a signed request to Cloudflare's test endpoint, explained
336
+ ```
337
+
338
+ To turn it on:
339
+ 1. Host the key directory at an https address you control, at `https://agent.example.com/.well-known/http-message-signatures-directory`. `qriton agent directory` writes it, with a `web.config` for IIS.
340
+ 2. Set this in `~/.qriton/config.json`, listing the sites that should know who you are:
341
+ ```json
342
+ { "webAgent": { "sign": true, "directory": "https://agent.example.com", "sites": ["shop.example", "*.gov.example"] } }
343
+ ```
344
+
345
+ Page fetches to those sites, over https only, then carry an Ed25519 signature over the target host, valid for one minute, plus a `Signature-Agent` header pointing at your directory. They identify as `qriton/<version> (+https://agent.example.com)`.
346
+
347
+ Every other site sees an anonymous browser request, exactly as before. A redirect is decided again for each site it passes through, and a signature never travels on to a site that is not listed. `"*"` signs everywhere, but only if you write it.
348
+
349
+ Identifying as an agent also tells a site it may serve you a page written for agents, with hidden instructions. So a page fetched while identified counts as outside input: until `/clear`, every action in that conversation asks you first. One key can serve several machines: copy `~/.qriton/web-agent.json` between them, so sites cannot tell the machines apart.
350
+
351
+ - **The key:** it belongs to this installation. It is kept privately in `~/.qriton/web-agent.json`, separate from mesh keys; only the public half is published.
352
+ - **Off by default,** and even when on, it only signs for the sites you list.
353
+ - **User settings only:** a project cannot change it.
354
+ - **Standard format:** signatures match the RFC 9421 and draft test vectors, and Cloudflare's test endpoint accepts them as well-formed.
355
+ - **Recognition:** sites recognise the key once the directory is published, and for Cloudflare, once the agent is registered.
356
+
219
357
  ## Teams and managed machines
220
358
 
221
359
  Administrators can restrict network destinations, allowed approval modes and which project settings apply, and can run commands in a network-isolated container. For the deployment guide, write to **cli@qriton.com**.