@eloxiv/cli 0.1.0 → 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/dist/docs/ci.md +4 -4
- package/dist/docs/contracts/client-sdk.md +4 -4
- package/dist/docs/contracts/local-client.md +6 -4
- package/dist/docs/registry/desktop-rune.md +1 -0
- package/dist/docs/registry/shell-foldkit.md +2 -1
- package/dist/docs/release.md +3 -3
- package/dist/docs/scaffold.md +4 -4
- package/dist/docs/security/threat-model.md +1 -1
- package/package.json +4 -4
package/dist/docs/ci.md
CHANGED
|
@@ -11,8 +11,8 @@ push|merge]` prints what a change would run.
|
|
|
11
11
|
| Tier | When | What |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| Per push | A pull request into anything but `main` (topic branches into `build/main`): opened, pushed to, reopened, ready for review, edited (a retarget re-plans) | Format; lint and boundaries (`mise run lint`); typecheck and build of the affected packages; the affected tests, the same files on Bun and on Node; the strict done gate on Bun and on Node (`done`); the Rust crates (`rust`) when a Rust input changed; the Rune host's live journey on Bun and on Node (`rune-journey`) when a Rust input or one of its own changed; the packaged Rune host on Linux, macOS and Windows (`desktop-rune-package`) only when the item's packaging or this workflow changed. Documentation alone: the format check only |
|
|
14
|
-
| Merge | A push to `main`, a pull request into `main` (`build/main`'s own draft pull request: every push to `build/main`), a run by hand | Every merge-tier job: the full check on Bun and on Node (`mise run check` without its benchmarks: lint, typecheck, build, every test, Playwright); the strict done gate on Bun and on Node (`done`); the performance budgets on Bun and on Node (`budgets (bun)`, `budgets (node)`: `mise run bench`, each on a runner of its own, docs/performance.md); desktop (Linux, macOS, Windows with the kernel on Bun, and Linux with the kernel on Node); React Native (kernel on Bun and on Node); the mobile host on an Android emulator (kernel on Bun and on Node) and its iOS simulator attempt; managed PostgreSQL emulated (Bun and Node); live Google
|
|
15
|
-
| Live | Nightly (03:23 UTC), or by hand with `scope: live` | Live Google
|
|
14
|
+
| Merge | A push to `main`, a pull request into `main` (`build/main`'s own draft pull request: every push to `build/main`), a run by hand | Every merge-tier job: the full check on Bun and on Node (`mise run check` without its benchmarks: lint, typecheck, build, every test, Playwright); the strict done gate on Bun and on Node (`done`); the performance budgets on Bun and on Node (`budgets (bun)`, `budgets (node)`: `mise run bench`, each on a runner of its own, docs/performance.md); desktop (Linux, macOS, Windows with the kernel on Bun, and Linux with the kernel on Node); React Native (kernel on Bun and on Node); the mobile host on an Android emulator (kernel on Bun and on Node) and its iOS simulator attempt; managed PostgreSQL emulated (Bun and Node); live Google on Bun and on Node when its own inputs changed in this push (live Neon runs only by hand, below); the Rust crates on Linux, macOS and Windows (`rust`) when theirs changed; the Rune journey (`rune-journey`) and the packaged Rune host (`desktop-rune-package`) when theirs changed. Nothing, only when this push changed documentation alone and the run before it passed; only the gate job (its tests on both runtimes) and the strict done gate when that documentation includes what a gate reads |
|
|
15
|
+
| Live | Nightly (03:23 UTC), or by hand with `scope: live` | Live Google on Bun and on Node, whatever changed; the nightly job also starts `slack-live.yml`. Both on `build/main` while it exists, else `main` (only on a definite 404 for `build/main`; any other lookup error fails the nightly job) |
|
|
16
16
|
|
|
17
17
|
`slack-live.yml` runs nightly (started by ci.yml's nightly job), by hand, and on a push to `main` or `build/main`
|
|
18
18
|
that changes what it exercises (its `paths`, checked against the import graph by `tools/done/test/ci-plan.test.ts`).
|
|
@@ -99,7 +99,7 @@ affected test on both, and the merge tier the whole suite on both, and every lan
|
|
|
99
99
|
| --- | --- | --- |
|
|
100
100
|
| Full check (`check`), budgets, managed PostgreSQL emulated, React Native | `check (bun)`, `budgets (bun)`, `managed postgres (emulated, bun)`, `react native (hermes, android, bun)` | the same jobs with `node` |
|
|
101
101
|
| Live Google (`live connector (google)`) | plan key `live-google`: the job's first lane | `live-google-node`: its second lane, in the same job after the first (they share the test account and Gmail's per-user quota, and one job holds one place in the account's concurrency group); it runs even when the first failed |
|
|
102
|
-
| Live Neon | `live-neon`: `live postgres (neon, bun)` | `live-neon-node`: `live postgres (neon, node)`, side by side, each with a Neon branch of its own |
|
|
102
|
+
| Live Neon (by hand only) | `live-neon`: `live postgres (neon, bun)` | `live-neon-node`: `live postgres (neon, node)`, side by side, each with a Neon branch of its own. On no tier (owner, 2026-11-22): run them by hand, `gh workflow run ci.yml --ref <branch> -f only=live-neon,live-neon-node`, when the managed-host setup changes; the emulated managed-PostgreSQL job runs the same suites as `neondb_owner` on the merge tier |
|
|
103
103
|
| Desktop | `desktop`: `desktop (linux)`, `desktop (macos)`, `desktop (windows)` | `desktop-node`: `desktop (linux, node kernel)`: the same host, journey and launch budget against a kernel on Node. The host's daemon sidecar is a Bun-compiled binary on every lane (decision 7), so only the kernel changes |
|
|
104
104
|
|
|
105
105
|
## The mobile lanes (`mobile`, `mobile-ios`)
|
|
@@ -274,4 +274,4 @@ runs the plan job alone (about 1 runner-minute); a push of docs/progress.md alon
|
|
|
274
274
|
this work) runs the plan job, the gate job (the definition-of-done gate's 7 test files on Bun and on Node) and the
|
|
275
275
|
final job, an estimated 3 to 4 runner-minutes; any code push runs the whole merge tier: the full check on both
|
|
276
276
|
runtimes, the desktop hosts, React Native and managed PostgreSQL (about 65 to 70 runner-minutes, as before this pull
|
|
277
|
-
request), and the live jobs only when their own inputs changed (live Neon about 23 more).
|
|
277
|
+
request), and the live jobs only when their own inputs changed (live Neon, about 23 more, has since moved to by hand only).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The headless client SDK every app's UI, and every headless app, is built on: sign-in, typed action calls, a policy-scoped local replica, the agent client, organisation switching and version skew. It uses only web-standard APIs, so the same SDK runs in browsers, Tauri, Bun, Node and React Native (decision 8).
|
|
4
4
|
|
|
5
|
-
- Kind: shell contract. Version 1.
|
|
5
|
+
- Kind: shell contract. Version 1.5.0 (1.5.0: an offline start's session is reported `offline` (LocalClient 1.2.0), the kernel's acceptance of it is announced at once and nothing waits on its organisation listing, and a sign-out without a revocation store forgets the remembered context before the revocation is sent; 1.4.0: the client core's offline start, a `SessionStore` that remembers the context last open with its token (`recall`, `remember`, `forgetContext`), the first check's `offlineProbeMs` deadline (also bounding a remembered session's first organisation listing), `SignOutNotSaved`, `refuse`, `isRefused`, `dispose`, `signOut(known?)` and `sessionStatus().error`; the chat SDK's `PendingConsent.title`, `ApprovalItem.title` read through `approvalLabel`, `actionLabel`, and `decisionLabel` and `makeDecisionLabel` (a MAKE action's decision named from its id: `mk_todos: Urgent`), and a tool's activity line prefers the event's title; 1.3.0: magic links and the desktop sign-in exchange; 1.1.0: the chat SDK drops the streamed text of a reply the kernel discarded, `reply-discarded`; 1.2.0: the account, Directory, avatar and session clients).
|
|
6
6
|
- Schema: [`packages/contracts/schema/contracts/ClientSDK.json`](../../packages/contracts/schema/contracts/ClientSDK.json) (source [`ClientSDK.ts`](../../packages/contracts/src/contracts/ClientSDK.ts)): the SDK's functions as language-neutral records.
|
|
7
7
|
- Implementation: `@eloxiv/client` ([`packages/client`](../../packages/client)): `signIn`, `signUp`, `signOut`, `listOrganizations`, `listMembers` ([`Auth.ts`](../../packages/client/src/Auth.ts)); `makeClient`, `isReplay`, `fetchRelease`, `isClientOutdated` ([`Client.ts`](../../packages/client/src/Client.ts)); `connectSync` ([`Sync.ts`](../../packages/client/src/Sync.ts)); `agentClient` ([`Agent.ts`](../../packages/client/src/Agent.ts)); the replica's storage adapters in `@eloxiv/client/storage` ([StorageAdapter](storage-adapter.md)); the kernel's sync tables in `@eloxiv/client/sync`.
|
|
8
8
|
- Kit: `@eloxiv/testing/conformance/ClientSDK` ([source](../../packages/testing/src/conformance/ClientSDK.ts)), against a real kernel and sync server.
|
|
@@ -104,7 +104,7 @@ Every function is one request to the kernel; what needs mail goes through the de
|
|
|
104
104
|
- **Desktop sign-in.** `beginDesktopSignIn({ redirectUri })` (the verifier the app keeps, its challenge, a state and the `query` for the app's web sign-in page), `approveDesktopSignIn(baseUrl, token, { challenge, redirectUri, state })` on that page (answers the redirect to follow), `completeDesktopSignIn(baseUrl, login, { code, state })` (refuses a state it did not send) and `desktopSignIn(controller, { baseUrl, redirectUri, signInPage, open, receive })`, the desktop identity bootstrap: the whole journey into the session controller.
|
|
105
105
|
- **OAuth sign-in.** `oauthSignInUrl({ provider, callbackURL, errorCallbackURL? })` answers the provider's page for a browser to open; it returns to `callbackURL` (a trusted origin) signed in with the session cookie. It joins an existing account only when the provider verified the same address and the account's own address is verified; otherwise it lands on `errorCallbackURL?error=account_not_linked`.
|
|
106
106
|
- **Avatars.** `avatarClient({ baseUrl, token, userId, compress? })`: `get(userId)` shares one lookup between every view asking at once and keeps the photo until its ETag changes; `subscribe(userId, listener)` hears of a new photo (or its removal) the moment this client uploads it; `upload({ contentType, bytes })` applies the app's `compress` (the SDK has no image codec: a browser passes a canvas-based one) and refuses anything but PNG, JPEG, WebP or GIF of at most 256 KiB before sending. The kernel shows a photo only to its person and to people sharing an organisation with them.
|
|
107
|
-
- **The session.** `sessionController({ baseUrl, store })` holds `loading`, `authenticated` (`token`, `account`), `unauthenticated`, `unavailable` or `signing-out`, for every view (`subscribe`). `start`, `refresh` and `invalidate` (after a 401) share one check in flight; a stored token is reported authenticated only once the kernel accepts it, forgotten when it refuses it, and kept as `unavailable` when the kernel cannot be reached (retried with backoff). `signIn`, `completeTwoFactor` and `adopt` check the new session's account before storing it; an adoption overtaken by a sign-out or another adoption (or abandoned through `adopt(session, { current })`), or whose check fails, stores nothing and revokes that session (one whose `current` is already false when it is called overtakes no adoption in progress), unless something else holds its token (the current or stored session, or another adoption of it running or accepted). Checks, adoptions and sign-out change the store and the state one at a time: a check that began before a session was adopted or a sign-out began publishes and forgets nothing, and checks during a sign-out answer without reading. A session is forgotten only while the store still holds it: a store with `clearIf(token)` does that atomically, so another writer of the same store keeps its token; without it the controller compares and clears, atomic only with its own writes. `signOut` stops `token()` before the revocation is sent, forgets the revoked session only once the kernel confirms it, and keeps a session adopted after it began unless it is the one being revoked (an adoption of that token, such as a changed password's unrotated token, resolves `false` from before the revocation is sent). **A durable sign-out** (`revocations`: a `RevocationStore`, a browser's storage) keeps the revocation in that store (read back) and forgets the stored session before reporting `unauthenticated`, so an interruption at any instant after the signed-out state shows (a reload, a closed tab) finds the revocation, never the session; the kernel's confirmation follows in the background (`revocationStatus`: `revoking`, `pending`, `confirmed`; `retryRevocations`, each attempt bounded by `revocationTimeoutMs`), and a revocation leaves the store only once the kernel confirms it (revoked now, or refused already). Where the store will not keep it, the token stays in memory, the stored session stays (a reload finds a session the kernel still accepts, never a token nobody holds) with its remembered context forgotten (`forgetContext`, so an offline restart reopens nothing for it; when that cannot be saved either, `signOut` rejects with `SignOutNotSaved`, stays `signing-out`, and is reported `unauthenticated` once the kernel confirms the revocation), this controller never reports that session again, and `signIn`, `completeTwoFactor` and `adopt` are refused with `UnsavedSignOut` (before the kernel is asked) until it is stored or confirmed. A stored session whose token the revocation store holds pending (its slot survived the sign-out: its removal failed or was interrupted) is never checked or reported by any controller over that store, and its slot is forgotten. A revocation the kernel confirms leaves the revocation store only after the session's slot is cleared (or, failing that, its remembered context forgotten); while neither succeeds it stays pending and is retried, and a `SignOutNotSaved` sign-out is reported `unauthenticated` only then. A slot that cannot be read at sign-out is a failure (`SignOutNotSaved`), never "nobody signed in", unless the caller passes the token it holds (`signOut(known)`: the client core passes an offline start's); a sign-out that failed keeps its token, so calling it again revokes the same one. **A refused session** (a 401 on the check, a late answer to the launch's bounded check, or `refuse(token)` for a 401 heard elsewhere, such as the organisation listing) is reported `unauthenticated` first, in a new generation (a check still in flight cannot replace it), and its slot is cleared afterwards in the background, retried with backoff until it succeeds or `dispose` (its remembered context forgotten meanwhile). The refused token is remembered in memory for the store object it came from for the life of the process (`isRefused`): no controller over that store reports it or lets the core reopen it offline again, even while the store still holds it. Limit (accepted): when the secure store can neither clear the slot nor forget its context, nothing durable records the refusal, so a restart of the app can reopen that context offline until the kernel is reached and refuses it again. A store may also keep the context last open with its token (`remember(token, { user, organization })`, `recall(token)`: the person and the organisation with its name and roles, never a credential), answering only for that token and forgetting it with the session (`clear`, `clearIf`, or another token saved); `memorySessionStore` does, and the client core uses it for an offline start (below). `safeReturnPath(candidate, origin)` and `signInPath(signIn, returnTo, origin)` keep a return after sign-in on the app's own origin.
|
|
107
|
+
- **The session.** `sessionController({ baseUrl, store })` holds `loading`, `authenticated` (`token`, `account`), `unauthenticated`, `unavailable` or `signing-out`, for every view (`subscribe`). `start`, `refresh` and `invalidate` (after a 401) share one check in flight; a stored token is reported authenticated only once the kernel accepts it, forgotten when it refuses it, and kept as `unavailable` when the kernel cannot be reached (retried with backoff). `signIn`, `completeTwoFactor` and `adopt` check the new session's account before storing it; an adoption overtaken by a sign-out or another adoption (or abandoned through `adopt(session, { current })`), or whose check fails, stores nothing and revokes that session (one whose `current` is already false when it is called overtakes no adoption in progress), unless something else holds its token (the current or stored session, or another adoption of it running or accepted). Checks, adoptions and sign-out change the store and the state one at a time: a check that began before a session was adopted or a sign-out began publishes and forgets nothing, and checks during a sign-out answer without reading. A session is forgotten only while the store still holds it: a store with `clearIf(token)` does that atomically, so another writer of the same store keeps its token; without it the controller compares and clears, atomic only with its own writes. `signOut` stops `token()` before the revocation is sent, forgets the revoked session only once the kernel confirms it, and keeps a session adopted after it began unless it is the one being revoked (an adoption of that token, such as a changed password's unrotated token, resolves `false` from before the revocation is sent). **A durable sign-out** (`revocations`: a `RevocationStore`, a browser's storage) keeps the revocation in that store (read back) and forgets the stored session before reporting `unauthenticated`, so an interruption at any instant after the signed-out state shows (a reload, a closed tab) finds the revocation, never the session; the kernel's confirmation follows in the background (`revocationStatus`: `revoking`, `pending`, `confirmed`; `retryRevocations`, each attempt bounded by `revocationTimeoutMs`), and a revocation leaves the store only once the kernel confirms it (revoked now, or refused already). Where the store will not keep it, the token stays in memory, the stored session stays (a reload finds a session the kernel still accepts, never a token nobody holds) with its remembered context forgotten (`forgetContext`, so an offline restart reopens nothing for it; when that cannot be saved either, `signOut` rejects with `SignOutNotSaved`, stays `signing-out`, and is reported `unauthenticated` once the kernel confirms the revocation), this controller never reports that session again, and `signIn`, `completeTwoFactor` and `adopt` are refused with `UnsavedSignOut` (before the kernel is asked) until it is stored or confirmed. A stored session whose token the revocation store holds pending (its slot survived the sign-out: its removal failed or was interrupted) is never checked or reported by any controller over that store, and its slot is forgotten. A revocation the kernel confirms leaves the revocation store only after the session's slot is cleared (or, failing that, its remembered context forgotten); while neither succeeds it stays pending and is retried, and a `SignOutNotSaved` sign-out is reported `unauthenticated` only then. A slot that cannot be read at sign-out is a failure (`SignOutNotSaved`), never "nobody signed in", unless the caller passes the token it holds (`signOut(known)`: the client core passes an offline start's); a sign-out that failed keeps its token, so calling it again revokes the same one. **A refused session** (a 401 on the check, a late answer to the launch's bounded check, or `refuse(token, owns?)` for a 401 heard elsewhere, such as the organisation listing: applied while `token` is the checked session, or while the controller is `unavailable` and `owns()` says the caller still holds it unchecked, judged in turn with the store's writes) is reported `unauthenticated` first, in a new generation (a check still in flight cannot replace it), and its slot is cleared afterwards in the background, retried with backoff until it succeeds or `dispose` (its remembered context forgotten meanwhile). The refused token is remembered in memory for the store object it came from for the life of the process (`isRefused`): no controller over that store reports it or lets the core reopen it offline again, even while the store still holds it. Limit (accepted): when the secure store can neither clear the slot nor forget its context, nothing durable records the refusal, so a restart of the app can reopen that context offline until the kernel is reached and refuses it again. A store may also keep the context last open with its token (`remember(token, { user, organization })`, `recall(token)`: the person and the organisation with its name and roles, never a credential), answering only for that token and forgetting it with the session (`clear`, `clearIf`, or another token saved); `memorySessionStore` does, and so do the hosts' stores (the web shell's over `localStorage`, shared by its tabs: a sign-out its revocation storage cannot keep leaves a token-scoped mark there that no tab's late `remember` overwrites and that its revocation store reports pending, and a `remember` from a tab that has not seen another tab's latest change of the context keeps nothing; the daemon's beside its secret store, the mobile host's in the device's secure storage), and the client core uses it for an offline start (below). `safeReturnPath(candidate, origin)` and `signInPath(signIn, returnTo, origin)` keep a return after sign-in on the app's own origin.
|
|
108
108
|
|
|
109
109
|
Proven in [`packages/testing/test/account-security.test.ts`](../../packages/testing/test/account-security.test.ts) (with a real SMTP server and an OAuth provider fake), [`packages/testing/test/profile-session.test.ts`](../../packages/testing/test/profile-session.test.ts) and [`packages/testing/test/directory-admin.test.ts`](../../packages/testing/test/directory-admin.test.ts).
|
|
110
110
|
|
|
@@ -112,7 +112,7 @@ Proven in [`packages/testing/test/account-security.test.ts`](../../packages/test
|
|
|
112
112
|
|
|
113
113
|
`@eloxiv/client/runtime` ([`Runtime.ts`](../../packages/client/src/Runtime.ts), decision 14) is the portable, framework-free client core: `makeClientRuntime({ kernelUrl, zeroUrl, schema, queries, mutators, modules, sessionStore, storage?, revocations?, initialOrg? })`. It owns what every client needs and none should implement twice: the session (`sessionController`, with desktop sign-in: `beginSignIn(redirectUri)`, `completeSignIn(login, { code, state })`), the selected organisation with a **generation** (`initialOrg`'s choice once signed in, by default the organisation selected before when the same person's session is adopted again, else the first membership; `selectOrg`), the replica of one person, organisation and session (`connectSync`, the storage injected), live named queries (`subscribe({ query, args?, id? }, owner)`: full snapshots tagged with their generation), optimistic writes through the generated mutators (`write({ mutator, input, id? }, owner)`: `predicted`, then `confirmed`, `rejected` with the typed error after the rollback, or `notConfirmed`), non-optimistic calls (`call(action, input, idempotencyKey?)`: the typed client for the app's actions; the kernel's, `make.*` and MAKE modules' actions over HTTP), an agent run's events (`followRun({ runId, after?, id? }, owner)`: the chat SDK's `chatClient.events` inside the core, reconnecting from the last stored event, each stored event emitted once, ending after `run-finished` or with the kernel's refusal; `unfollowRun`, `unfollowAll`) and the agent's readiness (`agentReadiness()`, the chat SDK's `readiness`), and teardown: an organisation change, a sign-out or `needs-auth` destroys every view, stops every followed run and closes the replica before the `context` event, then sends the `session` of the new generation (never before its `context`), and nothing of an older generation is emitted after it. Its events (`onEvent`) are [LocalClient](local-client.md)'s, without the stream's `seq`; the daemon serves it unchanged to native hosts. It follows the root SDK's portability rules.
|
|
114
114
|
|
|
115
|
-
**An offline start.** When the stored session cannot be checked because the kernel cannot be reached (`unavailable`) and the session store remembers a context for that token (`recall`), the core reports that person signed in, in that organisation alone (`organizations` holds only it), and opens their replica of it from its storage at once, so the last synced rows show and writes go to the replica as they do when the connection drops while running; `sessionStatus()` stays `unavailable` meanwhile (how a host marks it offline), switching organisation is refused (`ActionFailed`), and the check goes on every `recheckMs`. Nothing opens for another token, a store without `recall`, or a token a sign-out left pending (or a revocation store that cannot be read). The launch's first check of a token with a remembered context waits `offlineProbeMs` (3 s) for the kernel, in one attempt: a stalled connection or a network failure opens the offline context then, the check goes on in the background, and an answer that comes late is acted on at once (a refusal tears it down). When the kernel accepts the token, the core lists the person's organisations and
|
|
115
|
+
**An offline start.** When the stored session cannot be checked because the kernel cannot be reached (`unavailable`) and the session store remembers a context for that token (`recall`), the core reports that person signed in, in that organisation alone (`organizations` holds only it), marked `offline: true` (the session's own mark, 1.5.0; how a host shows it), and opens their replica of it from its storage at once, so the last synced rows show and writes go to the replica as they do when the connection drops while running; `sessionStatus()` stays `unavailable` meanwhile (how a host marks it offline), switching organisation is refused (`ActionFailed`), and the check goes on every `recheckMs`. Nothing opens for another token, a store without `recall`, or a token a sign-out left pending (or a revocation store that cannot be read). The launch's first check of a token with a remembered context waits `offlineProbeMs` (3 s) for the kernel, in one attempt: a stalled connection or a network failure opens the offline context then, the check goes on in the background, and an answer that comes late is acted on at once (a refusal tears it down). When the kernel accepts the token, the same context is announced at once without the `offline` mark and the core lists the person's organisations in the background (1.5.0: `subscribe`, `write` and `call` never wait on that listing, so reads come from the open replica and writes go to it meanwhile, and `organizationsStatus()` is `unavailable` until it answers; its answer is announced with a `session` event even when the session it lists is unchanged), keeping the same generation and replica while they still belong to the remembered organisation (else one is chosen in a new context); when it refuses it (on the check, or with a 401 on the organisation listing, also when a later check found the kernel unreachable again while that listing was in flight), everything is torn down as for any refused session (`needsAuth`: views destroyed, the replica closed, then the stored session and its context forgotten), whatever the store does: the teardown never waits for the store, a store that fails to clear the session has its context forgotten (`forgetContext`) and the clearing retried until it succeeds, and the refused token is not reopened again in this process. When the kernel accepts a remembered session at once but does not list its organisations within `offlineProbeMs`, the remembered organisation opens (`organizationsStatus()` `unavailable` until the listing comes), and the late listing reconciles it as a reconnect does. When another person signs in over an offline start (or over any open context), the first person's context is closed in a new generation (`signOut` reason) before the new person's organisations are listed. A selection (`selectOrg`) whose listing no longer has the open organisation resets it before refusing the selection (`Forbidden`). Whenever the kernel's listing of the person's organisations (at an online start, on reconnecting from an offline start, or listed again after a failure) selects none, the context remembered for the session is forgotten (`forgetContext`, the session kept) before the new context is announced, so a later offline start does not reopen an organisation the person was removed from; a newly selected organisation replaces it (`remember`, awaited, or forgotten when that fails). A sign-out while offline forgets the context with the session; without a revocation store (the daemon's), the context is forgotten before the revocation is sent, so an offline restart reopens nothing for it even when the kernel never confirms the sign-out. Once the kernel confirms it (or refuses the token already: 401), a slot that cannot be cleared still ends the sign-out `unauthenticated` while the context is forgotten (before, or then); only when neither can be is it `SignOutNotSaved` (staying `signing-out`, tried again with the same token). The core remembers the context each time one opens for a checked session (`remember`), and an online start of the same stored session returns to the remembered organisation (as `previous`, before `initialOrg`).
|
|
116
116
|
|
|
117
117
|
An in-process host (a JavaScript client: the web shell) has entries the protocol does not carry:
|
|
118
118
|
|
|
@@ -121,7 +121,7 @@ An in-process host (a JavaScript client: the web shell) has entries the protocol
|
|
|
121
121
|
- **Session details.** `token()` (for the host's own requests, never in an event), `sessionStatus()` (`loading` before the stored session is checked; `unavailable` and why, while the kernel cannot be reached to check it), `organizationsStatus()` (`listed`, or `unavailable` and why: the person's organisations could not be listed, so the session's empty `organizations` are unknown, not none; they are listed again every `recheckMs` (5 s) and by `start`, and once they come an organisation is selected in a new context, announced as usual). LocalClient's session event does not carry it yet: a native host sees the empty list until the listing succeeds.
|
|
122
122
|
- **Generation guards.** `subscribe`, `write` and `call` take `generation` (the last two also over LocalClient): refused (`StaleGeneration` naming the current generation, nothing predicted, sent or run) unless the context is still that generation, so a request made for one organisation never lands in the next.
|
|
123
123
|
|
|
124
|
-
Checked against a real kernel and zero-cache in [`registry/test/client-runtime.test.ts`](../../registry/test/client-runtime.test.ts) and LocalClient's conformance; the in-process entries against a stubbed kernel in [`packages/testing/test/client-runtime-sign-in.test.ts`](../../packages/testing/test/client-runtime-sign-in.test.ts) and [`client-runtime-races.test.ts`](../../packages/testing/test/client-runtime-races.test.ts), the offline start in [`client-runtime-offline.test.ts`](../../packages/testing/test/client-runtime-offline.test.ts). The web shell (`shell-foldkit` 0.7
|
|
124
|
+
Checked against a real kernel and zero-cache in [`registry/test/client-runtime.test.ts`](../../registry/test/client-runtime.test.ts) and LocalClient's conformance; the in-process entries against a stubbed kernel in [`packages/testing/test/client-runtime-sign-in.test.ts`](../../packages/testing/test/client-runtime-sign-in.test.ts) and [`client-runtime-races.test.ts`](../../packages/testing/test/client-runtime-races.test.ts), the offline start in [`client-runtime-offline.test.ts`](../../packages/testing/test/client-runtime-offline.test.ts) (reads and writes answered while the reconnect's listing stalls included), and every host's session store (the web shell's, the daemon's, the mobile host's) against the same custody rules in [`registry/test/session-store-kit.ts`](../../registry/test/session-store-kit.ts). The web shell (`shell-foldkit` 0.8.7, which shows organisations the core could not list as unavailable, or as a notice above an open organisation's rows) runs on one in-process runtime (IndexedDB replicas, the browser's storage for the session, its remembered context and pending revocations: an offline reload shows the remembered organisation with an offline indicator) through the Foldkit adapter's `runtimeReplica` and `runtimeEvents`.
|
|
125
125
|
|
|
126
126
|
## UI bindings
|
|
127
127
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The protocol native clients reach the client core through (decision 14). A host that cannot run the TypeScript client core in process (the Rune desktop host) talks to the device daemon instead: the daemon signs the person in, holds their session and the replica, and serves the core as JSON over HTTP plus one server-sent event stream under `/client/v1` on its loopback relay. Native types are generated from this contract's JSON Schema, never written by hand.
|
|
4
4
|
|
|
5
|
-
- Kind: shell contract. Version 1.
|
|
5
|
+
- Kind: shell contract. Version 1.2.0 (1.2.0: the offline start, a signed-in session's `offline` and the `offlineStart` feature; 1.1.0: the agent's run events and readiness, and a write's or call's expected `generation`; each additive: an older client is served unchanged).
|
|
6
6
|
- Schema: [`packages/contracts/schema/contracts/LocalClient.json`](../../packages/contracts/schema/contracts/LocalClient.json) (source [`LocalClient.ts`](../../packages/contracts/src/contracts/LocalClient.ts)); for code generation, the same types as one document with every type under `$defs` by name and tagged unions as `oneOf`, an empty struct as `{ type: "object" }`: [`packages/contracts/schema/codegen/LocalClient.json`](../../packages/contracts/schema/codegen/LocalClient.json) (`codegenBundle` in [`Catalog.ts`](../../packages/contracts/src/Catalog.ts)); the MAKE view types a native renderer draws are bundled the same way in [`codegen/Sandbox.json`](../../packages/contracts/schema/codegen/Sandbox.json).
|
|
7
7
|
- Implementation: `@eloxiv/daemon` composed with a `clientApp` ([`Client.ts`](../../packages/daemon/src/Client.ts)), over `ClientRuntime` from `@eloxiv/client/runtime` ([`Runtime.ts`](../../packages/client/src/Runtime.ts)).
|
|
8
8
|
- Kit: `@eloxiv/testing/conformance/LocalClient` ([source](../../packages/testing/src/conformance/LocalClient.ts)).
|
|
@@ -15,7 +15,7 @@ Every route needs a local token (`Authorization: Bearer ...`) except the sign-in
|
|
|
15
15
|
|
|
16
16
|
| Operation | Route | Body | Answer |
|
|
17
17
|
| --- | --- | --- | --- |
|
|
18
|
-
| `hello` | `GET /client/v1/hello` | | `Hello`: `{ protocol: "eloxiv.local-client", version: "1.
|
|
18
|
+
| `hello` | `GET /client/v1/hello` | | `Hello`: `{ protocol: "eloxiv.local-client", version: "1.2.0", features, app: { queries, mutators, actions } }`; `features` are `snapshots`, `optimisticWrites`, `actions`, `desktopSignIn`, since 1.1.0 `runEvents` and `agentReadiness`, and since 1.2.0 `offlineStart` |
|
|
19
19
|
| `session` | `GET /client/v1/session` | | `SessionState` |
|
|
20
20
|
| `signIn` | `POST /client/v1/sign-in` | `{}` | `SignInStarted`: `{ url, state }`. The daemon has bound its callback before answering; the host opens `url` (the app's web sign-in page with `challenge`, `redirect_uri` and `state`) in the system browser. The session becomes `signingIn` |
|
|
21
21
|
| `signInCallback` | `GET /client/v1/sign-in/callback?code&state` | | A small HTML page ("You can return to the app"). Browser-facing: no token, checked by its `state`, accepted once and within 60 s of `signIn`. The daemon redeems the code with the PKCE verifier it kept, keeps the session and emits `session`. A wrong, used or expired state answers `400` and redeems nothing |
|
|
@@ -38,7 +38,7 @@ Errors are JSON `{ _tag, message, ...fields }`: the standard invocation errors (
|
|
|
38
38
|
SessionState =
|
|
39
39
|
| { state: "signedOut" }
|
|
40
40
|
| { state: "signingIn" }
|
|
41
|
-
| { state: "signedIn", user: { id, email, name }, organizations: { orgId, name, roles }[], orgId: string | null, generation }
|
|
41
|
+
| { state: "signedIn", user: { id, email, name }, organizations: { orgId, name, roles }[], orgId: string | null, generation, offline?: true }
|
|
42
42
|
| { state: "signingOut" }
|
|
43
43
|
|
|
44
44
|
Event =
|
|
@@ -71,6 +71,8 @@ A `rows` event with status `error` and a `rejected` write carry the same kind of
|
|
|
71
71
|
9. **A run's events are the chat SDK's, once each (1.1.0).** A run subscription is `chatClient.events(runId, after)` inside the core: a connection to the kernel that drops or fails without a definitive answer is followed by another from the last stored event delivered, so a consent asked meanwhile, or the run's end, is never missed; each stored event reaches the client at most once (by its `seq`, whatever a reconnection repeats), streamed text as it comes. It ends after the event of type `run-finished`, or with the kernel's refusal (`error`); nothing of it follows either. Like a row subscription it is the client's own, destroyed when its stream closes, and ended by every context reset before the `context` event: no `run` event of an older generation is ever sent. Nothing of a subscription follows its end, not even an event the core had queued before it (unfollowed, its stream closed or replaced, a reset); `run-finished` and a refusal, which end it themselves, are still delivered.
|
|
72
72
|
10. **A request runs only in the context it was made in (1.1.0).** A write or a call may name the `generation` the client made it in. The daemon checks it against the current generation after every context change asked before it has finished, and before anything runs: in another, it is refused with `StaleGeneration` naming the **current** generation, and nothing is predicted, sent or run, so a send made in one organisation never runs in the next (another local client may have switched the shared daemon). `StaleGeneration` naming the request's **own** generation means the context changed while it ran: it may have run (a send is then resent under its key). A client retrying a request keeps the generation it was first made in. Without `generation` (a 1.0.0 client), the current context is used.
|
|
73
73
|
|
|
74
|
+
11. **An offline start shows the device's copy, and says so (1.2.0).** The daemon keeps the person's session in the secret store and, beside `state.json`, the person and organisation last open with it, bound to the token by its SHA-256 digest (never the token; `person-context.json`, 0600). One daemon serves LocalClient per state directory: a second one on the same canonical directory refuses to start while the first runs (`person-session.lock`, holding its process id; a lock left by a process that is gone is taken over), and a recall reads the context only after the secret store answered. A daemon that starts without reaching the kernel reports that person signed in, in that organisation alone, with `offline: true`, and serves its replica from disk at once: subscriptions answer from it and writes are predicted in it (pushed when the sync server is reachable again, within the sync engine's disconnect timeout of one minute; after it a write is `notConfirmed` with nothing predicted). Selecting another organisation is refused meanwhile (`ActionFailed`). When the kernel accepts the session, the same context goes on (same generation, `offline` gone, a `session` event), its organisations listed in the background: nothing waits on that listing. When it refuses it, the context resets and the session and its context are forgotten (guarantee 8). Nothing opens for another token, after a sign-out (the context is forgotten before the revocation is sent, whether or not the kernel confirms it; once the kernel confirms it the session goes from the secret store even when the context file cannot be removed, and the sign-out fails only when neither could be), or once the kernel listed the person in no organisation. Limit: rows synced in the last second before the daemon stopped may not be on disk (the sync engine writes its store a second after it settles).
|
|
75
|
+
|
|
74
76
|
## The agent through LocalClient
|
|
75
77
|
|
|
76
78
|
A native chat screen needs nothing beyond the operations above (the reference is the Rune host's, [`desktop-rune`](../registry/desktop-rune.md)); the guarantees that are hard to get right are the chat SDK's ([client SDK, "The chat SDK"](client-sdk.md#the-chat-sdk)), and a native host keeps its state the same way:
|
|
@@ -96,7 +98,7 @@ runMain(process.argv.slice(2), process.env, { clientApp: { modules: contracts, s
|
|
|
96
98
|
|
|
97
99
|
## How an implementation is checked
|
|
98
100
|
|
|
99
|
-
`localClientConformance(subject)` takes a `LocalClientSubject`: a daemon serving LocalClient for the registry's app, over a real kernel and zero-cache, with the host's secret, the tokens of other kinds of caller to refuse, a second person's client to make changes from, a way to play the browser (sign in by password and approve the desktop sign-in), and optionally the app's agent on a scripted model (a prompt whose turn asks for a consent-marked call, the action it names and the answer it gives). Its checks: `hello`; sign-in through the daemon's callback; a wrong and a replayed state refused with nothing redeemed; the session; listing and switching organisations, with the `context` reset before any row of the new organisation and no event of the old generation after it; a subscription's first snapshot and another person's change arriving; an optimistic write predicted, then confirmed; a refused write rejected with `Forbidden` after the rollback; a non-optimistic action call; a write not confirmed while the sync server is unreachable (when the subject can cut it off); harness, companion, shell and CLI tokens refused, and `ClientNotConfigured` from a daemon without an app; no kernel credential in any answer or event; closing the stream destroying its subscriptions; sign-out revoking the session and resetting; a call and a write made in the generation before a switch refused with `StaleGeneration` naming the current one, and run nowhere (1.1.0); with an agent (1.1.0): readiness, an agent turn through the protocol alone (`agent.messages` and `agent.runs` subscribed, `agent.send` as an action under its key and replayed under it, the run followed: streamed deltas, `consent-required`, approved with `consent.approve` under the decision's key, `consent-decided`, `run-finished` last, each stored event once and in order, the streamed answer the one the replica then holds), and a followed run of the first organisation sending nothing after the switch (its subscription gone; following it from the second ends with the kernel's refusal). Eloxiv's daemon runs it on Bun and on Node in [`registry/test/local-client.test.ts`](../../registry/test/local-client.test.ts) (in process, composed with the registry app, the replica in `bun:sqlite` or `node:sqlite`, zero-cache behind
|
|
101
|
+
`localClientConformance(subject)` takes a `LocalClientSubject`: a daemon serving LocalClient for the registry's app, over a real kernel and zero-cache, with the host's secret, the tokens of other kinds of caller to refuse, a second person's client to make changes from, a way to play the browser (sign in by password and approve the desktop sign-in), and optionally the app's agent on a scripted model (a prompt whose turn asks for a consent-marked call, the action it names and the answer it gives). Its checks: `hello`; sign-in through the daemon's callback; a wrong and a replayed state refused with nothing redeemed; the session; listing and switching organisations, with the `context` reset before any row of the new organisation and no event of the old generation after it; a subscription's first snapshot and another person's change arriving; an optimistic write predicted, then confirmed; a refused write rejected with `Forbidden` after the rollback; a non-optimistic action call; a write not confirmed while the sync server is unreachable (when the subject can cut it off); harness, companion, shell and CLI tokens refused, and `ClientNotConfigured` from a daemon without an app; no kernel credential in any answer or event; closing the stream destroying its subscriptions; sign-out revoking the session and resetting; a call and a write made in the generation before a switch refused with `StaleGeneration` naming the current one, and run nowhere (1.1.0); with an agent (1.1.0): readiness, an agent turn through the protocol alone (`agent.messages` and `agent.runs` subscribed, `agent.send` as an action under its key and replayed under it, the run followed: streamed deltas, `consent-required`, approved with `consent.approve` under the decision's key, `consent-decided`, `run-finished` last, each stored event once and in order, the streamed answer the one the replica then holds), and a followed run of the first organisation sending nothing after the switch (its subscription gone; following it from the second ends with the kernel's refusal); with a restart (1.2.0, `restart`: the daemon stopped and started again in place with the kernel and the sync server unreachable, then reachable): the remembered person and organisation reported `offline`, its rows from disk, a write predicted, then the same context checked (`offline` gone, every organisation) and the write confirmed. Eloxiv's daemon runs it on Bun and on Node in [`registry/test/local-client.test.ts`](../../registry/test/local-client.test.ts) (in process, composed with the registry app, the replica in `bun:sqlite` or `node:sqlite`, zero-cache and the kernel behind proxies the test cuts for the not-confirmed write and the offline restart, the agent on a scripted OpenAI-compatible model, `startScriptedChatModel` from `@eloxiv/testing`, whose turn moves the person's agent resources, `agent.moveResources`, a consent-marked call); [`registry/test/daemon-session-store.test.ts`](../../registry/test/daemon-session-store.test.ts) runs the offline start's custody kit over the daemon's person session; [`packages/testing/test/client-runtime-runs.test.ts`](../../packages/testing/test/client-runtime-runs.test.ts) checks the core's run subscriptions against a stubbed kernel (each stored event once across reconnections, a refusal as the subscription's error, every run stopped by a reset with nothing after the `context` event, readiness); [`registry/test/app-daemon.test.ts`](../../registry/test/app-daemon.test.ts) starts hello-app's own sidecar (the item's entry) as a process; [`registry/test/desktop-rune-journey.test.ts`](../../registry/test/desktop-rune-journey.test.ts) drives the Rune host against it live (decision 14's journey: sign-in through the web shell's approval page, live rows, an optimistic write a second client receives, a refused write rolled back with `Forbidden`, an agent turn on the scripted model with its consent approved in the chat screen, an organisation switch, a MAKE view step with a call, sign-out).
|
|
100
102
|
|
|
101
103
|
## Not yet guaranteed
|
|
102
104
|
|
|
@@ -30,6 +30,7 @@ Building needs Rust 1.97 or later; on Linux `libxkbcommon-dev` and `libwayland-d
|
|
|
30
30
|
## Guarantees and limits
|
|
31
31
|
|
|
32
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.
|
|
33
34
|
- Writes are the daemon's: the host never predicts or rolls back; a refusal shows its typed error after the rollback.
|
|
34
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.
|
|
35
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.
|
|
@@ -23,7 +23,8 @@ It installs `shell-foldkit/` (Vite config, `index.html`, `src/`). `eloxiv dev` r
|
|
|
23
23
|
- A screen is discarded when the route, the organisation or the session changes, so it never holds one organisation's rows after a switch; a late snapshot from the previous replica is dropped.
|
|
24
24
|
- It runs on the client core (`@eloxiv/client/runtime`, in process, since 0.7.0): the session, the organisation and its generation, the replica, live queries, optimistic writes and teardown are the core's, the same one the daemon serves native apps; screens reach them through `@eloxiv/client/foldkit` as before (`ReplicaKey`, `liveQuery`, `writeOptimistic`), the key's `opening` being the generation. `main.ts` passes the app's named queries (`queries` from `eloxiv.sync.ts`).
|
|
25
25
|
- Organisations the kernel could not list (a transient failure) show the error view with why (0.7.1), never an empty switcher or a screen loading for ever; the core lists them again and the shell follows.
|
|
26
|
-
-
|
|
26
|
+
- An offline reload (0.8.5) shows the organisation the session was last open in, from its IndexedDB replica, with an "Offline" indicator in the header (the core's `offline` session): the browser's storage keeps the person and organisation with the token they were open with (`eloxiv.session.context`, never a credential; `src/webSession.ts`), recalled only while the stored session holds that token, forgotten first with the session, when another token is stored, after a sign-out and when the kernel lists the person in no organisation. Writes go to the replica and are sent when the connection is back (within the sync engine's one-minute disconnect timeout); once the kernel answers, the indicator goes and the same screen carries on. Organisations not listed yet show as a notice above an open organisation's rows, not instead of them. With the browser's storage disabled (0.8.7), signing in works for the page alone, with no offline reload.
|
|
27
|
+
- Sign-out revokes the session and closes the replica's connection. It is durable: the revocation is kept in the browser's storage, and the stored session forgotten, before the signed-out state shows, and retried (every 15 s, when the network returns, at the next start) until the kernel confirms it. When storage is too full to keep the revocation, the sign-out leaves a mark for that token once its remembered context is gone (`eloxiv.session.signedOut`, 0.8.7): no tab remembers or reopens that session again, and the mark is retried as a revocation; a sign-out that cannot leave even that says it was not saved. Tabs share the session: a tab whose session another tab cleared, replaced or marked signed out checks it again at once (a `storage` event) and closes its context, and a tab's late `remember` cannot bring back a context another tab changed since (`eloxiv.session.context.rev`).
|
|
27
28
|
- A desktop sign-in is approved only by the person's explicit click on a page that says where the code goes; the page never approves on load, and refuses web redirects (the kernel refuses them too).
|
|
28
29
|
- It is a thin reference (decision 11): routing, sign-in, the organisation switcher, settings frame, the desktop sign-in approval and error view, not a design system.
|
|
29
30
|
|
package/dist/docs/release.md
CHANGED
|
@@ -33,7 +33,7 @@ The registry items depend on the packages at one range, `PACKAGES` in [`registry
|
|
|
33
33
|
## Releasing a version
|
|
34
34
|
|
|
35
35
|
1. Set the version: `mise run release:version 0.1.1`. It sets every public package's version, the versions compiled into the kernel and the daemon (`KERNEL_VERSION`, `DAEMON_VERSION`: health, MCP, the sidecar binary), and syncs the published exports. With recorded changesets, `pnpm changeset version` sets the packages' version from them (one fixed group, [`.changeset`](../.changeset/README.md)); run `mise run release:version <that version>` after it for the rest.
|
|
36
|
-
2. `mise run release:pack` locally if you like: the metadata check, the build, `pnpm pack` into `.eloxiv/release` (emptied first; `release.ts pack <dir>` packs elsewhere only into a new or empty directory) and every tarball checked; `node tools/done/src/release.ts smoke .eloxiv/release` installs them into an empty app with npm, imports every public entry point of each package on Node and Bun, and starts each daemon executable on its own runtime.
|
|
36
|
+
2. `mise run release:pack` locally if you like: the metadata check, the build, `pnpm pack` (with the `pack-order.cjs` hook, so every machine packs the same bytes) into `.eloxiv/release` (emptied first; `release.ts pack <dir>` packs elsewhere only into a new or empty directory) and every tarball checked; `node tools/done/src/release.ts smoke .eloxiv/release` installs them into an empty app with npm, imports every public entry point of each package on Node and Bun, and starts each daemon executable on its own runtime.
|
|
37
37
|
3. Merge the change to `main` as usual (CI's `tools/done/test/release.test.ts` checks the metadata, npm's packing of every entry point and the workflow).
|
|
38
38
|
4. Tag the merge commit (a commit on `main`: the workflow refuses any other) and push the tag:
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ The registry items depend on the packages at one range, `PACKAGES` in [`registry
|
|
|
43
43
|
|
|
44
44
|
The workflow has three jobs, all on GitHub-hosted runners (the only runners npm trusted publishing accepts).
|
|
45
45
|
|
|
46
|
-
**build** has no publishing authority: read-only access to the repository and no OIDC token. On a tag it first checks that the tagged commit is on `main`, then that the tag matches every public package's version and metadata. It builds and packs each package and checks every tarball (version, MIT licence, `^<version>` internal dependencies, no `workspace:` or source condition, every entry point and binary present, no tests or env files, expected size). Straight after, before any of the tarballs' code runs, it records each tarball's SHA-512 as a job output and uploads the tarballs.
|
|
46
|
+
**build** has no publishing authority: read-only access to the repository and no OIDC token. On a tag it first checks that the tagged commit is on `main`, then that the tag matches every public package's version and metadata. It builds and packs each package and checks every tarball (version, MIT licence, `^<version>` internal dependencies, no `workspace:` or source condition, every entry point and binary present, no tests or env files, expected size, each dependency field in its `package.json`'s order, and no file naming the building machine's checkout or home directory). Straight after, before any of the tarballs' code runs, it records each tarball's SHA-512 as a job output and uploads the tarballs.
|
|
47
47
|
|
|
48
48
|
**smoke** has no publishing authority either. It downloads a copy of the tarballs, checks it against build's digests and with `release.ts verify`, and smoke-tests it by installing the tarballs into an empty app (with the packages' peers), importing every public entry point of every package on Node and Bun (each subpath export, and each file a wildcard export such as `@eloxiv/testing/conformance/*` matches, so a runtime dependency missing from a manifest fails here; the React Native-only `@eloxiv/client/expo-sqlite` and the executables are resolved, not imported), starting each daemon executable on its own runtime (`@eloxiv/daemon/bin` on Bun, `bin-node` on Node) on an ephemeral port in a disposable state directory until it reports ready, and running `eloxiv --version`. It then asks npm what it would publish (a dry run, which also compares each version npm already has with its tarball). Nothing it runs can change build's artifact digests, which publish checks against.
|
|
49
49
|
|
|
@@ -66,7 +66,7 @@ mise run release:publish # install, release:pack, then npm publish each packag
|
|
|
66
66
|
git tag v0.1.0 && git push origin v0.1.0 # the workflow checks everything; it publishes nothing for this tag (below)
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
The workflow run for `v0.1.0` publishes nothing. It skips each version whose contents match your tarball, and if the runner's build differs from yours byte for byte it stops and names each package that differs, which is also harmless here, since every package is already published. (
|
|
69
|
+
The workflow run for `v0.1.0` publishes nothing. It skips each version whose contents match your tarball, and if the runner's build differs from yours byte for byte it stops and names each package that differs, which is also harmless here, since every package is already published. (The runner's build of v0.1.0 matched seven of the eight hand-built tarballs; `@eloxiv/testing` differed only in the order of its `@eloxiv/*` dependencies in `package.json`, which pnpm writes in the order its lookups finish. `release.ts pack` now gives pnpm a `beforePacking` hook, [`pack-order.cjs`](../tools/done/src/pack-order.cjs), that writes every dependency field in the order of the package's own `package.json`, and `verify` refuses any other order, so a build packs to the same bytes in any checkout, home directory, locale and time zone.) From the next version on, the workflow publishes.
|
|
70
70
|
|
|
71
71
|
Then make the release workflow each package's trusted publisher, in the `npm-release` environment:
|
|
72
72
|
|
package/dist/docs/scaffold.md
CHANGED
|
@@ -212,10 +212,10 @@ The kernel-provided `spaces` module (`spacesModule`, [Space](contracts/space.md)
|
|
|
212
212
|
### Shell and desktop
|
|
213
213
|
|
|
214
214
|
- **The example app's reference screens** (criterion 11, decision 11; [example-app.md](example-app.md)): UI items over `@eloxiv/client`, `@eloxiv/client/chat` and the Directory's member routes: `home-ui-foldkit` (the launcher at `/`: the person's spaces and everything installed), `inbox-ui-foldkit` (the unified inbox at `/inbox`), `members-ui-foldkit` (member administration at `/admin/members`), `people-ui-foldkit`, `mail-ui-foldkit` and `calendar-ui-foldkit`, each 0.1.0, with Story and Scene tests (`registry/test/shell-foldkit-reference.test.ts`). The browser journeys are `e2e/example.spec.ts` (J1 to J8, the providers' protocol fakes and a scripted model from `e2e/example.ts` and `e2e/model.ts`); the desktop journey (desktop 0.5.4) runs J1 to J8 in the webview, Alice's then Bob's in one session each, with a paired headless runner (`e2e/runner.ts`).
|
|
215
|
-
- **Shell** ([`registry/app/shell-foldkit`](../registry/app/shell-foldkit), item `shell-foldkit` 0.8.
|
|
215
|
+
- **Shell** ([`registry/app/shell-foldkit`](../registry/app/shell-foldkit), item `shell-foldkit` 0.8.7 (on the client core; an offline reload shows the organisation its session was last open in, from IndexedDB, with an offline indicator, since 0.8.5; its tabs share the session, a sign-out or a forgotten organisation never undone by another tab, since 0.8.7; code-split since 0.8.0: each screen a chunk loaded when a route first shows it, routed and linked meanwhile from its declaration's literal fields, which the build reads (`screenMeta.ts`), its Subscriptions hosted in one shell entry (`hostedSubscriptions`); the MAKE view host loaded by its mount; a chunk that cannot load shows an error with a reload), whose one screen marked `home: true` takes `/` (the example app's launcher); decision 10, proven in [spikes/foldkit-proof.md](spikes/foldkit-proof.md)): Foldkit 0.170.0 (The Elm Architecture over Effect: one Schema-typed Model, Messages, a pure update returning Commands, Subscriptions, ManagedResources), Foldkit UI's Dialog, StyleX 0.19.1 over the theme's `tokens.stylex.ts`, Vite 8 with `@foldkit/vite-plugin` and `@stylexjs/unplugin`; no React, router library, component kit or Tailwind. Sign-in, organisations (the switch discards the screen and marks the replica opening in one update, so no render pairs the new organisation with the old one's rows), routes from the installed views that have a screen (`src/screens/`, filled by UI items such as `hello-ui-foldkit`; `src/screen.ts` is their contract), **slots** (a screen names the slots it shows; the views other modules contribute to them are shown beside it as panels, their own screens created and discarded with it for the same replica, and contributed view commands as links: `notes-ui-foldkit` beside hello's greetings), **MAKE views** (`/make/<module>`, `src/make.ts` around the sandboxed host `src/makeView.ts`: the module's view and actions from `make.view`, mounted for the signed-in session in the selected organisation, opened afresh in another), sign-out with revocation kept and retried, an accessible appearance dialog (light, dark or the system's; left to right or right to left), the **locale** (`src/locale.ts`: the shell's text as a catalog in Paraglide's compiled shape, English and Arabic, negotiated from the browser's languages through `@eloxiv/shell-core`; `lang` and the direction follow the language chosen), the **error view** (a path nothing is installed at, organisations or a replica that cannot be reached), a minimal **settings frame** (`/settings`: profile, the organisation's members from `GET /api/org/members`, language, appearance), the **desktop sign-in approval** (`/desktop/sign-in`, shell-foldkit 0.6.0: what asks, where its code goes and the request's fingerprint, approved only by the person's click; signed in first when signed out) and a small **UI kit** (`src/ui.ts`: button, text field, select, alert, card, error view, radio group). Screens of the kernel's own views name their route (`chat-ui-foldkit` at `/agent/conversation`, `approvals-ui-foldkit` at `/approvals/request`, both over `@eloxiv/client/chat`; decision 11 keeps them deliberately basic); the shell refuses to start with one that collides with a manifest view's route, its own (`/`, `/settings`, `/make`, `/desktop`) or another screen's. A screen's and a panel's Subscriptions run for that instance of it, and every Message they send names it, so one sent before an organisation switch (a snapshot of the previous replica, still in flight) is dropped; a view contributed to slots twice is two panels, each with its own. Not built, by decision 11: a command palette, devtools, feedback and onboarding flows, broad settings pages, an admin control plane, rich kits; the React shell had none of them, so nothing was dropped. Runs on one in-process client core (`@eloxiv/client/runtime`, shell-foldkit 0.7.0: its session, durable sign-out, organisation and generation, replica, live queries, writes and teardown, the same core the daemon serves) and reads and writes through `@eloxiv/client/foldkit`'s bridge to it ([ClientSDK](contracts/client-sdk.md#ui-bindings)); bearer tokens stay in the core and the adapter's `Credentials`, outside the Elm state (the Model names a session by handle), and the password is never held. Test builds (`VITE_ELOXIV_TEST_HOOKS=1`) call a hook after every render (`src/testHooks.ts`). Marks route timings for the route-change benchmark and calls the desktop host's `eloxiv_interactive` command when it runs in Tauri.
|
|
216
216
|
- **Theme** ([`registry/app/themes/default`](../registry/app/themes/default), item `theme` 0.2.0, kind `theme`): the default [ThemeTokens](contracts/theme-tokens.md) and what `themeCss` and `themeStylex` write from them, `theme.css` and `tokens.stylex.ts` (`pnpm --filter @eloxiv/registry-source themes`). The shell imports `tokens.stylex.ts`.
|
|
217
217
|
- **Desktop** ([`registry/app/desktop`](../registry/app/desktop), item 0.4.1, which embeds the app's shell, built into `desktop/dist` (`scripts/shell.ts`: `ELOXIV_DESKTOP_SHELL`, else `shell-foldkit`, else the retired React `shell`), so updating it never changes the shell an app ships; 0.3.0 added the [Host](contracts/host.md) contract: `host.ts` over `src-tauri/src/host.rs`, the launch deep link and secure storage in the OS keychain, updates a documented stub): Tauri 2.12 host template that loads the shell and runs the daemon sidecar (started from Rust with `--port` and `--stdin-lifeline`, stopped on exit), reports launch to interactive, and builds on Linux, macOS and Windows. `pnpm exec tauri build` from the app root runs `scripts/prepare.ts` first (the sidecar for the target triple, through `@eloxiv/daemon/build-sidecar`, and the shell). Harness scripts: `measure-launch.ts`, `webdriver-e2e.ts` (WebKitWebDriver on Linux, msedgedriver on Windows) and `hooks-e2e.ts` (macOS, with the `e2e` cargo feature), one journey with two drivers: its checks, verdicts and page code are shared (`journey-checks.ts`, `journey-system.ts`), and `registry/test/desktop-journey.test.ts` holds both drivers to every check. See its README and "Desktop and React Native in CI".
|
|
218
|
-
- **Desktop on Rune** ([`registry/app/desktop-rune`](../registry/app/desktop-rune), item `desktop-rune` 0.6.
|
|
218
|
+
- **Desktop on Rune** ([`registry/app/desktop-rune`](../registry/app/desktop-rune), item `desktop-rune` 0.6.10 (with the offline start: started without the network, the daemon's SQLite replica of the organisation last open, marked offline; with the agent chat, installers, the Host contract's deep links with single instance, secure storage and signed updates with rollback, and the person's new notifications as OS notifications while it runs), decision 14; [its page](registry/desktop-rune.md); in `examples/hello-app` through `eloxiv add desktop-rune`): a native host in Rust on Rune (pinned at `eb5ae6c9`, with its five `[patch.crates-io]` entries, in a Cargo workspace of its own) over the app's own daemon through LocalClient v1: it starts the sidecar with a per-launch host secret and the stdin lifeline, waits for `/health`, and draws sign-in in the system browser, the organisation switcher, hello's live greetings with an optimistic and a refused write, a MAKE view drawn natively from the closed vocabulary ([Sandbox, "Native hosts"](contracts/sandbox.md#native-hosts)) and sign-out, light and dark, left to right or right to left, every control named for AccessKit. Requests run off the UI thread; nothing of an older generation is shown. Its protocol types are generated with typify from the contracts' JSON Schemas (`crates/eloxiv-local-client`, a freshness test regenerates and compares). The item ships the app's daemon entry (`sidecar/daemon.ts`, `daemon-node.ts`: the daemon with the app's `clientApp`) and `scripts/build-sidecar.ts`, which compiles it into `target/sidecar/eloxiv-daemon`; the host finds it beside itself (a package: then on a free port, with the app's own state directory and the servers `app.json` names), in its workspace's `target/sidecar` (`cargo run`), or runs the entry from source with Bun. `scripts/package.ts` makes installers with cargo-packager (`.app` and `.dmg`, NSIS, `.deb` and AppImage) from `app.json` (the app's identity and host settings, also compiled into the host and read by the release signer `eloxiv-update`), signed only with credentials, and `scripts/measure-launch.ts` measures launch to interactive from the host's probe line; CI's `desktop-rune-package` job builds, installs and launches them on the three systems and measures the 1.5 s budget ([ci.md](ci.md#the-packaged-rune-host-desktop-rune-package)). The person approves its sign-in on the web shell's `/desktop/sign-in` (shell-foldkit 0.6.0), the daemon's default sign-in page (`ELOXIV_SHELL_URL`). `cargo test` drives it in Rune's headless Runtime against a fake `/client/v1`; `tests/journey.rs` drives it against a real daemon, kernel and zero-cache, started by [`registry/test/desktop-rune-journey.test.ts`](../registry/test/desktop-rune-journey.test.ts) on Bun and on Node (`ELOXIV_RUNE_JOURNEY=1`). CI's `rust` job (`mise run rust:check`) runs on Linux, macOS and Windows when a Rust input changed ([ci.md](ci.md#the-rust-crates-rust)), and its `rune-journey` job the live journey on Linux (each optimistic write made with zero-cache's push held at a barrier, so its prediction is seen before the server answers) ([ci.md](ci.md#the-rune-journey-rune-journey)).
|
|
219
219
|
- **Mobile on Expo** ([`registry/app/mobile`](../registry/app/mobile), item `mobile` 0.3.10, decision 14; [its page](registry/mobile.md); in `examples/hello-app` through `eloxiv add mobile`): Expo 58 and React Native 0.88 (pinned as the React Native guard), its own npm project beside the app, Metro bundling the app's contracts and sync schema. One in-process client core (`@eloxiv/client/runtime`) with an expo-sqlite replica and the session in `expo-secure-store` (failures as `HostFailure`, durable sign-outs, nothing resurrected after a reinstall, the auth cookie React Native keeps cleared, the person and organisation last open remembered with the session, so an offline cold start shows their last synced rows at once, marked offline: the client core's offline start); screens for sign-in with two-factor, organisations, a live list with optimistic and refused writes, the agent's chat with consent and approval cards, notifications; deep links and notification responses through one View-contract parser and a gate that waits for the person and the organisation's generation; push through `notifications.registerInstallation` with the native token, decision buttons redeemed at `POST /api/notifications/decide` on iOS and, on Android, the request opened with the verdict preselected for the person to confirm; the Host contract with 1.1.0's `pushToken` and `onNotificationResponse`. Tests: `registry/test/mobile-host.test.ts`; CI's `mobile` lane drives it on an Android emulator ([ci.md](ci.md#the-mobile-lanes)), and `mobile-ios` attempts an iOS simulator build.
|
|
220
220
|
## Proofs in the full check
|
|
221
221
|
|
|
@@ -414,7 +414,7 @@ Budgets live in [`bench/src/budgets.ts`](../bench/src/budgets.ts). None were tig
|
|
|
414
414
|
The numbers are stable references (other documents cite them). Resolved gaps are removed and their numbers are not reused: 9 (the module manifest now declares permissions, settings, skills, views, slots, contributions, commands, work-item sources, entity resolvers, query views and approval rules ([ModuleManifest](contracts/module-manifest.md)), and `defineModule` workflows, event triggers and ingress sources), 12 (MCP calls carry a per-call idempotency key in `_meta`, backlog 7: [Invocation](contracts/invocation.md)) and 17 (CI runs on the draft pull request, on Bun and Node; the harness entry that later reused 17 is 18), and 4 (the app-wide Zero handle was `Zero<any>`; the sync schema is now generated with literal types and `connectSync` returns `SyncClient<AppSchema>`, decision 9), and 1 (optimistic writes: actions declare the change a replica predicts, `eloxiv generate` writes their mutators, and `/zero/mutate` runs each pushed write through the invocation path; [Sync](contracts/sync.md#optimistic-writes)), and 2 (policy compiler coverage, backlog 4: the compiler translates typed equality, order comparisons on Longs, `like`, `has`, `if-then-else`, literal sets with `contains`/`containsAll`/`containsAny`, the principal's groups, roles, permissions and email, `principal in resource.<attribute>` and `<named entity> in resource.<attribute>` (a named user only while that user acts), the record's state (`context.row`), sharing sets for the acting principal, and one hop through a declared reference within a module, and everything else fails closed ([the spike](spikes/cedar-policy-to-sql.md#limits-and-follow-ups) lists what stays refused); `eloxiv_ctx.has_grant` answers only for the acting principal and `principal.email` is answered in the database; compiled filters are keyed on the policy set's version, so a policy set that changes at runtime is never served stale, while row-level security still needs setup to run again after a policy change; `packages/kernel/test/policy-compiler.test.ts`, `policy-cache.test.ts`, `packages/testing/test/policy-sql.test.ts` and the policy differential suites), 3 (related queries, backlog 5: each `related()`/`whereExists()` subquery carries its own entity's read filter, and one reaching a table no entity governs is refused; [Sync](contracts/sync.md), guarantee 4, the Sync kit and `sharing-live.test.ts`) and 7 (the [Host](contracts/host.md) contract, 1.1.0, implemented by the web, Tauri, Rune and Expo hosts, and [StorageAdapter](contracts/storage-adapter.md) 1.0.0, by the memory, IndexedDB, SQLite and `expo-sqlite` stores, each held to its conformance kit).
|
|
415
415
|
|
|
416
416
|
5. **zero-cache needs Node.** Even in a Bun deployment, zero-cache runs on Node (`zeroCacheEnv` in [`System.ts`](../packages/testing/src/System.ts) and the CLI's [`Run.ts`](../packages/cli/src/Run.ts) find it). Dev settings that matter (`zeroCacheEnv`; the worker count, lag reporting, revalidation and the planner are defaults the environment overrides): `ZERO_NUM_SYNC_WORKERS=1`, `ZERO_REPLICATION_LAG_REPORT_INTERVAL_MS=0` (no lag-report readiness gating: even at 500 ms zero-cache jitters each report by up to ±1 s, which made cold start vary between 3.8 and 5.2 s), `ZERO_QUERY_ALLOWED_CLIENT_HEADERS=x-eloxiv-org`, `ZERO_MUTATE_ALLOWED_CLIENT_HEADERS=x-eloxiv-org,x-eloxiv-client-version`, `ZERO_ENABLE_CRUD_MUTATIONS=false` (writes reach the database only through actions), the kernel's `ELOXIV_ZERO_APP_ID` equal to zero-cache's `ZERO_APP_ID` (the shard sync's push writes its bookkeeping in), the publication `eloxiv_sync` (`ZERO_APP_PUBLICATIONS`), the query and mutate API keys the kernel checks (`ZERO_QUERY_API_KEY`, `ZERO_MUTATE_API_KEY`), `ZERO_AUTH_REVALIDATE_INTERVAL_SECONDS=10` (how long an expired session's replica can stay connected; Zero's default is 300 s), `ZERO_ENABLE_QUERY_PLANNER=false` (zero-cache's cost-based planner took 13 s to plan one generated permission filter of 59 correlated subqueries over six rows, seed `-1082452254` of `sync-property.test.ts`; deployments should turn it off too, or measure their own queries with it), and `synchronous_commit` left on. Production deployments with several replicas should keep lag reporting on and keep the revalidation interval at 10 s or less ([Sync](contracts/sync.md)). Sign-out, directory changes and sharing grants do not depend on either interval: zero-cache evaluates them live ([Sync](contracts/sync.md), guarantees 7 and 8; `sync-revocation.test.ts`, `sharing-live.test.ts`).
|
|
417
|
-
6. **Desktop and React Native** are enforced in CI (see "Desktop and React Native in CI" and [ci.md](ci.md)): the Tauri host on Linux, macOS and Windows, the Rune host's journey on Linux, the client SDK on Hermes and the Expo mobile host on Android. What remains: on macOS the Tauri journey runs as an injected script, not through WebDriver or operating-system input; the Tauri webview's replica is IndexedDB ([StorageAdapter](contracts/storage-adapter.md); Rune's is SQLite through its daemon, React Native's SQLite through `expo-sqlite`); nothing is proven on iOS (the mobile host's iOS simulator lane is an attempt that never fails a run). The client core
|
|
417
|
+
6. **Desktop and React Native** are enforced in CI (see "Desktop and React Native in CI" and [ci.md](ci.md)): the Tauri host on Linux, macOS and Windows, the Rune host's journey on Linux, the client SDK on Hermes and the Expo mobile host on Android. What remains: on macOS the Tauri journey runs as an injected script, not through WebDriver or operating-system input; the Tauri webview's replica is IndexedDB ([StorageAdapter](contracts/storage-adapter.md); Rune's is SQLite through its daemon, React Native's SQLite through `expo-sqlite`); nothing is proven on iOS (the mobile host's iOS simulator lane is an attempt that never fails a run). The client core opens the remembered replica at a start that cannot reach the kernel when the session store remembers the context with its token (`SessionStore.recall`, [ClientSDK](contracts/client-sdk.md) 1.4.0, reported `offline` since 1.5.0 and [LocalClient](contracts/local-client.md) 1.2.0): every host's store does (the mobile host's secure storage, the web shell's `localStorage` since shell-foldkit 0.8.5, the daemon's secret store with its context beside `state.json` for the Rune host), each checked against the same custody rules (`registry/test/session-store-kit.ts`), and live in the LocalClient kit's offline restart and a browser reload of hello-app with the kernel and zero-cache stopped. What remains: writes made offline are pushed only within the sync engine's one-minute disconnect timeout (after it they are refused, `notConfirmed`, with nothing predicted), and rows synced in the last second before a stop may not be on disk.
|
|
418
418
|
8. **Connector coverage.** The Microsoft Graph connector is proven against its protocol fake only (a live run is not required, owner decision 2026-11-17: [microsoft-graph.md](connectors/microsoft-graph.md)); Google and Slack also against real accounts; there is no Teams connector. CollabDocument, once listed here as a kernel contract not started, is built (CollabDocument 1.1.0: its kit, run by `collab-document.test.ts`, and `registry/test/notes-collab.test.ts`); the published contracts are listed in [contracts/README.md](contracts/README.md).
|
|
419
419
|
10. **In-process trust limit.** Registry and app modules are the app's own, trusted code, and run in the kernel's process on its connection. Row-level security, role privileges and setup's checks stop mistakes and SQL-level escapes; running module code (handlers, subscribers, module workflows and their steps, connectors, module schemas) without the kernel's services, in scopes of its own, stops a module reaching kernel services by accident; kernel privilege is bound to the kernel's own recorded handler functions, not to module objects. None of this is a boundary against deliberately hostile in-process code: such code can `RESET ROLE` on the kernel's connection, import and read what it likes, or open its own connections. Untrusted (agent-made, MAKE) modules run in the sandbox instead (backlog 3, resolved for them; [sandbox.md](contracts/sandbox.md)): their code runs in QuickJS with no ambient authority and their statements on a session logged in as their runtime role, so there is no kernel connection or more privileged role within their reach (`make-sandbox.test.ts`: "is its own role, with nothing more privileged to return to"; "reaches no other module's, kernel's or Better Auth's tables, and cannot forge the invocation context").
|
|
420
420
|
11. **Constraint side channels** (backlog 1, resolved as an accepted limit). Postgres checks unique and foreign-key constraints across row-level security; the kernel's rule that a write's outcome may not depend on an unreadable record is enforced per channel (see "The action contract": references are guarded, unique keys a writer could meet unreadable records on are refused at setup, key changes and exact actions' undeclared inserts are refused). The tests, one per channel: the Invocation kit ([`Invocation.ts`](../packages/testing/src/conformance/Invocation.ts), "identities and constraint outcomes") and [`setup.test.ts`](../packages/testing/test/setup.test.ts) ("refuses a unique key whose conflicts would disclose records a writer cannot read ..."). Two residual channels are accepted limits (owner decision, 2026-11-16):
|
|
@@ -575,7 +575,7 @@ An independent review of the Release work found two blocking issues, three shoul
|
|
|
575
575
|
`/tmp` (a tmpfs) ran out of inodes: test suites had left about 10,000 directories there, and `fallow audit` base-snapshot caches about 35,000 inodes each; the local cluster held 142 leftover databases and 13 inactive replication slots.
|
|
576
576
|
|
|
577
577
|
- **Sources:** the CLI tests' fixture registries and apps (`eloxiv-registry-*`, `eloxiv-app-*`) and symlink targets (`eloxiv-outside-*`) were never removed; the CLI-surface test's config directory (`eloxiv-cli-*`); the shell-assembly apps in `.eloxiv/tmp`; zero-cache's worker directories (`sync-worker-*`, `mutagen-*`), left by every killed zero-cache; and most test files dropped their database before they ran, not after, as did the browser suite.
|
|
578
|
-
- **Prevention:** temporary directories are made through a helper that removes them when the test finishes, passed or failed (`tempDir` in `packages/cli/test/fixtures.ts`, `onTestFinished`), or in `afterAll`; zero-cache's `TMPDIR` is its replica directory, which goes with the database. A Vitest global setup ([`tools/vitest/global-setup.ts`](../tools/vitest/global-setup.ts)) gives each run a temporary directory of its own (`TMPDIR`, inherited by every worker and every process a test starts), fails the run naming anything left in it, removes it, and drops the test databases (with their replication slots and replicas) the run created: setup tags each database it creates with the run's id (`ELOXIV_DATABASE_COMMENT`), so a parallel run's databases are left alone. The browser suite's teardown drops its database.
|
|
578
|
+
- **Prevention:** temporary directories are made through a helper that removes them when the test finishes, passed or failed (`tempDir` in `packages/cli/test/fixtures.ts`, `onTestFinished`), or in `afterAll`; zero-cache's `TMPDIR` is its replica directory, which goes with the database. A Vitest global setup ([`tools/vitest/global-setup.ts`](../tools/vitest/global-setup.ts)) gives each run a temporary directory of its own (`TMPDIR`, inherited by every worker and every process a test starts), fails the run naming anything left in it, removes it, and drops the test databases (with their replication slots and replicas) the run created: setup tags each database it creates with the run's id (`ELOXIV_DATABASE_COMMENT`), so a parallel run's databases are left alone. A database of the run it cannot drop fails the run, named (nothing would drop it later). The projects whose tests make databases (`packages/testing`, `packages/cli`, `registry`) name the same setup, so a run from a package's directory, which reads only that package's configuration, tags and drops its databases too; without it they had no tag and outlived the run (`eloxiv_t_rogue_node`, left by `setup.test.ts`, which now drops each database it makes when its test finishes). The browser suite's teardown drops its database.
|
|
579
579
|
- **fallow audit** (run by reviewers, not by `mise run check`) checks the base revision out into the temporary directory and keeps it as a cache per checkout root, so every agent worktree left one, and its garbage collection waited 30 days. `.fallowrc.json` sets `audit.cacheMaxAgeDays` to 1, so each audit sweeps abandoned caches of other worktrees after a day, and `mise run audit` runs it with `TMPDIR` in the checkout's ignored `.eloxiv/tmp`, so the cache goes with the checkout.
|
|
580
580
|
|
|
581
581
|
### Process lifetime (2026-11-14)
|
|
@@ -114,7 +114,7 @@ Entry points: Better Auth's routes behind the kernel (`packages/kernel/src/Ident
|
|
|
114
114
|
| ID-27 | I | A provider's or a gateway's free-form error text (echoing a device token) reaches the delivery records, the outbox or a summary | an answer records only the kernel's own text: a provider's documented code or the HTTP status, never the provider's text, a transport's or the database's message (`notifications/Providers.ts`) | `packages/testing/src/conformance/Push.ts` “keeps provider-supplied text out of the delivery records”; `packages/testing/test/push-providers.test.ts` “records FCM's codes only as the kernel's own constants”; `packages/testing/test/push-providers.test.ts` “records APNs's reasons only as the kernel's own constants” |
|
|
115
115
|
| ID-28 | T | A send whose answer was lost (a timeout, a crash between the request and its record) is sent again and the person sees the notification twice | each send is recorded (`sending`) before the provider is called and its answer after, so an installation that accepted or was refused is never sent again; APNs collapses copies by `apns-collapse-id` (the notification's id); an FCM copy replaces a visible one by its `tag` (the notification's id), and the Expo host presents a notification id once while it runs. There is no FCM collapse key: FCM keeps four per offline device, so a key per notification would drop distinct requests. Limit (accepted): delivery is at least once; on Android in the background the notification library draws a data message natively, so a resend after the person dismissed the first copy shows again | `packages/testing/src/conformance/Push.ts` “records each send before the provider answers it”; `packages/testing/src/conformance/Push.ts` “retries an installation that failed without sending again to one that accepted”; `packages/testing/test/push-providers.test.ts` “keeps distinct FCM notifications apart: no collapse key, only the notification's own tag”; `registry/test/mobile-host.test.ts` “presents a notification id once, and every other one” |
|
|
116
116
|
| ID-29 | I | The mobile app's session lands on disk outside secure storage (the auth provider's cookie from a sign-in or a second factor, kept in Android's persistent cookie store), or a password, session or decision token travels over plain HTTP | every request of the Expo host omits cookies (`registry/app/mobile/src/transport.ts`; Expo 58's native fetch then neither sends nor stores them, on Android and iOS), in the app's process only, so web cookie sign-in is unchanged; a release build refuses a non-HTTPS kernel or Zero URL and allows no Android cleartext; a development build may use plain HTTP, and a build bundled for a local test run (`EXPO_PUBLIC_ELOXIV_ALLOW_HTTP=1`) only to loopback and emulator hosts (127.0.0.1, ::1, localhost, 10.0.2.2), Android cleartext scoped to exactly those hosts by a network security config (`registry/app/mobile/app.config.js`); no request follows a redirect unless it asks to, so none takes a credential outside this policy. Limit: `10.0.2.2` is the host machine only inside the Android emulator; a build bundled with `EXPO_PUBLIC_ELOXIV_ALLOW_HTTP=1` and installed on a physical device would send credentials over plain HTTP to whatever machine on the local network holds that address. The flag is for local test builds (CI's emulator lanes) only, never set in a normal release build ([mobile](../registry/mobile.md#guarantees-and-limits)) | `registry/test/mobile-host.test.ts` “omits cookies on every request unless one asks for them”; `registry/test/mobile-host.test.ts` “refuses plain HTTP servers in a release build; a test build reaches only loopback and emulator hosts over it”; `registry/test/mobile-host.test.ts` “refuses redirects unless a request asks to follow them”; `registry/test/mobile-host.test.ts` “allows Android cleartext only in a build bundled for a local test run, and only to loopback and emulator hosts”; `registry/test/mobile-host.test.ts` “sends the notification's token and the verdict pressed, with no session, and reads the outcome” |
|
|
117
|
-
| ID-30 | I | An offline start (the client core opening a replica from disk while the kernel cannot be reached to check the stored session) shows another person's or organisation's rows, or keeps a revoked session's replica open | the context is remembered with the token it was open with and recalled only for that token (`SessionStore.recall`;
|
|
117
|
+
| ID-30 | I | An offline start (the client core opening a replica from disk while the kernel cannot be reached to check the stored session) shows another person's or organisation's rows, or keeps a revoked session's replica open | the context is remembered with the token it was open with and recalled only for that token (`SessionStore.recall`; every host's store forgets it with the session, first, and when another token is saved: the Expo host's secure store, also after a reinstall; the web shell's `localStorage`, rejecting a forgetting the browser refuses so the core retries, its tabs sharing it: a sign-out whose revocation storage cannot keep leaves a token-scoped mark no tab's late `remember` overwrites, counted as a pending revocation (unmarked, it is `SignOutNotSaved`), a `remember` from a tab that has not seen the latest context change keeps nothing, and open tabs re-check a session another tab cleared, replaced or marked; the daemon's, beside `state.json` with the token's SHA-256 digest, never the token, readable only by its owner, recalled only while the OS secret store still holds that token, which a sign-out the kernel confirmed deletes even when the context file cannot be removed; read after the secret store answered, one daemon per state directory); only that person's replica of that organisation opens, never for a token a sign-out left pending or when the revocation store cannot be read; the check goes on, and a token the kernel refuses (on the check, late after the launch's bounded check, or with a 401 on the organisation listing, also one that answers after a later check found the kernel unreachable again) tears the context down as any refused session: views destroyed and the replica closed first, never waiting for the store, then the session and its context forgotten, retried until the store succeeds, and the token is never reopened again in this process; a sign-out while offline forgets the context (without a revocation store, the daemon's, before the revocation is sent, so an unconfirmed sign-out reopens nothing either), revokes the offline start's token even when the slot cannot be read, and keeps a confirmed revocation until the session or its context is forgotten; another person signing in closes the first person's context before their organisations are listed. Limit: until the kernel answers, rows already on the device show for a session that may have been revoked elsewhere meanwhile (as they would to the same person going offline while running); nothing new reaches them. Limit (accepted): a refusal leaves no durable record when the secure store can neither clear the session nor forget its context, so a restart of the app can reopen that context offline until the kernel is reached and refuses the token again | `packages/testing/test/client-runtime-offline.test.ts` “opens nothing for another token, a store that remembers nothing, or a token a sign-out left pending”; `packages/testing/test/client-runtime-offline.test.ts` “tears everything down when the kernel refuses the session on reconnect”; `packages/testing/test/client-runtime-offline.test.ts` “tears the offline context down when the reconnect's listing refuses the session after the check became unavailable again”; `packages/testing/test/client-runtime-offline.test.ts` “forgets the remembered context with the session when the person signs out offline”; `packages/testing/test/client-runtime-offline.test.ts` “opens the remembered replica after a short deadline when the connection stalls, and tears it down on a late refusal”; `packages/testing/test/client-runtime-offline.test.ts` “closes the replica on a refusal while the store stalls, and cleans the store up afterwards”; `packages/testing/test/client-runtime-offline.test.ts` “never reopens a refused token in this process when the store can neither clear it nor forget its context”; `packages/testing/test/client-runtime-offline.test.ts` “closes an offline start's context at once when another person signs in, before their organisations are listed”; `registry/test/mobile-host.test.ts` “remembers the context last open with the session, recalls it only for that token, and forgets it with it”; `packages/testing/test/client-runtime-offline.test.ts` “forgets the remembered context before an offline sign-out's revocation is sent, without a revocation store”; `registry/test/shell-foldkit-session-store.test.ts` “refuses to save another token over a context it cannot forget, keeping the old one bound to its own token”; `registry/test/shell-foldkit-session-store.test.ts` “keeps a sign-out storage could not record from being undone by another tab's late remember”; `registry/test/shell-foldkit-session-store.test.ts` “keeps a stale remember from restoring an organisation another tab forgot, and lets that tab remember anew”; `registry/test/shell-foldkit-review.test.ts` “closes this tab's context when another tab's storage write cleared the shared session”; `registry/test/daemon-session-store.test.ts` “rejects a sign-out the secret store will not forget, the context forgotten first”; `registry/test/daemon-session-store.test.ts` “ends a daemon sign-out signed out when the context file cannot be unlinked but the keychain forgets the token”; `registry/test/daemon-session-store.test.ts` “recalls a context only if it is still on disk once the keychain answered”; `registry/test/daemon-session-store.test.ts` “refuses a second store over the same canonical state directory while the first holds it”; `packages/testing/test/session-controller-races.test.ts` “says the sign-out was not saved when neither the slot nor the context could be forgotten”; `registry/test/shell-foldkit-review.test.ts` “shows the remembered organisation, marked offline, and carries on in the same context once the kernel answers”; `registry/test/daemon-session-store.test.ts` “keeps the token in the secret store and the context beside state.json, owner-only, with no credential” |
|
|
118
118
|
|
|
119
119
|
## 2. Policy
|
|
120
120
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eloxiv/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The eloxiv command-line tool",
|
|
5
5
|
"homepage": "https://github.com/eloxiv/eloxiv/tree/main/packages/cli#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@babel/parser": "7.29.12",
|
|
34
34
|
"@effect/platform-bun": "4.1.2",
|
|
35
35
|
"@effect/platform-node": "4.1.2",
|
|
36
|
+
"@eloxiv/contracts": "^0.1.1",
|
|
37
|
+
"@eloxiv/registry": "^0.1.1",
|
|
36
38
|
"@napi-rs/keyring": "2.1.2",
|
|
37
39
|
"@rocicorp/zero": "1.11.3",
|
|
38
40
|
"diff": "9.0.0",
|
|
39
41
|
"drizzle-orm": "0.45.4",
|
|
40
42
|
"drizzle-zero": "0.21.0",
|
|
41
43
|
"effect": "4.1.2",
|
|
42
|
-
"node-diff3": "3.2.1"
|
|
43
|
-
"@eloxiv/contracts": "^0.1.0",
|
|
44
|
-
"@eloxiv/registry": "^0.1.0"
|
|
44
|
+
"node-diff3": "3.2.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsc -p tsconfig.build.json && node scripts/copy-docs.ts",
|