Repository navigation
fix(storage): settle FTS in its publication; delete dead parse caches - #5844
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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. |
Sinity
enabled auto-merge (squash)
September 29, 2026 20:00
CensusParseStage and its daemon/parse_prefetch.py shim have had no production instance since the manual rebuild engine was deleted: nothing in polylogue/ or devtools/ constructs or imports them, and every RawObservationReplacement is built with payload=None, so the RawParsePrefetchCache plumbing through revision_backfill never received a cache. Remove the module, the shim, RawParsePrefetchCache and every prefetch_cache parameter, the four daemon_parse_stage_* config keys, their docs, the stale daemon.md section, baseline entries, and the tests that only exercised the dead stage. The estimate_parsed_tree_bytes calibration tests move to test_parsed_tree_size.py because revision_backfill still uses the estimator. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
LiveParseStage.warm, LiveParsePrefetchCache, LiveParseCandidate, live_parse_worker, live_parse_and_shard_worker and batch.py's _live_parse_stage_candidates had no production caller: the watcher prepares paths through warm_paths/prefetch_paths and the writer consumes sealed carriers through pop_path. Remove them with the tests that only drove the byte-keyed cache, and correct the comments that still described it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Revision and membership replay skipped their per-session FTS repair when a caller passed defer_fts, and the live batch then repaired after committing the writes; the ingest batch let callers switch the repair effect off and repaid it with an after-pass bulk repair. Committed state between those points had blocks without search rows. The replay now always repairs the session it wrote in the same transaction, and every ingest batch runs the repair effect before its commit. Remove defer_fts, allow_pending, the ingest repair_message_fts switch, repair_message_fts_bulk, the ParseResult repair targets, and the ignored record_exact_snapshot and mark_stale parameters. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The stall-field test drove _completed_reporting_stalls, which went with the deleted byte-keyed warm. The slow-preparation test now captures the same event from warm_paths and checks its fields reach the log allowlist. Fakes of repair_message_fts_index_sync drop the keyword catch-all it no longer receives. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Resolving the census-stage deletion against master took the salvage branch's stale float-key entry, live_watcher_parse_stage_warm_timeout_seconds, in place of live_watcher_parse_stage_stall_report_seconds. Restore it, and rewrap the parsed-tree size docstrings the deletion shortened. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The blob-store routing fake of _process_ingest_batch_sync still declared the repair_message_fts keyword the batch no longer passes. The slow-JSON preparation test goes back to its own claim; the stall fields it briefly asserted are not reliably emitted on that schedule. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Sinity
force-pushed
the
feat/one-publication-path
branch
from
September 29, 2026 21:30
0087dad to
0a9e1f1
Compare
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.
Summary
Delete three predecessors of the one publication route and move message FTS settlement into the publication that writes it.
CensusParseStage, thepolylogue/daemon/parse_prefetch.pyshim,RawParsePrefetchCacheand everyprefetch_cacheparameter, the fourdaemon_parse_stage_*settings, their docs and baseline entries (polylogue-rykzt, reusing salvage commit bcfb374).LiveParseStage.warm,LiveParsePrefetchCache,LiveParseCandidate,live_parse_worker,live_parse_and_shard_workerandbatch._live_parse_stage_candidates.Problem
polylogue/ordevtools/constructedCensusParseStageorDaemonParseStage. EveryRawObservationReplacementwas built withpayload=None, so theRawParsePrefetchCacheplumbing never received a cache. The livewarm()/LiveParsePrefetchCachepath had no production caller either. The watcher prepares throughwarm_paths/prefetch_paths, and the writer consumes sealed carriers throughpop_path. Only tests drove these paths, and one test (test_prefetch_cache_thread_safety.py) stress-tested a cache that production never filled.defer_fts=Truetoapply_raw_revision_replayandapply_raw_membership_classificationwithmanage_transaction=True. Each write therefore committed its blocks without FTS rows. The batch then repaired all session ids in a separate transaction after its loop. A kill between those points left sessions committed but unsearchable, with nothing recording the missing rows. The Codex state branch (archive.commit()mid-loop) committed earlier records in the same state.repair_message_ftsswitch.parse_from_rawturned it off whenever there was no execution coordinator, then calledrepair_message_fts_bulkonce after all batches. Each batch commit in between published sessions without FTS rows.repair_message_fts_index_sync(record_exact_snapshot=...)andsuspend_fts_triggers_sync(mark_stale=...)accepted parameters they discarded (del record_exact_snapshot,del mark_stale), "retained for caller compatibility".Solution
daemon_parse_stage_warm_timeout_secondsand aar35's retired Drive/hook rows. Master's stall-report rename and aar35 deletions were kept. The remaining census-stage references in the legacy-prose-logging baseline and indocs/design/convergence-simplification-inventory.mdwere updated.cacheandshard_build_failure_count, and the tests that only drove them. The equivalence tests that assertedlen(stage.cache) == 0still run through the path route, which they already used.revision_governance.apply_raw_revision_replayandapply_raw_membership_classificationnow always callrepair_message_fts_index_syncfor the written session (except underbulk_build, which rebuilds FTS archive-wide at readiness).assert_session_fts_exact_synclosesallow_pending.defer_ftsis removed from both functions, the twoArchiveStorewrappers,publish_ingest_cohort(no caller passed it) and the live batch. The batch's after-loop repair is deleted.repair_message_ftsis removed fromprocess_ingest_batch,_process_ingest_batch_sync,_commit_sync_ingest_side_effects,ParsingService.parse_from_rawandparsing_workflow.parse_from_raw.repair_message_fts_bulk,ParseResult.fts_repair_session_idsand the now-unused_ConnectionBackendLikeprotocol are deleted with them. The write-effect payload key stays for its one remaining user: session deletion, which clears FTS rows itself before the rows they index are gone.record_exact_snapshotandmark_staleparameters are removed along with their callers.Derived-identity closure (
devtools schema closure). These changed production files are IN:polylogue/archive/write_effects.py,polylogue/config.py,polylogue/pipeline/parsed_tree_size.py,polylogue/pipeline/services/ingest_batch/_models.py,polylogue/sources/live/batch.py,polylogue/sources/live/parse_prefetch.py,polylogue/sources/live/watcher.py,polylogue/sources/revision_backfill.py,polylogue/storage/fts/fts_lifecycle.py,polylogue/storage/sqlite/archive_tiers/archive.py,polylogue/storage/sqlite/archive_tiers/revision_application.pyandpolylogue/storage/sqlite/archive_tiers/revision_governance.py. The deletedpolylogue/sources/census_parse_stage.pyandpolylogue/daemon/parse_prefetch.pyalso leave it. This PR moves the candidate derived schema identity, so it must land before any rebuild starts.Verification
Final head 0a9e1f1 (rebased onto 5ebcfe5):
agentctl job start --workspace /realm/worktrees/polylogue-publication-path polylogue verify_quick: job 3702,verify: PASSED exit=0at head 0a9e1f1.agentctl job start --workspace /realm/worktrees/polylogue-publication-path polylogue pytest_focused -- <45 files>: job 3703 at head 0a9e1f1. The full selection had 16 failures under a narrowed one-worker pool slot. devtools reran them alone:11 failed, 5 passed. The files are every edited test file, plus each test module that names a changed symbol (apply_raw_revision_replay,apply_raw_membership_classification,publish_ingest_cohort,repair_message_fts_index_sync,suspend_fts_triggers_sync,assert_session_fts_exact_sync,parse_from_raw,LiveParseStage,write_effects, the parse-stage settings), plustest_config.py,test_config_inventory.py,test_live_ingest_kill_recovery.py,test_incremental_retained_cold_route_characterization.pyandtest_raw_observation_derivation.py.11 failed, 36 passed), with the same assertion lines:test_ingest_governance::test_membership_that_becomes_eligible_after_preparation_defers_publication,test_bulk_build_lifecycle::test_fresh_shard_build_finishes_equivalent_to_retained_indexes,test_config::test_flat_daemon_bind_keys_are_refused,test_hermes_raw_identity::test_identical_hermes_profiles_persist_and_reprocess_independently,test_revision_replay::test_chain_replay_supersedes_equal_frontier_quarantined_membership_head,test_profile_writer_retirement::test_profile_mutation_census_matches_the_declared_owners, the fourtest_raw_observation_derivationpublish tests andtest_raw_materialization_parse_stage_equivalence::test_two_accepted_revisions_survive_one_periodic_profile_pass. They belong to master-green.test_accepted_marker_inputs::test_deferred_raw_does_not_publish_marker_witness_or_pending_carriertook 16.42 s in job 3547, against 14.49 s on master in job 3542.test_live_batch_support.pydrives_ingest_full_paths_syncand assertsmessages_ftsrows exist with no caller repair. Removing the replay's inline repair zeroesindexed.Self-review
Final pass: pass 3, against
docs/review/codex-review-guide.md, the nestedpolylogue/sources/AGENTS.mdandpolylogue/storage/AGENTS.md, and the generic list in the orchestrate worker contract. Pass 1 found four problems, and all four were fixed. Resolving the salvage branch's conflict with "theirs" had restoredlive_watcher_parse_stage_warm_timeout_secondsinto_FLOAT_CONFIG_KEYS; this was fixed in 176d9cf. A stall-field test still imported the deleted_completed_reporting_stalls, which mypy caught. A fake of_process_ingest_batch_syncstill declared the removedrepair_message_fts. The focused run failed collection because a benchmark conftest was registered twice, so the benchmark was taken out of the selection. Pass 2 found that the stall assertion moved ontowarm_pathsdid not hold on that schedule, so it was reverted. Pass 3 found nothing new.revision_governance.py:git grep -c 'repair_message_fts_index_sync(store._conn, \[session_id\])'= 2) and the ingest-batch write effect. Everydefer_fts=caller was found by grep (2 inlive/batch.py, 0 elsewhere) and removed, along with the pass-through inpublish_ingest_cohort, which no caller set. The session-delete path keepsrepair_message_fts: Falsebecause it clears the FTS rows itself before the delete (archive.py, delete path). It is the only remaining user of the payload key.store.commit()(manage_transaction=True) or the caller's batch commit. No new exception type was added.assert_session_fts_exact_syncnow always runs its parity check outsidebulk_build, so a missed repair raises there instead of passing as "pending".LiveParsePrefetchCacheandRawParsePrefetchCachewere byte-budgeted in-memory caches of parsed trees. Nothing replaces them, because production never filled them.replace_fts_partition_syncper id). The live batch paid one extra transaction per pass before and now pays none. A session written twice in one pass is repaired twice, which is the same cost as every non-deferring caller already had.test_live_ingest_kill_recovery.pyis in the selection.exceptpaths, instead of failing after the commit.ParseResult.fts_repair_session_idsandrepair_message_fts_bulkare gone. No count or receipt reported them.LiveParseStage._shutdown_lockedis unchanged apart from the removedcache.discard_all(), whose cache no longer exists.repair_message_fts_index_syncstill returns early on an empty id list, and a replay always has exactly one session id at that point (it raises before then otherwise).polylogue devtools testsfinds 0 hits each forLiveParseCandidate|LiveParsePrefetchCache|live_parse_worker|DaemonParseStage|CensusParseStage|census_parse_stage|RawParsePrefetchCache|prefetch_cache=|repair_message_fts_bulk|defer_fts|allow_pending|record_exact_snapshot|mark_stale|repair_message_fts=|daemon_parse_stage_. Docs updated: configuration.md (keys and env rows), daemon.md (parse-parallelism section), the historical design inventory (dated note), the legacy-prose and layering baselines.docs/design/daemon-core.md§9 still names_live_parse_stage_candidates; it is a measurement record at pinned commit0f1d1cb09, so it was left alone.repair_message_fts_index_syncfakes lost**kwargs, and the_process_ingest_batch_syncfake lostrepair_message_fts). The FTS change is pinned on the production route bytest_live_batch_support.py: removing the inline repair zeroesindexed.Residuals
prepare_jsonl_blob's collected branch (parse_payload(provider, list(records))) still holds every record of a non-stream JSONL file, and of any.jsonshape no streaming branch claims (including bundle providers when aprepare_sessionscohort callback is set). Deleting it needs a bounded branch per remaining shape; deleting it outright would refuse valid input.RawObservationReplacement.payloadstays typedNone, because the kernel'sReplacementLikeprotocol requires the field.flake/overlay/package/polylogue-status-document.patchstill targets aar35's removed spool plumbing (another repository; recorded on polylogue-aar35).git merge-tree) is clean.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg