fix(local): route multi-signature packages to human triage in the proposer #119

Merged
pat-s merged 1 commit from t3code/fix-ambiguous-proposals into main 2026-07-14 17:11:55 +00:00
Owner

Problem

A live propose-patches.R --open-issue run aborted with:

Patch registry validation FAILED:
  - ambiguous duplicate entries: hmmTMB|ubuntu-2604|*, imt|ubuntu-2604|*, refundBayes|ubuntu-2604|*
Error: Candidate registry failed validation; not writing or proposing.

Root cause: a package whose failing builds match more than one auto-proposable signature (e.g. some logs hit tbb-stddef-removed, others rcppparallel-bundled-tbb) landed in two separate signature groups, so the proposer emitted two candidate entries with the same package|platforms|versions key. The validator's ambiguous-duplicate check then failed the whole candidate set, aborting the run — so even the unambiguous candidates (e.g. vacalibration) never got proposed.

Fix

Add a pure, tested dedupe_candidates() that:

  • keeps a package's candidate only when it maps to a single signature (collapsing an accidental repeat under the same signature), and
  • routes a package that maps to multiple signatures (conflicting fix tiers -- makevars vs source patch) to human triage instead of guessing between them.

The proposer prints the skipped ambiguous packages and proceeds with the clean candidates, so one ambiguous package no longer blocks the rest. This matches the issue #115 guardrail: don't auto-pick when the fix is ambiguous.

Verification

  • New unit tests in test-proposal-tracking-lib.R cover the single-signature, multi-signature (conflict), duplicate-under-one-signature, and empty cases.
  • Reproduced the original failure end-to-end with a stubbed DB (hmmTMB ambiguous + vacalibration clean): hmmTMB is now listed under "Ambiguous -> human triage", vacalibration is proposed, and the candidate registry validates (Patch registry OK).
  • Full suite: 78 tests pass; all pre-commit hooks pass.
## Problem A live `propose-patches.R --open-issue` run aborted with: ``` Patch registry validation FAILED: - ambiguous duplicate entries: hmmTMB|ubuntu-2604|*, imt|ubuntu-2604|*, refundBayes|ubuntu-2604|* Error: Candidate registry failed validation; not writing or proposing. ``` Root cause: a package whose failing builds match **more than one** auto-proposable signature (e.g. some logs hit `tbb-stddef-removed`, others `rcppparallel-bundled-tbb`) landed in two separate signature groups, so the proposer emitted two candidate entries with the same `package|platforms|versions` key. The validator's ambiguous-duplicate check then failed the whole candidate set, aborting the run — so even the unambiguous candidates (e.g. `vacalibration`) never got proposed. ## Fix Add a pure, tested `dedupe_candidates()` that: - keeps a package's candidate only when it maps to a **single** signature (collapsing an accidental repeat under the same signature), and - routes a package that maps to **multiple** signatures (conflicting fix tiers -- makevars vs source patch) to **human triage** instead of guessing between them. The proposer prints the skipped ambiguous packages and proceeds with the clean candidates, so one ambiguous package no longer blocks the rest. This matches the issue #115 guardrail: don't auto-pick when the fix is ambiguous. ## Verification - New unit tests in `test-proposal-tracking-lib.R` cover the single-signature, multi-signature (conflict), duplicate-under-one-signature, and empty cases. - Reproduced the original failure end-to-end with a stubbed DB (`hmmTMB` ambiguous + `vacalibration` clean): `hmmTMB` is now listed under "Ambiguous -> human triage", `vacalibration` is proposed, and the candidate registry validates (`Patch registry OK`). - Full suite: 78 tests pass; all pre-commit hooks pass.
A package whose failing builds match more than one auto-proposable signature
(e.g. some logs hit `tbb-stddef-removed` and others `rcppparallel-bundled-tbb`)
produced two candidate registry entries with the same package/platforms/versions
key, so the candidate set failed `validate-patches.R` with "ambiguous duplicate
entries" and the whole proposer run aborted.

Add a pure `dedupe_candidates()` that keeps a package only when it maps to a
single signature and routes genuinely ambiguous packages (conflicting fix tiers)
to human triage instead of guessing between them. The proposer prints the
skipped packages and proceeds with the unambiguous candidates.
pat-s merged commit f1dd661213 into main 2026-07-14 17:11:55 +00:00
pat-s deleted branch t3code/fix-ambiguous-proposals 2026-07-14 17:11:55 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/build-cran-binaries!119
No description provided.