Skip to content

fix: start Community Prediction at question open_time#4688

Draft
SylvainChevalier wants to merge 2 commits intomainfrom
claude/issue-4684-community-prediction-should-start-at
Draft

fix: start Community Prediction at question open_time#4688
SylvainChevalier wants to merge 2 commits intomainfrom
claude/issue-4684-community-prediction-should-start-at

Conversation

@SylvainChevalier
Copy link
Copy Markdown
Contributor

Pre-predictions made before the question opens were being included in the CP timeline, causing it to start before open_time. Now clip pre-open forecasts so the CP timeline begins at the question's open_time, while still incorporating the most recent pre-open forecast state from each user that is still active at open_time.

Pre-predictions made before the question opens were being included in
the CP timeline, causing it to start before open_time. Now clip
pre-open forecasts so the CP timeline begins at the question's
open_time, while still incorporating the most recent pre-open forecast
state from each user that is still active at open_time.

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 71adf0fd-5c28-4fde-85bf-5a82c608ce46

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-4684-community-prediction-should-start-at

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SylvainChevalier
Copy link
Copy Markdown
Contributor Author

@lsabor feel free to throw away if bad.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4688-claude-issue-4684-community-pr-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:claude-issue-4684-community-prediction-should-start-at-9064059
🗄️ PostgreSQL NeonDB branch preview/pr-4688-claude-issue-4684-community-pr
Redis Fly Redis mtc-redis-pr-4688-claude-issue-4684-community-pr

Details

  • Commit: 44ca9693ee77fb450510deb47d43477076b4ea9a
  • Branch: claude/issue-4684-community-prediction-should-start-at
  • Fly App: metaculus-pr-4688-claude-issue-4684-community-pr

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

@SylvainChevalier
Copy link
Copy Markdown
Contributor Author

@claude please fix the issues revealed by the unit tests.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 5, 2026

Claude finished @SylvainChevalier's task in 5m 38s —— View job


CI fix pushed

  • Read CI status / identify failing step
  • Inspect logs and the PR diff
  • Diagnose
  • Apply fix
  • Push commit

Summary

The "unit tests" CI run was failing only because of the Check Ruff formatting step in the Backend Checks job — all 712 unit tests passed. The offender was utils/the_math/aggregations.py:

Would reformat: utils/the_math/aggregations.py
1 file would be reformatted, 306 files already formatted

The two new if (...) blocks added in this PR were written as multi-line:

if (
    earliest_time
    and forecast.end_time
    and forecast.end_time <= earliest_time
):

Once collapsed they fit on a single 86-char line (under the project's 88 limit), which is the form ruff/Black enforce. Both occurrences (in get_user_forecast_history) were collapsed in commit 9064059.

Note: I couldn't install ruff in this sandbox (no network), so I couldn't run ruff format directly. The fix is based on analysis of ruff's Black-compatible behavior and the project's line-length = 88. CI will verify on the next run.
• Branch: claude/issue-4684-community-prediction-should-start-at

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
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.

1 participant