Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Prevents orphan FTS shadow repair from deleting a virtual table that another process recreated after a stale preflight check. The preflight now only selects the guarded path. Destructive orphan detection and cleanup run after FTS rebuild admission is acquired.
The repair remains family-specific. Base, trigram, and CJK indexes are rebuilt only when needed. If an optional tokenizer is unavailable or CJK admission is denied, its sync triggers are removed so canonical message writes do not target a missing table. Stale recovery also keeps CJK recreation inside the same admission lifetime.
Related Issue
Refs #108130
Related to #103840
Type of Change
Changes Made
hermes_state_fts.py.How to Test
HERMES_PYTHON=/path/to/python scripts/run_tests.sh tests/state/test_fts_orphan_shadow_repair.py tests/state/test_fts_fresh_bootstrap_admission.py tests/state/test_fts_holder_instance_scope.py tests/state/test_fts_index_fail_open.py tests/state/test_fts_rebuild_admission.py tests/state/test_fts_runtime_rebuild.py tests/state/test_fts_trigram_cron_exclusion.py tests/state/test_fts_trigram_subagent_exclusion.py tests/test_fts_cjk_bigram.py tests/test_fts_update_of_narrowing.py tests/test_state_db_fts_segment_collision_probe.py tests/test_state_db_malformed_repair.py -q.ruff check hermes_state_fts.py hermes_state_schema.py tests/state/test_fts_orphan_shadow_repair.py.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) or N/Acli-config.yaml.exampleif I added/changed config keys or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows or N/A