Skip to content

fix(tdx-hydro): derive duplicate adjudication verdict - #212

Merged
CooperBigFoot merged 1 commit into
pce/close-the-seven-basin-coverage-gap/milestone-6from
pce/close-the-seven-basin-coverage-gap/m6-s3
Aug 10, 2026
Merged

fix(tdx-hydro): derive duplicate adjudication verdict#212
CooperBigFoot merged 1 commit into
pce/close-the-seven-basin-coverage-gap/milestone-6from
pce/close-the-seven-basin-coverage-gap/m6-s3

Conversation

@CooperBigFoot

@CooperBigFoot CooperBigFoot commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Problem

_adjudicate_duplicate previously returned BasinVerdict.SOURCE_DEFECT as an unconditional literal while computing, but never consulting, spatially_equal and coordinate_sequences_equal.

Derivation rule

The verdict is now derived by _derive_duplicate_verdict from the measured geometry:

  • spatially_equal is true — the two streamID 9 features describe the same ground written twice, which an adapter
    could safely collapse, so the verdict is BasinVerdict.ADAPTER_STRICTNESS and the selected branch is same_ground.
  • spatially_equal and coordinate_sequences_equal are both false — the two features describe different ground
    colliding on one identifier, which no adapter-side deduplication can resolve without dropping a drainage unit, so
    the verdict is BasinVerdict.SOURCE_DEFECT and the selected branch is different_ground.
  • coordinate_sequences_equal true with spatially_equal false is mutually inconsistent and refuses.

The rule is justified from source, not from the acquired data: _validate_duplicate_ids refuses on a bare Counter
of streamID values without ever consulting geometry, so the adapter's refusal is unconditional on the duplicate
count — which is exactly what makes the two branches distinguishable. This change makes no prediction about which
branch basin 1020018110's acquired data selects.

Refusal domain

The rule is defined only over non-empty, valid, finite, two-dimensional polygonal geometry. Every other input refuses with ValueError before Shapely .equals() is reached.

Evidence

The emitted evidence records the raw spatially_equal and coordinate_sequences_equal measurements, a machine-readable derivation rule, and the selected branch. A verdict-ledger reader can therefore recompute the verdict from the recorded measurements.

Falsification

Reinstating a hardcoded verdict is caught by test_duplicate_orchestration_derives_both_verdicts, test_duplicate_orchestration_uses_helper_result, and test_duplicate_stream_id_extracts_both_coordinate_sequences.

The full adapter suite passes 112 tests, and all five repository gates exit 0.

This step publishes no verdict ledger, contacts no external party, and touches no evidence tree.

_adjudicate_duplicate previously returned BasinVerdict.SOURCE_DEFECT as an unconditional literal while computing but never consulting spatially_equal and coordinate_sequences_equal.

The verdict is now derived by _derive_duplicate_verdict from the measured geometry. The rule is defined only over valid, finite, two-dimensional polygonal geometry; every other input refuses with ValueError before Shapely .equals() is reached.

The emitted evidence records the raw measurements plus a machine-readable derivation rule and selected branch so a ledger reader can recompute the verdict.
@CooperBigFoot
CooperBigFoot merged commit bd2606c into pce/close-the-seven-basin-coverage-gap/milestone-6 Aug 10, 2026
5 checks passed
@CooperBigFoot
CooperBigFoot deleted the pce/close-the-seven-basin-coverage-gap/m6-s3 branch August 10, 2026 08:15
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