fix: dry_run check order in auto_extract + corpus seeding for TestCrossModeConsistency - #40
Merged
Merged
Conversation
dry_run is now evaluated strictly between dedup (should_merge) and any kb_add/kb_update: the full pipeline (LLM extraction + dedup) still runs so candidate decisions are real, but no KB write of any kind is issued in dry-run mode. The would-be action for each accepted candidate is collected under summary["candidates"] so operators can inspect exactly what would have been written before enabling live writes — matching the documented "results returned for inspection only" contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…f48936) The cross-mode consistency tests previously assumed pre-seeded corpus entries that do not exist on a clean staging instance, so they failed there. Add a class-scoped `crossmode_corpus` fixture that seeds one sentinel entry under a unique topic, waits for the FTS index to settle, yields (client, sentinel), and deletes the entry (plus any topic stragglers) on teardown — best-effort so teardown never masks a test failure. Both tests now consume this fixture and pass on any clean staging environment. Reuses the existing e2e LoreClient pattern; class-scoped so the seed + FTS settle cost is paid once per class rather than per test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
davidgut1982
added a commit
that referenced
this pull request
Jun 2, 2026
davidgut1982
added a commit
that referenced
this pull request
Jun 2, 2026
* chore: bump version to 0.8.7 * docs: add 0.8.7 changelog entry * chore: bump version to 0.9.0 * docs: replace partial 0.8.7 changelog with comprehensive 0.9.0 entry * docs: add PR #40 fixes to 0.9.0 changelog
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
Two small, independent fixes bundled on one branch.
Fix 1 —
auto_extractdry_run check order (t_020a062b)src/lore/extraction/__init__.pyThe
dry_runguard is now evaluated strictly between the dedup step (should_merge) and anykb_add/kb_updatecall, so the documented contract holds exactly:dry_run=True— the full pipeline runs (LLM extraction + dedup + candidate generation), but no KB write of any kind is issued. Each accepted candidate's would-be decision (insert/merge, type, content, confidence,existing_id) is collected and returned undersummary["candidates"]so operators can inspect what would have been written — results for inspection only.dry_run=False(default) — the full pipeline including writes, unchanged.Precedence is preserved:
dry_runwins overreview_mode(nothing is written, not even to the pending queue). All existing control-surface and orchestrator test expectations (counts,dry_runflag,skippedaccounting) remain satisfied; the change is additive (candidatesonly appears in dry-run summaries).Fix 2 —
TestCrossModeConsistencycorpus seeding (t_c9f48936)tests/e2e/test_search_modes.pyTestCrossModeConsistencypreviously depended on pre-seeded corpus entries that do not exist on a clean staging instance, so it failed there. Added a class-scopedcrossmode_corpusfixture that:e2e-crossmode-<hex>topic — using the existing e2eLoreClientpattern, then waits 2 s for the FTS index to settle (matching the existingseeded_client/test_regression.pypattern).(client, sentinel)to the tests.Both tests in the class now consume this fixture, making them self-contained and green on any clean staging environment. Class scope means the seed + FTS-settle cost is paid once per class rather than per test.
Testing
tests/test_extraction_control_surface.pyandtests/test_extraction_orchestrator.py: all existing assertions still hold (dry-run writes nothing,dry_runflag set, exact 4-key summary preserved when dry-run is off).LORE_E2E_URLand exercises a live Lore instance on staging.🤖 Generated with Claude Code