compass.pipeline.jurisdiction.SingleJurisdictionRun#

class SingleJurisdictionRun(runtime, jurisdiction, extractor, *, usage_tracker=None, known_local_docs=None, known_doc_urls=None, perform_se_search=True, perform_website_search=True, validate_user_website_input=True)[source]#

Bases: object

Application service that orchestrates one jurisdiction run

Parameters:
  • runtime (compass.pipeline.runtime.PipelineRuntime) – Runtime context containing shared services, concurrency controls, output directories, and request settings for the current pipeline run.

  • jurisdiction (compass.utilities.jurisdictions.Jurisdiction) – Jurisdiction to process, including identifying metadata such as its full name, code, and website URL.

  • extractor (compass.plugin.base.BaseExtractionPlugin) – Configured extraction plugin instance responsible for parsing collected documents and persisting structured output for this jurisdiction.

  • usage_tracker (UsageTracker, optional) – Optional tracker instance used to accumulate token usage and cost information for LLM calls made during the jurisdiction workflow. By default, None.

  • known_local_docs (list of dict, optional) – Optional local document descriptors that should be seeded into collection for this jurisdiction before any search or crawl steps are run. By default, None.

  • known_doc_urls (list of dict, optional) – Optional URL-based document descriptors that should be seeded into collection for this jurisdiction before any search or crawl steps are run. By default, None.

  • perform_se_search (bool, optional) – Whether search-engine-driven discovery should be performed for this jurisdiction. By default, True.

  • perform_website_search (bool, optional) – Whether website-specific search and crawl steps should be performed for this jurisdiction. By default, True.

  • validate_user_website_input (bool, optional) – Whether user-supplied jurisdiction website inputs should be validated before being used in collection. By default, True.

Methods

collect(*[, relative_to])

Run collection mode for one jurisdiction

extract_from_collection_info(collection_info)

Run extraction mode for one jurisdiction

process()

Run process mode for one jurisdiction

run_collection_with_logging(*[, relative_to])

Collect one jurisdiction under location-scoped logging

run_extraction_with_logging(collection_info)

Extract one jurisdiction under location-scoped logging

run_process_with_logging()

Run one jurisdiction under location-scoped logging

async process()[source]#

Run process mode for one jurisdiction

Returns:

compass.pipeline.data_classes.JurisdictionResult – The result of running the jurisdiction, including any structured data found and related information.

async collect(*, relative_to=None)[source]#

Run collection mode for one jurisdiction

Parameters:

relative_to (path-like, optional) – Optional directory that should be the root of all relative paths. By default, None.

Returns:

dict – A dictionary containing collection information, including the jurisdiction’s full name, county, state, subdivision, type, FIPS code, and a list of collected documents with their associated metadata.

async extract_from_collection_info(collection_info)[source]#

Run extraction mode for one jurisdiction

Parameters:

collection_info (dict) – Dictionary containing information about the collected documents for the jurisdiction, including the jurisdiction’s full name, county, state, subdivision, type, FIPS code, and a list of collected documents with their associated metadata.

Returns:

compass.pipeline.data_classes.JurisdictionResult – The result of running the jurisdiction, including any structured data found and related information.

async run_process_with_logging()[source]#

Run one jurisdiction under location-scoped logging

Returns:

compass.pipeline.data_classes.JurisdictionResult – The result of running the jurisdiction, including any structured data found and related information.

async run_collection_with_logging(*, relative_to=None)[source]#

Collect one jurisdiction under location-scoped logging

Parameters:

relative_to (path-like, optional) – Optional directory that should be the root of all relative paths. By default, None.

Returns:

dict – A dictionary containing collection information, including the jurisdiction’s full name, county, state, subdivision, type, FIPS code, and a list of collected documents with their associated metadata.

async run_extraction_with_logging(collection_info)[source]#

Extract one jurisdiction under location-scoped logging

Parameters:

collection_info (dict) – Dictionary containing information about the collected documents for the jurisdiction, including the jurisdiction’s full name, county, state, subdivision, type, FIPS code, and a list of collected documents with their associated metadata.

Returns:

compass.pipeline.data_classes.JurisdictionResult – The result of running the jurisdiction, including any structured data found and related information.