Skip to content

feat(decisions): remove code_comment harvest, source gating, sticky dismissals#773

Merged
RaghavChamadiya merged 1 commit into
mainfrom
feat/decision-hygiene
Jul 11, 2026
Merged

feat(decisions): remove code_comment harvest, source gating, sticky dismissals#773
RaghavChamadiya merged 1 commit into
mainfrom
feat/decision-hygiene

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

Closes #751.

What changed

Removed the index-time code_comment harvest (Source 8). The repo-wide rationale-comment scan stored each matching comment verbatim as a proposed decision at floored confidence. The query-time live-grep miner already serves the same comments fresh inside get_answer and get_why, so the stored records added review burden without adding information: on a ~2.5k-file repo every reindex regenerated ~1,500 proposals. The shared heuristics module (rationale_comments.py) stays; the live miner is now its only consumer.

One-shot drain of the legacy backlog. Still-proposed code_comment rows (plus their evidence, edges, and node links) are deleted on the next init or update. This runs on all three persist paths, including index-only updates, so post-commit-hook users get the cleanup too. Confirmed and dismissed rows are kept.

decisions.sources config gate. Any remaining extraction source can be disabled per repo:

decisions:
  sources:
    comment: false   # LLM comment archaeology

Unknown or stale keys are ignored. Documented in CONFIG.md.

Sticky dismissals. repowise decision dismiss now sets a terminal dismissed status instead of deleting the row, and bulk_upsert_decisions treats those rows as tombstones: no headline promotion, no evidence accretion, never re-proposed. The same guard stops a re-extraction from walking a confirmed active decision back to proposed (previously a re-harvest tied the stored source rank and flipped it). Dismissed rows are hidden from listings and dashboards unless explicitly requested.

CLI id prefixes. decision show/confirm/dismiss/deprecate now accept the 8-char id prefixes that decision list prints (they previously required the full 32-char id, which the CLI never displays).

Validation

Dogfood on this repo: proposed queue dropped from 2,710 to 971 after one repowise update; zero code_comment rows or orphaned child rows remain; a dismissed decision stays dismissed and its tombstone is visible via decision show. Full unit suite green (6,921 passed), plus new tests for the source gate, sticky statuses, and the purge.

…smissals

Closes #751.

- Remove the index-time repo-wide code_comment rationale harvest (Source 8).
  The query-time live-grep miner already serves the same comments fresh in
  get_answer/get_why, so the stored records added noise without information:
  a 2.5k-file repo regenerated ~1,500 proposals on every reindex.
- Drain still-proposed code_comment rows on the next init/update (all three
  persist paths, including index-only), keeping confirmed/dismissed rows.
- decisions.sources config section: any remaining extraction source can be
  disabled per repo in .repowise/config.yaml.
- Sticky dismissals: dismiss sets a terminal dismissed status instead of
  deleting, and bulk_upsert_decisions never resurrects a dismissed row or
  walks a confirmed active decision back to proposed on re-extraction.
- Decision CLI subcommands (show/confirm/dismiss/deprecate) now accept the
  8-char id prefixes that decision list prints.

Dogfood: proposed queue dropped 2,710 -> 971 after one update; zero
code_comment rows or orphaned evidence/links remain; dismissals persist.

Claude-Session: https://claude.ai/code/session_01AbCVfR5FFEvDxRvJU7DmsW
@repowise-bot

repowise-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

✅ Health: 7.6 (unchanged)

📋 At a glance
1 file changed health · 5 hotspots touched · 9 new findings introduced · 5 co-change pairs left out · 5 files with recent fix history · 2 dead-code findings.

Files & modules (2)
  • packages (8 files)
    • .../pipeline/incremental.py
    • .../mcp_server/_code_rationale.py
    • .../decisions/provenance.py
    • .../phases/analysis.py
    • .../pipeline/persist.py
    • .../update_cmd/persistence.py
    • .../tool_answer/answer.py
    • .../decisions/extractor.py
  • tests (1 file)
    • .../analysis/test_decision_sources.py

⚠️ Change risk: moderate (riskier than 60% of this repo's commits · raw 9.2/10)
This change's risk is driven by:

  • more lines added than baseline
  • more scattered than baseline

🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)

File Score Δ Why
.../analysis/test_decision_sources.py 9.3 → 9.2 ▼ -0.2 🔻 introduced duplicated assertion block

💡 .../analysis/test_decision_sources.py: De-duplicate this assertion block. The same checks are copy-pasted across tests, so a behaviour change must be edited in several places and usually isn't. Extract the shared assertions into a helper or parametrize the cases over the varying inputs.

🔎 More signals (3)

🔥 Hotspots touched (5)

  • .../pipeline/incremental.py — 10 commits/90d, 5 dependents · primary owner: Raghav Chamadiya (96%)
  • .../mcp_server/_code_rationale.py — 2 commits/90d, 4 dependents · primary owner: Raghav Chamadiya (100%)
  • .../analysis/test_decision_sources.py — 2 commits/90d, 0 dependents · primary owner: Raghav Chamadiya (100%)
2 more
  • .../decisions/provenance.py — 3 commits/90d, 4 dependents · primary owner: Swati Ahuja (98%)
  • .../phases/analysis.py — 6 commits/90d, 3 dependents · primary owner: Swati Ahuja (66%)

🔗 Hidden coupling (2 files)

  • .../pipeline/persist.py co-changes with these files (not in this PR):
    • .../persistence/models.py (11× — 🟡 notable)
    • .../pipeline/orchestrator.py (11× — 🟡 notable)
    • .../persistence/test_models.py (10× — 🟡 notable)
    • .../persistence/__init__.py (6× — 🟢 routine)
  • .../update_cmd/persistence.py co-changes with .../update_cmd/command.py (6× — 🟢 routine) — not in this PR.

💀 Dead code (2 findings)

  • 💀 .../pipeline/incremental.py _noop_log (confidence 0.65)
  • 💀 .../tool_answer/answer.py _json_default (confidence 0.65)

📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-11 05:54 UTC
Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot

@RaghavChamadiya RaghavChamadiya merged commit 43cc505 into main Jul 11, 2026
7 checks passed
@RaghavChamadiya RaghavChamadiya deleted the feat/decision-hygiene branch July 11, 2026 05:57
swati510 pushed a commit that referenced this pull request Jul 11, 2026
…smissals (#773)

Closes #751.

- Remove the index-time repo-wide code_comment rationale harvest (Source 8).
  The query-time live-grep miner already serves the same comments fresh in
  get_answer/get_why, so the stored records added noise without information:
  a 2.5k-file repo regenerated ~1,500 proposals on every reindex.
- Drain still-proposed code_comment rows on the next init/update (all three
  persist paths, including index-only), keeping confirmed/dismissed rows.
- decisions.sources config section: any remaining extraction source can be
  disabled per repo in .repowise/config.yaml.
- Sticky dismissals: dismiss sets a terminal dismissed status instead of
  deleting, and bulk_upsert_decisions never resurrects a dismissed row or
  walks a confirmed active decision back to proposed on re-extraction.
- Decision CLI subcommands (show/confirm/dismiss/deprecate) now accept the
  8-char id prefixes that decision list prints.

Dogfood: proposed queue dropped 2,710 -> 971 after one update; zero
code_comment rows or orphaned evidence/links remain; dismissals persist.
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.

Option to disable or threshold comment-derived decision auto-proposals

2 participants