You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three fixes for issues surfaced when running through the indexed-corpus
flow end-to-end.
Backend
- Add `GET /api/documents/{id}/chunks` returning the ordered chunks for
a document (id, chunk_index, content, token_count). The store already
exposes `ListChunksByDoc`; this is a thin handler around it.
- Add `GET /api/graph?project=...&type=...&limit=...` returning the full
entity graph as `{nodes, edges}` matching the UI's existing
RawGraphResponse shape, so the same GraphCanvas can render it without
a parallel transform.
- Skip the embedding phase in `pipeline.indexFile` when `p.embedder` is
nil (provider=none / graph-only flow). Previously every CLI index run
with `DOCSIQ_LLM_PROVIDER=none` panicked with a nil-pointer in
`(*Embedder).EmbedTexts`, contradicting the CLAUDE.md guarantee that
the embedder is nil-safe in this mode. Chunks are still persisted;
downstream extraction works off raw text rather than vectors.
Frontend
- New `useDocChunks` hook fetching the chunks endpoint above.
- `DocumentView` now renders chunk content. For markdown documents we
pipe through `markdown-it` (already a dep) for HTML; otherwise we
fall back to a `<pre>` of the raw text. The previous view rendered
only `title + doc_type · v<n>`, leaving the document body blank — the
symptom users were hitting after `docsiq index`.
- New `useEntityGraph` hook fetching `/api/graph` and adapting it to
the existing `GraphData` interface.
- `Graph.tsx` now loads both the entity graph (from the indexing
pipeline) and the notes graph (wikilinks between authored notes),
defaults to the entity graph when it has nodes, and exposes a small
toggle so users can flip between the two. The previous route was
hard-wired to `useNotesGraph` only, so an indexed corpus with no
hand-authored notes always showed the empty state.
Adjacent issues surfaced but **not** fixed here (separate PRs):
- `./docsiq index --force` collides on `documents.file_hash UNIQUE`
because the supersede path bumps version but doesn't release the old
hash.
- `/api/graph/neighborhood` requires the entity *name* (case-sensitive
via `GetEntityByName`); UUIDs return 404. Worth accepting either.
0 commit comments