[Bug] PR-mined decisions store the decision sentence again as their rationale
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in apply_substring_gate at packages/core/src/repowise/core/analysis/decisions/gate.py:80-90, after the _GATED_FIELDS loop, and compare d.rationale with d.decision using normalize_text from provenance.py; clear the rationale only on equality and leave the substring rule untouched. Read requirement() at lifecycle.py:481 to confirm a cleared rationale then trips NO_RATIONALE_BLOCKER. Reproduce with a fixture PR body plus a model reply where rationale equals decision through DecisionExtractor.extract_all(enabled_sources={"pr"}), then add both cases (echo cleared, distinct rationale kept) to tests/unit/analysis/test_decision_gate.py.
Written by the indexing model from the issue text.
Description
Summary
When a PR body never says why, the PR miner's model often copies the decision sentence into rationale. The substring gate checks each field against the source separately, so the echo is verified "exact" and stored.
packages/core/src/repowise/core/analysis/decisions/gate.py:80-90
for fname in _GATED_FIELDS:
val = (getattr(d, fname, "") or "").strip()
...
verdict = verify_quote(val, norm_src)
Mechanism
mine_pr_bodiesaccepts the model'srationaleas-is (extractor.py:601-608,model_answers.py:134).- The gate grounds
decisionandrationaleagainst the same sentence, and nothing compares them with each other. requirement()takes the reason fromrationale(lifecycle.py:481), so the echo clearsNO_RATIONALE_BLOCKER. The comment at line 478 says the why must never come fromdecision.
Repro
Fixture PR body with one sentence, model reply with rationale == decision, run through DecisionExtractor.extract_all(enabled_sources={"pr"}):
source : pr | verification: exact
decision : ChatMarkdown takes a density prop shared across panels and replaces per-panel prose styles.
rationale : ChatMarkdown takes a density prop shared across panels and replaces per-panel prose styles.
blockers as stored : []
blockers if rationale empty: ['no rationale or explicit constraint reason']
Impact
get_why and the review queue show a restated "what" as the "why", and these records skip the rationale check on acceptance.
Done looks like
- In
apply_substring_gate, after the field loop, clearrationalewhennormalize_text(rationale) == normalize_text(decision)(normalize_textis inprovenance.py). - Keep the substring rule exactly as it is. Do not loosen it.
- Records without
contextthen showNO_RATIONALE_BLOCKER, andconfirmalready asks for--reason. - Out of scope: rows already stored, because mined PRs are not re-mined.
- Good first issue: one function, one comparison, an existing normaliser.
Tests
tests/unit/analysis/test_decision_gate.py (or the existing gate test file): an echoed rationale is cleared and the candidate survives; a distinct grounded rationale is kept.
- Dominant language
- Python
- Stars
- 7.1k
- Forks
- 756
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from repowise-dev/repowise
-
[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable filesPossibly taken @ZYZ666-RGB claimed this 1 day ago. Openbug good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#6296 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Coverage stack detection omits Swift, Dart, and Scala, falling through to UNKNOWN in evidence setupPossibly taken @RishabhIIITD claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
repowise-dev/repowise#5838 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not rootsPossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#4477 ·
Maintainers usually reply within 1 day
-
[Bug] COBOL listing directives EJECT, SKIP1/SKIP2/SKIP3 and TITLE fail to parse and drop the rest of the filePossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
repowise-dev/repowise#4474 ·
Maintainers usually reply within 1 day
-
`repowise uninstall` prints a configured database URL with a backslash on WindowsMay be free again A pull request for this issue was closed without being merged. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
repowise-dev/repowise#4347 · 2 comments ·
Maintainers usually reply within 1 day
All issues in repowise-dev/repowise
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePossibly taken @PabloRoque claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc-extras#839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day