Skip to content

Add v3 scoring model (Diet Egg) and Fresh Egg advisory#48

Open
jeffreyksmithjr wants to merge 4 commits intomainfrom
fresh-egg
Open

Add v3 scoring model (Diet Egg) and Fresh Egg advisory#48
jeffreyksmithjr wants to merge 4 commits intomainfrom
fresh-egg

Conversation

@jeffreyksmithjr
Copy link
Contributor

Summary

Changes

File What
models.py FreshAccountAdvisory model, fresh_account field on TrustScore
config.py scoring_model Literal extended to include v3, default changed to v3
scorer.py _score_v3(), _build_fresh_account_advisory(), routing, bot exclusion
formatter.py "Diet Egg" brand for v3, fresh account sections in markdown/CLI/check run, widened v2 checks
cli.py v3 added to click.Choice
action.py v3 added to validation
mcp_server.py v3 added to validation
test_scorer.py TestV3Scoring (9 tests), TestFreshAccountAdvisory (7 tests), existing tests fixed for new default
test_formatter.py TestDietEggFormatting (6 tests), TestFreshAccountFormatting (9 tests)
test_models.py FreshAccountAdvisory construction and serialization tests
test_config.py Default model assertion updated to v3

Live testing results

Tested against real GitHub profiles from the blog post validation set.

Established contributors

User Repo Score Level Merge Rate
josevalim elixir-lang/elixir 67% MEDIUM 500 merged / 250 closed
timneutkens vercel/next.js 69% MEDIUM 500 merged / 226 closed
vmoens pytorch/pytorch 64% MEDIUM 500 merged / 284 closed
tshepang rust-lang/rust 71% HIGH 500 merged / 203 closed
ry denoland/deno 62% MEDIUM 500 merged / 301 closed
soumith pytorch/pytorch 68% MEDIUM 500 merged / 232 closed
thomwolf huggingface/transformers 84% HIGH 249 merged / 48 closed
rauchg vercel/next.js 78% HIGH 144 merged / 41 closed

Less established / unknown contributors

User Repo Score Level Notes
navalprakhar pydantic/pydantic 82% HIGH 9 merged / 2 closed
puxiao vercel/next.js 61% MEDIUM 86 merged / 55 closed
krastogi-in pytorch/pytorch 0% UNKNOWN 0 merged PRs, fresh account advisory shown (218 days)

Edge cases

User Repo Score Level Notes
dependabot[bot] vercel/next.js 0% BOT No fresh account advisory (bot excluded)

Test plan

  • uv run pytest --cov=good_egg -v -- 332 passed, 94% coverage
  • uv run ruff check src/ tests/ scripts/ -- clean
  • uv run mypy src/good_egg/ -- clean
  • Live tested against 12 real GitHub profiles across 7 repos

Closes #46, closes #47

v3 uses alltime merge rate as the sole scoring input, dropping graph
score and log account age from the v2 logistic regression. Fresh
accounts (under 365 days) get an advisory surfaced in all output
formats without affecting the score. Bots are excluded from the
advisory since their synthetic profiles have unreliable age data.

- Add FreshAccountAdvisory model and TrustScore.fresh_account field
- Add _score_v3() using merge_rate as raw and normalized score
- Add _build_fresh_account_advisory() called in all scoring paths
- Change default scoring_model from v1 to v3
- Add "Diet Egg" brand name for v3 in all formatters
- Widen v2 component breakdown checks to include v3
- Add v3 to CLI, action, and MCP server validation
- Update tests: 332 passing, 94% coverage
@github-actions
Copy link

github-actions bot commented Mar 10, 2026

🥚 Good Egg: HIGH Trust

Score: 81%

Top Contributions

Repository PRs Language Stars
2ndSetAI/good-egg 19 Python 22
jeffreyksmithjr/verskyt 9 Python 2
jeffreyksmithjr/galapagos_nao 7 Elixir 21
aws-samples/aws-big-data-blog 3 Java 894
pytorch/pytorch.github.io 2 HTML 278
melissawm/open-source-ai-contribution-policies 1 N/A 124
nerves-project/nerves_examples 1 Elixir 402
kilimchoi/engineering-blogs 1 Ruby 37366
kdeldycke/plumage 1 CSS 55

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new v3 scoring model for evaluating trust, simplifying the scoring mechanism to rely solely on merge rate. It also incorporates a 'Fresh Egg' advisory to provide additional context for newer accounts, enhancing the overall insight into contributor trustworthiness. The default scoring model is updated to v3, and bots are excluded from the fresh account advisory.

