Skip to content

fix(extension): default to recursive chunker, keep doc metadata - #53

Merged
juicycleff merged 3 commits into
mainfrom
fix/default-chunker
Nov 4, 2026
Merged

juicycleff merged 3 commits into
mainfrom
fix/default-chunker

Conversation

@juicycleff

@juicycleff juicycleff commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

If you hand nexus a database, it no longer closes it when it stops. Your host keeps a working database for its own shutdown.

That covers a store you pass with nexus.WithDatabase (on the gateway or on the Forge extension) and a grove.DB the extension picks up from the Forge container. Gateway.Shutdown, and so the extension's Stop, still flushes usage records first. It then closes the store only when the gateway built that store itself, which today means the in-memory default. If you relied on Shutdown to close a store you handed in, close it yourself after Shutdown returns.

Before this, Shutdown closed whatever store it held. A host that shares one database with nexus (Loomplane does) saw the pool closed while it was still stopping its own services, so it wrapped the store in a type whose Close does nothing. With this change that wrapper can go.

We tracked ownership with an ownsStore flag set in Initialize where the default store is created. WithDatabase docs and the custom store guide now say who closes what.

Weave's engine also closes the store in Stop, so it may want the same treatment. We left it alone here.

Verification

  • New tests fail on main and pass here: the extension leaves a WithDatabase store open, leaves a grove.DB from the container usable (a ping after Stop works), and the gateway leaves a handed store open.
  • A fourth test pins the other half: Shutdown still closes a store the gateway opened itself.
  • make test across every module, make vet, and golangci-lint run ./... are clean. gofmt -l lists nothing.
  • The repo has no CHANGELOG.md. Release notes come from the commit subjects when release.yml runs, so there is no file to update.

This branch also moves grove (and its mongo, pg and sqlite drivers) to v1.10.2 and vessel to v1.0.5. Forge, fabriq and go-utils are already the latest.

The nexus embedder module is on nexus v1.9.2 too, so weave is now on the latest forge ecosystem releases.

The extension set no chunker, so every host had to pass one or ingest returned ErrNoChunker. It now starts the engine with the recursive chunker, and a chunker set through WithEngineOption still wins.

The engine also copies a document's metadata onto each of its chunks, so a search hit carries it. A key the chunker sets itself wins over the document's, and weave's own keys (tenant_id, document_id and the rest) still win over both.
@juicycleff juicycleff changed the title fix(extension): default to the recursive chunker and keep document metadata on chunks fix(extension): default to recursive chunker, keep doc metadata Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@juicycleff
juicycleff merged commit 46b1e62 into main Nov 4, 2026
15 checks passed
@juicycleff
juicycleff deleted the fix/default-chunker branch November 4, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant