Repository navigation
fix(cli): browse honors network.tor; Tor-down error on stderr; CSV nits (#132) - #133
JordanCoin wants to merge 1 commit into
Conversation
…ts (#132) browse now builds its route from config.network.tor via _egress_policy_from, with --tor/--no-tor as overrides, runs the fail-closed _check_tor_or_exit gate, and prints the same stderr route line as the records commands. tor_browse.py is unchanged; it receives the resolved use_tor. _check_tor_or_exit writes to stderr so --json and --csv - stdout stay clean, and its hint no longer tells users to "drop --tor". --csv PATH writes a header-only file on "no results" for records search, request list, analyze extract and deadlines list, so a stale file from a previous run is overwritten. records search keeps full usaspending descriptions and rank snippets in CSV; the Rich columns ellipsize instead. Closes #132 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWQw8DDrDZ2tFzswSSEtce
|
Review (Claude opus reviewer, read-only, 2026-11-06): MERGE. Verified: |
Closes #132
What changed
openfoia browsefollowsnetwork.torfrom config;--tor/--no-toroverride it. When Tor is configured but unreachable it exits non-zero before launching the browser (_check_tor_or_exit), and prints the same stderr route line as the records commands (Opening <url> (via Tor, real IP hidden).).tor_browse.pyis unchanged._check_tor_or_exit: the Tor-down message goes to stderr (no longer pollutes--json/--csv -stdout) and suggests starting Tor or settingnetwork.torfalse, not "drop --tor".--csv PATHwrites a header-only CSV on "no results" forrecords search,request list,analyze extract,deadlines list(on-screen message kept), so a stale file is no longer left looking current.records searchCSV keeps full USAspending descriptions and rank-mode snippets; the Rich columns now ellipsize on one line instead of slicing the data.Tests
tests/test_security_egress_cli.py: browse route for config on/off x flag override; fail-closed (non-zero, browser not called, message on stderr not stdout).tests/test_records_cli.py: header-only CSV overwrites a stale file; CSV keeps a long description intact.TestLLMExtractionfailures.Not in this PR
govinfo/regulationstitles (e.name[:80]) and the DocumentCloud highlight ([:120] + "…") are still sliced before the CSV. Same bug, left out to keep the diff small next to #131.🤖 Generated with Claude Code
https://claude.ai/code/session_01FWQw8DDrDZ2tFzswSSEtce