Changeset 0.21.2 (#88)

This commit is contained in:
2026-03-01 17:45:50 +00:00
parent 09c7281552
commit c5159538ce
18 changed files with 1105 additions and 32 deletions

View File

@@ -82,10 +82,10 @@ v0.21.0 Workspace Storage Primitive ✅
┌───────┴──────────────┐
│ │
v0.21.1 Workspace v0.21.3 Surface Infra
v0.21.1 Workspace v0.21.3 Surface Infra
Tools + Bindings + REPL (parallel)
│ │
v0.21.2 Workspace v0.21.5 Editor Surface
v0.21.2 Workspace v0.21.5 Editor Surface
Indexing + Search (Development Mode)
│ │
v0.21.4 Git v0.21.6 Article Surface
@@ -694,27 +694,35 @@ filesystem (source of truth) + DB metadata index (queryable cache).
- [x] Owner-based authorization: user=self, channel=owner, project=member, team=member
- [x] Unit tests: path cleaning, traversal detection, MIME detection, unsafe path filtering, write/read round-trip, delete, mkdir
### v0.21.1 — Workspace Tools + Channel/Project Binding
### v0.21.1 — Workspace Tools + Channel/Project Binding
Make workspaces useful in chat mode via tool calls.
- [ ] Workspace tools (category: workspace): `workspace_ls`, `workspace_read` (50KB soft limit), `workspace_write` (auto-mkdir), `workspace_rm` (recursive guard), `workspace_mv`, `workspace_patch` (find/replace)
- [ ] `channels.workspace_id` FK, `projects.workspace_id` FK
- [ ] Workspace resolution: channel workspace → project workspace (override pattern)
- [ ] Archive upload flow: detect archive MIME + workspace binding → extract to workspace
- [ ] Frontend: channel settings workspace toggle, project Files tab with tree view, chat bar workspace indicator
- [x] Workspace tools (category: workspace): `workspace_ls`, `workspace_read` (50KB soft limit), `workspace_write` (auto-mkdir), `workspace_rm` (recursive guard), `workspace_mv`, `workspace_patch` (find/replace)
- [x] `channels.workspace_id` FK, `projects.workspace_id` FK
- [x] Workspace resolution: channel workspace → project workspace (override pattern)
- [x] Tool injection in completion handler when workspace bound
- [x] Frontend: deferred (channel settings workspace toggle, project Files tab, chat bar workspace indicator)
### v0.21.2 — Workspace Indexing + Semantic Search
### v0.21.2 — Workspace Indexing + Semantic Search
Embed text files for semantic search. Reuses `knowledge.SplitText` + `knowledge.Embedder`.
- [ ] `workspace_chunks` table: workspace_id, file_id, chunk_index, content, embedding, metadata
- [ ] `workspace_files` additions: index_status, chunk_count
- [ ] Indexable types: text MIME types + 30+ code extensions
- [ ] Code-aware chunking: larger chunks (1500 chars), function/class boundary separators
- [ ] Content-addressed skip: sha256 check before re-chunking/re-embedding
- [ ] Background indexing: async goroutine with shared semaphore
- [ ] `workspace_search` tool: semantic search with optional glob filtering
- [x] `workspace_chunks` table (Postgres + SQLite migrations)
- [x] `workspace_files` additions: `index_status`, `chunk_count` columns
- [x] `workspaces.indexing_enabled` boolean (default true)
- [x] Store methods: `InsertChunks`, `DeleteChunksByFile`, `SimilaritySearch`, `UpdateFileIndexStatus`
- [x] Indexable types: text MIME types + 40+ code extensions + special filenames (Makefile, Dockerfile, etc.)
- [x] Code-aware chunking: 1500-char chunks with function/class/type/sub boundary separators
- [x] Content-addressed skip: sha256 comparison before re-chunking/re-embedding
- [x] `workspace.Indexer`: background goroutine with configurable concurrency semaphore
- [x] Single-file indexing via `FS.WriteFile` hook (`SetIndexer`)
- [x] Batch indexing via `ExtractArchive` (sequential within one semaphore slot)
- [x] `workspace_search` tool: semantic search with optional glob filtering, top-K capped at 20
- [x] `GET /api/v1/workspaces/:id/index-status` endpoint (per-status file counts, total chunks)
- [x] Configuration: `WORKSPACE_INDEXING_ENABLED`, `WORKSPACE_INDEX_CONCURRENCY` env vars
- [x] Graceful degradation when no embedding role configured
- [x] Mock store updated for FS unit tests
### v0.21.3 — Surface Infrastructure + REPL