Skip to content

Commit b05f914

Browse files
authored
Merge pull request #555 from spacedriveapp/spaceui
SpaceUI migration
2 parents ac01c5b + 37f4485 commit b05f914

File tree

305 files changed

+33222
-17536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+33222
-17536
lines changed

.agents/skills/commit-all/SKILL.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: commit-all
3+
description: Use this skill when the user asks to "commit all", "commit everything", or wants all outstanding changes committed. Groups unrelated changes into separate, well-described commits instead of one catch-all commit.
4+
---
5+
6+
# Commit All
7+
8+
## Goal
9+
10+
Commit every outstanding change in the working tree — but group unrelated changes into separate, informative commits so the git history stays useful.
11+
12+
## Workflow
13+
14+
1. **Survey all changes.** Run `git status` and `git diff` (staged + unstaged) to see the full picture. Include untracked files.
15+
2. **Identify logical groups.** Cluster files by the change they belong to. A "group" is a set of files that were modified for the same reason (e.g. a bug fix, a new feature, a config tweak, a dependency update). Use file paths, diff content, and your understanding of the codebase to decide.
16+
3. **Order commits.** Infra/config/dependency changes first, then library/core changes, then feature/UI changes, then docs/polish.
17+
4. **For each group, create one commit:**
18+
- Stage only the files belonging to that group (`git add <file> ...`). Never use `git add -A` or `git add .`.
19+
- Write a concise, informative commit message that describes *what* changed and *why*. Follow the repo's existing commit style (check `git log --oneline -10`).
20+
- Do not lump unrelated changes together just because they're small.
21+
5. **Verify.** After all commits, run `git status` to confirm the tree is clean. Run `git log --oneline -n <N>` (where N = number of commits created) to show the user what was committed.
22+
23+
## Commit Message Rules
24+
25+
- Keep the subject line under 72 characters.
26+
- Use imperative mood ("add", "fix", "update", not "added", "fixes").
27+
- If a change is trivial (whitespace, typo, formatting), it's fine to batch those into one commit labeled accordingly.
28+
- End every commit message with the Co-Authored-By trailer.
29+
30+
## Hard Rules
31+
32+
- Never combine unrelated changes in one commit.
33+
- Never skip or discard changes — everything gets committed.
34+
- Never use `git add -A` or `git add .`.
35+
- Do not push. Only commit locally.
36+
- Do not commit files that look like they contain secrets (`.env`, credentials, tokens). Warn the user about those instead.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
name: writing-guide
3+
description: Use when writing or editing any Spacebot copy — README sections, docs, release notes, marketing text, design doc summaries. Covers voice, tone, patterns to avoid, and what good Spacebot writing sounds like.
4+
---
5+
6+
# Writing Guide
7+
8+
Spacebot copy should sound like a confident engineer wrote it, not a language model. The test: would a developer reading the README think "someone knows what they're talking about" or "this was AI-generated"? These rules exist because the second outcome is common and costs credibility.
9+
10+
## Voice
11+
12+
Direct. Technical. No hedging. Short sentences with real content. Lead with the fact, not the framing. State what something is — not what it isn't.
13+
14+
The tagline sets the tone: "The agent harness that runs teams, communities, and companies." That's a claim. It doesn't explain itself. Good Spacebot copy makes claims and lets the detail below earn them.
15+
16+
## Patterns to Avoid
17+
18+
These are the specific patterns that make copy sound AI-generated. Avoid all of them.
19+
20+
**Em dashes in prose sentences.** Em dashes are fine in bullet point labels ("**Shell** — run arbitrary commands") but not inside sentences. Replace with a comma, a period, or restructure.
21+
22+
Bad: "The cortex sees across all channels — the only process with full system scope."
23+
Good: "The cortex is the only process that sees across all channels."
24+
25+
**"Not X. Not Y." openers.** Starting a description by saying what something isn't.
26+
27+
Bad: "Not markdown files. Not unstructured vectors. Spacebot's memory is..."
28+
Good: "Spacebot's memory is a typed, graph-connected knowledge system."
29+
30+
**"This isn't X, it's Y."** Classic AI construction. Just say the thing.
31+
32+
Bad: "This isn't a generic claim — it's four specific mechanisms."
33+
Good: "Spacebot builds on itself through four specific mechanisms."
34+
35+
**"The result is..." and "The through-line:"** Setup language that delays the actual point.
36+
37+
Bad: "The result is an agent that works out of the box."
38+
Good: "It works out of the box."
39+
40+
**"No X. No Y." closers.** Ending a paragraph with a string of negatives.
41+
42+
Bad: "No heartbeat.json. No drift."
43+
Good: Just cut it, or fold it into the sentence that precedes it.
44+
45+
**"This is the most important X."** Let the reader decide what's important.
46+
47+
Bad: "This is the most important structural difference between Spacebot and every other agent harness."
48+
Good: Just state the difference.
49+
50+
**Semicolons in prose.** Use a period.
51+
52+
Bad: "The agent proposes; you decide."
53+
Good: "The agent proposes. You decide."
54+
55+
**Parallel triplets.** Three consecutive "same X, same Y, same Z" constructions sound mechanical.
56+
57+
Bad: "Same context, same memories, same understanding."
58+
Good: "They have the full conversation history."
59+
60+
**"Not only X, but also Y."** Pick one.
61+
62+
**Generic improvement claims.** Never say "self-improving" or "gets smarter." Name the actual mechanism.
63+
64+
Bad: "Spacebot learns from experience."
65+
Good: "After a conversation goes idle, a background branch reviews the history and saves skills and memories worth keeping."
66+
67+
## What Spacebot Is Opinionated About
68+
69+
When describing Spacebot's opinions, name them specifically: the process model, memory schema, and task lifecycle. Don't say its opinions are about "one thing" — they cover multiple things. The unifying idea is that state belongs in structured storage, not markdown files the LLM manages.
70+
71+
## What Is and Isn't a Differentiator
72+
73+
**Is a differentiator:**
74+
- The task system as the structural foundation of autonomy
75+
- True process-level concurrency across users
76+
- Typed memory graph in SQLite with graph edges and hybrid search
77+
- Autonomy channel with full context on wake, state tracked through tasks not files
78+
- Spacedrive integration for cross-device execution and safe data access
79+
80+
**Is not a differentiator:**
81+
- Skills (every harness has skills, the format is not special)
82+
- "Self-improving" as a generic claim
83+
- Internal implementation details the user doesn't see
84+
85+
Don't advertise internal improvements as external features. If Spacebot previously sent cold context to workers and now sends full context, that's an internal fix. The user-visible claim is "the autonomy channel wakes with full context" — not "unlike the old approach."
86+
87+
## The Spacedrive Story
88+
89+
Two layers:
90+
91+
**What exists today:** multi-device access via P2P, remote execution via Spacedrive's permission system, file system intelligence via context nodes, safe data access via Prompt Guard 2 screening.
92+
93+
**Where it's going:** team + personal library switching, org graph delegation, full company deployment model.
94+
95+
Be honest about which is which. Don't present the vision as current capability.
96+
97+
## Prose Structure
98+
99+
Opening paragraphs should be 3-4 sentences. Lead with the strongest claim. No setup sentences ("In this section, we'll cover..."). No closing sentences that summarize what was just said.
100+
101+
Bullet points are for lists of discrete items. Prose is for explanation, argument, and narrative. Don't bullet-point things that belong in prose.
102+
103+
Section headers are short nouns or short sentences. No gerunds ("Building the Memory System"). No questions ("What Is the Task System?").
104+
105+
## Words to Avoid
106+
107+
comprehensive, utilize, harness (as a verb), unlock, revolutionary, groundbreaking, remarkable, pivotal, powerful, exciting, cutting-edge, seamless, robust, leverage, paradigm, ecosystem (when not literally true), journey, dive deep, explore, embark.
108+
109+
Also avoid: "at its core," "under the hood," "out of the box" (unless used once, intentionally), "world-class," "best-in-class."

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
.DS_Store
33
.fastembed_cache
44
.build/
5+
*.db
6+
*.db-shm
7+
*.db-wal
58

