Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5d8eb8a
docs(storage): define the session storage owners' target contracts
eric8810 Nov 23, 2026
817e4c1
docs(storage): serialize title writes and settle worktree removal by …
eric8810 Nov 23, 2026
26f10f7
docs(storage): decide titles through a change callback
eric8810 Nov 23, 2026
415aa6d
docs(storage): align the storage contracts with their callers
eric8810 Nov 23, 2026
2d8ad14
docs(storage): remove the engine's proxy queries and fold fork text i…
eric8810 Nov 23, 2026
50ac531
docs(storage): address the storage contract review
eric8810 Nov 23, 2026
5abf26f
docs(storage): address round-three review and self-checks
eric8810 Nov 24, 2026
3676a27
docs(storage): restore the FileStorage root_path dependency
eric8810 Nov 24, 2026
f562eeb
docs(storage): address the round-five inline review
eric8810 Nov 24, 2026
e5f5945
docs(storage): align the read handshake and the title service names
eric8810 Nov 24, 2026
be6e4ee
docs(storage): answer the round-five ledger and the round-six decisions
eric8810 Nov 24, 2026
eb4ec4f
docs(storage): finish the title wording
eric8810 Nov 24, 2026
f723d85
docs(storage): link the owner contracts from the architecture tree
eric8810 Nov 24, 2026
512b240
docs(storage): point superseded sections at the owner contracts
eric8810 Nov 24, 2026
39ee216
docs(storage): answer the pre-review findings
eric8810 Nov 24, 2026
7747192
docs(storage): answer the second pre-review
eric8810 Nov 24, 2026
8edbe8a
docs(storage): map the FileStorage and instance-identity rules
eric8810 Nov 24, 2026
d2eb578
docs(storage): answer the round-eight reviews
eric8810 Nov 24, 2026
c6d1dae
docs(storage): carry main's removal registration into the contracts
eric8810 Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/architecture/rust-agent/plugins/Attachments.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The model reads that path with `read` like any file. Design:
| Service | Purpose |
| --- | --- |
| `S:SessionIdentity` | The Session a put stores for; Rpc already resolved it from `sessionId`. |
| `P:SessionFiles` | SessionStore's `sessionFiles` data face (§9 of its owner contract). In this graph it is a graph-only fixture that stores nothing. |
| `P:SessionFiles` | SessionStore's `sessionFiles` data face ([SessionFiles](../../../design/plugins/SessionFiles.md)). In this graph it is a graph-only fixture that stores nothing. |
| `S:SessionMethods` | Register the `attachment` namespace from `apply`, until this part unloads. |

## Method
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/rust-agent/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ App Server optional plugins are outside this local-execution profile. [Web](../.

The product also installs [ImageUnderstanding](../../image-understanding.md) next to Modality; its Session part consumes the process target and auxiliary-model services outside this local-execution profile.

Process infrastructure rows are also outside this local-execution index. [UiExtensions and UiResources](../../client-ui-extensions.md) own client UI content and Session file publications. `UiHost` owns UI leaves: per leaf, a `UiLeaf` plugin whose life is the rutis session with the interactive `dimcode` process. Its contract is [Tui design §3.6](../../../design/plugins/Tui.md#36-ui-registry-and-ui-leaves) and its current assembly is in the generated [App Server services](../generated/app-server/services.md). The leaf runs its own `Tui` in the CLI's client tree; it is not a local-execution capability. The language runtimes' connection rows, `session-node` and `py`, are process infrastructure too: each starts its runtime and mounts the rutis session its foreign rows run on ([How Dim uses rutis A.4](../../../design/rutis-usage.md#a4-runtimes-and-sessions)).
The session storage owners are outside this local-execution index; their contracts are [SessionStore](../../../design/plugins/SessionStore.md), [SessionFiles](../../../design/plugins/SessionFiles.md), [ManagedWorktrees](../../../design/plugins/ManagedWorktrees.md), [SqliteStorage](../../../design/plugins/SqliteStorage.md) and [SessionTitle](../../../design/plugins/SessionTitle.md). Process infrastructure rows are also outside this local-execution index. [UiExtensions and UiResources](../../client-ui-extensions.md) own client UI content and Session file publications. `UiHost` owns UI leaves: per leaf, a `UiLeaf` plugin whose life is the rutis session with the interactive `dimcode` process. Its contract is [Tui design §3.6](../../../design/plugins/Tui.md#36-ui-registry-and-ui-leaves) and its current assembly is in the generated [App Server services](../generated/app-server/services.md). The leaf runs its own `Tui` in the CLI's client tree; it is not a local-execution capability. The language runtimes' connection rows, `session-node` and `py`, are process infrastructure too: each starts its runtime and mounts the rutis session its foreign rows run on ([How Dim uses rutis A.4](../../../design/rutis-usage.md#a4-runtimes-and-sessions)).

## Reading and maintaining these pages

Expand Down
2 changes: 2 additions & 0 deletions docs/design/appserver/native-storage-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,8 @@ semantics, preserved Steer candidates, automation origins and rollback.

## SQLite owner operations

These operations are the engine's crate-private implementation for the data owners; the public faces are [SqliteStorage](../plugins/SqliteStorage.md), [SessionStore](../plugins/SessionStore.md), [SessionFiles](../plugins/SessionFiles.md) and each data owner's contract. The paragraphs below describe the internal call flow and remain the implementation record.

Persistent Agents calls `sqliteStorage.agents`, `owners`, `save` and `delete` for its directory and Session ownership. Delegation reads use `members`, `ledMembers`, `ownedAgents`, `memberSessions` and `agentOwner`. Startup repair reads both lists from `unfinishedOwned`. SQLite owns all record reads and writes.

SessionStore calls `sqliteStorage.createSession({sessionId,config})` to create a Session and its main branch in one transaction. `sessionConfig({sessionId})`, `branches({sessionId})`, `head({sessionId,branchId})`, `batchEnd({sessionId,branchId,sequence})` and `batchEndAt({sessionId,branchId,sequence})` use the existing TimelineStore requests and replies. The export reads the same branch directory through its read-only snapshot.
Expand Down
4 changes: 2 additions & 2 deletions docs/design/appserver/session-deletion-and-fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,8 @@ path (`TimelineStore::rollback_session`) calls the same row removal as `delete_s

### Worktree association port

SessionStore provides the process service `worktreeAssociations` to the Session file-facts owner.
The operation is the data face `associate {sessionId, repository, root, subtree}`, all paths as
This section is superseded by [the SessionStore contract](../plugins/SessionStore.md): the association is
`store.associateWorktree {id, repository, root, subtree}`, all paths as
UTF-8 strings, with the same atomicity and errors as §17; a Rust caller calls the same method. The
file-access contract owns the directory definition, containing repository common directory and
worktree root. The port writes usage only and performs no Git discovery or authorization.
38 changes: 4 additions & 34 deletions docs/design/appserver/session-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,43 +410,13 @@ like `session_file_owners`, so output stays readable after the source is deleted

### 9.1 Language-neutral (ADR 002 D5)

`sessionFiles`, process scope, no instance key, provided by SessionStore.

| Method | Mode | Request | Reply |
| --- | --- | --- | --- |
| `put` | async | `{sessionId: string, name: string, content: string}`, where `content` is the bytes in base64 | `{fileId: string, path: string, bytes: u64}` |
| `import` | async | `{sessionId: string, name: string, source: string}`; authorized absolute local source path | `{fileId: string, path: string, bytes: u64}` |
| `read` | async | `{sessionId: string, fileId: string, offset: u64}` | `{data: string, eof: bool}`; base64 of at most 64 KiB, `eof` exactly when empty |
| `register` | async | `{sessionId: string, path: string}` (ADR 013) | `{}`; a missing Session is `not_found` |
| `owns` | async | `{sessionId: string, path: string}` | `{owned: bool}` |
| `owned_paths` | async | `{sessionId: string}` | `{paths: string[]}`, a Session file's directory and each output path |

`sessionFiles` is a data face: its catalog entry is shared and SessionStore publishes
the same `SessionFiles` binding at its Rust type key and `host_key("sessionFiles")`.
Native calls invoke the owner directly; wire calls decode and invoke the same operations.

`import` applies the same Session, name, 16 MiB, pending/owned transaction,
permissions and cancellation rules as `put`. FileStorage pins the source while
copying with a 64 KiB buffer; source growth or truncation fails before publication.
The caller authorizes source-path access. `read` resolves only immutable files
owned by the supplied Session, returning `not_found` for a foreign file ID.
Offsets at or beyond EOF return an empty chunk. Dropping a wire call cancels it.

- `path` is absolute on the Session's resource node, the way `read` resolves it for the Session.
`bytes` is the stored length.
- `register`, `owns` and `owned_paths` are ADR 013's ownership interface. `register` resolves the
path and records it before the caller hands it to the model; `owns` answers from both ownership
tables, and ADR 014 reads it as the session-owned fact for writes.
- Cancellation is a protocol action: the caller drops the call or sends the bridge's cancel
request. It takes effect up to txn 2. After that the file is committed and the reply stands.
- Errors are data, `{code, message}` (§10).
- SessionStore offers no operation that changes, renames or removes one file. Sharing and
release happen only inside S5c's fork and delete transactions, which are SessionStore's own
Rust steps, not service methods.
Superseded by [the SessionFiles contract](../plugins/SessionFiles.md). The operations, the
offset paging, the import reply, the output-path registration and the file removal are defined
there; this document keeps the storage layout, the flows and the error codes above.

### 9.2 How Attachments uses it

Attachments ([A.2](../plugins/Attachments.md#a2-attachmentput)) declares `S:SessionIdentity` and
Attachments ([A.2](../plugins/Attachments.md#a2-attachmentput)) declares its Session identity and
the process service `sessionFiles` in its `Deps`: an enclosing-scope dependency on a core part
(D3). A SessionStore reload reloads Attachments, which its rule check already accepts. For
`attachment.put` it calls `put(sessionId = its own Session, name, content = the text's UTF-8
Expand Down
2 changes: 1 addition & 1 deletion docs/design/appserver/session-notices.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn notify(ctx: &Ctx, session_id: &str, notice: SessionNotice);
SessionStore's `setTitle` (S5b), for example, commits the new revision and then calls
`notify(&ctx, session_id, SessionNotice { source: "SessionStore".into(), kind: "title".into(), data })` inside its
serialization of title writes, where `data` is `{title, titleSource, titleRevision}`
([S5b §5, §7](session-title-metadata.md#7-the-title-notice)).
([SessionStore](../plugins/SessionStore.md#operations) and [S5b §7](session-title-metadata.md#7-the-title-notice)).

## 5. Rpc forwarding

Expand Down
Loading