Skip to content

fix(decisions): fold a re-mined decision into the record that already holds it - #5221

Merged
swati510 merged 2 commits into
mainfrom
fix/decision-ingest-dedupe
Nov 2, 2026
Merged

swati510 merged 2 commits into
mainfrom
fix/decision-ingest-dedupe

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

Every update re-mines recent PR and commit bodies. Each pass rewords the title and picks its own span, and the span decides the files and quote the decision id derives from, so a decision already stored came back under a new id. On this repository, 462 mined records held 187 decisions, with up to 11 copies of one sentence. Title dedup needs equal titles, the lane fold (#2753) pairs PR with commit lanes only, and semantic dedup needs an embedder, so none of them caught it.

What changed

  • Ingest folds an incoming decision with no title match into a record of the same lane that cites a common evidence commit and says the same thing: one decision text opens the other, or their content words overlap at least 0.75 with the same negations. The stored id is kept, the new pass is added as evidence, and a rewording does not retitle the record. Shared evidence alone never folds, since one PR often states several decisions.
  • Existing copies are folded by the id repair that runs at the start of every index, recording a merged alias so old ids still resolve.
  • Survivor: an accepted record first, then one whose status a person set, then the oldest. Accepted, person-set and reviewed records are never folded away; needs_split bundles are left alone.

Measured on this repository's decisions

Before After
Mined records 462 187
Acceptable candidates 234 101

Kept apart: three distinct decisions from one commit, two tuning rules that share numbers, a bundled span vs one of its claims, and a negated ruling. Paraphrases with no shared wording are not merged.

Verification

  • tests/unit/persistence/test_decision_reworded_duplicates.py (new, 30 cases from real duplicate clusters), plus test_decision_lane_fold.py fixtures corrected where two distinct decisions had copied text.
  • Decision persistence suites: 375 passed. Goldens and analysis: 191 passed. Pipeline, CLI persist and MCP get_why: 391 passed.
  • The id recipe is unchanged.

… holds it

Every update re-mines recent PR and commit bodies. Each pass rewords the
title and picks its own span, and the span decides the files and quote the
id derives from, so the id moved and a new record was minted for a decision
already stored. On repowise-dev/repowise, 462 mined records held 187
decisions, with up to 11 copies of one sentence. Title dedup needs equal
titles, the lane fold (#2753) pairs PR with commit lanes only, and semantic
dedup needs a real embedder, so none of them caught it.

Ingest now folds an incoming decision with no title match into a stored or
in-batch record of the same lane that cites a common evidence commit and
says the same thing: one decision text opens the other, or their content
words overlap at least 0.75 with the same negations. The stored id is kept,
the arrival accretes as evidence, and a same-lane rewording does not retitle
the record. Shared evidence alone never folds: one PR states several
decisions.

The id repair that runs at the head of every index folds copies stored
before this, with a merged alias so an old id still resolves. The keeper is
the accepted record, then one with a status a person set, then the oldest.
Accepted, person-set and reviewed records are never folded away, and
needs_split bundles are held out on both paths.

Replayed on the showcase store: 462 records to 187, 95 copies fold into the
41 accepted records, and no two accepted records match each other.
@repowise-bot

repowise-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Worth a look: 1 thing to check below.

  1. This PR introduces 7 new health notes across 3 files: 5× untested complexity, 2× complex method (see all)

✅ Health of changed files: 7.7 → 8.0 (+0.3; structure +0.3) Average full file score (structure and history) of 6 changed code files, weighted by size before this PR; not the repository score.

Patch coverage 95.4% (105 of 110 changed executable lines covered)

5 uncovered changed lines in 2 files
File Uncovered changed lines Covered
packages/core/src/repowise/core/persistence/crud/decision_lane_fold.py 270, 300, 308 42 of 45
packages/core/src/repowise/core/persistence/crud/decision_identity.py 105-106 11 of 13

Report from this run for 6ebd374. Every check on the PR page.


View on Repowise
Plain markdown for agents · Reviews (2) · Last reviewed commit: fix(decisions): count quantity and contrast words when matching decision · Since the last review: 1 resolved (their code changed), 1 answered in its thread

Settings and updates

Silence one PR with [skip repowise] in the title · Bot settings
/repowise recheck reviews the current head again
/repowise review deep runs the deep review on it
/repowise remember <text> tells the reviewer what to leave out next time (reply on a finding to scope it to that file)
/repowise help lists the commands
⭐ Star Repowise · 📥 Install on another repo

…ion text

"holds one message per worker" and "holds two messages per worker"
reduced to the same content words, so two rulings folded into one record.
@swati510
swati510 merged commit 39199a9 into main Nov 2, 2026
15 checks passed
@swati510
swati510 deleted the fix/decision-ingest-dedupe branch November 2, 2026 08:11
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.

2 participants