Optional automatic index rebuild when sources change
For human review. This is a follow-up to #129 (implemented in PR #136). A human maintainer will review and implement this manually. No code or PRs come with this issue. No version bump or npm publish is requested.
Summary
knolo-box status now reports stale: true when source files change. The index still only rebuilds when run manually, so it goes stale after every source refresh and stays stale until an operator rebuilds it by hand.
Steps to reproduce
- Run
knolo-box build --config <config>so a scope has a pinned V5 image and a recorded source fingerprint. - Confirm
knolo-box statusreports the pin matches and the index is not stale. - Edit, add, or remove source files under that scope without rebuilding.
- Run status again. It correctly reports
stale: true. - Confirm nothing rebuilds the index automatically. Search still uses the stale image until a manual
knolo-box build.
Expected behavior
- Add an optional watch or auto-rebuild mode: a file watcher, or rebuild-on-query when the source fingerprint changes, with debounce.
- Make it configurable in
box.config.jsonand off by default, so existing installs do not start rebuilding unless an operator opts in. - Status should include a field showing the last auto-rebuild time and result (success or failure, and a short reason on failure).
- Pin and verify semantics stay clear: a rebuild writes a new image with a new pin.
knolo_verifyand pin checks apply to the new image. A matching pin must not be presented as "fresh" when sources have drifted, and a new pin must be published after a successful rebuild.
Why it matters
Staleness is now visible, but a box that refreshes sources regularly will report stale after every refresh and keep serving outdated results until someone remembers to rebuild. Optional auto-rebuild lets operators keep the index current without a manual step, while leaving the default behavior unchanged.
Acceptance criteria
- With auto-rebuild off (the default), status still reports
stale: trueafter source changes, and the index is not rebuilt automatically. - With auto-rebuild on, a source change leads to a debounced rebuild, status reports not stale, and the new image has a new pin that verifies.
- Status exposes the last auto-rebuild time and result.
- Docs for
box.config.json,knolo-box status, andknolo_statusdescribe the option, the debounce behavior, and the new pin after a rebuild.
Related
- #129 (closed): Status and verify should report a stale index when source files change (PR #136)
- #115 (closed): stale image served after rebuild
A human maintainer will review and implement this manually.