refine app foundation

This commit is contained in:
Georg Bauer
2026-07-24 12:36:48 +02:00
parent 579e1030b2
commit 62e7752ec7
6 changed files with 941 additions and 872 deletions

30
PLAN.md
View File

@@ -18,6 +18,7 @@ sessions, tools, and turn orchestration.
| Model runtime | Preferences only | Persisted model choice, DFlash toggle, and idle timeout | Downloads, loading, inference, idle unloading, and Metal integration |
| Local endpoint | Not started | Nothing listening | OpenAI-compatible HTTP and streaming surfaces |
| Agent | UI shell only | Empty conversation pane and composer placeholder | Messages, generation, tools, approvals, compaction, and cancellation |
| Dev brain | Not started | No vault access | Obsidian vault selection, durable access, and agent knowledge/memory tools |
| Release | Not started | Development binary builds and tests | `.app` packaging, signing, entitlements, and notarization |
The application currently manages durable project/session metadata and model
@@ -184,6 +185,7 @@ visual placeholders with no message or agent runtime behind them.
- file write
- anchored edit
- text/file search
- opt-in Dev Brain knowledge lookup and memory storage
4. Stream assistant tokens and partial tool calls into Iced while inference and
tools run on workers. Preserve cooperative interruption and a valid KV
prefix at every stop point.
@@ -193,9 +195,33 @@ visual placeholders with no message or agent runtime behind them.
6. Port context compaction and system-prompt reinjection after ordinary
multi-turn operation is correct.
### Dev Brain — Obsidian knowledge and memory
- Add an optional Dev Brain setting in Preferences. Use the native macOS folder
picker to select an existing Obsidian vault, allow the vault to be changed or
disconnected, and persist its canonical path plus a security-scoped bookmark
in SQLite so sandboxed builds can regain access after restart.
- Keep the vault global to the application rather than tied to one project or
session. The selected vault remains in its original location; never copy it
into Application Support or a project directory.
- Add one local `dev_brain` agent tool with the minimum useful operations:
search Markdown notes, read a selected note, and create or append a memory
note. Return vault-relative paths with results so the agent can cite where
knowledge came from.
- Restrict every operation to the explicitly selected vault. Resolve and check
paths before access, ignore `.obsidian` and hidden files, and do not provide
deletion or arbitrary overwrite operations initially.
- Let the agent retrieve relevant global knowledge during a turn and record
durable conclusions after a turn. Vault access is opt-in, does not preload the
model, and must not block sessions when no vault is configured or available.
- Reuse the existing local file/search implementation underneath the new vault
boundary instead of building a second filesystem stack.
Exit criterion: create a project session, ask the model to inspect and edit a
small fixture repository, review each tool result in the GUI, restart, and
continue from the persisted session.
continue from the persisted session. With Dev Brain enabled, store a memory in
one session and retrieve it with a cited vault-relative note path from a session
in another project after restarting the app.
## Verification and packaging
@@ -223,3 +249,5 @@ tests, and release packaging remain open.
chats and HTTP requests cannot load duplicate engines.
4. Add transcript/KV persistence, then connect the existing conversation UI and
finally port the agent tools.
5. Add the opt-in Dev Brain tool after local file/search boundaries and agent
approvals are stable.