@eloxiv/cli 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/AgentSkills.d.ts +51 -0
- package/dist/AgentSkills.d.ts.map +1 -0
- package/dist/AgentSkills.js +264 -0
- package/dist/AgentSkills.js.map +1 -0
- package/dist/AgentWeb.d.ts +83 -0
- package/dist/AgentWeb.d.ts.map +1 -0
- package/dist/AgentWeb.js +436 -0
- package/dist/AgentWeb.js.map +1 -0
- package/dist/App.d.ts +213 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +357 -0
- package/dist/App.js.map +1 -0
- package/dist/Blueprint.d.ts +47 -0
- package/dist/Blueprint.d.ts.map +1 -0
- package/dist/Blueprint.js +241 -0
- package/dist/Blueprint.js.map +1 -0
- package/dist/Brand.d.ts +42 -0
- package/dist/Brand.d.ts.map +1 -0
- package/dist/Brand.js +370 -0
- package/dist/Brand.js.map +1 -0
- package/dist/Changelog.d.ts +22 -0
- package/dist/Changelog.d.ts.map +1 -0
- package/dist/Changelog.js +117 -0
- package/dist/Changelog.js.map +1 -0
- package/dist/Cli.d.ts +17 -0
- package/dist/Cli.d.ts.map +1 -0
- package/dist/Cli.js +810 -0
- package/dist/Cli.js.map +1 -0
- package/dist/DbAdmin.d.ts +18 -0
- package/dist/DbAdmin.d.ts.map +1 -0
- package/dist/DbAdmin.js +91 -0
- package/dist/DbAdmin.js.map +1 -0
- package/dist/Dependencies.d.ts +53 -0
- package/dist/Dependencies.d.ts.map +1 -0
- package/dist/Dependencies.js +132 -0
- package/dist/Dependencies.js.map +1 -0
- package/dist/Deploy.d.ts +39 -0
- package/dist/Deploy.d.ts.map +1 -0
- package/dist/Deploy.js +458 -0
- package/dist/Deploy.js.map +1 -0
- package/dist/Docs.d.ts +71 -0
- package/dist/Docs.d.ts.map +1 -0
- package/dist/Docs.js +240 -0
- package/dist/Docs.js.map +1 -0
- package/dist/Doctor.d.ts +56 -0
- package/dist/Doctor.d.ts.map +1 -0
- package/dist/Doctor.js +368 -0
- package/dist/Doctor.js.map +1 -0
- package/dist/Dossier.d.ts +23 -0
- package/dist/Dossier.d.ts.map +1 -0
- package/dist/Dossier.js +92 -0
- package/dist/Dossier.js.map +1 -0
- package/dist/Emit.d.ts +26 -0
- package/dist/Emit.d.ts.map +1 -0
- package/dist/Emit.js +51 -0
- package/dist/Emit.js.map +1 -0
- package/dist/Errors.d.ts +26 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +17 -0
- package/dist/Errors.js.map +1 -0
- package/dist/Evals.d.ts +52 -0
- package/dist/Evals.d.ts.map +1 -0
- package/dist/Evals.js +126 -0
- package/dist/Evals.js.map +1 -0
- package/dist/Files.d.ts +47 -0
- package/dist/Files.d.ts.map +1 -0
- package/dist/Files.js +145 -0
- package/dist/Files.js.map +1 -0
- package/dist/Generate.d.ts +80 -0
- package/dist/Generate.d.ts.map +1 -0
- package/dist/Generate.js +310 -0
- package/dist/Generate.js.map +1 -0
- package/dist/Guards.d.ts +45 -0
- package/dist/Guards.d.ts.map +1 -0
- package/dist/Guards.js +530 -0
- package/dist/Guards.js.map +1 -0
- package/dist/Inspect.d.ts +125 -0
- package/dist/Inspect.d.ts.map +1 -0
- package/dist/Inspect.js +270 -0
- package/dist/Inspect.js.map +1 -0
- package/dist/Keychain.d.ts +57 -0
- package/dist/Keychain.d.ts.map +1 -0
- package/dist/Keychain.js +73 -0
- package/dist/Keychain.js.map +1 -0
- package/dist/Lock.d.ts +13 -0
- package/dist/Lock.d.ts.map +1 -0
- package/dist/Lock.js +145 -0
- package/dist/Lock.js.map +1 -0
- package/dist/Mcp.d.ts +91 -0
- package/dist/Mcp.d.ts.map +1 -0
- package/dist/Mcp.js +128 -0
- package/dist/Mcp.js.map +1 -0
- package/dist/Merge.d.ts +18 -0
- package/dist/Merge.d.ts.map +1 -0
- package/dist/Merge.js +43 -0
- package/dist/Merge.js.map +1 -0
- package/dist/Migrate.d.ts +78 -0
- package/dist/Migrate.d.ts.map +1 -0
- package/dist/Migrate.js +288 -0
- package/dist/Migrate.js.map +1 -0
- package/dist/Plugins.d.ts +36 -0
- package/dist/Plugins.d.ts.map +1 -0
- package/dist/Plugins.js +304 -0
- package/dist/Plugins.js.map +1 -0
- package/dist/Postgres.d.ts +73 -0
- package/dist/Postgres.d.ts.map +1 -0
- package/dist/Postgres.js +294 -0
- package/dist/Postgres.js.map +1 -0
- package/dist/Publish.d.ts +23 -0
- package/dist/Publish.d.ts.map +1 -0
- package/dist/Publish.js +59 -0
- package/dist/Publish.js.map +1 -0
- package/dist/Registry.d.ts +539 -0
- package/dist/Registry.d.ts.map +1 -0
- package/dist/Registry.js +340 -0
- package/dist/Registry.js.map +1 -0
- package/dist/Remote.d.ts +90 -0
- package/dist/Remote.d.ts.map +1 -0
- package/dist/Remote.js +1006 -0
- package/dist/Remote.js.map +1 -0
- package/dist/Run.d.ts +120 -0
- package/dist/Run.d.ts.map +1 -0
- package/dist/Run.js +477 -0
- package/dist/Run.js.map +1 -0
- package/dist/SyncGen.d.ts +118 -0
- package/dist/SyncGen.d.ts.map +1 -0
- package/dist/SyncGen.js +392 -0
- package/dist/SyncGen.js.map +1 -0
- package/dist/Update.d.ts +301 -0
- package/dist/Update.d.ts.map +1 -0
- package/dist/Update.js +627 -0
- package/dist/Update.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +42 -0
- package/dist/bin.js.map +1 -0
- package/dist/docs/backlog.md +56 -0
- package/dist/docs/ci.md +277 -0
- package/dist/docs/cli.md +696 -0
- package/dist/docs/connectors/google.md +115 -0
- package/dist/docs/connectors/http-openapi.md +7 -0
- package/dist/docs/connectors/mcp.md +8 -0
- package/dist/docs/connectors/microsoft-graph.md +75 -0
- package/dist/docs/connectors/openai.md +25 -0
- package/dist/docs/connectors/slack.md +162 -0
- package/dist/docs/connectors/workos.md +39 -0
- package/dist/docs/contracts/README.md +173 -0
- package/dist/docs/contracts/action-consent.md +92 -0
- package/dist/docs/contracts/action-registry.md +85 -0
- package/dist/docs/contracts/actor.md +100 -0
- package/dist/docs/contracts/agent-resources.md +90 -0
- package/dist/docs/contracts/agent-runtime.md +257 -0
- package/dist/docs/contracts/approvals.md +126 -0
- package/dist/docs/contracts/audit.md +75 -0
- package/dist/docs/contracts/auth-provider.md +74 -0
- package/dist/docs/contracts/calendar-provider.md +46 -0
- package/dist/docs/contracts/client-sdk.md +245 -0
- package/dist/docs/contracts/collab-document.md +151 -0
- package/dist/docs/contracts/command.md +44 -0
- package/dist/docs/contracts/connections.md +235 -0
- package/dist/docs/contracts/context-accounting.md +50 -0
- package/dist/docs/contracts/daemon.md +243 -0
- package/dist/docs/contracts/db-tx.md +53 -0
- package/dist/docs/contracts/delegation.md +68 -0
- package/dist/docs/contracts/device-control.md +103 -0
- package/dist/docs/contracts/directory-provider.md +36 -0
- package/dist/docs/contracts/directory.md +161 -0
- package/dist/docs/contracts/document-source.md +33 -0
- package/dist/docs/contracts/files.md +115 -0
- package/dist/docs/contracts/flags.md +83 -0
- package/dist/docs/contracts/host.md +68 -0
- package/dist/docs/contracts/http-api.md +43 -0
- package/dist/docs/contracts/ingestion.md +130 -0
- package/dist/docs/contracts/ingress.md +141 -0
- package/dist/docs/contracts/invocation.md +260 -0
- package/dist/docs/contracts/local-client.md +110 -0
- package/dist/docs/contracts/locale.md +56 -0
- package/dist/docs/contracts/machine-identity.md +117 -0
- package/dist/docs/contracts/mail-provider.md +49 -0
- package/dist/docs/contracts/memory.md +53 -0
- package/dist/docs/contracts/messaging.md +40 -0
- package/dist/docs/contracts/metering.md +139 -0
- package/dist/docs/contracts/model-provider.md +84 -0
- package/dist/docs/contracts/module-manifest.md +213 -0
- package/dist/docs/contracts/notification-channel.md +90 -0
- package/dist/docs/contracts/notifications.md +123 -0
- package/dist/docs/contracts/outbox.md +80 -0
- package/dist/docs/contracts/privacy.md +110 -0
- package/dist/docs/contracts/progress.md +52 -0
- package/dist/docs/contracts/query-surface.md +108 -0
- package/dist/docs/contracts/readiness.md +63 -0
- package/dist/docs/contracts/release.md +142 -0
- package/dist/docs/contracts/result-rendering.md +61 -0
- package/dist/docs/contracts/sandbox.md +186 -0
- package/dist/docs/contracts/scheduler.md +148 -0
- package/dist/docs/contracts/screen-context.md +81 -0
- package/dist/docs/contracts/search.md +120 -0
- package/dist/docs/contracts/secrets.md +74 -0
- package/dist/docs/contracts/settings.md +109 -0
- package/dist/docs/contracts/sharing.md +77 -0
- package/dist/docs/contracts/slot.md +48 -0
- package/dist/docs/contracts/space.md +67 -0
- package/dist/docs/contracts/storage-adapter.md +45 -0
- package/dist/docs/contracts/storage-backend.md +56 -0
- package/dist/docs/contracts/sync.md +213 -0
- package/dist/docs/contracts/telemetry.md +80 -0
- package/dist/docs/contracts/theme-tokens.md +50 -0
- package/dist/docs/contracts/tool-source.md +58 -0
- package/dist/docs/contracts/versioning.md +99 -0
- package/dist/docs/contracts/view.md +65 -0
- package/dist/docs/contracts/work-items.md +99 -0
- package/dist/docs/contracts/workflow.md +82 -0
- package/dist/docs/decisions.md +163 -0
- package/dist/docs/example-app.md +192 -0
- package/dist/docs/getting-started.md +927 -0
- package/dist/docs/goal.md +54 -0
- package/dist/docs/parity.md +29 -0
- package/dist/docs/performance.md +129 -0
- package/dist/docs/registry/README.md +74 -0
- package/dist/docs/registry/app.md +38 -0
- package/dist/docs/registry/approvals-ui-foldkit.md +28 -0
- package/dist/docs/registry/calendar-ui-foldkit.md +27 -0
- package/dist/docs/registry/calendar.md +35 -0
- package/dist/docs/registry/chat-ui-foldkit.md +30 -0
- package/dist/docs/registry/desktop-rune.md +50 -0
- package/dist/docs/registry/desktop.md +32 -0
- package/dist/docs/registry/eloxiv-action.md +25 -0
- package/dist/docs/registry/eloxiv-connector.md +25 -0
- package/dist/docs/registry/eloxiv-module.md +25 -0
- package/dist/docs/registry/eloxiv-policy.md +25 -0
- package/dist/docs/registry/eloxiv-view.md +25 -0
- package/dist/docs/registry/hello-ui-foldkit.md +29 -0
- package/dist/docs/registry/hello.md +39 -0
- package/dist/docs/registry/home-ui-foldkit.md +27 -0
- package/dist/docs/registry/home.md +29 -0
- package/dist/docs/registry/inbox-ui-foldkit.md +27 -0
- package/dist/docs/registry/mail-ui-foldkit.md +27 -0
- package/dist/docs/registry/mail.md +34 -0
- package/dist/docs/registry/meeting-prep.md +26 -0
- package/dist/docs/registry/members-ui-foldkit.md +28 -0
- package/dist/docs/registry/mobile.md +37 -0
- package/dist/docs/registry/notes-ui-foldkit.md +27 -0
- package/dist/docs/registry/notes.md +26 -0
- package/dist/docs/registry/people-ui-foldkit.md +28 -0
- package/dist/docs/registry/people.md +38 -0
- package/dist/docs/registry/shell-foldkit.md +35 -0
- package/dist/docs/registry/theme.md +25 -0
- package/dist/docs/registry/ui-conformance.md +30 -0
- package/dist/docs/release.md +100 -0
- package/dist/docs/scaffold.md +826 -0
- package/dist/docs/security/threat-model.md +299 -0
- package/dist/docs/upstream/zero-cache-socket-handoff.md +105 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
- package/src/AgentSkills.ts +329 -0
- package/src/AgentWeb.ts +507 -0
- package/src/App.ts +435 -0
- package/src/Blueprint.ts +276 -0
- package/src/Brand.ts +415 -0
- package/src/Changelog.ts +136 -0
- package/src/Cli.ts +1458 -0
- package/src/DbAdmin.ts +115 -0
- package/src/Dependencies.ts +170 -0
- package/src/Deploy.ts +563 -0
- package/src/Docs.ts +309 -0
- package/src/Doctor.ts +424 -0
- package/src/Dossier.ts +148 -0
- package/src/Emit.ts +68 -0
- package/src/Errors.ts +18 -0
- package/src/Evals.ts +153 -0
- package/src/Files.ts +152 -0
- package/src/Generate.ts +402 -0
- package/src/Guards.ts +541 -0
- package/src/Inspect.ts +358 -0
- package/src/Keychain.ts +107 -0
- package/src/Lock.ts +174 -0
- package/src/Mcp.ts +159 -0
- package/src/Merge.ts +70 -0
- package/src/Migrate.ts +331 -0
- package/src/Plugins.ts +347 -0
- package/src/Postgres.ts +353 -0
- package/src/Publish.ts +64 -0
- package/src/Registry.ts +405 -0
- package/src/Remote.ts +1158 -0
- package/src/Run.ts +541 -0
- package/src/SyncGen.ts +570 -0
- package/src/Update.ts +873 -0
- package/src/bin.ts +46 -0
- package/src/index.ts +7 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Goal: build Eloxiv
|
|
2
|
+
|
|
3
|
+
Build Eloxiv from its walking skeleton into a complete framework for agent-native applications, and keep iterating until every criterion in the definition of done passes.
|
|
4
|
+
|
|
5
|
+
## Inputs
|
|
6
|
+
|
|
7
|
+
- [decisions.md](decisions.md): the settled architecture, contracts, stack, budgets and example app. It is fixed. If a decision proves wrong or impossible, record the evidence under "Waiting on the user" in the progress file and work on something else; do not change the decision.
|
|
8
|
+
- [scaffold.md](scaffold.md): what the walking skeleton built, how to run it, the action contract (exact and best-effort actions, replay receipts, the result envelope), its stubs and known gaps. Start from it.
|
|
9
|
+
- [backlog.md](backlog.md): limits accepted in the skeleton's independent review, each of which must be resolved by the criteria below or explicitly deferred by the user.
|
|
10
|
+
- [spikes/](spikes/): the evidence behind the Effect RPC, Zero and Cedar choices, and why Postgres row-level security enforces the compiled policy.
|
|
11
|
+
- [research/agent-native-feature-ledger.md](research/agent-native-feature-ledger.md): every feature agent-native provides, with its destination in Eloxiv. It is the list of what to build, defer or drop, not a design to copy.
|
|
12
|
+
- `repos/agent-native`: read-only reference. Port its hardened designs where the ledger marks them worth keeping (durable runs, approval of prepared arguments, audit attribution, SQL verification, credential membership checks, provider backpressure), never its code shape or its multi-app plumbing.
|
|
13
|
+
|
|
14
|
+
## How to work
|
|
15
|
+
|
|
16
|
+
Each iteration:
|
|
17
|
+
|
|
18
|
+
1. Read `docs/progress.md` (create it on the first iteration).
|
|
19
|
+
2. Pick the unmet criterion, or part of one, that the most other work depends on.
|
|
20
|
+
3. Build it to the standard of the existing skeleton, with tests that prove the behaviour rather than its presence.
|
|
21
|
+
4. Run `mise run check` on both Bun and Node.
|
|
22
|
+
5. Get an independent review of each substantial or security-relevant change, following your global instructions on models and review, and fix its blocking findings.
|
|
23
|
+
6. Commit the reviewed work on a branch with a conventional message. Do not push or publish without the user's approval.
|
|
24
|
+
7. Update `docs/progress.md`: what was done, its evidence (test IDs, benchmark results, review outcome), the criteria still open, and anything waiting on the user.
|
|
25
|
+
|
|
26
|
+
When something needs the user (a decision, credentials, an account, an external service), record it under "Waiting on the user" with your recommendation and continue with work that doesn't depend on it. Never fake a dependency: a stand-in does not prove a connection works, and the progress file must say which connections are proven.
|
|
27
|
+
|
|
28
|
+
Keep `docs/scaffold.md` current as the map of what exists, or replace it with equivalent documentation.
|
|
29
|
+
|
|
30
|
+
## Definition of done
|
|
31
|
+
|
|
32
|
+
Every check below passes in CI on both Bun and Node.
|
|
33
|
+
|
|
34
|
+
1. **Ledger parity.** `docs/parity.json` gives every ledger row exactly one status: `implemented` (citing the tests that prove it), `registry` (citing the item path), `dropped` (with the ledger's reason), or `deferred-by-user`. A CI check fails on any unaccounted row, and on any `implemented` or `registry` row whose cited tests or paths don't exist.
|
|
35
|
+
2. **One invocation path.** A property-based suite proves that every surface (typed client, HTTP, MCP, agent tool, CLI, scheduled jobs, workflows and inbound webhooks) gives the same identity, policy result, approval behaviour, idempotency, audit record and outbox event for the same call. An action the policy hides is unreachable on every surface, including when its agent tool group is disabled.
|
|
36
|
+
3. **Module isolation.** Every module owns a Postgres schema and role. Tests prove no module can read or write another's tables. Cross-module work goes only through actions, events, entity references and capability contracts. Boundary checks prove the kernel has no UI dependencies.
|
|
37
|
+
4. **Kernel contracts.** Every kernel service, capability contract and shell contract in decisions.md, including the contracts added from the ledger's gaps, has a published schema, documentation and a conformance suite, and the kernel implementation passes it.
|
|
38
|
+
5. **Connectors.** Microsoft Graph and Google connectors pass the MailProvider, CalendarProvider, DirectoryProvider and DocumentSource conformance kits, including correct 401-versus-403 handling, merged scopes on one Connection, refresh, and cursor-based delta sync that resumes after interruption. Messaging is proven with at least one channel connector (Slack or Teams) through Ingress.
|
|
39
|
+
6. **Policy and sync.** Declarative policy, including per-record sharing grants and the published query views, compiles into SQL filters used for both sync and authorisation, with no construct compiled more loosely than it is written. Each client's replica holds only what its actor may read. Optimistic writes reconcile with server results, including rejection.
|
|
40
|
+
7. **Approvals and durable work.** Business approvals run end to end (request, notify, approve or reject, resume) on Workflow. Scheduled jobs, event triggers and durable agent runs survive a process restart without losing or repeating side effects.
|
|
41
|
+
8. **Agent.** One agent works over the whole registry through the action registry and the query surface. It has memory, delegation and context accounting. An eval suite covering every example module's skills meets its thresholds. External agents reach the app through MCP using MachineIdentity's OAuth flow.
|
|
42
|
+
9. **Headless proof.** The example app's acceptance scenarios pass through the client SDK, the CLI and MCP alone, with no registry UI installed.
|
|
43
|
+
10. **Registry.** `eloxiv add`, `eloxiv diff` and `eloxiv update` work for modules, connectors, the shell, UI items, the desktop host and skills: provenance records version and hash, and update performs a three-way merge that keeps local edits and reports conflicts. An app replaces any UI item without touching the kernel.
|
|
44
|
+
11. **Example app.** The app in `examples/`, assembled only through the CLI, has the home space (launcher, unified inbox, global agent, member administration), People, Mail and Calendar with the Microsoft Graph and Google connectors. Its UI is a plain reference built from the registry's thin reference screens (decision 11), limited to what its journeys exercise, not a finished product. Its end-to-end journeys pass in the browser and in the Tauri desktop host on Linux, macOS and Windows, with the daemon as its sidecar.
|
|
45
|
+
12. **Daemon.** The daemon pairs a device, runs agent turns on the person's own Codex and Claude Code subscriptions, relays tools over loopback with token custody, and runs as a headless runner on an always-on machine that serves turns sent from the browser and from scheduled jobs.
|
|
46
|
+
13. **MAKE.** The agent drafts a module that goes through preview, approval, sandboxed install, a version bump and rollback, end to end, and cannot exceed its capability profile.
|
|
47
|
+
14. **Mobile guard.** CI proves the client SDK and sync run on a real React Native runtime (Hermes), not only in a bare VM.
|
|
48
|
+
15. **Performance budgets.** Every budget in decisions.md is asserted in CI against what it measures (the kernel, the hello app or the full example app), including desktop launch, and none is loosened; a budget decisions.md marks as reported is reported, not asserted, and budgets are judged and excepted as decision 13 says.
|
|
49
|
+
16. **Security.** Threat-model tests cover identity, policy, approval, MCP and OAuth flows, webhooks, the sandbox, the daemon and secrets, and an independent security review has no unresolved blocking findings.
|
|
50
|
+
17. **Backlog.** Every item in `docs/backlog.md` is resolved with tests that prove it, or marked deferred by the user.
|
|
51
|
+
18. **Documentation.** Every contract, CLI command and registry item is documented for an outside developer building their own app, with a getting-started guide that a fresh agent can follow to build a new module and app from the registry, including building the app's own screens on the client SDK and the headless chat SDK.
|
|
52
|
+
19. **One definition per module** (decision 9). The example and registry modules declare each field once, in their Drizzle table, and a boundary check fails if any module or registry UI item imports the sync engine (`@rocicorp/zero`) directly.
|
|
53
|
+
|
|
54
|
+
Stop only when every criterion passes and `docs/progress.md` shows nothing waiting on the user.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Ledger parity
|
|
2
|
+
|
|
3
|
+
[`parity.json`](parity.json) records, for every row of the [agent-native feature ledger](research/agent-native-feature-ledger.md), where that feature stands in Eloxiv. It is criterion 1 of the definition of done in [goal.md](goal.md): every row has exactly one status, and a check fails on any row left out and on any claim that doesn't hold.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
One flat JSON object, keyed by ledger row id (`A-001` …), in ledger order. It is formatted as oxfmt formats JSON (two-space indent, one field per line).
|
|
8
|
+
|
|
9
|
+
| Status | Fields | Meaning |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `implemented` | `tests`: non-empty list of `{ "file", "name" }`; optional `note` | Eloxiv provides the feature as it defines it, and the cited tests prove the behaviour. `file` is a repository-relative `*.test.ts` or `*.spec.ts`, or a conformance kit's source (see below); `name` is the exact literal title of an `it(...)` or `test(...)` in it (modifiers such as `it.each(...)(...)` and `it.effect(...)` count) |
|
|
12
|
+
| `registry` | `items`: non-empty list of paths under `registry/` (an item's source, for example `registry/app/modules/hello`); optional `tests`, `note` | The feature ships as registry items, which exist |
|
|
13
|
+
| `dropped` | `reason`: the ledger row's Reason, verbatim | Only for rows whose ledger Destination is `dropped:*`. A row the ledger keeps can be dropped only by the user, as `deferred-by-user` |
|
|
14
|
+
| `deferred-by-user` | `note`, `decision` | The user deferred it. `decision` is the title of an entry under `## Deferred by the user` in [progress.md](progress.md): a `### <title>` heading or a list item starting `**<title>.**`. Agents never set this status themselves |
|
|
15
|
+
| `open` | `plan`; optional `note` | Not done yet. `plan` is where it will land: a contract named in [decisions.md](decisions.md) (for example `Scheduler`, `AgentRuntime`, `Sharing`) or a registry item, `registry:<kind>/<item>` (or `registry:<kind>`), using the ledger's kinds |
|
|
16
|
+
|
|
17
|
+
No other fields are allowed.
|
|
18
|
+
|
|
19
|
+
**Tests in conformance kits.** A contract's tests live in its conformance kit, `packages/testing/src/conformance/<Name>.ts` (see [contracts/README.md](contracts/README.md)), not in the `*.test.ts` file that runs them. Cite such a test by the kit's source file and the title as the kit writes it. The citation holds only if some `*.test.ts` file in `packages/`, `registry/`, `examples/` or `tools/` runs the kit, recognised as `tools/done/test/contracts.test.ts` recognises a kit's runner: it imports `.../conformance/<Name>` or `.../conformance/<Name>.ts`. Other files under `conformance/` (fixtures, helpers in subdirectories) cannot be cited. The ledger's `open:<n>` destinations are treated as their kept destination: the decisions they waited on are settled.
|
|
20
|
+
|
|
21
|
+
## The check
|
|
22
|
+
|
|
23
|
+
[`tools/done/test/parity.test.ts`](../tools/done/test/parity.test.ts) (Vitest project `done`) parses the ledger and checks the file. Under `mise run check` it fails on broken claims: a missing, unknown, duplicated or out-of-order row, a malformed entry, a cited test file or title that does not exist, a cited kit that no test runs, a missing registry path, a dropped reason that is not the ledger's or a drop the ledger doesn't make, a deferral without a recorded decision, or a plan that names no contract or registry kind. It prints a one-line count per status. `mise run done` also fails while any row is `open`.
|
|
24
|
+
|
|
25
|
+
`mise exec -- node tools/done/src/parity-report.ts` prints the open rows grouped by plan, largest first (`--features` adds each row's feature).
|
|
26
|
+
|
|
27
|
+
## Updating a row
|
|
28
|
+
|
|
29
|
+
When work lands, change the row to `implemented` and cite the tests that prove its feature as Eloxiv defines it, not merely something adjacent; when in doubt, leave it `open`. Run the `done` project (`mise exec -- bun --bun vitest run --project done`) to check the citations.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Performance budgets: how they are measured
|
|
2
|
+
|
|
3
|
+
The budgets are decision "Performance" in [decisions.md](decisions.md). They are enforced on Bun and Node by `mise run bench` (`tools/scripts/bench.sh`), which CI's `budgets (bun)` and `budgets (node)` jobs run on the merge tier, each on a runner of its own beside the full check (`tools/done/src/ciPlan.ts`, `budgets-bun` and `budgets-node`), and which the desktop lanes run for the desktop launch. The limits live in [`bench/src/budgets.ts`](../bench/src/budgets.ts). They may be tightened once measurements show headroom; they are never loosened without asking. The latest measured values are under "Measured baselines" in [scaffold.md](scaffold.md).
|
|
4
|
+
|
|
5
|
+
## What each budget asserts
|
|
6
|
+
|
|
7
|
+
| Budget | Limit | Asserted on |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Shell route change from the local replica (React shell, and the Foldkit shell when the app has it) | 50 ms | the median of 3 rounds' p95, each round 40 route changes in a new browser context |
|
|
10
|
+
| Invocation overhead, excluding the handler | 5 ms | the median of 3 rounds' p50, each round 500 invocations of a no-op action |
|
|
11
|
+
| A write reaching another client | 250 ms | the median of 3 rounds' p95, each round 40 writes on each path (the slower path's p95) |
|
|
12
|
+
| Kernel start on a set-up database | 2 s | the median of 3 starts of an app's kernel alone (no zero-cache, no Vite), setup and seed in its process, each on a freshly prepared database; taken for every app measured (the hello app, and the whole example app), and asserted on the slower app's median |
|
|
13
|
+
| Hello app in development: memory | 2048 MiB | the largest of 5 independent starts, each the proportional set size of the whole process tree (below) |
|
|
14
|
+
| Hello app in development: cold start | 5 s | the median of 5 independent cold starts |
|
|
15
|
+
| Whole example app in development: memory | 2048 MiB | the largest of 5 independent starts (when the repository has the whole example app) |
|
|
16
|
+
| Whole example app in development: cold start | 8 s, a tripwire | the median of 5 independent cold starts; reported (`TRIPPED` when over), never a gate (decision 13) |
|
|
17
|
+
| Desktop launch to interactive | 1.5 s | the median of 3 rounds' p95, each round 20 launches with its own system (desktop lanes) |
|
|
18
|
+
|
|
19
|
+
The statistic each budget names (p95 or p50) is taken within each round, and the run asserts the median of the rounds. A slow spell confined to one round does not move it; a regression moves every round. Each round's figure is printed with the budget, and `bench/results/latest.<runtime>.local.json`, which CI uploads, holds every sample (`values`).
|
|
20
|
+
|
|
21
|
+
The hello app is `examples/hello-only` (or `ELOXIV_BENCH_HELLO_APP_DIR`): `app`, `hello`, `hello-ui-foldkit`, `shell-foldkit` and `theme`, assembled through the CLI (`eloxiv init --preset web`, `eloxiv add hello hello-ui-foldkit`) and kept current with the registry like every example (`packages/cli/test/cli.test.ts` fails when it falls behind; `eloxiv update --cwd examples/hello-only`). The whole example app is the app under `examples/` with people, mail and calendar and a shell, `examples/hello-app` (or `ELOXIV_BENCH_EXAMPLE_APP_DIR`). Each is measured on its own: five cold starts and three kernel starts each. Without a hello-only app, the hello app falls back to the whole example app, measured once for both apps' rows (stricter than the decision asks, never looser; the run prints a `NOTE`). Each result names the app it was measured on (`measured on examples/<app>`). Both apps' cold starts end at the same point, a signed-in browser showing `/hello` with a fixture greeting that only sync can have delivered, so the whole example app must keep the hello module.
|
|
22
|
+
|
|
23
|
+
**Memory is the whole process tree.** Everything the `mise run dev` orchestrator started, followed by parent process (zero-cache starts each of its workers in a session of its own, but they stay its children), plus the PostgreSQL cluster, after sign-in, an action and its sync; the browser is excluded. It is reported by role (`kernel MiB`, `zero-cache MiB`, `zero-cache worker MiB`, `vite MiB`, `orchestrator MiB`, `postgres MiB`, and each role's process count), and a sample without the kernel, zero-cache or at least one zero-cache worker fails the benchmark rather than understate the budget (`bench/src/memory.ts`, `bench/test/apps.test.ts`). Rounds and starts are independent: each is measured from scratch. For the development benchmark, each of the five starts gets a freshly prepared database, a fresh zero-cache replica, a new `mise run dev` orchestrator and a new browser context. These budgets used to be taken over one round, which a runner's spell could swing:
|
|
24
|
+
- The same commit's single cold start measured 2.6 to 5.8 s, and `809bef60` failed at 5.08 s.
|
|
25
|
+
- Three of twenty Windows launches in one run took 1.7 to 3.3 s where the rest took 0.7 to 1.1 s; the p95 was 1749 ms against 1500.
|
|
26
|
+
|
|
27
|
+
## A slow machine is not a regression
|
|
28
|
+
|
|
29
|
+
CI runners have slow spells, and a slow spell slows everything at once. In one run on `809bef60`, invocation overhead was 11.0 ms where it is usually about 1.2, route change 5.6 ms where it is usually 2.4, and a write 89.7 ms where it is usually 14. In another, a single `psql` took 27 ms instead of 3 to 8. So every run also times a fixed workload, the calibration ([`bench/src/calibration.ts`](../bench/src/calibration.ts)):
|
|
30
|
+
- 256 SHA-256 digests of 1 MiB on one core;
|
|
31
|
+
- the median of seven starts of the runtime doing nothing;
|
|
32
|
+
- 64 digests on every core at once, timed until the last core finishes;
|
|
33
|
+
- the median of 400 one-byte round trips to a child process through a pipe, which shows how soon a waiting process gets to run;
|
|
34
|
+
- the median of 200 `SELECT 1` round trips to PostgreSQL, when it is running. Every benchmark waits on PostgreSQL.
|
|
35
|
+
|
|
36
|
+
The first two alone missed a slow spell. In run 42691022411 (`2f207d36`, Bun), one core hashed in 124 ms and a process started in 5.3 ms, both healthy. Yet every one of the five cold starts took 7.1 to 8.4 s, where the same job's Node run took 3.8 to 5.6 s. Serving the sign-in page took 930 ms where a healthy runner takes 320 to 360 ms, though the shell's code was the same, and invocation overhead was 5.8 ms where it is usually about 1.2. The last three measures are for that kind of spell: cores shared with another tenant, a busy scheduler, or a slow database.
|
|
37
|
+
|
|
38
|
+
Calibrations before and after the benchmarks still miss a spell that falls between them. In run 42720827531 (`32958566`, Node), the sign-in page took 770 ms and a write 70 ms, yet every measure of both calibrations was healthy. So a watcher also runs the whole time the benchmarks run (`calibration.ts --watch`, a process of its own). It records how late a 20 ms timer fires (the 95th percentile) and, on Linux, the share of CPU time the hypervisor gave other tenants (steal time, from `/proc/stat`). Either over its limit counts as a slow machine, like a calibration (`calibration-during.<runtime>.json`). Whether it would have caught that run is not proven: it was added after it. The watcher runs on Node in both lanes (it watches the machine, not a runtime). It does not slow the benchmarks: its own use is 0.25 % of a core, and on 2026-11-10 a CI run of build/criteria-367 with no watcher at all missed the cold-start budget as the run with one did (p50 6.5 s and 6.7 s, run 42884207817), as did one with zero-cache unpatched (6.4 s). Paired runs at the same time showed the runners, not the code: build/main 4.7 s against the branch's 6.7 s in one pair, and with the test suites left out the branch's Bun lane 4.5 s against build/main's 6.3 s (runs 42893242109 and 42893255405, both Node lanes over budget). Every calibration measured healthy throughout, so those measures do not see this slowness: one build/main commit started in 2.7 to 8.8 s by runner, its kernel's phases about 1.8 times slower on the slow ones, while every runner calibrated at 116 to 133 ms against a 400 ms limit.
|
|
39
|
+
|
|
40
|
+
**The runner's speed.** More measures see it, each as a ratio to a known-good runner's time (`REFERENCE` in `bench/src/calibration.ts`):
|
|
41
|
+
- the kernel's start alone (the kernel-start budget's own measurement), which follows the cold start closely from runner to runner: each app's to its own reference, the larger ratio counting, so the app whose start missed counts;
|
|
42
|
+
- a contention workload shaped like the cold start, which knows nothing of the code: `cores + 2` processes of the runtime started at once, each compiling 6000 functions, round-tripping 30 000 records through JSON and reading 300 files three times (`contentionMs`, the faster of two rounds);
|
|
43
|
+
- an I/O workload, which knows nothing of the code either: 16 files of 1 MiB written and each synced to disk, then read back; then, in PostgreSQL, a table created with row-level security and a policy, 10 000 rows written in 40 commits, an index built and the rows read (`ioMs`, the faster of two rounds; its scratch table and files are removed).
|
|
44
|
+
|
|
45
|
+
The host's ratio is the larger of the two workloads'. It is the runner's speed when the kernel bears it out by starting slower than on the reference runner (its ratio over 1); a kernel as fast as the reference's makes the runner's speed the kernel's ratio, healthy. A kernel that got slower raises only the kernel's ratio and is never taken for a slow runner; it fails as the code. Over `SLOW_RATIO` (1.3) the runner is slow. The kernel used to have to be over 1.3 too (the runner's speed was the smaller of the two ratios), which a kernel-start miss could not reach: the whole example app's Node reference, 1,878 ms, is 94 % of the 2,000 ms budget, so any start under 2,441 ms read healthy whatever the host measured. Merge tier 43798305676 (attempt 1, Node) failed that way: I/O 1.40 times the reference (1.33 after the miss), contention 1.06, the whole example app's kernel 2,152 ms, a ratio of 1.15 taken for the runner's speed (`bench/test/calibration.test.ts`, "takes a host whose I/O measures 1.40 times the reference for slow when the kernel start misses its budget"). The contention and hello-app kernel references are the fastest of 14 Blacksmith 4-vCPU runners measured at once on 2026-11-10 (run 42895735110): Bun contention 283 ms and kernel 1139 ms, Node 370 and 1465 ms. On those 14 runners the kernel's start went from 1.1 to 2.6 s and the cold start from 3.8 to 7.8 s together; the contention workload from 0.28 to 0.69 s, more loosely. The whole example app's kernel references are a healthy build/main run's on that runner (43693928307, attempt 2): Bun 1228 ms, Node 1878 ms.
|
|
46
|
+
|
|
47
|
+
The I/O workload is for a host whose disk or database is contended, as when the merge tier's heavy jobs share the machine: CPU-bound measures stay fast while setup's statements, and so the kernel's start, slow down (backlog 47). In build/main's run 43693928307 the Node lane missed the kernel start at 2,853 ms on attempt 1 and passed at 1,878 ms on attempt 2, with contention at 0.85 both times and every other measure healthy; the hello app's kernel, 1.29 times its reference, just under the slow ratio. Judged on contention alone that run failed as the code; with the I/O workload slow too and the whole example app's kernel counted, it is measured again and, if still slow, inconclusive (`bench/test/calibration.test.ts`, "takes a host whose disk and database are contended for slow, though its CPU workloads measure fast"). Whether the workload would have seen that run's contention is not proven: it was added after it. Its reference is from build/main's first merge-tier run that measured it (43707743149, 2026-11-15): 36 ms on Bun and 43 ms on Node, on runners whose contention was 0.81 and 0.82 times the reference's (it had been 140 ms, from this machine under other agents' load, which would have missed nearly any contention). Set high, it can only miss a contended host, never excuse the code.
|
|
48
|
+
|
|
49
|
+
1. The calibration runs before the benchmarks.
|
|
50
|
+
2. Every benchmark runs, and every budget is asserted.
|
|
51
|
+
3. If every budget is met, the run passes.
|
|
52
|
+
4. If one is missed, the calibration runs again. If the runner measured healthy both times, the run fails: the miss is the code's. If either calibration was over a limit, or the runner's speed over 1.3, the runner was slow, so only the benchmarks that missed are measured once more, from scratch, and the runner is calibrated a third time.
|
|
53
|
+
5. A budget still missed fails only when the runner measured healthy on both sides of its second measurement: the calibration after the miss (just before it) and the third (just after it). Slow on either side, the second measurement was taken on a runner slow for at least part of it, and the run is **inconclusive: runner too slow to judge**. It does not fail the check and is not evidence the budget is met (decision 13). Memory is never excused: it is not speed. Judged by the third calibration alone, PR #94's run failed: the runner 2.41 and 2.21 times the reference before the second measurement, 1.117 after it, and the cold start 5,285 ms against its 5,000 ms budget (`bench/test/calibration.test.ts`, "a miss measured again on a runner slow before the second attempt").
|
|
54
|
+
|
|
55
|
+
Every run's outcome, the runner's speed ratios, the kernel's start and the calibrations are written to `bench/results/verdict.<runtime>.json`, into the benchmark report (`latest.<runtime>.local.json`, `verdict`) and to the job summary. Neither the measurement nor the budget is ever scaled by the ratio.
|
|
56
|
+
|
|
57
|
+
Under the earlier rule (both ratios over 1.3), the 14 runners of run 42895735110 (this branch) would have judged the hello app's cold start 8 passes, 5 inconclusive and 1 failure (Node, 5.2 s on a runner the contention workload rated fast), and the kernel start 11 passes and 3 inconclusive. The 17 earlier probe jobs (build/main, this branch and the example app, raw results kept with the integrator) recorded the kernel's start but not the contention workload; judged on the kernel's ratio alone, they would have been 5 passes and 11 inconclusive for the cold start, and 8 and 8 for the kernel start: none a failure, where every miss failed before.
|
|
58
|
+
|
|
59
|
+
Only a complete report passes. `bench/src/run.ts` writes its attempt's report last, marked complete, with the budgets it measured. A benchmark that throws leaves none, and a missing, unreadable, incomplete or earlier attempt's report fails the run (`bench/test/report.test.ts`, with a real exception). So does a run that measured nothing.
|
|
60
|
+
|
|
61
|
+
The measurement is repeated, never the assertion. No budget moves, and a run on a healthy runner gets no second chance. The decision is tested in [`bench/test/calibration.test.ts`](../bench/test/calibration.test.ts). The calibrations (`before`, `after`, `again`), the watch, both attempts (`attempt-1` and `attempt-2`) and the verdict are in `bench/results`.
|
|
62
|
+
|
|
63
|
+
## Where the kernel's start goes
|
|
64
|
+
|
|
65
|
+
The whole example app's kernel start on a set-up database, on Node, measured as the budget measures it (the kernel alone, setup and seed in its process, each start on a freshly prepared database) with timing marks in the kernel, the median of 5 starts through `heavy.sh` on this machine (16 threads, under other agents' load; CI's runner takes about 0.73 times as long: 1,878 ms where this machine took 2,557), 2026-11-15:
|
|
66
|
+
|
|
67
|
+
| Phase | ms | Share |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| Process start and loading the code (to `runPrepareAndServe`) | 1,006 | 39% |
|
|
70
|
+
| Setup: checks, the database host and the recorded state | 71 | 3% |
|
|
71
|
+
| Setup: roles (`bootstrapCluster`) | 29 | 1% |
|
|
72
|
+
| Setup: the registry (declarations and policies checked, Cedar loaded) | 325 | 13% |
|
|
73
|
+
| Setup: the lease, the kernel's recorded state, `bootstrapDatabase`, Better Auth's pending migrations | 82 | 3% |
|
|
74
|
+
| Setup: migrations and hardening (`migrateAndHarden`; every module checked against its recorded state) | 632 | 25% |
|
|
75
|
+
| Seed | 187 | 7% |
|
|
76
|
+
| Serving: the kernel's layers until `/health` answers | 253 | 10% |
|
|
77
|
+
| Total | 2,557 | |
|
|
78
|
+
|
|
79
|
+
In a CPU profile of one start, Node's module loader took about 600 ms (reading `package.json` scopes alone about 300), Cedar's WebAssembly about 400 (`validatePolicies` 198, `permissionsTestedBy` 113: the registry's checks), Effect about 335, garbage collection about 110, and waits (PostgreSQL, the file system) about 530.
|
|
80
|
+
|
|
81
|
+
The registry was built three times per start, by setup, the seed's services and the server's, each checking the same declarations and policies again. Its checks are pure, so a process now runs them once for each set of modules, policy texts and options (`passedChecks` in `packages/kernel/src/Registry.ts`); every process still checks its app before using it. That took the seed from 187 to 80 ms and serving from 253 to 174 ms: the whole start from 2,557 to 2,367 ms (median of 5, same machine). What remained was loading the code and `migrateAndHarden`.
|
|
82
|
+
|
|
83
|
+
On 2026-11-16 (build/kernel-start), the same measurement, median of 7 starts on this machine (`node bench/src/kernel-start.ts 7`, or `bun --conditions=@eloxiv/source bench/src/kernel-start.ts 7`, which start the whole example app's kernel exactly as the budget does and print every start), was 2,406 ms on Node before the change; on Bun, which the change leaves as it was, 1,741 ms. On CI, merge tier 43833998501 measured the whole example app's kernel start at p50 1,589.8 ms on Node and 1,684.5 ms on Bun (budget 2,000 ms). Phases on Node, with timing marks (not kept):
|
|
84
|
+
|
|
85
|
+
| Phase | Before (ms) | After (ms) |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| Process start and loading the code (to `runPrepareAndServe`) | 1,032 | 717 |
|
|
88
|
+
| Setup: checks, the database host and the recorded state | 44 | 43 |
|
|
89
|
+
| Setup: roles (`bootstrapCluster`) | 25 | 25 |
|
|
90
|
+
| Setup: the registry (declarations and policies checked, Cedar) | 345 | 345 |
|
|
91
|
+
| Setup: the lease, the kernel's recorded state, `bootstrapDatabase`, Better Auth's pending migrations | 81 | 83 |
|
|
92
|
+
| Setup: migrations and hardening (`migrateAndHarden`) | 632 | 633 |
|
|
93
|
+
| Seed | 83 | 83 |
|
|
94
|
+
| Serving until `/health` answers (from the kernel's last mark; includes spawning) | about 150 | about 150 |
|
|
95
|
+
|
|
96
|
+
What each idea bought:
|
|
97
|
+
- **Node's resolution of the dependencies' relative imports** (about 315 ms, Node only). Node finds a file's `package.json` again for every import to learn its format, copying the manifest out of its native cache each time: about 7,400 relative imports at this start, drizzle-orm's 179 kB manifest alone about 200 ms. Node 26 does the same. An app's `server/main.ts`, started as the process's entry on Node, installs the kernel's resolve hook (`@eloxiv/kernel/runtime/resolve`, app 0.10.0) before it loads anything else; it answers only an `import` of a relative `.js`, `.mjs` or `.cjs` path from a file in `node_modules` to a file in the same package, as Node would (real path, format from the extension and the nearest `package.json`'s `type`), leaves everything else to Node, and leaves every import to Node in a process that keeps links' paths (`--preserve-symlinks`, `--preserve-symlinks-main`, `NODE_PRESERVE_SYMLINKS`). `packages/testing/test/node-resolve.test.ts` resolves every import of the whole example app both ways and requires no difference (a module that fails to load fails it), and checks links, packages without a `type`, directories, missing files, other packages and the preserved-links flags.
|
|
98
|
+
- **Node's compile cache** (nothing more): it was already on (`NODE_COMPILE_CACHE` in mise.toml), and it covers type stripping too.
|
|
99
|
+
- **Cedar and the registry** (nothing kept). Within a process the registry's checks already run once (`passedChecks`, and the compiler's own memos). Keeping Cedar's answers across processes, recorded by setup in the database, bought about 270 ms on both runtimes, and was removed: setup authorises policies, and an answer a database restore can supply is not one Cedar gave (a row under the right key holding a weaker answer, or one a column grant let another role write, would have been accepted). Authenticating them with key material from outside the database is more machinery than the time is worth.
|
|
100
|
+
- **Migrations and hardening on a set-up database** (nothing). No migration runs and no module is re-hardened: each module's hardening is already skipped by its fingerprint (`module_hardening`). What runs is the drift detection, whose result depends on the live catalogue and data, outside any fingerprint: each module's security state compared with the recorded one (about 130 ms), unsafe objects (about 45), its query views re-created and checked (about 80), the role hygiene and sync guards (about 50), the constraints (about 20), and the schema snapshots read again (about 100). About 1,000 statements, 466 ms of the database's own time; neither forcing generic plans nor reusing statements changed it.
|
|
101
|
+
- **Parallel startup work** (not taken). The registry's checks are CPU on the one thread and must pass before setup's first module change, so they can overlap only the few database round trips before it.
|
|
102
|
+
- **Lazy loading** (not taken). zero-cache's server code and the AI SDK are about 130 and 100 modules, under 50 ms each with the resolve hook; the modules' Drizzle tables, Better Auth and Effect are needed before `/health`.
|
|
103
|
+
|
|
104
|
+
## Calibration limits
|
|
105
|
+
|
|
106
|
+
| Machine | CPU workload | A process start (Node) | A process start (Bun) |
|
|
107
|
+
| --- | --- | --- | --- |
|
|
108
|
+
| This machine (16 cores, idle) | 111 to 115 ms | 18 to 21 ms | 3.3 to 3.6 ms |
|
|
109
|
+
| CI `check` jobs (Linux, 4 vCPUs; run 42675750565) | 107 (Bun), 126 (Node) ms | 21.1 ms | 3.2 ms |
|
|
110
|
+
| CI desktop lanes (Bun; same run) | Linux 98, macOS 101, Windows 177 ms | | Linux 1.7, macOS 4.6, Windows 14.7 ms |
|
|
111
|
+
| Limit | 400 ms | 60 ms (Windows 150) | 12 ms (Windows 45) |
|
|
112
|
+
|
|
113
|
+
The limits are about three times a healthy runner's figures (CPU: two to four times). A slow spell exceeds them: process starts were four to eight times slower. An ordinary run does not. Another machine sets its own with `ELOXIV_BENCH_CPU_LIMIT_MS` and `ELOXIV_BENCH_SPAWN_LIMIT_MS`.
|
|
114
|
+
|
|
115
|
+
| Machine | Every core | Wake-up | PostgreSQL round trip |
|
|
116
|
+
| --- | --- | --- | --- |
|
|
117
|
+
| This machine (16 cores, under other work) | 49 to 66 ms | 0.016 to 0.020 ms | 0.086 to 0.119 ms |
|
|
118
|
+
| CI `check` jobs (Linux, 4 vCPUs; run 42707289006) | 48 (Bun), 40 (Node) ms | 0.019, 0.013 ms | 0.079, 0.073 ms |
|
|
119
|
+
| Limit | 150 ms | 0.06 ms | 0.25 ms |
|
|
120
|
+
|
|
121
|
+
These limits are set the same way: about three times the healthy figures above. Another machine sets its own with `ELOXIV_BENCH_PARALLEL_LIMIT_MS`, `ELOXIV_BENCH_WAKE_LIMIT_MS` and `ELOXIV_BENCH_POSTGRES_LIMIT_MS`.
|
|
122
|
+
|
|
123
|
+
| Machine | Timer lateness, p95 (while the benchmarks ran) | CPU steal |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| This machine (16 cores, load 7.6, 5 s) | 0.15 ms | 0% |
|
|
126
|
+
| CI `check` jobs (Linux, 4 vCPUs; run 42800128281) | 1.3 (Bun), 1.1 (Node) ms | 0.16%, 0.06% |
|
|
127
|
+
| Limit (provisional) | 25 ms | 10% |
|
|
128
|
+
|
|
129
|
+
These two limits are provisional: set from this machine's figures until CI's first runs give a healthy runner's. Another machine sets its own with `ELOXIV_BENCH_TIMER_LATE_LIMIT_MS` and `ELOXIV_BENCH_STEAL_LIMIT_PERCENT`.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# The registry
|
|
2
|
+
|
|
3
|
+
Everything an Eloxiv app is assembled from, besides the kernel package: modules, connectors, the web shell, screens, the desktop host, a space, a skill and the tooling around them. Items are copied into your app's repository with `eloxiv add` and owned there, with their version and content hash recorded in `eloxiv.lock.json`, so `eloxiv diff` and `eloxiv update` can show and merge what changed on either side ([the CLI](../cli.md#the-registry)). [Getting started](../getting-started.md) assembles an app from them.
|
|
4
|
+
|
|
5
|
+
`eloxiv info <item>` shows an item as published (what it installs, needs and asks next) without running any of it; `eloxiv list` shows what an app has installed.
|
|
6
|
+
|
|
7
|
+
## Modules
|
|
8
|
+
|
|
9
|
+
Headless: a module's screens are separate UI items, so an app can install a module without its UI and build its own screens.
|
|
10
|
+
|
|
11
|
+
| Item | What it is |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| [hello](hello.md) | A small module to learn from: one entity, one action, a policy, sync queries, a skill |
|
|
14
|
+
| [notes](notes.md) | Reacts to hello's events through the outbox; a collaborative document per note |
|
|
15
|
+
| [people](people.md) | Employees, structure and reporting lines; sensitive fields for HR; directory import |
|
|
16
|
+
| [mail](mail.md) | Each person's mailboxes, synced; send, drafts, triage, snooze, rules, shared threads |
|
|
17
|
+
| [calendar](calendar.md) | Each person's calendars, synced; events, invitations, free/busy, finding a time |
|
|
18
|
+
|
|
19
|
+
## Connectors
|
|
20
|
+
|
|
21
|
+
Registry code over the kernel's capability contracts and Connections (one grant, merged scopes, refresh, custody).
|
|
22
|
+
|
|
23
|
+
| Item | Provides |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| [google](../connectors/google.md) | MailProvider, CalendarProvider, DirectoryProvider, DocumentSource (Gmail, Calendar, Workspace directory, Drive) |
|
|
26
|
+
| [microsoft-graph](../connectors/microsoft-graph.md) | MailProvider, CalendarProvider, DirectoryProvider, DocumentSource (Outlook, Entra ID, OneDrive) |
|
|
27
|
+
| [slack](../connectors/slack.md) | Messaging, through Ingress (events, signatures, linked identities) |
|
|
28
|
+
| [mcp](../connectors/mcp.md) | ToolSource: remote MCP servers' tools over endpoint Connections (outbound MCP) |
|
|
29
|
+
| [http-openapi](../connectors/http-openapi.md) | HttpApi: any HTTP API, with its OpenAPI catalogue, over endpoint Connections |
|
|
30
|
+
| [openai](../connectors/openai.md) | ModelProvider for the agent: OpenAI or any OpenAI-compatible endpoint |
|
|
31
|
+
|
|
32
|
+
## The shell and screens
|
|
33
|
+
|
|
34
|
+
| Item | What it is |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| [shell-foldkit](shell-foldkit.md) | The web shell (Foldkit, StyleX, Vite): sign-in, organisations, routing, slots, appearance |
|
|
37
|
+
| [theme](theme.md) | The default design tokens, light and dark, right-to-left aware |
|
|
38
|
+
| [hello-ui-foldkit](hello-ui-foldkit.md) | hello's screen |
|
|
39
|
+
| [notes-ui-foldkit](notes-ui-foldkit.md) | notes' screen and slot panel |
|
|
40
|
+
| [people-ui-foldkit](people-ui-foldkit.md) | people's directory and person screens |
|
|
41
|
+
| [mail-ui-foldkit](mail-ui-foldkit.md) | mail's threads and thread screens |
|
|
42
|
+
| [calendar-ui-foldkit](calendar-ui-foldkit.md) | calendar's agenda and event screens |
|
|
43
|
+
| [chat-ui-foldkit](chat-ui-foldkit.md) | A chat with the person's agent, on the headless chat SDK |
|
|
44
|
+
| [approvals-ui-foldkit](approvals-ui-foldkit.md) | Business-approval prompts |
|
|
45
|
+
| [inbox-ui-foldkit](inbox-ui-foldkit.md) | The unified inbox |
|
|
46
|
+
| [home-ui-foldkit](home-ui-foldkit.md) | The home space's launcher |
|
|
47
|
+
| [members-ui-foldkit](members-ui-foldkit.md) | Member administration |
|
|
48
|
+
| [ui-conformance](ui-conformance.md) | Conformance probes for the UI kit, for an app that replaces it |
|
|
49
|
+
|
|
50
|
+
Every screen is a thin reference (decision 11): a starting point you reshape, built on the client SDK only. Your own screens are files beside them ([Getting started](../getting-started.md#7-a-screen-on-the-client-sdk)).
|
|
51
|
+
|
|
52
|
+
## The app, the desktop host, spaces and skills
|
|
53
|
+
|
|
54
|
+
| Item | What it is |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| [app](app.md) | The server entry: the kernel with everything installed |
|
|
57
|
+
| [desktop](desktop.md) | The Tauri 2 desktop host, with the daemon as its sidecar |
|
|
58
|
+
| [desktop-rune](desktop-rune.md) | The native desktop host on Rune (Rust), over the app's own daemon through LocalClient v1, with MAKE views drawn natively |
|
|
59
|
+
| [mobile](mobile.md) | The mobile host on Expo and React Native, on the client core in process: SQLite replica, session in secure storage, push with decision buttons |
|
|
60
|
+
| [home](home.md) | The home space without a screen: spaces, the global agent, the unified inbox |
|
|
61
|
+
| [meeting-prep](meeting-prep.md) | An agent skill that prepares a person for a meeting |
|
|
62
|
+
| [eloxiv-module](eloxiv-module.md) | A framework skill for coding agents: writing a module |
|
|
63
|
+
| [eloxiv-action](eloxiv-action.md) | A framework skill for coding agents: adding an action to a module |
|
|
64
|
+
| [eloxiv-policy](eloxiv-policy.md) | A framework skill for coding agents: writing a module's Cedar policy, which both authorises its actions and decides what syncs to each person |
|
|
65
|
+
| [eloxiv-connector](eloxiv-connector.md) | A framework skill for coding agents: writing a connector over the kernel's Connections that implements capability contracts, proven with a protocol fake and the contract's conformance kit |
|
|
66
|
+
| [eloxiv-view](eloxiv-view.md) | A framework skill for coding agents: giving a module a view and building its screen on the headless client SDK |
|
|
67
|
+
|
|
68
|
+
## Retired items
|
|
69
|
+
|
|
70
|
+
`shell` (the React shell, last version 0.4.0) and `hello-ui` (its hello route, last 0.3.0) were replaced by `shell-foldkit` and `hello-ui-foldkit` (decision 10). Their last versions stay published, so an app that installed them keeps working; `eloxiv add` refuses them, and `diff` and `update` name the replacement.
|
|
71
|
+
|
|
72
|
+
## Writing your own
|
|
73
|
+
|
|
74
|
+
An app's own module needs no registry: list it in `eloxiv.json` ([the app's own modules](../cli.md#the-apps-own-modules)). To publish items for several apps, build a registry of your own in the same format (`publishVersions` from `@eloxiv/cli` writes each item's immutable versions) and point `eloxiv.json`'s `registry` at it, a directory or an `https` URL. `eloxiv blueprint connector|channel|action|module|make` prints instructions for a coding agent to write each kind.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# app
|
|
2
|
+
|
|
3
|
+
The app's server entry: the kernel, set up and served with every installed module, connector, model provider and skill. Every app starts from it; the other server-side items are composed into it. Kind `app`, no UI.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It installs:
|
|
12
|
+
|
|
13
|
+
| File | What it is |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `server/main.ts` | `KernelApp` from the composition (`eloxiv.server.ts`, `eloxiv.schema.ts`: never `eloxiv.sync.ts`, whose mutators load the modules' predictions, client code): the installed modules and the kernel modules they ask for, the kernel's collaboration and inbox modules, connectors, skills, model providers for the agent, and the sync schema. Run as `main.ts setup` (database), `seed` (demo data), `prepare` (both), `prepare-and-serve` (development) or with no argument (serve) |
|
|
16
|
+
| `server/seed.ts` | Demo data for development: the organisations Acme and Globex, `alice@example.com` and `bob@example.com` (password `eloxiv-dev-password`) |
|
|
17
|
+
| `patches/@rocicorp__zero@1.11.3.patch` | A fix to zero-cache, applied by pnpm (`pnpm.patchedDependencies`), until it is fixed upstream |
|
|
18
|
+
|
|
19
|
+
`eloxiv init --preset headless|web|desktop` adds it for you.
|
|
20
|
+
|
|
21
|
+
## Use it
|
|
22
|
+
|
|
23
|
+
You rarely edit `server/main.ts`: `eloxiv add`, `update` and `generate` keep the composition it reads current. Edit it for what is the app's own: its name, `KernelApp.agent` (a per-organisation `ModelCredentials`, a default model), workflows, settings. Run it through the CLI: `eloxiv dev` in development, `eloxiv start kernel` and `eloxiv start setup` in production ([the CLI](../cli.md#running-an-app)). Replace `seed.ts` with your own data, or stop seeding outside development.
|
|
24
|
+
|
|
25
|
+
The model is chosen at run time: `ELOXIV_AGENT_MODEL=<provider>:<model>`; a model server on this machine over plain http needs `ELOXIV_MODEL_ALLOW_LOCAL_HTTP=1`, and one that speaks Chat Completions `ELOXIV_MODEL_API=chat`.
|
|
26
|
+
|
|
27
|
+
## Guarantees and limits
|
|
28
|
+
|
|
29
|
+
- Runs on Bun and on Node (it picks the kernel runtime for the one running it).
|
|
30
|
+
- The kernel refuses to start with a sync schema that differs from what `eloxiv generate` writes for the installed entities ([Sync](../contracts/sync.md)).
|
|
31
|
+
- The seed is for development: it creates known passwords.
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
eloxiv init my-app --preset headless
|
|
37
|
+
cd my-app && eloxiv add hello && eloxiv dev --no-shell
|
|
38
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# approvals-ui-foldkit
|
|
2
|
+
|
|
3
|
+
Approval prompts over the chat SDK's approval state: the business-approval requests waiting for the person's decision, with Approve and Reject, and their own requests still waiting. Kind `ui`: one file in the [web shell](shell-foldkit.md)'s `src/screens/`, which the app owns and may edit, eject or replace without touching the kernel. Like every registry screen it is a thin, plain reference (decision 11): a starting point to reshape, built only on the client SDK.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add approvals-ui-foldkit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It brings the shell, and asks for the kernel's inbox modules (work items, notifications, approvals, consent). The screen is at `/approvals/request`.
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
A rule in a module's or the app's approval policy makes a call wait for approval ([Approvals](../contracts/approvals.md)); eligible approvers see it here and in their inbox. Decisions go through `approvals.approve` and `approvals.reject`, each under its own idempotency key.
|
|
16
|
+
|
|
17
|
+
To change it, edit the file (`eloxiv diff approvals-ui-foldkit` shows your edits, and `eloxiv update` merges the registry's next version into them), or `eloxiv eject approvals-ui-foldkit` to own it outright. [Getting started](../getting-started.md#7-a-screen-on-the-client-sdk) explains how a screen is built.
|
|
18
|
+
|
|
19
|
+
## Guarantees and limits
|
|
20
|
+
|
|
21
|
+
- It reads only the replica it was created for: a snapshot of another organisation's replica, still in flight after a switch, is dropped.
|
|
22
|
+
- An agent cannot decide an approval; the requester never approves their own request.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
eloxiv add approvals-ui-foldkit && eloxiv dev # http://localhost:5173/approvals/request
|
|
28
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# calendar-ui-foldkit
|
|
2
|
+
|
|
3
|
+
[calendar](calendar.md)'s screen: events at `/calendar` with invitations marked, and an event at `/calendar/<id>` with Accept, Tentative and Decline, the answer shown as it reaches the provider. Kind `ui`: one file in the [web shell](shell-foldkit.md)'s `src/screens/`, which the app owns and may edit, eject or replace without touching the kernel. Like every registry screen it is a thin, plain reference (decision 11): a starting point to reshape, built only on the client SDK.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add calendar-ui-foldkit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
It brings [calendar](calendar.md) and the shell. The screen is at `/calendar`.
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
It needs a connected calendar (a CalendarProvider connector, connected by the person).
|
|
16
|
+
|
|
17
|
+
To change it, edit the file (`eloxiv diff calendar-ui-foldkit` shows your edits, and `eloxiv update` merges the registry's next version into them), or `eloxiv eject calendar-ui-foldkit` to own it outright. [Getting started](../getting-started.md#7-a-screen-on-the-client-sdk) explains how a screen is built.
|
|
18
|
+
|
|
19
|
+
## Guarantees and limits
|
|
20
|
+
|
|
21
|
+
- It reads only the replica it was created for: a snapshot of another organisation's replica, still in flight after a switch, is dropped.
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
eloxiv add calendar-ui-foldkit && eloxiv dev # http://localhost:5173/calendar
|
|
27
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# calendar
|
|
2
|
+
|
|
3
|
+
Calendar, headless: each person's CalendarProvider Connections synced into private calendars; create, change, cancel and answer events; colleagues' free/busy; finding a time with colleagues and outside addresses; invitations awaiting an answer as work items. Its screen is [`calendar-ui-foldkit`](calendar-ui-foldkit.md). Kind `module`; it asks for the kernel's inbox and connections modules.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add calendar
|
|
9
|
+
eloxiv add google # or microsoft-graph: a CalendarProvider
|
|
10
|
+
eloxiv add calendar-ui-foldkit # its screen, optional
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
| Action | What it does |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `calendar.create`, `calendar.update`, `calendar.cancel` | your events; recorded at once, made at the provider after, at most once |
|
|
18
|
+
| `calendar.respond` | accept, decline or tentatively accept an invitation |
|
|
19
|
+
| `calendar.freeBusy` | when colleagues are busy (times only); needs `calendar.freeBusy` |
|
|
20
|
+
| `calendar.findTime` | free slots for you, colleagues and outside addresses, within working hours |
|
|
21
|
+
| `calendar.apply`, `calendar.changed` | called by the sync engine and the kernel |
|
|
22
|
+
|
|
23
|
+
View `calendar.agenda` (`/calendar`); query views `calendar.events`, `calendar.changes`, `calendar.busy`; work-item source `calendar.invitations`; skill `calendar.scheduling`.
|
|
24
|
+
|
|
25
|
+
## Guarantees and limits
|
|
26
|
+
|
|
27
|
+
- Calendars are private; free/busy shows times, never what the event is.
|
|
28
|
+
- Changes reach the provider at most once; an agent needs the person's consent for each.
|
|
29
|
+
- `calendar.findTime` looks at most 62 days ahead.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
eloxiv call calendar.findTime --input '{"start":"2026-12-01T00:00:00Z","end":"2026-12-05T00:00:00Z","minutes":30,"userIds":["<user id>"]}'
|
|
35
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# chat-ui-foldkit
|
|
2
|
+
|
|
3
|
+
A basic chat with the person's agent over the [headless chat SDK](../contracts/client-sdk.md#the-chat-sdk) (`@eloxiv/client/chat`): conversations, the transcript (stored messages and the active run's streamed text), a composer, sends that outlive the screen (an outstanding store in `localStorage`), a prompt for each tool call held for the person's consent, and a choice of the person's paired devices to answer. Kind `ui`: one file in the [web shell](shell-foldkit.md)'s `src/screens/`, which the app owns and may edit, eject or replace without touching the kernel. Like every registry screen it is a thin, plain reference (decision 11): a starting point to reshape, built only on the client SDK.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add chat-ui-foldkit
|
|
9
|
+
eloxiv add openai # a model for the agent; set ELOXIV_MODEL_OPENAI_API_KEY
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
It brings the shell, and asks the composition for the kernel's agent module (with the inbox its consent needs) and their sync tables. The screen is at `/agent/conversation`.
|
|
13
|
+
|
|
14
|
+
## Use it
|
|
15
|
+
|
|
16
|
+
Without a model connector the agent's runs fail with `ModelUnavailable`. [Getting started](../getting-started.md#9-a-chat-screen-on-the-headless-chat-sdk) builds a smaller chat of your own on the same SDK.
|
|
17
|
+
|
|
18
|
+
To change it, edit the file (`eloxiv diff chat-ui-foldkit` shows your edits, and `eloxiv update` merges the registry's next version into them), or `eloxiv eject chat-ui-foldkit` to own it outright. [Getting started](../getting-started.md#7-a-screen-on-the-client-sdk) explains how a screen is built.
|
|
19
|
+
|
|
20
|
+
## Guarantees and limits
|
|
21
|
+
|
|
22
|
+
- It reads only the replica it was created for: a snapshot of another organisation's replica, still in flight after a switch, is dropped.
|
|
23
|
+
- Every guarantee is the SDK's: one send per idempotency key, streamed text per model step never shown twice, events only from the active run, consent decided only by the person.
|
|
24
|
+
- The outstanding sends' text stays in `localStorage` on a shared device until each is settled or discarded.
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
eloxiv add chat-ui-foldkit && eloxiv dev # http://localhost:5173/agent/conversation
|
|
30
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# desktop-rune
|
|
2
|
+
|
|
3
|
+
A native desktop host on [Rune](https://github.com/anomalyco/rune), in Rust (decision 14): its own window over the app's own daemon, which holds the client core (session, organisation, replica, named queries, optimistic writes) and serves it as [LocalClient v1](../contracts/local-client.md) on loopback. The host starts the daemon as its sidecar with a per-launch host secret and the stdin lifeline, and never sees a kernel credential or the person's password. MAKE views are drawn natively from the closed view vocabulary ([Sandbox, "Native hosts"](../contracts/sandbox.md#native-hosts)). The app owns the folder; it builds on Linux, macOS and Windows. Kind `desktop`. A minimal reference (decision 11): sign-in, the organisation switcher, a live list, an optimistic and a refused write, the agent's chat (a conversation, its transcript with the streamed answer, a composer, consent and approval prompts, the engine not set up), a MAKE view, sign-out, light and dark, left to right or right to left.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add desktop-rune
|
|
9
|
+
cd desktop-rune && cargo test # headless: no window, no GPU
|
|
10
|
+
cargo run --release # the window, with the app's daemon sidecar beside the binary
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Building needs Rust 1.97 or later; on Linux `libxkbcommon-dev` and `libwayland-dev` (and `libxkbcommon-x11-0` for an X11 window). The sidecar is the app's own daemon entry, shipped as `desktop-rune/sidecar/daemon.ts` (`daemon-node.ts` on Node) and composed with the app's sync schema, queries, mutators and contracts (`clientApp`); `node desktop-rune/scripts/build-sidecar.ts` compiles it with Bun into `desktop-rune/target/sidecar/eloxiv-daemon`, where `cargo run` finds it (in development the host also runs the entry from source with Bun). The person signs in on the web shell's `/desktop/sign-in` ([shell-foldkit](shell-foldkit.md)): set `ELOXIV_SHELL_URL` for the sidecar when the shell is not at `http://localhost:5173`. `desktop-rune/README.md`, installed with it, is the full guide.
|
|
14
|
+
|
|
15
|
+
## Use it
|
|
16
|
+
|
|
17
|
+
- `Cargo.toml` is a workspace of its own: Rune and its five `[patch.crates-io]` entries pinned at one revision (Cargo takes patches only from the root), and Rune's lowered debug info.
|
|
18
|
+
- `app/src/view.rs` holds the screens; `app/src/model.rs` what the host keeps of the daemon's events and `app/src/chat.rs` the chat's state (pure, tested); `app/src/make/` the MAKE renderer.
|
|
19
|
+
- The chat appears when the app has the agent (its daemon's `hello` names the agent's queries and `runEvents`, LocalClient 1.1.0): rows from named queries, sends and decisions as actions under the chat SDK's idempotency keys, the run's events from a run subscription ([LocalClient, "The agent through LocalClient"](../contracts/local-client.md#the-agent-through-localclient)).
|
|
20
|
+
- `crates/eloxiv-local-client` is LocalClient v1 for Rust: types **generated** with typify from `@eloxiv/contracts`' JSON Schemas (`cargo run -p eloxiv-local-client-codegen` after updating `@eloxiv/contracts`; its test fails while they are stale), a blocking client of every route, the event stream on its own thread.
|
|
21
|
+
- `app.json` is the one file the app edits for its identity and host settings, read by packaging, compiled into the host and read by the release signer: `name`, `identifier` (reverse DNS: window app id, bundle id, data and daemon state directories, single instance, keychain namespace), `binaryName`, `version`, `urlScheme`, the installers' `description`, `publisher`, `copyright`, `category` and `icon`; `deepLinks.register`; `servers.kernelUrl`, `zeroUrl`, `shellUrl` (what the packaged app's sidecar reaches, given to it as `ELOXIV_KERNEL_URL`, `ELOXIV_ZERO_URL`, `ELOXIV_SHELL_URL`; no app edits `sidecar/daemon.ts` for them); `updates.url`, `publicKey`, `channel`. Unknown fields and invalid values are refused before a build. Environment variables override each field at run time (`ELOXIV_APP_ID`, `ELOXIV_APP_SCHEME`, `ELOXIV_UPDATE_URL`, `ELOXIV_KERNEL_URL`, ...; `ELOXIV_HOST_CONFIG` names another `app.json`).
|
|
22
|
+
- Two apps on one machine: a packaged sidecar keeps its state in `<state base>/<identifier>/daemon` and listens on a free loopback port chosen at launch; a development build keeps the daemon's defaults (4191, its own state directory). `ELOXIV_DAEMON_PORT` and `ELOXIV_DAEMON_STATE_DIR` fix them.
|
|
23
|
+
- Installers: `node desktop-rune/scripts/package.ts` (cargo-packager 0.11.8): `.app` and `.dmg`, NSIS, `.deb` and AppImage, the sidecar installed as `<binaryName>-daemon`, the icons made from `icon`, signed and notarised only when the Apple or Windows credentials are in the environment, else unsigned and said so. The AppImage step's downloaded tools are pinned to exact versions and checked against SHA-256 sums; the NSIS ApplicationID plugin is checked before the installer is accepted.
|
|
24
|
+
- Deep links: one process per app (a later launch hands its link to the running one and exits); each link is read with the View contract's `parseLink` (ported to Rust, over the app's views from `<sidecar> --print-views` and the host's own screens) and opens its screen in the organisation it names (a MAKE module's screen with the module filled in, its view run only when the person presses Open: a link never runs an action). The installers register the scheme (the `.deb`'s desktop entry, NSIS under `HKCU\Software\Classes`, the bundle's `Info.plist`); the host registers it itself only from an AppImage or a development build (Linux desktop entry and `xdg-mime`, Windows `HKCU\Software\Classes`), never over an installer's.
|
|
25
|
+
- Secure storage: the host's own secrets in the OS keychain (`keyring`), namespaced by the app id; absent is `None`, a failing store an error.
|
|
26
|
+
- Notifications (0.6.0; 0.6.2 hardened), **while the app runs**: the person's new notification records, followed through the daemon (the inbox's `notifications.mine` named query, when the app's `clientApp` has it), shown as OS notifications (`app/src/notices.rs`): on macOS UNUserNotificationCenter driven by the host (its calls in `crates/eloxiv-mac-notifications`, the host's only `unsafe` code; the bundled app only; the person's authorisation is asked once, apart from posting, and only what is still wanted when they allow it is scheduled, so nothing withdrawn while the prompt was open shows later; rune-notify delivers the clicks), on Windows `rune-notify` (toasts under the app's AppUserModelID, registered before the window opens), on Linux the freedesktop notification service over D-Bus, probed off the first frame's path. A record is shown once per person, organisation and id in a run (across switches), only from a complete snapshot after the generation's first one, unread, not dismissed, the person's own in the organisation shown, and not created before the watch began (the host's clock, less five minutes for the server's); one read elsewhere is withdrawn. Asking for an organisation switch or a sign-out withdraws everything shown at once and suspends the feed (a refused switch resumes it without repeats); clicks and buttons do nothing while a switch or sign-out is on its way, the event stream is closed, or on a notification of another generation. A click opens the record through the deep links (the first view that shows its entity, as `recordLink`, with that record selected; `--print-views` names each view's module and entity), or the agent's conversation for an approval or consent request (a consent's in the conversation whose run holds it); a click before the app's views are known waits for them in its generation. Approve and Reject show only when the linked request is one the synced rows say the person can decide now (a pending, unexpired approval request someone else made, from `approvals.requests`, which the feed follows itself; a consent request the person's followed run holds, consent requests not being synced), with the request's words, never the notification's title, body or category; they call `approvals.approve|reject` or `consent.approve|reject` through LocalClient in the current generation under the chat SDK's decision keys, one decision per request across the chat's cards and the OS (the notification is withdrawn as deciding starts). Linux clicks count only from the service instance that showed the notification (its unique bus name) and each post's buttons carry a nonce; bodies go as literal text; a post withdrawn before it goes is not sent, or is closed as soon as it is answered. At exit (and in the fast-exit hook) everything shown is withdrawn and the Linux threads stop; native clicks carry this run's id, so one left in the system's history by an earlier run does nothing. A consent notification shows no held-call input. This is in-app notifications surfaced natively, not push: nothing reaches the person while the app is closed, and the Host contract's `push` stays unsupported (no push subscription); `HostServices::notifications` reports `{ shown, backend, permission?, reason? }`: `shown` is `while-running` only with a backend found, notifications not turned off and an app that follows `notifications.mine`; `permission` is the OS's own answer (macOS's authorisation status, Windows's toast setting) and is left out on Linux, whose notification service has none.
|
|
27
|
+
- Updates: `cargo run -p eloxiv-update -- keygen | pack | release` makes the keys, signs a release (minisign, the trusted comment naming app, version, platform and kind) and writes its manifest; the host checks it, downloads and verifies the build, and on "Restart to update" swaps the AppImage, bundle or install directory, keeps the new build only once it is interactive, else rolls back, starts the old one again and remembers the failed version, which is not offered again until a newer one is published; Windows runs the installer. `release --config app.json` takes the app, version and channel from `app.json`. Unsupported, with the reason, without an update host, in a development build, for a system package (`.deb`), or for an install the person cannot replace.
|
|
28
|
+
- The sidecar is found as `ELOXIV_DAEMON_BIN`, else `<binaryName>-daemon` beside the executable or in `../libexec` (a package; `eloxiv-daemon` beside it too), else the workspace's `target/sidecar/eloxiv-daemon`, else `sidecar/daemon.ts` with Bun; `ELOXIV_DAEMON_PORT` and `ELOXIV_DAEMON_ARGS` start it; `ELOXIV_DAEMON_URL` with `ELOXIV_DAEMON_HOST_SECRET` attach to a running daemon instead.
|
|
29
|
+
|
|
30
|
+
## Guarantees and limits
|
|
31
|
+
|
|
32
|
+
- Networking never runs on the UI thread; nothing of an older generation (another organisation, before a sign-out) is ever shown, from the intent on.
|
|
33
|
+
- An offline start (0.6.10, LocalClient 1.2.0): a daemon started without reaching the kernel serves the person's SQLite replica of the organisation last open (remembered beside its `state.json`, bound to the session's token) and reports the session `offline`; the header says "Offline: showing this device's copy" instead of the replica's connection until the kernel answers, then "Synced" in the same context. The host needs nothing else: the session it is given is signed in, and its subscriptions and writes are answered from the replica.
|
|
34
|
+
- Writes are the daemon's: the host never predicts or rolls back; a refusal shows its typed error after the rollback.
|
|
35
|
+
- A send is one send: its key is recorded before it leaves in an outstanding store per person and organisation (a small file in the host's data directory: text, conversation and key, never a credential; changed under a lock of its own and re-read first, so hosts sharing the directory keep each other's sends), settled by whatever answers it even after its screen is gone, and kept for a retry after a lost answer across organisation switches, sign-outs and restarts; it runs only in the organisation it was made in (LocalClient's expected generation), and a kept send is offered again only once the session of the current generation names its person and organisation (between a `context` event and its session nothing is sent); consent and approvals are decided only by the person's press; streamed text never shows beside the stored answer that replaces it.
|
|
36
|
+
- A MAKE view's code never runs in the host; it calls only the actions `make.view` lists, one step at a time, and opens no URL.
|
|
37
|
+
- The sidecar stops with the host, also when the host is killed (its stdin lifeline).
|
|
38
|
+
- Proven live by `registry/test/desktop-rune-journey.test.ts` (CI's `rune journey` lane, Bun and Node): the host's app against a real daemon, kernel and zero-cache, every check of `app/tests/journey.rs` ok (an agent turn on a scripted model among them: the consent allowed in the chat screen, part of the answer drawn as streamed text while the model holds the rest, then the stored answer shown once).
|
|
39
|
+
- Installers (0.5.0) are built, installed and launched on Linux, macOS and Windows by CI's `desktop-rune package (linux|macos|windows)`, which checks the sidecar runs and stops with the host, measures launch to interactive (the host's probe line, `scripts/measure-launch.ts`, against the 1.5 s desktop budget) and uploads them ([ci.md](../ci.md#the-packaged-rune-host-desktop-rune-package)); it runs on the merge tier, and per push only when the item's packaging or the workflow changed.
|
|
40
|
+
- Updates are signed and verified against the app's key and never downgrade; a build that does not start is rolled back (not on Windows, where the installer applies it) and not offered again. Links are only the app's own and only navigate.
|
|
41
|
+
- Proven by `cargo test` (`mise run rust:check`): `app.json` and its overrides, the sidecar's port and state directory, `parseLink`'s port, link routing over a fake daemon, the single-instance hand-over with the real binary (Linux, with a display), the scheme registration builders per OS and when the host registers at all, the keychain (and a real round trip where the OS store answers), the updater against a local update server (a good update, bad signatures, a replayed older build, downgrades, interrupted downloads) and its apply step (kept, or rolled back and remembered).
|
|
42
|
+
- Proven by `cargo test`: `app/tests/notices.rs` over the fake daemon (a new row shown once and old, read or late rows never; a click routes; Approve and Reject call the right action with the right key and generation; a context reset withdraws and drops clicks) and the backend chosen per OS; a real freedesktop notification and its click opening the record were shown on Linux by hand. macOS and Windows notifications are built and unit-tested in CI only.
|
|
43
|
+
- Not yet: push (a subscription a NotificationChannel delivers to, or notifications while the app is closed), file pickers, tests of the real OS window beyond launch and the single-instance hand-over; a deep link and an update into an installed copy are shown on Linux only (macOS and Windows: built, installed, launched and unit-tested in CI).
|
|
44
|
+
|
|
45
|
+
## Example
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
cd desktop-rune
|
|
49
|
+
ELOXIV_DAEMON_URL=http://127.0.0.1:4191 ELOXIV_DAEMON_HOST_SECRET=<the daemon's host secret> cargo run
|
|
50
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# desktop
|
|
2
|
+
|
|
3
|
+
A Tauri 2 desktop host template: one window over the app's own web shell, with the Eloxiv daemon (pairing, local agent runtimes on the person's own subscriptions, token custody, a loopback relay) running as its sidecar. The app owns the folder; it builds on Linux, macOS and Windows. Kind `desktop`; it asks for the kernel's devices module.
|
|
4
|
+
|
|
5
|
+
## Add it
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
eloxiv add desktop # or eloxiv init --preset desktop
|
|
9
|
+
pnpm exec tauri icon desktop/app-icon.svg --output desktop/src-tauri/icons
|
|
10
|
+
pnpm exec tauri build --no-bundle
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Building needs Rust, Node 24 and Bun, and the platform's webview build dependencies (Linux: WebKitGTK 4.1 and GTK 3 development packages; Windows: the MSVC build tools and WebView2; macOS: the Xcode command-line tools). `desktop/README.md`, installed with it, is the full guide: the build, development with `tauri dev`, the end-to-end drivers per platform and the launch measurement.
|
|
14
|
+
|
|
15
|
+
## Use it
|
|
16
|
+
|
|
17
|
+
- `src-tauri/tauri.conf.json`: the identifier and product name to change for your app; development loads the shell's dev server, builds embed `desktop/dist`, built first by `scripts/prepare.ts` (the daemon sidecar with `bun build --compile`, and the app's shell with Vite).
|
|
18
|
+
- `src-tauri/capabilities/main.json`: what the window may call; add permissions there when your shell needs more.
|
|
19
|
+
- `VITE_ELOXIV_URL` and `VITE_ELOXIV_SYNC_URL` choose the kernel and zero-cache a build talks to. The kernel's CORS allows the webview's origin (`tauri://localhost`, `http://tauri.localhost` on Windows) by default.
|
|
20
|
+
- The [Host](../contracts/host.md) contract (deep links, secure storage, updates, files) and the [Daemon](../contracts/daemon.md) contract describe what the host and sidecar provide.
|
|
21
|
+
|
|
22
|
+
## Guarantees and limits
|
|
23
|
+
|
|
24
|
+
- The sidecar starts with the host and stops with it, also when the host is killed (its stdin lifeline).
|
|
25
|
+
- The host embeds whichever shell the app has; updating it never switches the app's shell.
|
|
26
|
+
- Launch to interactive is budgeted at 1.5 s (`node desktop/scripts/measure-launch.ts` measures it).
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
node desktop/scripts/prepare.ts --skip-shell && pnpm exec tauri dev # with eloxiv dev running
|
|
32
|
+
```
|