Skip to content

test: cover litigation providers, portal paths, and prompt assembly - #118

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-1de6
Draft

test: cover litigation providers, portal paths, and prompt assembly#118
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-1de6

Conversation

@cursor

@cursor cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • Provider factory (litigation/providers/factory.py): OpenRouter/Ollama/LM Studio selection, missing OPENROUTER_API_KEY guard, attribution headers, and provider routing extra_body.
  • Case numbering & transcript save (litigation/run.py): registry-less fallback, custom category/deliberation, slugify edge cases, courtroom save location, scribe certification footer, long matter title truncation.
  • Portal path regressions (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.
  • HTML export pipeline (export_transcript.py): md_to_html headers/code/blockquotes and personality/vote styling.
  • Deliberation prompts (prompts/assembler.py): matter inclusion, hearing-type-specific instructions (standard/expedited/contempt), spectator exclusion.

Test files added/updated

  • Added: tests/test_litigation_providers.py, tests/test_portal_generate.py
  • Updated: tests/test_litigation_run.py, tests/test_export_transcript.py, tests/test_portal_paths.py, tests/test_prompt_assembler.py

Why 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

python3 -m pytest tests/
87 passed in 0.33s

All tests are deterministic, use tmp_path/monkeypatch, and require no network or live LLM calls.

Open in Web View Automation 

cursoragent and others added 2 commits June 30, 2026 12:05
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant