Repository navigation
fix: pre-release review findings (FTS remnants, plaintext FtM copy, false-empty results, NO_PROXY pin, possibly-sent faxes) - #156
Merged
Conversation
…atabase The flag that triggers the FTS5 merge lived in memory and was cleared before the merge ran, so a merge that failed (another process holding the database) or never ran (killed after the commit) left the deleted page's words in data.db until some later delete. The deleting transaction now records the owed merge in a one-row table (migration 009), cleared only after a merge succeeds; every session merges first if it is set. The trigger uses an unqualified table name (SQLite before 3.47 refuses main.x in a trigger's INSERT), and a failure to set it up is logged instead of silently dropped. Found in an independent pre-release review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
records fetch -s aleph|companieshouse wrote downloads/ftm/<name>.ftm.json (officers' names, birth dates, nationalities) next to an encrypted database and never removed it. ftm_import gains parse_ftm_lines and a lines= argument; nothing is written outside the database now. Found in an independent pre-release review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
- Aleph: when the local --type/--jurisdiction re-check drops every hit, say so instead of a bare 'No results'; read more FtM country properties (mainCountry, birthCountry, residency, pastFlags). - OpenSanctions offline: a miss says exact whole-name/alias matching is not proof the name is not listed (records search and openfoia search). - The records search ID column folds instead of cutting the id records fetch needs; --all-sources prints the OpenSanctions API key notice. - Aleph: anchored date check; related-entity schemas validated before storing. Found in an independent pre-release review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
A NO_PROXY match was mounted as a plain transport, so public_addresses_only() was never consulted for it. It now uses the same pinned direct transport. Found in an independent pre-release review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
A read timeout after the POST went out printed an empty error, with no hint that Twilio or Lob may already have accepted (and charged for) it. Errors now say either that nothing was sent (no connection) or that it may have been accepted and to check the dashboard before sending again. Found in an independent pre-release review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
…faxes Found in an independent pre-release review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
Merged
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.
An independent pre-release review of everything merged since v5.0.0 found one deleted-data issue that counts as a blocker under the project's own rules, plus six should-fix issues. This PR fixes all of them.
Every fix was reproduced first, using the reviewer's scripts or a new test. Each new test fails on the old code and passes with the fix.
Blocker: deleted text survived in the full-text index (
openfoia/db.py, migration 009)The flag that triggers the FTS5 merge lived in memory and was cleared before the merge ran. So a merge that never finished left a deleted page's words in
data.db. There were two ways that happened:The words stayed until some unrelated later delete happened to trigger a merge.
The fix:
fts_merge_pending. The record is cleared only after a merge succeeds, and every session merges first if it is set.Fixing this also turned up a second bug:
main.x) in a trigger's INSERT. That is the SQLite bundled with Python 3.11.except, so on those systems no trigger was created at all.Should-fix
records fetch -s aleph|companieshousewrotedownloads/ftm/*.ftm.json(officers' names, birth dates, nationalities) next to an encrypted database and never removed it.ftm_importgainsparse_ftm_linesand alines=argument.--type/--jurisdictionre-check dropped every hit, the output was a bare "No results found".mainCountry,birthCountry,residency,pastFlags.records searchand inopenfoia search(as the source's reason).NO_PROXYhosts skipped the DNS-rebinding pin. They were mounted as a plain transport.records searchtable cut off the id thatrecords fetchneeds.Nits
--all-sourcesnow prints the OpenSanctions API-key notice.Not changed
schema=parameter: the reviewer recalledfilter:schemata=. But Aleph's live/api/openapi.json(checked 2026-11-19) documentsschemaon/api/2/entities, and results are re-checked locally either way.Docs
NO_PROXYhosts are pinned too.Checks
Generated by Claude Code