Apply minimum-sample floor to weekly AI-adoption % (fixes #189) - #201
Merged
Conversation
…#189) origin_distribution (which drives weekly AI-adoption %) had no minimum commit count, unlike stabilization_ratio — a single AI-tagged commit in an otherwise quiet week could swing that week to 100% AI adoption. This leaked into the org timeline chart as visible zigzag noise, reported while reviewing #183/#190's connectNulls fix. Now gated behind the same MIN_COMMITS_FOR_RATIO=3 floor stabilization already uses: weeks below it get an empty origin_distribution instead of a distribution computed from too few data points. Downstream, computeOrgTimeline (platform) already treats a week with no origin data as aiWeight=0 -> aiPct=null, and the connectNulls fix already renders null as a gap instead of a fake trend — so this composes with both existing fixes without any platform-side change needed. intent_distribution (feature/fix %) has the same statistical shape but is out of scope here — flagged in #189 as a secondary "worth evaluating" item, not this specific complaint. Co-Authored-By: claude-code_2-1-238_agent <claude-code_2-1-238_agent@iris.invalid>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Closes #189. Reported as "the lines look messy/zigzag" on the org timeline chart after #190 (connectNulls fix) and #200 (full-history fix) made the chart's real underlying data fully visible for the first time.
Root cause:
origin_distribution(which drives weekly AI-adoption %) had no minimum commit count, unlikestabilization_ratio(gated behindMIN_COMMITS_FOR_RATIO = 3). A single AI-tagged commit in an otherwise quiet week could swing that week's AI-adoption all the way to 100%, and a single human commit could swing it to 0% — statistically meaningless spikes that showed up as real-looking zigzag on the chart.Fix
iris/analysis/activity_timeline.py:origin_distributionis now gated behind the sameMIN_COMMITS_FOR_RATIOfloorstabilization_ratioalready uses. Weeks below it get an empty{}instead of a distribution computed from 1-2 data points.No platform-side change needed — this composes cleanly with two fixes already merged:
computeOrgTimelinealready treats a week with empty origin data asaiWeight = 0→aiPct = null.connectNullsfix (Stop drawing a fake trend through data-less weeks in org timeline #190) already rendersnullweeks as a gap instead of bridging them with a fake line.intent_distribution(feature/fix %) has the identical statistical shape but is out of scope here — noted in #189 as a secondary item, not the reported complaint.Test plan
tests/test_activity_timeline.py: a below-floor week (1 commit) getsorigin_distribution == {}; an at-floor week (3 commits) gets a correctly populated distributionpytest tests/ -q— 468 passed (466 existing + 2 new)🤖 Generated with Claude Code