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

9 commits

Author SHA1 Message Date
wing-anara
efa1a0752b Reduce redundant sync traffic and keep slow transfers progressing 2026-09-15 21:25:52 +00:00
wing-anara
6614b32425
Fix macOS streaming crashes, repair stalled sync, and reduce rendering overhead (#259)
* Fix native streaming aborts and causal sync recovery; reduce redraw and drawable overhead

* Prepare v0.2.40 stability release

* Clarify measured graphics footprint and allocator-report limits
2026-09-05 15:16:25 -07:00
wing-anara
ec314936af sync: remove the legacy s2 room client — chat2 is the only chat transport
The s2 loro-room client (RoomClient, /session/{chatId}/ws) predates chat2
and survived only as the migration overlap. Every chat in the fleet is on
chat2 (v0.1.34 shipped born-chat2 + host sweep + first-contact push), so
the legacy path was pure cost: an extra socket per straggler chat and
~2400 lines of dead transport.

- crates/sync: room.rs and its tests deleted; RoomClient/RoomEvent/
  RoomTuning gone. The shared vocabulary (SyncError, UrlProvider,
  StaticUrl, RoomStatsSnapshot) moves to types.rs — registry and chat2
  clients keep using it unchanged. s2_reader example and the s2 live
  edge-convergence test removed.
- doc_host: handle.room field, spawn_s2_join, and fetch_s2_room_doc
  deleted. Gen-1 straggler chats now open read-only on their local fat
  doc; when this device hosts one, the existing quiet-seed posts the
  chat2 checkpoint and flips the registry (its wait-for-s2-join gate is
  gone — with no s2 writers anywhere, the host's local doc is the
  authority). Transcript salvage keeps its rollback-copy source only.
  The cutover watcher and migration sweep stay: they are what converges
  any straggler.
- SyncStatus / `zeron sync`: per-chat rows now report chat2 stats
  (cursor/headSeq/pending/rows/resets) instead of s2 room stats; the
  workspace registry line is unchanged.
- Edge: SessionRoom DO stays deployed for pre-cutover released clients;
  no current client dials it (noted in ARCHITECTURE.md; server-side
  removal is separate cleanup).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 19:51:07 +02:00
wing-anara
b0be3dea2f rename: comet -> zeron everywhere (binary, crates, env, data dir, iOS)
- binary/CLI `comet` -> `zeron`; crates comet-* -> zeron-*; COMET_* -> ZERON_*
- data dir ~/.comet-native -> ~/.zeron, with a one-shot rename migration
- services: comet-native.service -> zeron.service; launchd sh.zeron.comet ->
  sh.zeron.app; macOS bundle id dev.comet.native -> sh.zeron.app
- release artifacts comet-<ver>-* -> zeron-<ver>-*; drop the Comet.app
  tarball-path compat hack in package-macos.sh
- iOS: Comet -> Zeron targets/dirs, bundle id sh.zeron.Zeron, zeron:// scheme
- clients default to https://edge.zeron.sh; installer + landing on zeron.sh
- kept on purpose: repo name, worker names (comet-native-edge/comet-landing;
  DO storage is bound to the script name), R2 bucket names, and legacy
  comet.zeron.sh routes so 0.1.x clients keep working

zeron-<ver>-* artifacts don't exist until the next release, so curl-install
and landing downloads 404 between this deploy and the 0.2.0 tag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-14 10:49:19 +00:00
wing-anara
d28cf9c22f chat2 C3/M2/M3: host wiring, roomGen cutover, reader discard-and-adopt
The self-repair cutover (docs/chat2-sync.md), motivated by tonight's
incident: a cold reader no client release could heal, because s2's
full-history WS backfill burst dies on some network paths. chat2 readers
fetch one compact checkpoint over Range-resumable HTTP instead.

- doc_host open() branches on the registry's roomGen: 2 → chat2 join
  (supervised dial, 60s deadline, backoff, wake redial; ChatClient resolves
  only after full catch-up) with local commits fed to the relay via
  subscribe_local_update; else → the extracted s2 join, unchanged.
- Host-side lazy migration (M1/M2): on opening an s2 chat it hosts, the
  host spawns a seed — rebuild_thin_doc → POST seed checkpoint
  (seqCovered=0) → rollback copy of the fat lineage → persist thin
  (epoch 2, cursor 0) → flip registry roomGen=2 LAST (crash before the
  flip = chat stays on s2, retried next open). Live handle is retired
  (never persists the fat doc again) and dropped when unpinned.
- Reader discard-and-adopt (M3): opening a roomGen-2 chat with a local
  epoch<2 doc keeps a rollback snapshot ({chat}.pre-chat2), re-queues own
  pending commands, starts fresh, and lets the chat2 catch-up repopulate.
  No user action — the self-repair path.
- chat2 host duties on the quiesce tick: threshold checkpoints
  (rowBytes>512KB || rows>200, seqCovered=cursor) and the last-64 tail
  sidecar publish (the iOS/thin-reader fallback).
- plan_catch_up + run_session: checkpoint PRESENCE keys on checkpointSize,
  not checkpointSeq — a seeded room's checkpoint covers seq 0, and the
  seq==0 shortcut (present in BOTH sites) made adopted readers skip the
  seed and render empty transcripts. Caught by the live gauntlet: the real
  ChatClient now cold-reads a scratch room seeded with this session's real
  573KB doc → 276KB thin checkpoint over HTTP → all 36 messages converge.

Suites: full workspace green (31 result sets). Gauntlet: rebuild → seed
POST → real-ChatClient cold read on a deployed scratch worker, plus the
seeded-at-zero regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 09:26:58 +00:00
wing-anara
c359862f1e chat2 test harnesses: live E2E, cross-language crosscheck, whale rebuild probe
Artifacts from the verification pass, for the C3 session and CI-someday:

- edge/scripts/chat2-check.mjs: 65-check wire-level E2E against a deployed
  worker (protocol, guards, checkpoint lifecycle, quota, sidecars, blob-route
  isolation + '#' encoding, reset).
- edge/scripts/chat2-crosscheck.mjs + crates/sync/examples/chat2_live.rs:
  real ChatClient (tungstenite + actor) vs a JS Loro peer through a live
  ChatRoom — checkpoint-then-rows leg, live push/ack, byte-level convergence.
- edge/scripts/chat2-persist-check.mjs: seed/verify pair proving rows,
  checkpoint, frontier meta and sidecars survive DO eviction (redeploy).
- crates/doc/examples/rebuild_whale.rs: M1 rebuild against a real snapshot
  file; the 1b65e93d whale: 1,079,986 -> 152,934 bytes (7.1x), 384 sidecar
  payloads, idempotent, 8ms.
- edge/wrangler.chat2test.jsonc: throwaway staging config (dev auth, isolated
  bucket, workers.dev) used to run all of the above; deploy, test, delete.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 03:44:26 +00:00
Wing
347c920f2b Deaf-socket healing: probe-on-focus, acks don't feed the probe, edge closes on send failure
The 2026-08-04 incident, caught live with 0.1.17 logging + wrangler tail:
work-laptop's workspace-room socket had its writes accepted and fanned out
(its rows reached other devices minutes-fresh) while receiving NOTHING back
— title stuck at "New session", no Working indicator — until the DO
instance recycled (16:30:19Z "connection closed"), which healed every
device at once. The wedge then re-formed within minutes.

Three failure-shape fixes and one observability fix:

- Probe clock now keyed on SERVER-PUSHED %LOR frames (broadcasts, backfill,
  join answers), never acks: a deaf-receiving socket whose own writes keep
  getting acked used to reset the probe on every ack and was never probed.
  Acks still extend the JOIN deadline (slow-uplink pushes must not be
  killed mid-drain — the original adversarial finding stands).
- ProbeSync RPC + window-focus rising edge in the shell: focusing the app
  probes the workspace room and every open chat room (each gated on ≥30s
  broadcast-quiet), so a wedged device heals seconds after you look at it
  instead of minutes later.
- edge: a member socket that throws on broadcast send is CLOSED, not
  skipped — the client redials and VV-backfills within seconds. The old
  swallow left a permanently deaf peer that still pinged and wrote.
- Mid-session rejoins now log at info: this morning's recovery was
  completely silent, which made the incident timeline unreconstructable.

Also: doc_surgery dump-workspace mode (used to prove work-laptop's writes
were landing during the incident).

Regression test: own_write_acks_do_not_suppress_the_probe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 09:42:52 -07:00
wing-anara
104e2a7ae6 cargo fmt the workspace
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 18:44:15 +00:00
wing-anara
a49deff3c1 sync: doc_surgery example — inspect/repair chat docs in a docs store
The one-off recovery tool from the Jul 28 devbox incident, kept as an
example: inspect-workspace / inspect-chat / cut-chat against a
docs.sqlite3 store. serde_json joins sync's dev-dependencies for it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 12:37:26 -07:00