Skip to content

fix(id): do not promote a world dev candidate when the freshness rescan fails - #8791

Merged
dezren39 merged 1 commit into
mainfrom
queue/15037-8781-freshness-rescan
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/15037-8781-freshness-rescan

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Fixes #8781.

Problem

In run_dev_watch (pkgs/id/crates/id-worlds/src/world_dev.rs), the post-compile freshness rescan replaced a failed discover_sources with the candidate's own snapshot id (unwrap_or_else(|_| candidate_snapshot_id.clone())). That made DevSession::promote's stale check pass by construction, so a candidate could replace the last-good program while the sources were undiscoverable (source deleted/unreadable during compilation). Codex P2 on merged PR #8647, comment 4537028872.

Fix

  • New freshness_verdict helper: a failed discovery is FreshnessVerdict::Failed(diagnostic) — it never substitutes any other snapshot id.
  • run_dev_watch: on Failed, record a freshness_rescan_failed cycle with the diagnostic, set the session's last-failure, and retain the active world (no promotion), mirroring the existing rescan_failed / compile_failed cycle handling.

Test

Regression test freshness_verdict_fails_when_sources_become_undiscoverable (oracle: issue #8781's acceptance): with main.roc present the verdict is Current with the discovered snapshot id; after main.roc is deleted the verdict is Failed naming main.roc, never a snapshot id the candidate could match — so the cycle is recorded failed and the active world is retained.

Queue: task 15037, lane any-a.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…an fails

run_dev_watch replaced a failed discover_sources with the candidate's own snapshot id, so promote's stale check passed by construction and the candidate could replace the last-good program while sources were undiscoverable (issue #8781, Codex P2 on PR #8647).

freshness_verdict now reports Failed on discovery error; the watch loop records a freshness_rescan_failed cycle, sets last-failure, and retains the active world. Regression test: freshness_verdict_fails_when_sources_become_undiscoverable.
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 23:01
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3b7c0f52-fea3-41ce-8654-9a2ce666e9a1
Commits

Reviewing files that changed from the base of the PR and between 7f14ad8 and 2470a76.

Files selected for processing: 1

  • pkgs/id/crates/id-worlds/src/world_dev.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T23:02:34.446550Z 2470a76 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant