joshu

Technical reference

Learn how the open-source Joshu box works and why, with the architecture, design decisions, and code map of each subsystem.

The technical reference tells developers how Joshu works and why it works that way. It is for each person who reads or changes the code of Joshu, including the contributors to the open-source repository. Each technical reference document covers one subsystem. The document tells the problem that the subsystem solves, how the parts of the subsystem fit together, what happens at run time, and the reason for each important design decision.

The technical reference is not a user guide. A user guide tells owners how to use Joshu, and the technical reference tells developers how Joshu is built.

How to read the technical reference

If Joshu is new to you, read the system overview first. It shows how a box is built from end to end (the desktop, the Joshu API, Hermes, Kanban workers, connectors, memory, voice, and the Docker stack), and why the main boundaries exist. Then read the gentle introduction to the app architecture and the platform architecture, which show the three layers of the app platform (apps, the platform data plane, and the runtime) and how a request moves between them. Then read the document of the subsystem that you want to change.

Technical reference documents in other folders

SubsystemDocumentWhat you learn
Platform and appsplatform-architecture.mdThe three layers, the domains, the packages, and the app invoke API.
Platform and appsjoshu-app-architecture-intro.mdHow the companion reaches an app through skills, the app GUI, and voice, with diagrams.
Platform and appsplatform-data.mdThe TypeScript client that apps use to read mail, calendar, and files.
Hermeshermes-integration.mdWhy Joshu customizes Hermes with skills, plugins, and environment variables instead of a fork, and where each customization goes.
Box accessbox-api-edge-security.mdWhich routes of the box API a request from the internet can reach, which need a desktop session or a direct localhost request, and how an admin desktop login signs in as the owner with a one-time link.
Instance agentinstance-agent-protocol.mdHow the instance agent gets signed commands from the control plane, which commands it runs, and what each command returns.
Realtime goalsrealtime-goals.mdThe acknowledgment, the follow-up questions, and the results on the channel of the request.
Safetyagent-safety.mdThe three tiers that control the writes of the companion, and how the owner approves a write.
Mail and calendarconnectors.mdHow the connector apps copy mail and calendar into Markdown files, index the files, and give the companion a small set of actions.
Files and searchfile-brain.mdHow gbrain indexes the Desktop files and answers hybrid search.
Kanban enginekanban/hermes-kanban-engine.mdHow Hermes runs Kanban workers on a box, which Joshu patches change Hermes Kanban, and when Joshu stops the worker of a task.
Proactive nudgeskanban/cross-board-readers.mdHow the hourly proactive tick picks one owner question from all boards, when it composes and sends a nudge, and how owner replies reach the task.
Teamsteams.mdHow the companions of different owners work together in a team stand-up.
Whiteboardjwhiteboard-developer-guide.mdHow the UI, the semantic model, storage, the embedded agent, and voice of jWhiteboard fit together.
Whiteboardcuratorial-whiteboard.mdThe semantic and review layer beside an Excalidraw board, and its authority rules.
Box stackvps-sandbox/README.mdThe Docker stack of a box on a VPS or a local host.
Buildruntime-assets.mdWhy the files that the API reads at run time must be copied to dist/.
Repositoriesoss-fleet-sync.mdHow the public repository and the fleet repository stay aligned.

What a technical reference document has

Each technical reference document has these sections, in this order. A short document can join two sections, but it must keep the content of each.

  1. Purpose: what the subsystem does, in two or three sentences.
  2. Motivation: the problem that the subsystem solves, and the constraints that shaped the design (for example cost, privacy, or a limit of an upstream project).
  3. Architecture: the components, the boundary of each component, the data that each component owns, and how the components connect. Add a Mermaid diagram when a diagram is clearer than text.
  4. Theory of operation: what happens at run time, step by step, and the mental model that a developer needs to predict the behavior of the subsystem.
  5. Design decisions: one entry for each important decision, with the date, the decision, the alternatives that were considered, and the reason that the decision won. When a later decision replaces an entry, keep the entry and write which entry replaces it.
  6. Limits and failure modes: what the subsystem does not do, what can go wrong, and how the subsystem recovers.
  7. Code map: the main files, the entry points, the configuration, and the tests.

Write about the current design. The design decisions section is the only place for history; release notes and GitHub issues hold the rest.