Repository navigation
Conversation
This branch has not been deployed
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.
Closes #1934 (bounty ¥3,000).
What this adds
A new example plugin,
examples/courtlistener-edgar-evidence/, implementing the publicEvidenceProviderSPI (evidence.retrieve.v1) for two public US sources — followingdocs/EVIDENCE_CONTRACT.mdand the shape ofexamples/hello-evidence-plugin/:courtlistener-edgar-evidence.courtlistener) — queries that look like US citations (e.g.410 U.S. 113) go to the citation-lookup API (an unfound citation returns nothing, never an invented case); other queries go to the opinion search API. The locator is the citation itself,source_uriopens the opinion on courtlistener.com.courtlistener-edgar-evidence.sec-edgar) — EDGAR full-text search; the locator is the accession number + file name,source_uriis the sec.gov Archives original.Contract discipline
as_offilters later-effective items; outages degrade to an empty list, never an exception.evidence_id/content_hashderive from source content only (retrievedAtstays null), and hash changes track source changes — that is the anchor-drift signal for the Sources pane.User-Agenton every request, a built-in rate limiter (CourtListener default quota 5/min; EDGAR fair-access 10/s), zero hardcoded keys — the CourtListener token comes from the user's ownCOURTLISTENER_API_TOKENenv var (API v4 requires auth; without it that source degrades to empty, EDGAR unaffected), and the EDGAR User-Agent is overridable viaAWD_EVIDENCE_USER_AGENT.HttpTransport(JDK HttpClient by default, 4s/8s timeouts, inside the host's 10s cap); JSON parsing is a small zero-dependency parser tolerant of camelCase/snake_case field drift.Tests (offline, fixtures only)
mvn test— 14/14 pass, including:EvidenceProviderConformanceKit(ConformanceTest).as_ofexclusion, limit, idempotent replay, rate-limiter spacing (fake clock).src/test/resources/fixtures/are recorded/synthetic response shapes; no live network in CI. The EDGAR endpoint shape was verified live while writing the fixtures; CourtListener's API now requires a token, so its fixtures follow the documented v4 response shape and field handling is deliberately liberal.Bilingual README (EN + zh-CN) covers behavior, configuration and build/install steps. SPDX headers on all sources.
CLA: happy to sign via the CLA Assistant bot on this PR.