Skip to main content

Crate forge_server

Crate forge_server 

Source
Expand description

The server: what a client reads of the core, and no view of its own.

Holds the view surface - the reads a client makes and the commands it sends -, the peer envelope parsing, forge’s own slash commands, the transcript fold that says where a conversation’s turns sit and the task endings it carries, a Monitor’s watched-command tail, and the socket that carries all of it to whatever is drawing.

Nothing here draws. What a glyph, a colour or a weight is belongs to the client, and the test is whether removing a thing changes what the data IS or only how it is DRAWN.

The reducers that derive a client’s session records live in that client.

Modules§

boot
The boot the server runs: the config dir, the workspace, the subsystem wave, the socket, and the boot spawn.
cli
The binary’s own arguments, shared by every caller of crate::boot.
commands
forge’s own slash commands: the catalogue a view offers beside the ones the CLI advertises. View-side data with no session in it, so it lives here rather than in either view: the table is the same for every reader, and a second copy would drift.
composer
The composer’s live state: whether a seat is compacting and the landed dictation nobody has sent yet.
delivery
The turn a delivery draws as: a cron fire, a Gotify notification, a Slack message or a peer comm.
envelope
Envelope parsing for the bracket-wrapped prose forge_workspace injects into user-turn text, plus the Slack mrkdwn converter.
error
App-level error enum. Definition lives in forge_primitives::error . This module re-exports it so existing crate::error::AppError imports keep resolving.
file_index
The file index, as this crate’s callers reach it.
git_diff
The plumbing a view reaches the core’s reads through, re-exported so a view depends on this crate and forge-primitives and no further.
live
What a view has learned from the stream, which its first render and every later one both read.
logging
output_tail
A command’s own output: the tail of the file the CLI streams it to.
perf_log 🔒
The web page’s perf log: the frame records a client with no shell measures, written beside forge.log.
startup
Startup-time process-state bumps. Currently just the RLIMIT_NOFILE raise (#251) - macOS launchd hands GUI-spawned processes a soft cap of 256 open FDs, and multi-session forge steady-state crosses that ceiling (~15-25 FDs per session × claude pipes / watchers / MCP / tokio kqueues). Without the bump, git scans and other openers fail with EMFILE once enough sessions are open.
surface
The surface a view uses: named read verbs by subject, returning values that carry no view type, and one dispatch verb for what a view acts with.
testing
View fixtures for a sibling crate’s tests.
timezone
transcript
The conversation fold: wire messages in, where its turns sit out.
translate
transport
The socket a client speaks to, and what a connection needs to answer it.
unseen
The green diamond: a turn that finished on a session this page has not shown since.
work
The working tree the HOME’s rows read, behind a cache: no render path shells out.

Structs§

SeatUpdate
The core’s update protocol, as a view reads it. It is the same type the same call hands a view, so nothing here wraps or renames it. The update the core emits, re-exported: it is the workspace-to-view protocol already, so a view subscribes to it rather than to a second vocabulary this crate would have to keep in step. One frame on the stream: the update, and the number the seat’s own counter minted for it.

Enums§

Command
The core’s write protocol, re-exported for the same reason the update is: a view acts by dispatching the core’s own command rather than a second vocabulary this crate would have to keep in step. Command envelope: a view -> forge-workspace.
DispatchError
Why a command did not reach a session, so a view can say which of the three it was rather than only that something failed. Errors from the dispatch boundary. UnknownSession and SessionClosed are returned by Workspace::dispatch; NoActiveSession is for a caller with no slot to name.
SessionUpdate
Update envelope: forge-workspace -> a view.

Constants§

FORGE_BUILD_PROVENANCE
How this build was made - the marker scripts/install.sh sets, or empty for anything else. Surfaced at startup by startup::report_build_provenance.
FORGE_CARGO_LOCK_DIGEST
Digest of the Cargo.lock this build saw, not of forge’s single-instance lock. FNV-1a, not a SHA, so shasum will not reproduce it. Meaningful only compared against the digest a build of the released tag reports.
FORGE_VERSION
Full version string, on the greeting and in the boot log.
FORGE_VERSION_SHORT
Short version string, for tight slots a view draws. Always carries the short SHA as +<sha> so the running build is identifiable from a screenshot.