69
# Interface
710
interface/node_modules/

CONTRIBUTING.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# Contributing
2+
3+
Contributions welcome. Read [RUST_STYLE_GUIDE.md](RUST_STYLE_GUIDE.md) before writing any code, and [AGENTS.md](AGENTS.md) for the full implementation guide.
4+
5+
---
6+
7+
## Prerequisites
8+
9+
- **Rust** 1.85+ with `rustfmt` and `clippy`
10+
- **protoc** (protobuf compiler)
11+
- **bun** (for frontend/interface work)
12+
- **just** (`brew install just` or `cargo install just --locked`)
13+
14+
Optional: [Nix flakes](https://nixos.org/) for isolated dev environments (`nix develop` gives you everything).
15+
16+
---
17+
18+
## Getting Started
19+
20+
1. Fork the repo and create a feature branch
21+
2. Run `./scripts/install-git-hooks.sh` (installs a pre-commit hook that runs `cargo fmt`)
22+
3. `cargo build` to verify the backend compiles
23+
4. For frontend work: `cd interface && bun install`
24+
5. Make your changes
25+
6. Run `just preflight && just gate-pr`
26+
7. Submit a PR
27+
28+
---
29+
30+
## PR Gate
31+
32+
Every PR must pass `just gate-pr` before merge. This mirrors CI and checks:
33+
34+
1. **Migration safety** — new migrations only, never edit existing ones
35+
2. **Formatting**`cargo fmt --all -- --check`
36+
3. **Compile**`cargo check --all-targets`
37+
4. **Lints**`cargo clippy --all-targets -Dwarnings`
38+
5. **Tests**`cargo test --lib`
39+
6. **Integration compile**`cargo test --tests --no-run`
40+
41+
Use `just gate-pr --fast` to skip clippy and integration compile during iteration.
42+
43+
The frontend CI (`interface-ci.yml`) runs `bun ci` and `bunx tsc --noEmit` on interface changes.
44+
45+
---
46+
47+
## Project Structure
48+
49+
Single binary crate (no workspace). Key directories:
50+
51+
```
52+
src/
53+
├── main.rs — CLI entry, config, startup
54+
├── lib.rs — re-exports
55+
├── config.rs — config loading/validation
56+
├── error.rs — top-level Error enum
57+
├── llm/ — LlmManager, model routing, providers
58+
├── agent/ — Channel, Branch, Worker, Compactor, Cortex
59+
├── hooks/ — SpacebotHook, CortexHook
60+
├── tools/ — reply, branch, spawn_worker, memory_*, etc.
61+
├── memory/ — MemoryStore, hybrid search, graph ops
62+
├── messaging/ — Discord, Telegram, Slack, webhook adapters
63+
├── conversation/ — history persistence, context assembly
64+
├── cron/ — scheduler, CRUD
65+
├── identity/ — SOUL.md, IDENTITY.md, USER.md loading
66+
├── secrets/ — encrypted credentials (AES-256-GCM)
67+
├── settings/ — key-value settings
68+
└── db/ — SQLite migrations, connection setup
69+
70+
interface/ — Dashboard UI (Vite + React + TypeScript)
71+
prompts/ — LLM prompts as markdown (not Rust strings)
72+
docs/ — Documentation site (MDX)
73+
desktop/ — Tauri desktop app
74+
scripts/ — Dev tooling (hooks, gates, builds)
75+
```
76+
77+
Module roots use `src/module.rs`, **not** `src/module/mod.rs`.
78+
79+
---
80+
81+
## Rust Conventions
82+
83+
The full guide is in [RUST_STYLE_GUIDE.md](RUST_STYLE_GUIDE.md). Key points:
84+
85+
**Imports** — three tiers separated by blank lines: (1) crate-local, (2) external crates, (3) std.
86+
87+
**Error handling** — domain errors per module, wrapped by top-level `Error` enum via `#[from]`. Use `?` and `.context()`. Never silently discard with `let _ =`.
88+
89+
**Async** — native RPITIT for async traits (not `#[async_trait]`). `tokio::spawn` for concurrent work. Clone before moving into async blocks.
90+
91+
**Logging**`tracing` crate, never `println!`. Structured key-value fields. `#[tracing::instrument]` for spans.
92+
93+
**Lints** (enforced in Cargo.toml): `dbg_macro = "forbid"`, `todo = "forbid"`, `unimplemented = "forbid"`.
94+
95+
**Testing**`#[cfg(test)]` at end of file. `#[tokio::test]` for async. `.unwrap()` is fine in tests only.
96+
97+
---
98+
99+
## Frontend (Interface)
100+
101+
Use **bun** exclusively — never npm, pnpm, or yarn.
102+
103+
```bash
104+
cd interface
105+
bun install # install deps
106+
bun run dev # dev server
107+
bun run build # production build
108+
```
109+
110+
### SpaceUI Packages
111+
112+
The dashboard uses `@spacedrive/*` packages published to npm from the [spaceui](https://github.com/spacedriveapp/spaceui) monorepo:
113+
114+
- `@spacedrive/primitives` — base UI components
115+
- `@spacedrive/ai` — AI chat components
116+
- `@spacedrive/forms` — form components
117+
- `@spacedrive/explorer` — file explorer components
118+
- `@spacedrive/tokens` — design tokens
119+
120+
`package.json` points to npm versions (e.g. `"^0.2.0"`). CI pulls from the registry. For local development, `bun link` overrides them with your local copies.
121+
122+
**Local SpaceUI development:**
123+
124+
Clone the spaceui repo adjacent to this one, then run the link command:
125+
126+
```bash
127+
git clone https://github.com/spacedriveapp/spaceui ../spaceui
128+
just spaceui-link
129+
```
130+
131+
This builds SpaceUI, registers all packages as global links, and connects them to `interface/`. Use `bun run watch` in the SpaceUI repo for automatic rebuilds.
132+
133+
To unlink and restore npm versions: `just spaceui-unlink`.
134+
135+
---
136+
137+
## Useful Commands
138+
139+
```bash
140+
just preflight # validate git/remote state
141+
just gate-pr # full PR gate (mirrors CI)
142+
just gate-pr --fast # skip clippy + integration compile
143+
just typegen # generate TypeScript API types
144+
just check-typegen # verify types match
145+
just build-opencode-embed # build OpenCode embed bundle
146+
just bundle-sidecar # build Tauri sidecar
147+
just desktop-dev # run desktop app in dev mode
148+
just update-frontend-hash # update Nix hash after frontend dep changes
149+
```
150+
151+
---
152+
153+
## Migrations
154+
155+
SQLite migrations are **immutable**. Never edit an existing migration file. Always create a new timestamped migration for schema changes.
156+
157+
---
158+
159+
## Architecture
160+
161+
See [ARCHITECTURE.md](ARCHITECTURE.md) for the full design. The short version: five process types, each with one job.
162+
163+
- **Channels** — user-facing LLM, stays responsive, never blocks on work
164+
- **Branches** — fork channel context to think, return conclusion, get deleted
165+
- **Workers** — independent task execution with focused tools, no conversation context
166+
- **Compactor** — programmatic context monitor, triggers compaction before channels fill up
167+
- **Cortex** — system observer, generates memory bulletins, supervises processes
168+
169+
Key rule: **never block the channel**. Branch to think, spawn workers to act.
170+
171+
---
172+
173+
## Release Process
174+
175+
Releases are triggered by git tags (`v*`). The CI workflow:
176+
177+
1. Verifies `Cargo.toml` version matches the tag
178+
2. Builds multi-platform binaries (x86_64/aarch64, Linux/macOS)
179+
3. Builds Docker images (amd64/arm64)
180+
4. Creates a GitHub release with binaries
181+
5. Updates the Homebrew tap
182+
183+
---
184+
185+
## License
186+
187+
FSL-1.1-ALv2 ([Functional Source License](https://fsl.software/)), converting to Apache 2.0 after two years.

0 commit comments

Comments
 (0)