Run artifact

workspace/targets/Quakes/blueprint/FEATURE-Near.md

FEATURE: Near Earthquake Events

FieldValue
Version20261024 V1
DescriptionFinds saved earthquake events within a requested distance of a point.
Depends OnARCHITECTURE.md
Providesquakes near
Consumessaved GeoJSON FeatureCollection

Purpose

The near command lists events within a radius of a latitude and longitude. It reads a saved GeoJSON FeatureCollection and writes a CSV report to standard output.

Trigger and inputs

quakes near --lat <deg> --lon <deg> --radius <km> [--min-mag <m>] <file>

The file is the final argument. Options may follow the command in any order. --min-mag uses the shared report default when omitted. Decimal values match -?[0-9]+(\.[0-9]+)?.

Behavior

Programmatic Acceptance

=== AC near-valid-request ===
Intent: A valid near request is accepted by the CLI.

from cli.testing import cli_runner

code, _, _ = cli_runner( "near", "--lat", "0", "--lon", "0", "--radius", "1", "sources/quakes_2025-01-01_07.geojson" ) assert code == 0 === END AC near-valid-request ===

=== AC near-required-options ===
Intent: A near request missing a required coordinate is rejected as a usage error.

from cli.testing import cli_runner

code, _, _ = cli_runner( "near", "--lat", "0", "--lon", "0", "sources/quakes_2025-01-01_07.geojson" ) assert code == 2 === END AC near-required-options ===

=== AC near-coordinate-bounds ===
Intent: A latitude outside the documented range is rejected as a usage error.

from cli.testing import cli_runner

code, _, _ = cli_runner( "near", "--lat", "95", "--lon", "0", "--radius", "1", "sources/quakes_2025-01-01_07.geojson" ) assert code == 2 === END AC near-coordinate-bounds ===

=== AC near-invalid-file ===
Intent: An invalid GeoJSON file is reported as an operational failure without standard output.

from cli.testing import cli_runner from pathlib import Path

invalid_file = Path("near-invalid.geojson") invalid_file.write_text("not json\n") try: code, stdout, _ = cli_runner( "near", "--lat", "0", "--lon", "0", "--radius", "1", str(invalid_file) ) assert code == 1 assert stdout == "" finally: invalid_file.unlink(missing_ok=True) === END AC near-invalid-file ===

User Acceptance

Guardrails