Commit graph

315 commits

Author SHA1 Message Date
Mario Zechner
ff33ef42c4 feat(chord): telemetry from pages and workers stored by the server, who a span was for
The four telemetry gaps (rows on commits, chord.host, microsecond times, a read-only store) and: pages record and
send span batches over their link to the server's ingest object (checked, capped, rate-limited, stamped browser and
with the link's principal); workers send theirs too, so the server is the store's only writer; principalAttributes
lets an app choose what a span records about its principal. The tutorial shows a real page's click traced to the
worker, with the trace viewer.
2026-11-04 11:59:14 +00:00
Mario Zechner
80f7a11494 docs(chord): the server is the one place telemetry is stored 2026-11-04 11:01:31 +00:00
Mario Zechner
f666087695 docs(chord): the principal hook caches for itself; a Chord host option 2026-11-04 10:58:46 +00:00
Mario Zechner
72dd26e084 docs(chord): spans record who they were for, through an app hook 2026-11-04 10:57:57 +00:00
Mario Zechner
596523e01e docs(chord): telemetry from browser pages decided 2026-11-04 10:54:06 +00:00
Mario Zechner
0efe50cb6d docs(chord): tutorial chapter on telemetry, with a small trace viewer 2026-11-04 10:40:17 +00:00
Mario Zechner
378d45a05b feat(chord): telemetry, spans across hosts (slice 9)
Chord's telemetry schema; spans for calls, methods, relays, holds, activations, natives, loads, reloads, resolves,
revocations, routines, jobs and HTTP requests; trace carriers on hold and call (bounded, printable ASCII) continued by
relays and workers; events and host-wide metrics; the app kit passes an adapter to its hosts. renderTrace escapes
control characters. Example 62 prints a trace across three hosts.
2026-11-04 10:02:48 +00:00
Mario Zechner
f4427f8a3e docs(chord): the tutorial uses tx.update with its integer key now that int keys type-check 2026-11-04 09:07:34 +00:00
Mario Zechner
2205a824bb docs(chord): slice 9 spec, telemetry with spans across hosts 2026-11-04 07:46:53 +00:00
Mario Zechner
0c2b568fd9 fix(chord): calls during a swap never see not_ready; reloads start dependents' fates first
A call arriving while an attempt activates waits for its outcome (bounded by readyTimeout) instead of failing
not_ready while its client sees live. Fates start in the reverse of the order objects went live, so a pure
dependent of a swapping provider swaps instead of parking.
2026-11-04 07:39:18 +00:00
Mario Zechner
3d11c3510b feat(chord): messages and languages in the app kit (i18n)
defineMessages with typed t, t.message/t.render for messages as data, the Translations registry with fallbacks and
conflicts, a locale preference per principal with the device as default and a live switch, useMessages and
scope.messages, formatTime/formatNumber. The tutorial gains a chapter on languages.
2026-11-03 20:25:53 +00:00
Mario Zechner
2439933cf2 feat(chord): live queries over an object's own tables (self.query)
self.query(table, q, limit) runs before the object goes live and again in the commit step of every commit that
touched the table, publishing only the diff; a reload swaps the object. The tutorial and 59-chat use it.
2026-11-03 19:40:48 +00:00
Mario Zechner
828bcadcba docs(chord): live queries over an object's own tables (self.query) 2026-11-03 19:16:58 +00:00
Mario Zechner
8f9446a060 feat(chord): invalid and forbidden exported, page state across plugin reloads, the tutorial app's API a workspace package 2026-11-03 19:02:56 +00:00
Mario Zechner
d6fb784c84 docs(chord): tutorial gaps decided: invalid exported, the app's API a package, page state across plugin reloads 2026-11-03 18:43:02 +00:00
Armin Ronacher
9f7d909f8b fix(chord): recover worker links after a sleep or a lost link
The heartbeat no longer counts time the process did not run (a laptop's sleep, a blocked event loop) as silence: after such a pause each open link pings at once and closes only if its peer stays silent for close - ping.

A running worker's lost link is now a stop instead of a failure: worker_link_lost is reported and the held route starts a new worker. A second lost link within a minute of the last recovery still fails the address.
2026-11-03 18:15:53 +01:00
Armin Ronacher
7aed50ae8b fix(chord): clear stale worker lock files on macOS and the BSDs
A worker killed by a signal left its lock's socket file, and every later start of its address failed closed on it, retry too. The workers component now removes a lock socket file nobody accepts on before each start and after a child's exit by a signal, in the address's queue. processLock also treats ENOTSOCK as stale instead of retrying until its context ended.
2026-11-03 17:48:14 +01:00
Mario Zechner
3551ec07eb docs(chord): p2 on Chord v2 and the v1 deletion done 2026-11-03 12:15:48 +00:00
Mario Zechner
ed4f488401 feat(chord): remove Chord v1 (/old, /old/node), its tests and docs
p2 runs on Chord v2; apps still on v1 pin @earendil-works/chord@1.5.0.
2026-11-03 12:11:22 +00:00
Mario Zechner
d7704516e0 fix(chord): int() table keys type as numbers again (a TypeBox leftover) 2026-11-03 08:32:07 +00:00
Mario Zechner
24d3993b20 docs(chord): the Chord v2 tutorial, a todo app built with the app kit (example 61) 2026-11-03 08:30:05 +00:00
Mario Zechner
0c7c741988 fix(chord): channel test attaches its expectation before the deadline can pass 2026-11-03 07:29:13 +00:00
Mario Zechner
5bd014b1c7 feat(chord): mistakes that wait are reported at once
- get, hold and registry on a host that has not loaded throw not_ready at once.
- A registry with contributions and no provider is reported (registry_undeclared) at publication.
- A request waiting unbound is reported once after 5 s (unbound_long; one clock per host), and keeps waiting.
- An invalid plugin name makes load and reload throw before any change.
- A transaction cancelled by the end of its context is reported (transaction_cancelled) besides rejecting.
- Docs: who a reference acts as, no per-link call limit, await what you start in a root or a handler.
2026-11-03 07:19:52 +00:00
Mario Zechner
51bb8f5c06 fix(chord): createWorkers' route resolve type-checks in every program 2026-11-03 07:19:24 +00:00
Mario Zechner
8ff2cec028 docs(chord): p2 switch goes to the phone once green 2026-11-03 06:59:12 +00:00
Mario Zechner
5d74f40de9 docs(chord): changes cancelled by a seal are reported 2026-11-03 06:49:01 +00:00
Mario Zechner
fc7d91f4e8 docs(chord): mistakes that wait are reported at once; no per-link call limit 2026-11-03 06:39:27 +00:00
David Brailovsky
c856eb0b6e fix(chord): mark plugin-imports test fixture private so preview publishing skips it
Some checks are pending
CI / build-check (push) Waiting to run
CI / test (coding-agent) (push) Waiting to run
CI / test (durable) (push) Waiting to run
CI / test (other) (push) Waiting to run
CI / mcp-conformance (push) Waiting to run
Environments / daemons (push) Waiting to run
Environments / check (push) Blocked by required conditions
Environments / release-daemons (darwin-arm64, macos-latest) (push) Blocked by required conditions
Environments / release-daemons (darwin-x64, macos-latest) (push) Blocked by required conditions
Environments / release-daemons (linux-arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
Environments / release-daemons (linux-x64, ubuntu-latest) (push) Blocked by required conditions
Environments / release-daemons (windows-arm64, windows-11-arm) (push) Blocked by required conditions
Environments / release-daemons (windows-x64, windows-latest) (push) Blocked by required conditions
Environments / tests (macos-latest) (push) Waiting to run
Environments / tests (ubuntu-24.04-arm) (push) Waiting to run
Environments / tests (ubuntu-latest) (push) Waiting to run
Environments / tests (windows-11-arm) (push) Waiting to run
Environments / tests (windows-latest) (push) Waiting to run
2026-11-03 00:04:15 +01:00
Mario Zechner
3c7a9ca0e7 feat(chord): example 59-chat keeps its messages in a table 2026-11-02 22:47:49 +00:00
Mario Zechner
d5c4b80ebf docs(chord): p2 moves to Chord v2, then v1 is deleted 2026-11-02 22:38:23 +00:00
Mario Zechner
e9c0ff4d84 feat(chord): Chord v2 is the package's root
src/next is src (the main export), src/next-node is src/node with short subpaths (/http, /workers, /plugins,
/plugins/runtime, /app, /surfaces, /web, /react, /tui, /tui/launcher); the foundations get /json and /watch;
Chord v1 moves to src/old (/old, /old/node) until p2 runs on v2; tests and docs move likewise (test/, docs/,
test/old, docs/old). Durable and env import the foundations from their subpaths.
2026-11-02 22:36:55 +00:00
Mario Zechner
1d81a69727 docs(chord): Chord v2 becomes the package's root 2026-11-02 21:40:16 +00:00
Mario Zechner
5bc4145165 feat(chord): Chord v2 web and terminal surfaces (slice 11)
- Web: base bundles built from the app's entry at start (content-hashed, served
  forever), plugin scripts that register themselves and one combined file,
  WebScripts/TuiScripts showing the current set, startPage with the connection
  loop, in-place plugin reloads and a reload on a new base bundle.
- React bindings: HostProvider, useHold, useWatch, useRegistry, useRefState.
- Terminal: startTerminal, a launcher that signs in with a token, a token file or
  device pairing and always runs the app's terminal code in a sandboxed child
  process (pipes, empty environment, --permission granting nothing, no SQLite,
  a builtin allowlist and a frozen process inside); output filter, confirmed
  copy/open/attach actions; startTerminalRuntime and TuiScope inside.
- Themes: the Themes registry, ThemeChoice per principal, CSS variables on the
  page, terminal colours by role; CSS modules in plugin builds.
- App kit: startServer gains web and tui; startApp renamed startServer,
  exportAddress/importAddress renamed exportData/importData and export no longer
  stops the worker; ephemeral sessions end with their client's last link.
- Examples 56-web, 57-tui, 58-themes, 59-chat.
2026-11-02 21:31:59 +00:00
Mario Zechner
9c248717da docs(chord): messages and languages in the app kit decided 2026-11-02 21:28:52 +00:00
Mario Zechner
65c85bda2c docs(chord): slice 11 spec, the sandbox is a child process 2026-11-02 20:47:13 +00:00
Mario Zechner
10cf3264fb docs(chord): design §23, the terminal's sandbox is a child process 2026-11-02 20:26:54 +00:00
Mario Zechner
128912d246 docs(chord): the terminal's sandbox is a child process 2026-11-02 20:26:39 +00:00
Mario Zechner
15f00a786a docs(chord): example 60, session sync played with the store's outbox, applyBatch and archives 2026-11-02 20:13:38 +00:00
Mario Zechner
642e30b689 docs(chord): p3 meeting prep with pictures, sync example, branches 2026-11-02 17:18:31 +00:00
Mario Zechner
1746cfd515 docs(chord): i18n proposal, t.message and one file per host 2026-11-02 17:09:59 +00:00
Mario Zechner
48f9f1b423 docs(chord): i18n proposal, messages as object state 2026-11-02 17:03:46 +00:00
Mario Zechner
7dffeaf521 docs(chord): i18n proposal 2026-11-02 16:58:24 +00:00
Mario Zechner
1f8604f84f docs(chord): sync applies batches with the host stopped 2026-11-02 16:47:09 +00:00
Mario Zechner
95485d32f1 docs(chord): startServer, exportData without stopping; p3 notes on subagent context and tree 2026-11-02 16:15:54 +00:00
Mario Zechner
e64f313bd6 docs(chord): p3 feature set and work packages, meeting prep 2026-11-02 15:58:52 +00:00
Mario Zechner
cf74b67653 docs(chord): p3 meeting summary, session sync and index 2026-11-02 15:49:56 +00:00
Mario Zechner
d6af4d18e5 docs(chord): looks and themes decided; slice 11 spec gains themes 2026-11-02 15:23:22 +00:00
Mario Zechner
072e413bf3 feat(chord): Chord v2 slice 13, the app kit
chord/next/app: startApp and startWorker with the fixed app layout, worker kinds,
AppInfo and WorkerInfo; sessions (hashed tokens, rolling cookies, bearer tokens),
the one-time owner link, the owner token file, device pairing; Files per host
with ordered chunked uploads; export and import per address; plugin roots,
installs and applyChanges; optional users, invite and ephemeral login facets.
HTTP: deny by default (public routes and sockets), remoteAddress,
readSignedCookie. Examples 53-55.
2026-11-02 15:13:37 +00:00
Mario Zechner
ff2c8931cf docs(chord): looks and themes proposal 2026-11-02 15:05:24 +00:00
Mario Zechner
9823079ad9 feat(chord): Chord v2 slice 12, the plugin model
Plugins import the app's versioned API (createPlugins api option: unlisted
versions, other kinds' modules, mixed versions and direct Chord imports refused),
each other by relative path within a root or by package name across
repositories (npm or git pins), with per-kind files checked by name.
chord.plugins lists a package's plugins. Required roots, single-file plugins,
installPlugin from git or npm, testPlugin with stub facets.
plugin-authoring.md for authors and agents. Examples 49-52.
2026-11-02 13:19:03 +00:00