Skip to content

feat(canonical): red CI vetoes bestPick over a green sibling - #15

Merged
StressTestor merged 2 commits into
mainfrom
feat/ci-veto-bestpick
Jul 14, 2026
Merged

feat(canonical): red CI vetoes bestPick over a green sibling#15
StressTestor merged 2 commits into
mainfrom
feat/ci-veto-bestpick

Conversation

@StressTestor

Copy link
Copy Markdown
Owner

the problem (live, on the star map)

odysseus cluster 4 = bug #5207 (ntfy reminder dies on non-ASCII title) with two fix PRs. ground truth: #5208 merged (3-line fix, pytest green), #5358 closed (pytest failing). pr-prism's bestPick was #5358 — the rejected one — at score 0.752 vs 0.532, contested=false.

why: #5358 added a test file, which inflated its quality score via the hasTests/descriptionQuality/diffSize signals. the signals can't see that the test fails, is a tautology, and covers unrelated scope. so a red, closed, scope-creep PR outranked the green fix that actually landed.

the fix

a known-red build never becomes canonical/bestPick over a same-state sibling whose build isn't red, regardless of quality score.

  • ciRank() in canonical.ts: only ciStatus === "failure" demotes. success/pending/unknown/absent rank equal, so a PR whose checks haven't reported yet is never penalized, and an all-failing set falls through to score unchanged
  • inserted into PR-mode compare after statePriority, before score: state (merged > open > closed) still dominates, and the veto acts within a state
  • isNearTie: a green-over-red pick is decisive, so contested=false
  • flows through the single selectCanonical source to report, starmap payload, cli, identity. triage's DupeMatch has no ciStatus, so it's unaffected

tests + gates

  • 8 new tests incl. the live #5207 case; full suite 317 green (was 309)
  • marko: mediocre -> fixed (stale module header now documents state + CI ordering)
  • verify-change adversarial gate: refute-by-default, RED proof pinned on the #5207 case

star-map compatibility

value change only — canonical/contested shift for affected clusters. STARMAP_SCHEMA_VERSION stays 1, old snapshots keep parsing. this is the first of the three calibration fixes surfaced by dogfooding cluster 4.

a PR with a known-failing build must never become a cluster's canonical/
bestPick over a same-state sibling whose build is not red, regardless of
quality score. the quality score rewards signals like 'has a test file'
without checking that the test passes, so a scope-creep PR with a failing
added test could outrank the minimal green fix that actually landed
(odysseus #5207: bestPick was the closed, CI-failing #5358 over the merged
#5208).

- ciRank() in canonical.ts: only ciStatus==='failure' demotes; success/
  pending/unknown/absent rank equal, so a not-yet-reported PR is never
  penalized and an all-failing set falls through to score unchanged
- inserted into PR-mode compare after statePriority, before score, so
  state (merged>open>closed) still dominates and the veto acts within a state
- isNearTie: a green-over-red pick is decisive, so contested=false
- 8 tests incl. the live #5207 case; starmap value change only, schema v1

flows through the single selectCanonical source to report, starmap
payload, cli, and identity; triage's DupeMatch has no ciStatus so it is
unaffected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cd0efdb3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/canonical.ts
Comment on lines +133 to +134
const cr = ciRank(b.ciStatus) - ciRank(a.ciStatus);
if (cr !== 0) return cr;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict the CI veto to PR candidates

When a PR-majority cluster includes its tracker issue and same-state PRs whose CI is failure, this comparison gives the issue an absent-CI rank of 1 while the failing PRs rank 0, so the issue is selected before score is considered. That regresses the existing PR-majority behavior that the issue stays the tracker and the best PR is the canonical/bestPick; the veto should only compare CI between PR candidates rather than treating issues as non-failing siblings.

Useful? React with 👍 / 👎.

@StressTestor
StressTestor merged commit d585472 into main Jul 14, 2026
2 checks passed
@StressTestor
StressTestor deleted the feat/ci-veto-bestpick branch July 14, 2026 21:51
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