Integrate PRs #73–#77 with cross-PR regression fixes - #78
Merged
Merged
Conversation
Resolved add/add conflict in tests/test_records_cli.py by keeping both regression tests (raw-JSON output from #73, help-text coverage from #74). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
Two integration fixes on top of the merged PRs: - crossref: #76 made a failing source raise, which discarded every hit the checker had already collected. One unreadable ICIJ CSV therefore erased real matches found in the files that did open. _SourceCheckError now carries partial hits, _check_icij keeps reading the remaining files, and the crossref loop merges those hits while still marking the source ERRORED. Failure stays visible; evidence stops disappearing. - records search --raw: an adapter error printed '[]' and exited 0, so a script could not tell an API failure from 'no results'. The error now goes to stderr with exit 1, leaving stdout parseable JSON (#73) and honouring the 'no results != API error' rule alongside #75. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
Follow-ups found by reviewing the five PRs together rather than one at a time: - crossref: every remote checker fails through result.error, which #76 wrapped in a bare RuntimeError -- so a 503, a DNS failure and a schema change all reported ERRORED(RuntimeError) while opensanctions, which takes a different path, showed the real kind. The adapter's own failure kind is now carried through, and only the leading exception name: the detail can echo the looked-up entity name through a URL, and these statuses land in a report the user may share. - crossref: an ICIJ directory containing no CSVs reported status 'checked' -- a clean bill of health after reading nothing. A failed or nested extraction now reports NoICIJData instead. - records search --raw: the adapter-crash handler still wrote its message to stdout through rprint, contradicting the pipe-safety #73 added two lines above. It goes to stderr now. - records search: the 'a 0 is not proof no filing exists' caveat from #75 only fired with --type, so the broader untyped SEC search -- where EDGAR full-text coverage gaps bite hardest -- kept the flat 'No results found'. - sec filings: the shard walk fired every archive request back to back, which for a long-lived filer is the burst SEC's fair-access policy cuts off. Requests are paced, and shards SEC dates entirely before --since are skipped rather than fetched and discarded. - sec filings: _filing_entity was annotated Optional but never returns None, leaving its caller dereferencing an Optional. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
JordanCoin
pushed a commit
that referenced
this pull request
Sep 26, 2026
Bump version to 4.2.0 and add the changelog entry for PRs #73-#78: records filings (SEC filing history), per-source cross-reference statuses, honest failure reporting in crossref and records search --raw, and the full nine-source records search docs. Minor bump: records filings is a new command; nothing is removed or changed incompatibly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
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.
Merges all five open PRs together and fixes the defects that only appear when they are combined. Each PR was green on its own, but all five touch
records_searchincli.pyand none had ever been tested against the others.Closes #73, closes #74, closes #75, closes #76, closes #77.
Conflicts resolved
tests/test_records_cli.py(add/add). Kept both tests: raw-JSON output from fix: keep records raw output valid JSON #73, help-text coverage from docs: list all records search sources #74.Defects found by reviewing the integrated result
crossref.py(from #76)_SourceCheckErrornow carries partial hits,_check_icijkeeps reading the remaining files, and the loop merges those hits while still marking the sourceERRORED. Failure stays visible; evidence stops disappearing.result.error, which was wrapped in a bareRuntimeError— so a 503, a DNS failure and a schema change all reportedERRORED(RuntimeError), whileopensanctions(a different code path) reported the real kind in the same run. The adapter's own failure kind now comes through. Only the leading exception name travels: the detail can echo the looked-up entity name via the URL, and these statuses land in a report the user may share.checked— a clean bill of health after reading zero bytes. A failed or nested extraction now reportsNoICIJData.cli.py(from #73 and #75)records search --rawon an adapter error printed[]and exited 0, so a script could not tell an API failure from "no results". The error goes to stderr with exit 1, leaving stdout parseable JSON.rprint, contradicting the pipe-safety comment two lines above it. It goes to stderr now.--type, so the broader untyped SEC search — where EDGAR full-text coverage gaps bite hardest — kept the flat "No results found".sec_edgar.py(from #77)data.sec.gov, which is the burst SEC's fair-access policy cuts off. Requests are now paced, and shards SEC dates entirely before--sinceare skipped rather than fetched and discarded._filing_entitywas annotatedRecordEntity | Nonebut never returnsNone, leaving its caller dereferencing anOptional.Verification
ruff checkandruff format --checkclean onopenfoia/andtests/.tests/test_security_metadata.pyhas 2 failures in the dev container (pyo3/_cffi_backend), reproduced on unmodifiedmain— environmental, and green in GitHub CI on all five source PRs.mypygains 2 errors, both theuntyped-decorator/no-untyped-defpattern the other 48 CLI commands already have. Not a CI gate (continue-on-error).Not addressed
records searchsends the query to a third party with no warning and no confirmation — no--tor, no prompt. #77's newrecords filingsdoes warn and confirm; #74 documents the gap in the README rather than closing it. That is a Principle 1 gap, but closing it changes CLI behavior for existing scripts, so it is left as a separate decision.🤖 Generated with Claude Code
https://claude.ai/code/session_016LaGpHLuSRHzGARb38X7YS
Generated by Claude Code