feat(metric): Merge Strategy detection + mergeCommit ingestion (#75, #76)#77
Merged
Conversation
) Ingest (#75): capture mergeCommitSha + commit subjects - PullRequest gains merge_commit_sha / merge_commit_parent_count; CommitRef gains subject (messageHeadline). All backward-compatible. - github_reader: mergeCommit added to gh field lists; the light GraphQL pass now also fetches mergeCommit{oid parents{totalCount}} + per-commit messageHeadline (renamed _fetch_pr_enrichment_graphql). Metric (#76): Merge Strategy detection per repo + reliability flag - New analysis/merge_strategy_detector.py: per-PR classify (2-parent ground truth -> commit_refs presence in main -> squash (#N) subject stamp), aggregated to merge|squash|rebase|mixed|unknown with dominant_share and commit_metrics_reliable (False only for squash/mixed). Strictly per-repo. - Wired full chain: schema, aggregator (logs unknown reason), report writer Merge Strategy section, narrative finding, i18n (en + pt-br), TS types, platform UI (repo-detail reliability badge + compare column desktop/mobile), ingest route + migration 019 (indexed columns), docs/METRICS.md. Tests: tests/test_merge_strategy_detector.py (10 cases) + 8 added to tests/test_github_reader_state.py. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
clickmatos
approved these changes
Jun 3, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #75 (ingestion enabler) and #76 (the metric that consumes it).
#75 — Ingest
mergeCommitSha+ commit subjectsPullRequestgainsmerge_commit_sha/merge_commit_parent_count;CommitRefgainssubject(messageHeadline). Backward-compatible defaults.github_reader:mergeCommitadded to the gh--jsonfield lists (cheap{oid}on every path); the light GraphQL enrichment pass now also fetchesmergeCommit{oid parents{totalCount}}and per-commitmessageHeadline(renamed_fetch_pr_enrichment_graphql). Parent count lands on the GraphQL path; gh-only paths get the sha and fall through to the heuristic.#76 — Merge Strategy detection per repo + reliability flag
iris/analysis/merge_strategy_detector.py. Per-PR classification, in confidence order:merge_commit_parent_count == 2→mergemain— all present →merge; none present → squash(#N)subject stamp / single commit →squash, else →rebaseunknown(excluded from the dominant computation)merge|squash|rebase|mixed|unknownwithdominant_shareandcommit_metrics_reliable(False only for squash/mixed).< 5classified →unknown(reason logged, never invented).Full chain wired
schema → aggregator → report writer (Merge Strategy section) → narrative finding → i18n (en + pt-br) → TS types → platform UI (repo-detail reliability badge + compare column, desktop & mobile) → ingest route + migration
019(indexed columns) →docs/METRICS.md(§28 + module map).Validation
pytest164 passed ·iris --helpok · analysis chain oktscclean · lint 0 errors · prettier clean ·vitest186 passed ·buildoktests/test_merge_strategy_detector.py(10) + 8 added totests/test_github_reader_state.pyDeploy note
The compare-table column needs migration
019_merge_strategy.sqlapplied to Supabase before those columns populate. The repo-detail badge reads the JSONB payload and works regardless.Closes #75
Closes #76
🤖 Generated with Claude Code