Highlights

  • v3 Scoring Model: Implements a new scoring model (v3) that uses all-time merge rate as the sole input, simplifying the previous v2 model.
  • Fresh Account Advisory: Adds a 'Fresh Egg' advisory for accounts under 365 days old, providing an informational note without affecting the score.
  • Configuration Update: Changes the default scoring model to v3 and excludes bots from the fresh account advisory.
  • Formatting Changes: Updates formatting to include 'Diet Egg' branding for v3 and fresh account sections in various output formats.
Changelog
  • Fresh Egg advisory
    • Accounts under 365 days old get an informational note in all output formats
    • Does not affect the score
    • Bots are excluded from the fresh account advisory
  • New scoring model
    • v3 uses alltime merge rate as the sole input
    • Drops graph score and log account age from v2
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Point the Good Egg workflow at ./ instead of the published @v1 tag so
the PR runs the branch code. Set scoring-model to v3.
Remove the local checkout used for testing. Drop the explicit
scoring-model since v3 is now the default.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the v3 scoring model ('Diet Egg'), which simplifies scoring to be based solely on the contributor's merge rate, and adds a 'Fresh Egg' advisory for accounts under a year old. The default model is also updated to v3. The changes are well-structured, logical, and supported by a comprehensive set of new tests. My review includes a couple of minor suggestions to improve code maintainability by updating a docstring and centralizing a configuration value to avoid duplication.

@@ -36,7 +36,11 @@ def _existing_contributor_context(score: TrustScore) -> tuple[int, str]:

def _brand_name(score: TrustScore) -> str:
"""Return 'Better Egg' for v2, 'Good Egg' for v1."""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The docstring for _brand_name is now outdated with the addition of the 'v3' scoring model. Please update it to reflect the new logic and include 'Diet Egg'.

Suggested change
"""Return 'Better Egg' for v2, 'Good Egg' for v1."""
"""Return 'Diet Egg' for v3, 'Better Egg' for v2, or 'Good Egg' for v1."""

"""Build a fresh account advisory from user profile data."""
age_days = user_data.profile.account_age_days
return FreshAccountAdvisory(
is_fresh=age_days < 365,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The threshold 365 is hardcoded here, which duplicates the default value from the FreshAccountAdvisory model in models.py. This could lead to inconsistencies if the threshold is ever changed in one place but not the other.

To ensure a single source of truth, I recommend retrieving the default value from the model's definition rather than repeating the magic number. For example:

threshold = FreshAccountAdvisory.model_fields['threshold_days'].default
# ...
is_fresh=age_days < threshold

- README: update scoring models table, add Fresh Egg section, update
  description to reflect v3 as default
- docs/configuration.md: add v3 to scoring model section, YAML schema,
  env var table, and scoring_model description
- docs/github-action.md: update inputs/outputs tables, replace "Using
  Better Egg" with general "Selecting a Scoring Model" section, add
  diet-egg-workflow to example list
- docs/library.md: replace v2-only config section with general scoring
  model selection, add fresh_account to TrustScore field table, update
  raw_score description
- docs/mcp-server.md: update all parameter tables and return examples
  to show v3 as default
- docs/methodology.md: add Diet Egg (v3) section with motivation, Fresh
  Egg advisory, and component scores; update scoring section to lead
  with v3
- docs/troubleshooting.md: add v3 and Fresh Egg troubleshooting sections
- examples: add diet-egg-workflow.yml, update .good-egg.yml with v3
  comments, update library_usage.py with v3 and fresh_account usage
- assets: replace PR comment screenshot with Diet Egg version
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.

Fresh Egg: flag accounts under 1 year old in scoring output Good Egg v3: simplify scoring to merge_rate only for unknown contributors

1 participant