test: cover litigation providers, portal paths, and prompt assembly - #118
Draft
cursor[bot] wants to merge 2 commits into
Draft
test: cover litigation providers, portal paths, and prompt assembly#118cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Lock down OpenRouter/Ollama/LM Studio provider selection, missing API key guards, and run.py behaviors for registry-less allocation, slugify, courtroom save location, scribe certification, and title truncation. Co-authored-by: exios4 <exios4@protonmail.com>
Add regression tests for md_to_html, personality vote styling, portal generate.py transcript paths, launch.sh exports dir, and deliberation prompt assembly per hearing type. Co-authored-by: exios4 <exios4@protonmail.com>
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.
Risky behavior now covered
litigation/providers/factory.py): OpenRouter/Ollama/LM Studio selection, missingOPENROUTER_API_KEYguard, attribution headers, and provider routingextra_body.litigation/run.py): registry-less fallback, custom category/deliberation, slugify edge cases, courtroom save location, scribe certification footer, long matter title truncation.courtroom/portal/generate.py,launch.sh,viewer.html): transcript index path, exports dir, sessions fetch path — same class of bugs fixed in Fix portal viewer and launch.sh transcript path resolution #54/fix: portal viewer 404 transcript path and duplicate litigation Case Nos #66.export_transcript.py):md_to_htmlheaders/code/blockquotes and personality/vote styling.prompts/assembler.py): matter inclusion, hearing-type-specific instructions (standard/expedited/contempt), spectator exclusion.Test files added/updated
tests/test_litigation_providers.py,tests/test_portal_generate.pytests/test_litigation_run.py,tests/test_export_transcript.py,tests/test_portal_paths.py,tests/test_prompt_assembler.pyWhy these tests materially reduce regression risk
These areas sit on critical paths: LLM provider misconfiguration breaks every deliberation run; duplicate or wrong Case Nos corrupt legal transcript metadata; portal path bugs cause 404s for all transcript viewing; broken HTML export degrades the primary read path for court records; wrong hearing-type prompts produce procedurally invalid transcripts.
Validation
All tests are deterministic, use
tmp_path/monkeypatch, and require no network or live LLM calls.