Skip to content

Commit 5d8326d

Browse files
committed
docs(project): align guidance with shipping behavior
1 parent 765640b commit 5d8326d

30 files changed

Lines changed: 577 additions & 505 deletions

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Start engineering review with
6262

6363
- `architecture.md` — cross-process ownership and system flow;
6464
- `window-lifecycle.md` — native windows, save barriers, retirement, shutdown;
65+
- `bug-reporting.md` — local report collection, review authorization, approval,
66+
artifact handoff, and privacy;
6567
- `renderer-workspace.md` — folder/tab/search transitions and renderer liveness;
6668
- `data-lifecycle.md` — preparation, indexing, reconcile, queues, cleanup;
6769
- `file-transactions.md` — paths, import, save, conflicts, mutations;

README.md

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
# StashBase
22

3-
**Turn local files into searchable context for Agents.**
3+
**Turn local files into Agent-ready context.**
44

55
[![Website](https://img.shields.io/badge/website-stashbase.ai-0a66c2.svg)](https://stashbase.ai)
66
[![Release](https://img.shields.io/github/v/release/liliu-z/stashbase?label=release)](https://github.com/liliu-z/stashbase/releases/latest)
77
[![Status](https://img.shields.io/badge/status-early%20alpha-orange.svg)](#status)
88
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
99
[![Discord](https://img.shields.io/badge/Discord-support%20%26%20chat-5865F2.svg?logo=discord&logoColor=white)](https://discord.gg/zsRZH4PTq9)
1010

11-
Much of your best context lives in local files that Agents can't easily search — papers, contracts, scanned documents, recordings. 📂 Open a folder in StashBase and its supported contents become searchable:
11+
Much of your best context already lives in local files: notes, papers,
12+
contracts, project data, scanned documents, and recordings. Open a folder in
13+
StashBase and work with that material in place:
1214

13-
- 📄 **Prepare:** extract searchable text from PDFs, DOCX files, images, audio, and video.
14-
- 🔎 **Search:** find relevant context by meaning, not just keywords.
15-
- 🤖 **Connect:** share searchable context across Claude, Codex, and other MCP clients.
15+
- 📂 **Work in place:** browse, read, and edit supported files without moving them into a proprietary workspace.
16+
- 🔎 **Prepare and search:** extract difficult formats, search exact text immediately, and optionally add meaning-based retrieval with AI Index.
17+
- 🤖 **Use with Agents:** run Claude Code or Codex in the built-in Chat, or share the same authorized library with other MCP clients.
1618

1719
Your folders remain the source of truth; StashBase adds a search index that can be rebuilt from them.
1820

1921
The core idea:
2022

2123
```text
22-
Local files -> prepared text -> search index -> MCP -> Agents
24+
Local files -> prepared evidence -> retrieval -> Agents
2325
```
2426

2527
---
@@ -73,21 +75,30 @@ For a portable build, download `StashBase-*-linux-*.AppImage`, make it executabl
7375

7476
### First Launch
7577

76-
When you open StashBase for the first time:
77-
78-
1. **Open a folder**: Click the folder icon to choose a local folder containing files you want to search
79-
2. **(Optional) Set up AI Index**: To search by meaning and give Agents better retrieval, sign in through Supabase with Google for the included monthly allowance, or add an OpenAI/OpenRouter key in **Settings → AI Index**. An OpenAI restricted key needs access only to embeddings with `text-embedding-3-small`; model-list access is not required.
80-
3. **(Optional) Set up transcription**: To transcribe audio or video, download a speech model from **Settings → Transcription**. Small (465 MiB) is the default; Tiny (74 MiB) and Base (141 MiB) are lighter options. Transcription runs entirely on your machine, with no API cost, and you can cancel or rerun it while viewing the file
81-
4. **(Optional) Connect to Claude/Codex**: From **Settings → MCP**, connect external AI tools to access your searchable library
82-
5. **Start in Chat**: Chat is already open with one reusable blank session.
83-
Opening the app or a folder does not install an Agent; the first explicit
84-
**New Chat** prepares the selected runtime. Codex is the initial default,
85-
and StashBase remembers later Claude or Codex choices. Selecting a source
86-
file brings the document alongside the same conversation.
87-
88-
Your library is **opt-in**: only folders you open in StashBase are indexed. You can remove a folder at any time; StashBase clears its index but never deletes your files from disk.
89-
90-
> Haven't set up AI Index, or used the hosted allowance? In-app exact text search still works.
78+
The first window opens with no folder selected and one reusable blank Chat.
79+
80+
1. **Enable AI Index**: Sign in to StashBase for free monthly AI Index usage,
81+
or use your own OpenAI/OpenRouter key. To continue without it, choose **Skip
82+
AI Index for now**; exact text search and local file work remain available.
83+
2. **Ask how StashBase works**: In the Chat that is already open, ask **“How do
84+
I use StashBase?”** It starts against the whole Library, including Start
85+
Here. StashBase uses a supported system Claude Code or Codex runtime when
86+
available; if it is missing, installation waits for **Install and
87+
continue**. Agent provider login is separate from StashBase sign-in and AI
88+
Index configuration.
89+
3. **Open source files when you need them**: On a brand-new empty default
90+
folder home, StashBase adds **👋 Start Here** to the Library without opening
91+
it automatically. Open it from the titlebar's **Library** menu, or use **Add
92+
Folder…** to work with one of your own local folders. Selecting a source
93+
brings it alongside the same conversation.
94+
95+
StashBase processes only folders in its Library. Apart from the bundled Start
96+
Here introduction, folders join only when you explicitly add or open them. You
97+
can remove a folder at any time; StashBase clears its app-owned state but never
98+
deletes your files from disk.
99+
100+
Transcription and external MCP access can be configured later when you need
101+
them. Neither is required to begin browsing local files.
91102

92103
### Updating and Uninstalling
93104

@@ -121,7 +132,11 @@ Your library is **opt-in**: only folders you open in StashBase are indexed. You
121132

122133
---
123134

124-
## Usage Tips
135+
## Document Workbench
136+
137+
StashBase works directly with ordinary local folders. The Files sidebar,
138+
persistent tabs, Quick Open, and format-specific viewers keep source work in
139+
the same workspace as Chat.
125140

126141
Use **File → New Window** or Cmd/Ctrl+Shift+N to keep different folders and
127142
tools side by side. Window close follows VS Code's platform shortcuts;
@@ -133,9 +148,9 @@ safe application actions with their existing safeguards.
133148

134149
---
135150

136-
## What It Does
151+
## Search and Preparation
137152

138-
StashBase has two core jobs: prepare files and index their contents.
153+
The local RAG layer has two core jobs: prepare files and index their contents.
139154

140155
### Prepare
141156

@@ -153,8 +168,18 @@ Some formats need preparation before their contents can be searched. StashBase k
153168

154169
For PDF, DOCX, audio, and video, Agents read the derived text while the original remains the visible source file. Audio and video play directly when supported; otherwise, StashBase creates a compatible local audio preview. Large files dragged into the app stream to disk instead of being held entirely in memory. See [Architecture](design-docs/architecture.md) and [Preparation](design-docs/design/preparation.md) for the product and system contracts.
155170

171+
Audio and video transcription is optional. Download a local speech model from
172+
**Settings → Transcription** when you need it. Small (465 MiB) is the default;
173+
Tiny (74 MiB) and Base (141 MiB) are lighter choices. Transcription runs on
174+
your machine with no transcription API cost.
175+
156176
### AI Index
157177

178+
Sign in to StashBase for free monthly AI Index usage, or configure your own
179+
OpenAI/OpenRouter key in **Settings → AI Index**. An OpenAI restricted key
180+
needs access only to embeddings with `text-embedding-3-small`; model-list
181+
access is not required. Exact search needs neither option.
182+
158183
StashBase builds its AI Index and exact text search over:
159184

160185
- Markdown, HTML, and raw JSON text
@@ -179,11 +204,12 @@ MCP is the main interface between StashBase and Agents.
179204

180205
While the StashBase app is running, a local MCP server makes the same library available to external clients and the built-in Agent panel.
181206

182-
Core tools:
207+
Common tools:
183208

184209
- `library_info` - return the default folder home, opened folders, optional folder descriptions, and embedder status.
185210
- `search_library` - search the library in semantic (default) or keyword mode, optionally filtered by source type. Semantic mode may search the whole library; exact keyword mode works before AI Index is set up and requires a folder or path-prefix scope.
186211
- `reindex` - reconcile disk changes and make updated files searchable.
212+
- `create_project` - create and register a new project folder beneath an authorized location.
187213

188214
StashBase also exposes bounded file helpers for opened folders:
189215

@@ -198,9 +224,9 @@ These helpers exist for Agent clients that run in a sandbox and cannot directly
198224

199225
### Connect a Client
200226

201-
The normal path is **Settings -> MCP**. StashBase can write the MCP config for supported clients or copy the stdio snippet for clients that manage config themselves.
227+
The built-in chat agents (Claude Code, Codex) connect automatically. For any other MCP-compatible client, copy the standard configuration or the server connection details from **Settings → MCP** and register them in that client.
202228

203-
For manual stdio setup, URL-based clients, Docker access, ports, CORS boundaries, and token rotation, see [Advanced MCP configuration](docs/mcp-configuration.md).
229+
For setup examples, URL-based clients, Docker access, ports, CORS boundaries, and token rotation, see [MCP configuration](docs/mcp-configuration.md).
204230

205231
---
206232

@@ -225,6 +251,10 @@ knowledge base. It adds:
225251
- `@` mentions find files and folders with forgiving workspace-path search;
226252
selecting one inserts only its workspace-relative path.
227253

254+
Claude Code and Codex keep their normal provider login and native history.
255+
Those credentials are independent from StashBase account sign-in and the
256+
embedding source selected for AI Index.
257+
228258
---
229259

230260
## Storage Model
@@ -266,7 +296,7 @@ areas without duplicating the source tree:
266296

267297
## Build From Source
268298

269-
For contributors and developers building locally, and for platforms without a prebuilt installer.
299+
For contributors and developers running StashBase locally from source.
270300

271301
### Linux prerequisites (Ubuntu / Debian)
272302

@@ -289,11 +319,6 @@ pnpm electron
289319
# Development mode
290320
pnpm dev
291321

292-
# Build a distributable app for your platform
293-
pnpm dist # macOS
294-
pnpm dist:win # Windows
295-
pnpm dist:linux # Linux (.deb and .AppImage)
296-
297322
# Optional: include the local PDF/OCR extractor sidecar
298323
pnpm build:python-extract-sidecar
299324
```
@@ -304,6 +329,10 @@ Before opening a PR:
304329
pnpm check
305330
```
306331

332+
Packaging is release-only and runs from a validated release tag. Maintainers
333+
should follow the [release pipeline](code-review/release-pipeline.md) instead
334+
of creating ad hoc distributable builds.
335+
307336
---
308337

309338
## Status
@@ -325,7 +354,7 @@ Reasonably stable:
325354
- Markdown, HTML, JSON, PDF, and image preview
326355
- PDF extraction, image OCR, and local audio and video transcription, with persisted failures and retry
327356
- AI Index and exact text search
328-
- MCP server and client connectors
357+
- MCP access for built-in and externally configured clients
329358
- Bounded file helpers for sandboxed Agents
330359
- Built-in Claude Code / Codex panel
331360

code-review/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Interface, inspect the small implementation map, then read the changed code and
66
focused tests. Code and tests remain the source of truth for current behavior
77
and exact assertions.
88

9+
The contract set is an index over deep Modules, not a compressed source-tree
10+
inventory. Select the smallest set of Seams that owns the change; do not load
11+
every contract or expand an Implementation Map unless the change crosses the
12+
named Interface. This is the engineering half of the
13+
[coarse-to-fine documentation route](../design-docs/README.md#coarse-to-fine-route).
14+
915
## Review Route
1016

1117
```text
@@ -31,6 +37,7 @@ product area → user journey → review contract
3137
|---|---|
3238
| Runtime ownership or cross-process flow | [Architecture](architecture.md) |
3339
| Native windows, save-on-close, app shutdown | [Window Lifecycle](window-lifecycle.md) |
40+
| Bug-report collection, review, approval, handoff, privacy | [Bug Reporting](bug-reporting.md) |
3441
| Renderer folder, tab, search, or overlay coordination | [Renderer Workspace](renderer-workspace.md) |
3542
| Conversion, indexing, reconcile, cleanup | [Data Lifecycle](data-lifecycle.md) |
3643
| Import, save, rename, move, delete, conflicts | [File Transactions](file-transactions.md) |

code-review/agent-panel.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
the scope visible to the user; content and resumed history remain pinned.
1717
- A scope-specific History selection records one pending handoff. The active
1818
suitable blank tab consumes it exactly once before reconnecting.
19+
- Runtime readiness gates Chat before transport connection. Failed gates use
20+
the structured preparation failure stage and advertised manual recovery:
21+
installation can copy an install command, MCP can open manual setup, and
22+
simulated failures can remain retry-only. Error prose never selects an
23+
action.
24+
- Tab activation and history resume only select renderer state. A missing
25+
runtime remains on the setup gate until **Install and continue**; activation
26+
code must not call the preparation endpoint speculatively.
1927

2028
## Layout and Visibility
2129

@@ -94,8 +102,8 @@
94102
|---|---|
95103
| Panel boundary | `web-src/src/components/ChatPane.tsx` and `AgentView.tsx` |
96104
| Transcript/composer Modules | `web-src/src/components/agent/AgentMessages.tsx`, `AgentComposer.tsx`, `MentionComposer.tsx`, and `SessionHistoryMenu.tsx` |
97-
| State Interfaces | Chat tab state/actions in `web-src/src/store/state.ts` and `stateReducer.ts`; focused pure state Modules under `components/agent/` |
98-
| Runtime transport Adapter | connection URL/lifecycle Modules under `components/agent/` over the normalized [Agent Runtime](agent-runtime.md) protocol |
105+
| State Interfaces | Chat tab state/actions in `web-src/src/store/state.ts` and `stateReducer.ts`; activation consent in `components/agent/chatActivation.ts`; focused pure state Modules under `components/agent/` |
106+
| Runtime transport Adapter | connection URL/lifecycle Modules and `runtimeFailurePresentation.ts` under `components/agent/` over the normalized [Agent Runtime](agent-runtime.md) protocol |
99107
| Markdown Adapter | `web-src/src/components/agent/AgentMarkdown.tsx` |
100108
| Focused evidence | `web-src/src/__tests__/agent-*.test.ts`, `e2e/fixtures/fake-codex-app-server.test.mjs`, and `e2e/journeys/agent-panel.spec.ts` |
101109

code-review/agent-runtime.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,46 @@
88
- App boot and folder navigation perform only cheap discovery and idempotent
99
MCP repair for already installed runtimes. They never install an Agent or run
1010
a login-shell probe.
11-
- The first explicit New Chat action owns readiness for the selected Agent.
12-
Discovery prefers a supported system executable, then a managed executable
13-
under AppData. If neither exists, only that Agent's official runtime is
14-
installed.
11+
- New Chat opens readiness for the selected Agent but does not itself authorize
12+
a download. Discovery prefers a supported system executable, then a managed
13+
executable under AppData. If neither exists, the Agent gate waits for
14+
**Install and continue** (or the explicit Settings install action) before
15+
installing only that Agent's official runtime. Opening, switching, or
16+
resuming a tab never installs another runtime as a side effect.
1517
- Managed runtimes never modify `PATH` and continue using the provider's normal
1618
account and history home. Resetting a managed executable never clears login
1719
or native history.
20+
- Settings offers Uninstall only for a StashBase-managed runtime, never for a
21+
system executable. It stops that agent's sessions, resets preparation state,
22+
and removes only the private install under AppData (the removal path-guards
23+
to that root). Uninstall is disk reclamation, not deactivation: the next
24+
explicit New Chat re-runs readiness.
1825
- Codex uses its official standalone installer in a private target. Claude uses
1926
its official release manifest, verifies size and SHA-256, and publishes
2027
atomically. Shutdown cancels preparation.
21-
- Readiness configures the matching CLI's StashBase MCP entry. Native attach
22-
repeats that idempotent write immediately before process start.
23-
- A discovery, installation, or config failure is visible and retryable but
24-
never blocks the workspace or silently substitutes another Agent.
28+
- Readiness configures the matching CLI's StashBase MCP entry through
29+
`ensureAgentMcp`, the only writer of the built-in agents' own config files.
30+
Native attach repeats that idempotent write immediately before process
31+
start. There is no user-facing connect/disconnect for built-in agents; MCP
32+
is part of readiness, and Settings surfaces a repair action only on
33+
failure.
34+
- Preparation is one staged Interface: discover, install only when missing,
35+
then configure MCP. Its failure contract names `stage`, `code`, a bounded
36+
message, retryability, and an optional manual recovery. Renderer code must
37+
not classify failures by parsing messages. Installation failure may expose
38+
the provider install command; MCP failure may expose the read-only manual MCP
39+
setup, never an install command.
40+
- Retry calls the same preparation Interface. Fresh discovery skips a completed
41+
installation, so an MCP retry rewrites only the idempotent MCP configuration;
42+
no parallel repair state machine exists.
43+
- Development failure injection is one mutually exclusive, in-memory
44+
`nextFailure` value. It is consumed only when explicit readiness reaches that
45+
stage and immediately resets to normal; background startup repair never
46+
consumes it, and an installation injection stays pending when an existing
47+
runtime skips installation. Settings presents these controls inside a
48+
visually distinct development-only surface; production omits the surface.
49+
- A discovery, installation, or MCP failure is visible and retryable but never
50+
blocks the workspace or silently substitutes another Agent.
2551

2652
## Session Scope and Lifetime
2753

@@ -82,11 +108,12 @@ assumed CLI versions.
82108
|---|---|
83109
| Agent Interface | `AgentAdapter`, normalized client/server events, scope resolution, attach, and stop in `server/agent-contract.ts` |
84110
| Adapter registry | `server/agent-adapters.ts` |
85-
| Preparation Interface | `AgentBootstrapCoordinator` in `server/agent-runtime-installer.ts` plus discovery paths in `server/agent-cli.ts` |
111+
| Preparation Interface | `AgentBootstrapCoordinator` and its structured failure contract in `server/agent-runtime-installer.ts`; discovery and one-shot debug controls in `server/agent-cli.ts` and `server/agent-runtime-paths.ts` |
112+
| MCP wiring | `ensureAgentMcp` and the launcher writer in `server/agent-mcp.ts` |
86113
| Claude Adapter | `server/agent.ts` and its SDK/native-process helpers |
87114
| Codex Adapter | `server/codex-session-runtime.ts`, `codex-rpc-transport.ts`, `codex-protocol.ts`, and `codex-history.ts` |
88115
| Scope/history owners | `server/agent-session-registry.ts`, `agent-session-folders.ts`, `agent-projects.ts`, and session routes |
89-
| Renderer Adapter | `web-src/src/agentBootstrap.ts`, `agentCatalog.tsx`, and [Agent Panel](agent-panel.md) |
116+
| Renderer Adapter | `web-src/src/agentCatalog.tsx`, `components/agent/chatActivation.ts`, `components/agent/runtimeFailurePresentation.ts`, and [Agent Panel](agent-panel.md) |
90117
| Focused evidence | `server/__tests__/agent-contract.test.ts`, `agent-runtime-installer.test.ts`, `agent-projects.test.ts`, `codex-agent.test.ts`, `agent.test.ts`, and `e2e/fixtures/fake-codex-app-server.test.mjs` |
91118

92119
## Validation

code-review/architecture.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ The main ownership seams are intentionally narrower than this map:
109109

110110
- [Window Lifecycle](window-lifecycle.md) — renderer readiness, save barriers,
111111
identity retirement, multi-window behavior, and shutdown.
112+
- [Bug Reporting](bug-reporting.md) — local collection, sender-bound review,
113+
immutable approval, artifact handoff, and privacy.
112114
- [Renderer Workspace](renderer-workspace.md) — per-window folder, document,
113115
retrieval, and shell transition ownership.
114116
- [Data Lifecycle](data-lifecycle.md) — preparation, indexing, reconcile,

0 commit comments

Comments
 (0)