Files
gitlore/docs/ideas/closure-gaps.md
Taylor Eernisse 4185abe05d docs: add feature ideas catalog, time-decay scoring plan, and timeline issue doc
Ideas catalog (docs/ideas/): 25 feature concept documents covering future
lore capabilities including bottleneck detection, churn analysis, expert
scoring, collaboration patterns, milestone risk, knowledge silos, and more.
Each doc includes motivation, implementation sketch, data requirements, and
dependencies on existing infrastructure. README.md provides an overview and
SYSTEM-PROPOSAL.md presents the unified analytics vision.

Plans (plans/): Time-decay expert scoring design with four rounds of review
feedback exploring decay functions, scoring algebra, and integration points
with the existing who-expert pipeline.

Issue doc (docs/issues/001): Documents the timeline pipeline bug where
EntityRef was missing project context, causing ambiguous cross-project
references during the EXPAND stage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:16:48 -05:00

2.1 KiB

MR-to-Issue Closure Gap

  • Command: lore closure-gaps
  • Confidence: 88%
  • Tier: 2
  • Status: proposed
  • Effort: low — single join query

What

Find entity_references where reference_type='closes' AND the target issue is still open AND the source MR is merged. These represent broken auto-close links where a merge should have closed an issue but didn't.

Why

Simple, definitive, actionable. If a merged MR says "closes #42" but #42 is still open, something is wrong. Either auto-close failed (wrong target branch), the reference was incorrect, or the issue needs manual attention.

Data Required

All exists today:

  • entity_references (reference_type='closes')
  • merge_requests (state='merged')
  • issues (state='opened')

Implementation Sketch

SELECT
    mr.iid as mr_iid,
    mr.title as mr_title,
    mr.merged_at,
    mr.target_branch,
    i.iid as issue_iid,
    i.title as issue_title,
    i.state as issue_state,
    p.path_with_namespace
FROM entity_references er
JOIN merge_requests mr ON er.source_entity_type = 'merge_request'
    AND er.source_entity_id = mr.id
JOIN issues i ON er.target_entity_type = 'issue'
    AND er.target_entity_id = i.id
JOIN projects p ON er.project_id = p.id
WHERE er.reference_type = 'closes'
  AND mr.state = 'merged'
  AND i.state = 'opened';

Human Output

Closure Gaps — merged MRs that didn't close their referenced issues

group/backend !234 merged 3d ago → #42 still OPEN
  "Refactor auth middleware" should have closed "Login timeout bug"
  Target branch: develop (default: main) — possible branch mismatch

group/frontend !45 merged 1w ago → #38 still OPEN
  "Update dashboard" should have closed "Dashboard layout broken"

Downsides

  • Could be intentional (MR merged to wrong branch, issue tracked across branches)
  • Cross-project references may not be resolvable if target project not synced
  • GitLab auto-close only works when merging to default branch

Extensions

  • Flag likely cause: branch mismatch (target_branch != project.default_branch)
  • lore closure-gaps --auto-close — actually close the issues via API (dangerous, needs confirmation)