knolo-core icon indicating copy to clipboard operation
knolo-core copied to clipboard

Optional automatic index rebuild when sources change

Open HiveForensicsAI opened this issue 3 weeks ago • 0 comments

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

  1. Run knolo-box build --config <config> so a scope has a pinned V5 image and a recorded source fingerprint.
  2. Confirm knolo-box status reports the pin matches and the index is not stale.
  3. Edit, add, or remove source files under that scope without rebuilding.
  4. Run status again. It correctly reports stale: true.
  5. 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.json and 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_verify and 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: true after 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, and knolo_status describe 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.

HiveForensicsAI avatar Nov 10 '26 10:11 HiveForensicsAI