0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
Commit graph

1,742 commits

Author SHA1 Message Date
hoangvu12
8a91a02dd2 Plugins: a plugin can read the composer's draft and set it aside
A new "draft" permission lets a plugin read what's being typed in the message box (zeron.draft) and take the whole draft out and put it back later (take_draft, put_draft, swap_draft, drop_draft). Zeron keeps a taken draft itself, so a plugin never sees file paths. This is what a prompt stash needs: write in the wrong chat, set it aside, restore it in the right one.
2026-11-15 04:59:16 +07:00
Wing
adc82e90a8 Provider accounts: review and security fixes
- A key's name is judged on its own: anything that looks like a key is
  refused whatever key it's for, so Rename can't be used to test guesses
- Previews can't add a key, rename an account or forget a GitHub login;
  a test checks every action the code refuses is blocked
- A Pi switch over a Claude login it can't identify is refused, and the
  live entry is compared before it's written
- Hermes key add: the child dies with the request; the name goes as --label
- Switching from the composer reloads the agent's models
- changed_logins dedups through a sorted set
- Hermes model names: plain files up to 64 MB, naming waits at most 5 s;
  Hermes .env read is bounded
- The API key dialog's Cancel waits while a key is checked
- stores.rs module docs match what each store does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:22:37 -07:00
Wing
59b2f1c44a Claude for Pi: a rate-limited profile still signs in, as the token names the account
Anthropic's profile endpoint answered a real sign-in with nothing usable
(the engine was being rate limited on Claude's usage endpoint at the same
moment), so Pi's Claude sign-in failed with 'Could not identify the
signed-in Claude account' after the token exchange had succeeded. The
token response names the account (account.uuid, account.email_address,
organization.name), as Claude Code's own sign-in already falls back to;
Pi's now does too, keyed as the profile path keys it. A refused or failed
profile lookup logs its status, never the body or the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:24:13 -07:00
Wing
4ec5b50c86 Providers: keys read once, by name or last four; provider marks; Hermes env keys
- A key row says its last four exactly once: named, "Work" over
  "OpenRouter · API key"; unnamed, "API key ···a1b2" over "OpenRouter".
  The name, when set, is kept apart (display_name); the title is derived
  otherwise. Rename opens empty for an unnamed key and says which key.
- Hermes keys read the same; one seeded from an environment variable is
  never titled by it ("API key ···a1b2" over "OpenRouter · from
  environment"), and Hermes' own "api-key-N" labels count as unnamed.
- A key row's face is its provider's mark in the add rows' round well;
  logins keep their avatars. The add dialog's name field: "Name
  (optional)".
- Test servers ignore the `HEAD /` probes a preview scan in the test
  process sends to every local listener: the cause of the occasional
  extra hit in the GHES, spent-Claude and Pi key tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:14:27 -07:00
Wing
5a18697ad8 Merge remote-tracking branch 'origin/zeron/model-source-hint' into zeron/provider-accounts 2026-11-13 14:00:11 -07:00
Wing
3d07f58d60 Providers: API keys, Claude for Pi, cards like Claude Code's, Hermes fixes
Per-provider agents (Pi, OpenCode, Hermes) now look and act like every
other agent's card, take API keys in the app, and behave across devices.

Card: the same rows, rules and "In use" as Claude Code's and Codex's — a
provider's accounts together, each provider with its own one in use, the
plan line saying whose ("ChatGPT Plus", "OpenRouter · API key ···a1b2") —
and every add row at the foot (Add ChatGPT / Claude / GitHub Copilot
account, Add API key). No section chrome, no CLI hints. "Switch to this
account" only on a switchable row not in use; a refused switch says why
in a toast instead of doing nothing.

API keys: "Add API key" opens a dialog (provider select with each
provider's mark, masked key field with its placeholder shape shown plain,
optional name, Save disabled until typed, spinner and locked inputs while
the provider checks the key, the provider's refusal under the field).
Stored as each agent's CLI stores it: Pi's auth.json api_key entry,
OpenCode 1.x's api entry (OpenCode 2.x keeps keys in its own database:
refused with what to do, and a warning on the list), Hermes through
`hermes auth add <provider> --type api-key` with the key on stdin in a
session without a terminal. Keys are named (default "<Provider>
···<last4>", renamable from the row's menu; a name holding any of the key
is refused). The key is never logged, never in an error or the snapshot,
never on argv or in a child's environment, files 0600, and
AddAgentApiKey is local IPC only (refused, never forwarded, when it names
another device; refused by the relay host if a peer sends one).

Claude for Pi: Pi's own Claude Pro/Max sign-in, saved as pi saves it, a
fresh grant, swapped under pi's lock; a switch keeps a refresh the agent
made since the last list (single-use refresh tokens). OpenCode has no
Claude sign-in (verified in 2.1.2): refused with the API-key alternative.

Hermes: lists only pool entries Hermes itself uses (its
_pool_entry_is_explicit: device_code, loopback_pkce, hermes_pkce,
manual[:*], env:<VAR> while the variable holds a key) — a borrowed
gh_cli Copilot token is no longer offered.

Also: provider marks (one mono set), Select options with marks, Dialog
confirm `disabled`, TextField draws a password's placeholder unmasked,
Groq/Mistral dropped from key providers (no marks in the set).

Tests: engine agent_accounts 118 (keys stored/refused/never shown or
logged/stdin-only/0600, OpenCode 2.x refusal, names and rename, two keys
one provider, Pi Claude local and for another device, rotation kept,
Hermes explicit-only); device_routing remote per-provider list/switch,
provider refusal routed, remote key refused with no relay frame and no
file holding it; rpc routing asserts; app Rust and UI tests updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:52:59 -07:00
Wing
24cae27850 Hermes: 900K variants are a Context Window choice; names read lean, off the runtime
Hermes lists '<model>-900k' after each Codex model with a large window (a
Hermes-side name: the base runs at Codex's 272K). They fold into their base
model as a Context Window option (272K default, 900K), and a run that picks
900K sends the variant's id; pick_model_value composes any chosen window
('[1m]'/'-1m' for Claude as before, '-900k' for Hermes). Saved chats on a
variant id still run it.

The name lookup streams models_dev_cache.json through a 64 KiB buffer and
keeps only the names asked for (keys compared in the parser's buffer, never
allocated unless kept): peak footprint 2.6 MB vs 10.5 MB for the full parse
on the real 5.8 MB file. It runs on a blocking thread while the Hermes child
shuts down, so no async worker waits on file reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:07:36 -07:00
Wing
6c7b1ac222 Hermes: name models as Hermes's own models.dev catalog does
Hermes's ACP adapter labels each model with its id; the catalog it keeps
beside its config ($HERMES_HOME/models_dev_cache.json) names them as their
makers do. Read-only; a model it doesn't list keeps its id. Catalog cache
schema 3 so saved id-labelled lists are rediscovered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:49:33 -07:00
Wing
623dabc3d0 Merge remote-tracking branch 'origin/zeron/model-source-hint' into zeron/provider-accounts 2026-11-13 12:26:41 -07:00
Wing
f224da9e0b Model picker: a long line fades at its edge and glides to its end; old catalogs refetched
- A model row's name and provider read as one line: where it runs past
  the row its right edge fades (as FadeText's), and while the row is
  highlighted (pointer or keys) it glides left until its end shows,
  rests and glides back. Reduce motion keeps it still; a row that fits
  never moves. Test: `a line past its row fades at its right edge, and
  glides to its end while highlighted`.
- The saved model catalog's schema is 2: models name their provider and a
  Hermes `<Provider> · <model>` label is split. A catalog an older engine
  saved has neither, so it is fetched again rather than served as it was
  (Hermes showed "Anthropic · claude-fable-5.1" from its old cache).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:25:12 -07:00
Wing
a26f5f4ce0 Providers: accounts per model provider for Pi, OpenCode and Hermes
Agents that keep a login per model provider now show and switch them per
provider, everywhere:

- Settings → Providers (and setup's Your agents): such an agent's accounts
  sit under a heading per provider ("ChatGPT", "Claude", "GitHub Copilot"),
  each group with its own "In use" and its own "Add <provider> account"; a
  provider with none yet is a "Connect <provider>" row at the card's foot,
  and a sign-in shows in its own provider's row. A provider Zeron can't
  sign in to (Pi's Claude) says how the agent adds one. Hermes' pool is
  grouped the same way, read-only (no actions), adding through
  `hermes auth add <provider>`. Single-login agents look as before.
- Model picker: the Account row is the chosen model's provider's
  ("ChatGPT account" / "Claude account"), listing and switching that
  provider's accounts alone, so a ChatGPT switch never touches the Claude
  login; a provider with none yet says None and offers "Add <provider>
  account" (Settings → Providers, its sign-in started on the composer's
  device); a provider with neither has no row.
- Engine: Pi gains GitHub Copilot sign-in (GitHub device code with pi's own
  Copilot app, exchanged for a Copilot session at copilot_internal/v2/token,
  unconfigured models enabled and availableModelIds recorded as pi's
  /login does; an account without Copilot is refused, nothing written).
  Hermes gains xAI (`hermes auth add xai-oauth`, device code). Hermes
  marks each provider's first pool entry in use (a model of that provider
  runs on it), the active provider's rows still first. Switching and new
  sign-ins already rewrite one provider's entry alone; tests now pin it.
- Proto: login_options adds Pi github-copilot and Hermes xai-oauth;
  groups_by_provider, login_option, account_group_label and
  account_group_hint name the groups for every app.

All serde-additive: no field renamed, older apps read the same snapshot.

Tests: proto providers (3 new); engine agent_accounts (5 new: Pi Copilot
sign-in, no-Copilot refusal, per-provider switch isolation, Hermes xAI,
Copilot session/model parsing; Hermes in-use updated); app Rust (2 new:
grouping, device rows + logins); UI (provider_groups 6, model_accounts
_providers 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:21:17 -07:00
Wing
f5d0530e57 Model picker: every agent's model says its provider; Hermes' too
Merged main into the provider-hint branch, and:
- A model whose agent names its provider (Pi, OpenCode, Hermes) says it on
  every row, not only beside a namesake: where a model comes from is part
  of which it is, even with one provider signed in.
- Hermes labels a model `<Provider> · <model>` with id `<provider>:<model>`
  ("Anthropic · claude-fable-5.1"): its label is now the model, and the
  provider rides apart, named as Pi's are (openai-codex → Codex), else as
  Hermes wrote it. `provider_name` is shared from Pi's catalog.
- Tests: ACP `a_provider_glued_to_a_models_label_rides_apart`; the picker's
  provider tests updated for the rule (7 passed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:43:29 -07:00
Wing
0aaa69f1c8 Merge remote-tracking branch 'origin/main' into zeron/model-source-hint 2026-11-13 11:09:51 -07:00
Wing
067b9e7d18 zeron-doc test: a tool part names its preview paths
#1103 gave MessagePart::Tool `preview_paths`; a transcript_delta test
from the release line built one without it, so zeron-doc's tests no
longer compiled once main and the release line met.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:34:11 -07:00
Wing
1e910d9159 Engine test: a stored tool picture's path is looked for as the journal writes it
`tool_result_images_are_stored_inside_uploads` (#1103) looked for the
stored path in the journal's JSON text as it is; on Windows the path's
`\` is escaped there, so main's Windows tests failed. It looks for the
path as JSON writes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:00:54 -07:00
Wing
f29c197e2d Merge remote-tracking branch 'origin/main' into zeron/main-catches-up 2026-11-13 03:59:31 -07:00
Daniel Katulevskiy
3510f868e7 Engine tests on Windows: a Linux sysfs fixture is Unix only; a worktree path git accepts
Now that zeron-engine's tests compile on Windows they run there, and two
failed for Windows reasons:
- device_stats' sysfs fixture names files 0000:01:00.0, which Windows
  refuses: the test is Unix only.
- spaces' worktree test passed git a canonicalized \?\ verbatim path,
  which `git worktree add` refuses: the prefix is dropped.

(cherry picked from commit 8fb608ad68)
2026-11-13 02:09:29 -07:00
Daniel Katulevskiy
952ec8a348 Engine tests compile on Windows: the getrusage measurements are Unix only
Two hand-run measurements read CPU time with libc::getrusage, which Windows
doesn't have, so zeron-engine's lib tests didn't compile there and the
Windows tests job stopped at its build. The measure module
(source_control.rs) and live_like_bytes_and_cpu_before_and_after
(chat_persistence.rs) now compile on Unix only.

(cherry picked from commit 02ca4e0362)
2026-11-13 02:09:29 -07:00
Wing
f6a1213353 Merge remote-tracking branch 'origin/zeron/stable-zgx' into zeron/main-catches-up 2026-11-13 02:09:29 -07:00
Wing
0f5bf22b49 Engine: PowerShell's name reads the same on every platform
`is_powershell` took the shell's name through std::path, which splits at
`\` only on Windows, so its test (`C:\Program Files\PowerShell\7\pwsh.exe`)
failed on the Linux and macOS runners and held 0.3.4's release back. The
name is now the last part at either slash, less its extension. Windows,
where it runs, reads the same as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 01:18:27 -07:00
Wing
2447c974ce Merge remote-tracking branch 'origin/zeron/stable-zgx' into zeron/main-catches-up 2026-11-12 23:59:01 -07:00
Daniel Katulevskiy
749ed74884 ui tests: name the entry type for empty transcript resets
TranscriptFrame::reset became generic over E: Borrow<SessionMessageEntry>,
so reset(&[]) no longer infers a type and zeron-ui's lib tests stopped
compiling (E0283). Spell out SessionMessageEntry at the two call sites.

(cherry picked from commit 6629b96ada)
2026-11-12 23:57:46 -07:00
Wing
b8eb0216ef Merge remote-tracking branch 'origin/main' into zeron/main-catches-up
# Conflicts:
#	edge/src/env.ts
#	edge/wrangler.jsonc
2026-11-12 23:57:45 -07:00
zeronsh[bot]
2718721ea5 Ctrl+C in a Windows terminal tab interrupts what the shell runs
The app starts the engine with CREATE_NEW_PROCESS_GROUP (crates/launch
`spawn_detached`), which makes it ignore Ctrl+C, and every process
inherits that from its creator: the shell the engine opens on a
pseudoconsole, and what it runs, ignored Ctrl+C too. PowerShell got the
key (char 3) but `ping -t` ran on. The engine puts normal handling back
before it creates a shell; a process started any other way has it
already, and the engine has no console for a Ctrl+C to come from.

The new test opens PowerShell from a process ignoring Ctrl+C, runs
`ping -t localhost`, sends Ctrl+C and waits for ping's summary. Like the
other ConPTY tests in windows_tests, it doesn't run on WING-PC (input
written to the shell never arrives there, with or without this change);
the fix was checked in the app: ping stopped, the tab went on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:53:05 -07:00
Daniel Katulevskiy
2e0147e068 Windows terminals: -NoLogo on the ConPTY launch Windows takes
Windows opens its terminals through terminals/windows.rs's own
CreateProcessW launch, not portable-pty's CommandBuilder, so -NoLogo given
there never reached PowerShell. It's on that command line now, after the
quoted executable.

(cherry picked from commit a3104d46e2)
2026-11-12 23:53:05 -07:00
Daniel Katulevskiy
d44bbc3026 Windows terminals open PowerShell, cmd only without it
A terminal tab on Windows ran %COMSPEC%, cmd.exe: a prompt with no space
after its `>` and nothing coloured as it's typed. It now runs PowerShell 7
(pwsh.exe on PATH), else the Windows PowerShell every Windows has, else
%COMSPEC% as before (cmd.exe when that's unset too). PowerShell starts
with -NoLogo: its prompt alone, no banner on every tab.

(cherry picked from commit 817182a5d6)
2026-11-12 23:53:05 -07:00
Wing
204f9ca2ab Tool images: a tool part's preview paths are only the engine's own copies
Clients read a tool part's `previewPaths` as pictures as they are (zgx
reads a local chat's straight from disk, #1186), so a path an adapter put
on a result (`/dev/zero`, a picture elsewhere on the Mac) must never reach
the doc. Results with image bytes carry only the copies stored in uploads;
paths without stored pictures are dropped, with a warning. No adapter sets
them today; this keeps it that way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:10:14 -07:00
Wing
3ef287e270 Tool images: engine only, one file per picture in a chat, the CLI's note exactly
Review follow-ups for #1103:
- crates/ui is back to main (the desktop is apps/zgx now), but for the
  `preview_paths: Vec::new()` its initializers need to compile. The engine
  still names stored copies on the tool part; zgx reads them (#1186).
- A stored picture is named `tool-<chat>-<sha256 of its bytes>`: the same
  picture again in a chat (another Read, another subagent) is one file
  rather than a copy per call, and a chat's pictures share a prefix for
  whatever clears a chat's away. Uploads keep them as before.
- Only the CLI's own image note is bookkeeping: one line, `[Image: source:
  <path>]` or `[Image: original WxH, displayed at WxH…]`. A steer that just
  starts with `[Image: ` and ends with `]` reaches the subagent.
- `is_meta` and `tool_use_result` also read as the live stream spells them.
- docs/image-preview.md says what the engine does and who reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:06:13 -07:00
Daniel Katulevskiy
a2115820ae
Tool results: fill the image preview fields in main's new ToolResult events
Main added ToolResult initializers (ReadToolOutput tests in tool_output.rs
and e2e, the mock harness's long-running commands, steer_now) after this
branch last merged it. They lacked preview_paths and image_payloads, so
zeron-engine's lib tests did not compile.
2026-11-12 21:14:19 -08:00
Daniel Katulevskiy
4e1efa5393
Merge remote-tracking branch 'upstream/main' into pr1103-fix 2026-11-12 20:37:23 -08:00
Wing
d071ed2dbb engine: a message from another chat never stops the agent's running command
Since a steer started stopping an open tool call in place (76ca2e17b),
a `send_message` from another chat did too. Claude Code words every
interrupt as the person rejecting the call ("STOP what you are doing and
wait for the user to tell you how to proceed ... The instruction to stop
and wait still stands"), so a Claude agent took the other chat's message
as an order to stop and sat waiting. Codex and Muse add no such text,
which is why only Claude stopped.

A steer carrying Zeron's "from another chat" header (which only the
engine writes) now waits for the step boundary, as the `send_message`
tool promises: the command finishes and the message lands right after
it. The person's own Steer still stops the command at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:28:35 -07:00
Wing
80b3d4168e Model picker: provider search from word starts; rows gain a hint in place
From review of the provider hint:
- A search finds a row by its provider from the start of one of its
  words ("code" finds OpenCode, "pen" or "ai" don't reach inside a word),
  or by name and provider read together across the gap ("gpt-5.5 codex").
- A row built without a hint (an older engine's catalog) is built again
  when its model gains a provider, so the hint shows in place.
- ACP effort grouping keeps a model's provider; Pi sends none for an
  empty provider id.
- Tests: the keys pick the exact next row; provider search from word
  starts; a row gains its hint in place (fails without the fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 15:18:26 -07:00
Wing
60d85b8502 Model picker: say a model's provider where two share a name
Pi signed in to both Codex and OpenCode lists GPT-5.5 twice, and the
picker gave no way to tell the rows apart.

Engine: Model gains `provider { id, name }` (serde-additive). Pi fills it
from its provider id with a name people say (openai-codex -> Codex,
opencode -> OpenCode, unknown ids in words); OpenCode from its provider
catalog. Single-source harnesses leave it None. zgx's catalog bridge
passes it to the picker.

Picker: a model with a provider carries its name as the row's hint
(Dropdown `hint`): quiet text in the name's size, on its line, the row's
gap after it; the name fades first when the row runs short. It shows
where it disambiguates (the agent lists the same name from another
provider), on every tab including Starred, and on rows a search found by
it ("codex", "gpt-5.5 codex"). Hints follow the catalog in place, and a
hinted row's accessible name reads what is drawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 15:11:53 -07:00
Wing
f7eab0ecf7 Merge remote-tracking branch 'origin/zeron/zgx' into zeron/stable-zgx
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 15:08:49 -07:00
Wing
40e79949c3 A terminal's writes reach it in the order they were sent
The RPC server ran each call on a task of its own, and tasks spawned back
to back start in no set order: tokio runs the newest first (its LIFO
slot). Two WriteTerminal calls in a row reached the PTY swapped. zgx's
terminal (Ghostty on macOS) answers a program's queries through the
bridge, each answer its own write: termenv (gh, glamour) asks for the
background (OSC 11), then the cursor (CSI 6n), took the cursor report
first as "no colour" and stopped reading, and gh's prompt read the colour
answer after it as typed keys ("unexpected escape sequence from
terminal: ['\x1b' ']']"), the cursor reports left in the shell (`;22R`).
Keys typed or pasted fast went out of order the same way, and a remote
viewer's numbered input lost the older of two (write_sequenced took it
for a replay).

A terminal's WriteTerminal and ResizeTerminal calls now run one after
another, in the order the connection sent them, on a lane of their own:
one per terminal, so a write that blocks (a paste into a program that
doesn't read) holds back no other terminal on the connection. A call's
answer is sent beside its lane, so a client slow to read answers doesn't
hold the next write back. When the connection ends, input already sent
still goes in; every other call is aborted as before.

tests/terminal_query_order.rs (unix; the probe is Perl): over the
engine's own dispatch, a program in the PTY asks as termenv does, 300
times, and a viewer answers as Ghostty does (two writes, at once).
Before: 284 of 300 read the cursor first (298 in an earlier run); after:
300 of 300 in order, the colour's answer in 2.64 ms median, 4.29 ms p99.
rpc's tests: two terminals' interleaved writes and resizes reach the
service each in order, a stuck terminal holds back no other, and input
sent before the connection ends goes in, in order (all three fail on
the base).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 15:07:42 -07:00
Wing
8f75cc28f7 Version 0.3.0: the zgx app's first stable release
Wing: "this release is big so it should be 0.3.0". The workspace and both
lockfiles' own crates move to 0.3.0. REMOTE_APPROVALS_SINCE, which only
names the release to update to, says 0.3.0 (there's no 0.2.139 stable).

Audited for a minor bump: 0.2.138's updater and the shipped betas compare
versions numerically with no major/minor or minimum-version rule (0.3.0 is
newer than 0.2.138 and every 0.2.139-beta.N, and a test says so); Windows'
version check is digits and dots; Linux's app/<version> and the beta\<v>
folder take any version; the macOS bundle version 0.3.0.9999 sorts above
0.2.139.N; templates compare by equality, as at every release; the edge,
relay and mesh carry no app-version gates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 14:40:29 -07:00
Wing
b592c3b067 Merge remote-tracking branch 'origin/zeron/zgx' into zeron/stable-zgx
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:50:49 -07:00
Wing
a4401fef49 engine tests: chat images through linked folders, checked by the names a chat uses
uploads::tests::chat_images_read_only_raster_files_inside_the_chat_folder
failed on macOS. It read a folder linked as the root (elsewhere/chat-folder
-> folder) by the folder's temp-dir name. On macOS that name is itself
behind a link (/var -> /private/var), so it is neither the name the chat
knows the folder by nor its real one; on Linux it is the real one, so CI
passed.

Not a product bug: a chat folder whose ancestors are links (/tmp, /var,
iCloud or Dropbox links) serves its images by the chat's name for it and
by its real name. The test now says so explicitly on both platforms (the
temp folder's own root, under /var on macOS; and the linked root), read
by the chat's name and the real one. The third alias stays refused on
purpose: accepting it means resolving prefixes of a path the agent chose,
which the jail avoids (autofs /net and Windows junctions reach hosts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:38:55 -07:00
Wing
1a7dc2e49c engine: a shut-down engine is freed (two holds kept its whole graph alive)
local_first's online_runtime_shutdown_stops_edge_workers_and_retires_the_graph
failed every time ("engine graph still reachable after shutdown + drop").
CI never ran it (scripts/ci/test-core.sh lists the engine tests it runs).
After shutdown + drop the doc host stayed at 2 strong references for good;
tracking every DocHost clone named both:

- The version-change hook (zeron_update::set_before_restart, c004d547c)
  is process-wide and captured the doc host and workspace strongly, so
  every engine ever assembled in the process stayed alive. It now holds
  them weakly and upgrades when it runs: only this process's live engine
  restarts it (the CLI never sets a hook), and with its graph gone there
  is nothing left to prepare.
- A cycle: the engine holds its plugins (sessions.set_plugins), the
  plugins' agents hold their host (EngineAgentHost, 564da4414), and the
  host holds the doc host, sessions and workspace. Plugins::shutdown now
  lets go of that host, as shutdown already breaks the sessions <-> doc
  host cycle. (The agents' sink holds the plugins weakly; left alone.)

Each alone still leaks (the test fails with either fix undone); with
both it passes, 5/5. A new restart_hook test (its own binary: the hook
is process-wide) shows the hook still prepares the running engine's
store and holds nothing after shutdown; with the old strong hook it fails.

The test's next check then failed on this Mac only: one `HEAD /` after
shutdown. lsof named the sender: the Zeron Engine already running on
the Mac, whose preview discovery probes this process's listeners (a
listener bound after shutdown got probed too). Not the engine under
test, so the counting edge leaves `HEAD /` out, as the client tests'
mock edge already does; the engine sends the edge no `HEAD /`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:38:55 -07:00
Wing
989c418c81 Windows: an update holds the completion lock through its swap
From a review of the last changes: a start's cleanup (now at engine starts
too) could take the new version's folder, placed but not yet run from, in
the second an update spent swapping zeron.exe, leaving it to download again
at its first start. `apply` now holds the completion lock from placing the
folder through the swap (completion, which holds it already, doesn't take
it twice). And the completion error no longer names a file the GitHub feed
doesn't have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:36:37 -07:00
Wing
bb9ba1802e Windows: a headless start clears what an update set aside too
From the Windows proof on WING-PC: `zeron.exe.old` (the image an update
moves aside) went only at a window launch. `engine` and `headless` hand
over to the engine first, and the engine isn't the installed zeron.exe, so
an install only ever run headless kept it for good. Those two now run the
cleanup before handing over (it can't touch anything in use, a trial, or a
folder being completed).

And a completion that can't read its feed says it tried this version's own
manifest before the latest, rather than naming only the last thing tried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:28:59 -07:00
Wing
71144518d1 Windows: a trial uses the package it was staged with; cleanup waits its turn
From the review's re-check: a trial started by the new engine downloaded
the zip a second time to complete itself, which on a slow line could run
past its deadline; it now installs the package staged beside it (verified
when staged). And a launch's cleanup leaves the version folders alone while
another start holds the completion lock, so it can't remove a folder a trial
has just put in place before its engine runs from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:24:15 -07:00
Wing
a0a4efcc27 Second review: whole version folders, a trial-only job, choices kept
From an independent review of the branch:
- Windows: a version's folder is complete with its engine AND its scripts,
  and a folder is removed whole or not at all (moved aside first, which
  Windows refuses while its engine runs). A cleanup during a trial could
  leave the next version's engine without its scripts, an app with no
  interface until the next release.
- The job that ends the engine with the zeron.exe wrapper is made only for
  an update's trial: elsewhere Ctrl+C reaches both, and the job would cut
  the engine's own clean shutdown short.
- A beta record with no claim (the old app's switch, before `chosen` was
  recorded) is a choice: the beta it installs keeps it one rather than
  claiming it, so a stable release doesn't move it.
- A claim a stable release ended is recorded as such, not as a choice of
  Stable that would let a beta be sent back to an older release.
- An install the old app's updater moved here leaves the GitHub feed (no
  beta channel beside it) for the edge's at its first launch as the zgx
  app, however it arrived; a package no longer brings its feed.
- release.yml fails loudly when it can't read the beta manifest: claim-only
  betas reach a stable release through that copy alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:20:37 -07:00
Wing
003b4feb44 engine tests: every harness whose boot revives a turn says it serves no IPC port
Same gap as message_queue's (b6b79ab39): a turn revived on boot waits in
`ipc_port_ready` until the boot says it serves a port or none, and these
harnesses said neither, so each revival waited out the 10 s limit.

Found by measuring, not grep: a temporary probe logged every expiry of
that wait across all 64 engine test binaries. It fired in
cloud_killed_turn (4 tests), cloud_attachments and cloud_wake_update,
and nowhere else except the unit test of the limit itself. With the
fix it fires in none.

- cloud_killed_turn: 3 of its revival tests failed (the run came at
  boot + 10 s against a 10 s wait); now 15/15 in 1.35 s, from 10.8 s.
  a_revived_turn_waits_for_the_machines_logins checked nothing before
  (the port wait alone held the run back); without its broker wait it
  now fails at once ("a run started ahead of the broker").
- cloud_attachments, cloud_wake_update: 0/5 failures each.
- adapter_chaos_live (#[ignore], real providers; found by review, a
  probe run skips it): restart_durability reboots onto a revived turn,
  which waited 10 s too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:13:18 -07:00
Wing
fd3bb08c1b engine tests: cloud_killed_turn compiles again (RunEnvironment::prepare takes the chat)
`RunEnvironment::prepare` gained `chat_id: Option<&str>` (8ea7bf8c1, accounts.pin); the
test's `Logins` broker still had the old three parameters (E0050), so
the whole file failed to build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:06:53 -07:00
Wing
1b8bdfbd49 Merge zeron/zgx d3adab233 into zeron/stable-zgx
The conflicts were the engine's Luau NDEBUG fix arriving twice (stable-zgx
took it on its renamed scripts and the shared zgx-build.yml; zeron/zgx on
the old names and zgx-beta.yml's inline jobs): stable-zgx's text kept.
windows.rs: stable-zgx's version folders with zeron/zgx's DisplayVersion
guard (refresh_installer_version takes the installation). apps/zgx's
windows-sys features are both sides'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 13:04:17 -07:00
Wing
41417142c3 doc tests: the cached-read race test compares every round, not by luck
cached_reads_stay_whole_while_another_thread_commits compared a cached
read with a whole read only when the doc happened to stand still around
both, and needed 50 such moments in 20 s. In a debug build a whole read
outlasts the writer's 0-3 ms gaps, so it failed with "too few still
moments to compare" (5/5 locally, and in CI).

The writer now works in rounds and waits for the reader between them:
every round gives one guaranteed still comparison (>= 300 in all), and
the reader's reads during the next round's commits still land in the
slow subscriber's window. Same check as before. With the read's change
lock and frontier check both removed, it fails at round 2 (as the old
test did); intact, it passes in ~6 s, 0/10 under 10 busy cores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 12:49:53 -07:00
Wing
e6b959540b engine tests: a send reaches the agent while the publish is held
send_to_delivered_stays_flat_as_the_chat_grows compared wall-clock send
times in a 3,000-entry chat with a new one and failed under CI load
(4/10 under load locally, before and after beta.7's changes).

It guards c1168b6bf: the open chat's publish runs beside the drains, not
before them. The test now checks that ordering with no clock: it holds
the publish where it hands the transcript to its watchers (a held
`borrow()` of the watch holds `send_replace`), sends, and waits for the
agent to get the send while the publish is still held; released, the
publish lands. With c1168b6bf undone (publish awaited before the
drains) it fails 3/3; with it, it passes in 0.07 s, 0/10 under load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 12:49:53 -07:00
Wing
b6b79ab398 engine tests: say the test engine serves no IPC port, as boot does
message_queue's restart test failed in CI ("timed out waiting for the
interrupted opening turn to be picked back up"). The engine was fine: a
turn revived on boot waits in `ipc_port_ready` until the boot says it
serves a port or none (deferred.rs always says one). The test engine said
neither, so every revival waited out the 10 s limit, racing the test's
own 10 s wait. Logs: resume at boot + 10.004 s when it passed, +10.009 s
when it failed.

assemble_at now calls `set_no_ipc_port()`. Restart test: 1-4/20 failed
alone, 0-2/10 under load before; 0/20 alone, 0/20 under 10 busy cores
after, and it runs in 9.4 s instead of 19 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
2026-11-11 12:32:12 -07:00
Wing
108b4444d7 Windows updater: only the installer's own folder refreshes its DisplayVersion
refresh_installer_version wrote DisplayVersion under the per-user Inno uninstall key on every in-app update, so a portable copy updating itself (or a test copy) changed the installed Zeron's version in Settings > Apps. It now writes only when the folder being updated is the entry's InstallLocation (same folder however spelt); no location, no write. Tests: folder matching, and the real registry path against a volatile scratch key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:27:59 -08:00