Capability and script contracts#

analyze_change.py#

Run analyze --staging-dir DIR --output-dir RELATIVE_DIR and pipe one JSON object to stdin:

{
  "before": {"collection": "eo", "record_id": "a", "asset_id": "tci-a", "media_contract_version": "2.0", "media_type": "image/jp2", "media_role": "manifest", "georeferencing_method": "affine_crs", "file": "a.jp2"},
  "after": {"collection": "eo", "record_id": "b", "asset_id": "tci-b", "media_contract_version": "2.0", "media_type": "image/jp2", "media_role": "manifest", "georeferencing_method": "affine_crs", "file": "b.jp2"},
  "threshold": 0.2,
  "minimum_region_pixels": 9,
  "region_limit": 50,
  "max_pixels": 2000000
}

Unknown keys are rejected. Both files must be regular, non-symlink, self-contained GeoTIFF or JPEG 2000 files using the extension-matched GTiff or JP2OpenJPEG driver beneath the staging directory, no larger than 256 MiB, 50 million decoded pixels, 16 bands, or 50 million total pixel-band samples. VRT/network drivers, GDAL PAM and directory discovery, curl-backed extensions, external georeferencing, and conventional sidecars are disabled or rejected. The output directory must already exist beneath staging. The script validates every source band bound before reading and compares at most three bands after independent 2nd/98th percentile normalization on a bounded EPSG:6933 grid spanning the union of both authoritative extents. It writes difference.png and change-mask.png, returning only staging-relative names and SHA-256 hashes.

Every source must bind an exact GeoNeMo media asset under contract 2.x; companion assets, unsupported georeferencing, and extension/media-type mismatches are rejected. The output envelope contains a geo_change.v3 result. detected and no_material_change require sufficient observable pixels, union-grid coverage, and per-source observable coverage; otherwise the status is indeterminate. Non-overlap or missing georeferencing is an input/unsupported failure, never an unregistered pixel comparison.

Host compare_images#

Accept bounded authoritative previews for the exact before/after catalog records and one focused question informed by the deterministic measurement. The host fixes the provider, prompt revision, output schema, authentication, timeouts, and limits. Preserve provider, model alias, prompt revision, source hashes, warnings, and limitations in the answer. Do not present the semantic comparison as measurement of the generated difference or mask artifacts. The exact provider prompt and JSON contract are versioned in vision-comparison-provider.md.