Repository navigation
fix(core): repair and report entities missing search rows - #1954
Conversation
An entity with no search_index row was unsearchable in every mode and could never get a vector, because vectors are cut from search rows. Change detection compares checksums only, so an unchanged file whose rows were dropped (by the migrations that recreated search_index) was never re-read. `bm reindex --full --embeddings` runs no search pass, so it skipped those entities and still reported success. `bm project info` counted coverage from search_index, so the gap read as full coverage. The fix adds one query that finds entities without their entity-type search row, and uses it in three places: - The local project-index pass rebuilds search rows for those entities after its file batches and embeds them with the pass's other targets. Every install repairs itself on its next index pass. - SearchService.reindex_vectors restores missing rows before embedding, so `--embeddings` without a search pass no longer skips them. The CLI prints how many entities each phase restored. - project info reports entities_missing_search_rows, recommends `bm reindex` when it is non-zero, and counts those entities in the embedding coverage bar. The i2c3d4e5f6g7 migration claimed run_migrations() runs an embedding backfill. No such hook exists; the docstring now says so instead of adding migration-time work. Reported by SWSAmor in #1826. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ef88c6efc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
get_embedding_status returned early on a keyword-only host and when the vector manifest or storage was missing, before it counted entities with no search_index row. Those paths reported zero, so a keyword-only install with an unsearchable entity showed "Up to date". The count now runs once before any vector checks. When it is non-zero, every returned status carries it and recommends `bm reindex`, which runs the search pass that restores the rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e771483b1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A migration that recreated search_index can leave every entity without search rows. restore_missing_search_rows loaded all of them at once, with observations and relations eagerly loaded, before indexing any. On a large project that can exhaust memory during the pass meant to repair it. The repair now loads and indexes one batch of entity ids at a time and keeps only an id and checksum per restored entity, so each batch's entity graph can be released. The local index pass uses its file batch size; reindex_vectors uses the vector sync chunk size. Result counts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91c5657bd2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Search keys an entity's projection row by the entity's id, and the integrity checker requires s.id = e.id. Matching on entity_id let a stale entity row carrying the right entity_id under another id count as present, so project info stayed healthy and no index pass rebuilt it. Match on id, as the integrity checker does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4feb6fe96c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
total_indexed_entities counted distinct entity_id over every search row, so an entity that kept observation or relation rows but lost its entity row was counted as indexed and as missing, and the coverage total could exceed the entity count. Count entities that have their canonical row (type 'entity', keyed by the entity's own id), the complement of the missing-rows query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e8e35ff56
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A missing-row repair candidate whose file cannot be read or parsed (for example invalid UTF-8) raised out of the batch and aborted the pass, so every retry stopped at the same file and later entities never converged. Index each candidate on its own, log and count a failure, and leave it out of the restored and vector targets, as file batches already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9caf0f447
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
restore_missing_search_rows now returns a SearchRowRepair with the restored entities and the ones whose file could not be read or parsed. reindex_vectors leaves the failed ones out of vector sync and counts them as errors with a sample message, instead of embedding an entity with no source rows and reporting success. project info no longer draws a vector coverage bar when the host has no vector runtime; the search-index gap stays in the status line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2c5ce38b2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Duplicate canonical (type 'entity', id) rows are a corruption index integrity tracks; COUNT(DISTINCT id) keeps them from inflating the indexed-entity count and the coverage total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82c0cf316a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Failed repairs were added to errors but not to total_entities, so the CLI's errors-versus-total check misread the run: a sole failure looked like success and one failure beside one success looked like total failure. Include them in the total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9615a99395
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Vectors can outlive their search rows when a migration recreates search_index, and the entities-with-chunks count included them, so project info could show full coverage while every entity was unsearchable. Count chunked entities that also have their canonical search row, the same set the indexed count uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfc2fc3c24
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
## Why `just release v1.0.0` pre-flight-checks for a `## v1.0.0` heading on `main`, so the changelog has to land first. ## What changed `CHANGELOG.md`: the Unreleased section becomes `## v1.0.0 (2026-10-29)`. Its existing items are kept, and the 60 or so commits since #1871 are added: - **Breaking:** - the MCP surface is only `bm_*`, with the old tools deleted (#1944, #1947, #1959, #1962–#1964) - `project` is required (#1934) - the ChatGPT adapters moved to Cloud - `bm tool` mirrors the tools (#1943) - the POSIX verbs are rebuilt and `bm tail` is removed (#1960) - cloud sync/bisync are removed (#1953) - `bm schema` project resolution (#1959) - LiteLLM is an optional extra - **Features:** text-file line ranges in `bm_read`; chat imports return their file paths. - **Bug fixes:** including the three found in the 1.0 live test (#1971, #1972, #1974), with contributor credits for @Flynn-Kawolsky (#1957), @SWSAmor (#1951) and @MbappeWU (#1948). - **Security:** the CodeRabbit deep-scan hardening batch. I checked the entries against PR bodies rather than titles, and corrected #1954, #1948 and #1967 to describe what they actually fixed. The date is today; change it if the tag lands tomorrow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8 Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Why
bm cloud syncmade Cloud match the local folder withrclone sync --delete-excluded. It deleted cloud-only notes, including notes that people and managed agents created in Cloud.bm cloud bisyncmirrored both ways and could delete or overwrite files on either side. #1596 deprecated both. For 1.0,bm cloud push/bm cloud pullreplace them on Personal and Team workspaces. They never delete on the destination and stop on differing files until the user chooses a conflict strategy.What changed
Removed
project_sync,project_bisync,get_project_bisync_state,bisync_initialized,get_rclone_version,supports_create_empty_src_dirs, andMIN_RCLONE_VERSION_EMPTY_DIRSfromrclone_commands.py.sync/bisync/bisync-resetimplementations,MirrorCommand,_warn_mirror_deprecated, and the Team-refusal messages for the mirrors fromproject_sync.py.force/fail_on_read_erroroptions of the.bmignoreconverter. Only the destructive sync used them. The test file that covered them is deleted.bm project removeno longer deletesbisync-state/<project>. Nothing reads that state now, and the migration contract says old state directories are left for the user.Kept as migration stubs (
cloud/removed_mirror_commands.py)sync,bisync, andbisync-resetare hidden frombm cloud --help. They accept any of the old arguments and printpull/pushcommands for the named project (shell-quoted, with<project>when no name was given). The output also covers the deletion, rename, and conflict differences. Each stub then exits 1.Kept and moved (the old
bisync_commands.pyholds no bisync code now)mount_api.py:get_mount_info(used by push/pull, prune, check, andproject ls --cloud) andgenerate_mount_credentials(used bycloud setup).BisyncErroris renamedMountApiError.rclone_filters.py:convert_bmignore_to_rclone_filters(used by the push/pull diff and copy, and by check) andconvert_bmignore_to_rclone_prune_filters(used by prune).rclone_commands.pynow imports them at the top; the earlier lazy import was not needed to avoid a cycle._require_personal_workspacenow serves onlyprune, so its message parameter is gone.Unchanged: push/pull (dry-run,
--workspacerouting,--on-conflictchoices, destination-only preservation), Team WebDAV transfer,cloud setup,sync-setup,prune, andcheck. Thebisync_initialized/last_syncconfig fields stay so existing config files still load.Docs:
docs/1.0.md(status, stub behavior, state-directory note, checklist),docs/cloud-cli.md(the deprecated section is replaced by "Removed in 1.0" with a migration table; the limitations now cover renames and reverse-transfer resurrection),bm(1), AGENTS.md, and the Hermes README.Verification
just fast-check: lint, format, and ty pass. (This worktree neededuv sync --extra milvusfirst so ty could resolvepymilvus.)BASIC_MEMORY_TESTMON_SELECT_FLAGS="--import-mode=importlib" just fast-test tests/cli/cloud/test_project_sync_command.py tests/cli/cloud/test_webdav_transfer.py tests/test_rclone_commands.pypasses 136 tests. The original baseline was 194; the difference is the deleted mirror tests.tests/cli/cloud,tests/test_rclone_commands.py,tests/cli/test_project_remove_cloud_stub.py,tests/test_remedy_emission_sites.py,tests/test_config.py,tests/cli/test_project_set_cloud_local.py,tests/cli/test_project_add_with_local_path.py,tests/cli/test_project_list_and_ls.py,tests/test_man_pages.py, andtests/cli/test_man_command.pypass 529 tests.tests/cli: 1262 passed, 7 skipped.tests/cli/cloud/test_removed_mirror_commands.pyruns the real CLI against a logged-in config with a synced project and old bisync state. It asserts exit 1, guidance text, and that no user file, config, or bisync state changes. It also blocks every httpx request.Note:
test_project_add_remedy_matrix.py's cloud rows can fail depending on test order when run in one session after the cloud test files. I reproduced the same 4 failures on unmodifiedmain, so this PR did not cause them. The file passes when run alone and in the fulltests/clirun.Fixes #1845
🤖 Generated with Claude Code
https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8