Skip to content

fix(id): refuse duplicate file names in world compile requests (#1593) - #1594

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/1593-compile-duplicate-names
Oct 28, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/1593-compile-duplicate-names

Conversation

@dezren39

@dezren39 dezren39 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #1593

What

validate_spec in pkgs/id/src/world_compile.rs now refuses a compile request that carries two files with the same name, with an error naming the duplicated file:

file name "Helper.roc" appears more than once in the compile request

Why

Nothing refused duplicate names, and each stage of world_compile::compile then treated the request differently (verified in #1593 with a laptop probe driving the verbatim functions):

  • the staging loop writes files in order to the same job path, so the later file silently overwrote the earlier one;
  • digest_sources still hashed all files, so the installed module's source_blake3 provenance described sources that were never compiled;
  • a duplicated main.roc validated on files[0], but the main.roc read back for the platform-path rewrite — and compiled — was the second one;
  • check_imports scanned shadowed files that never reach the compiler, so a dead file could refuse an otherwise clean compile.

compile() calls validate_spec before check_imports, the source digest, and staging, so this one refusal closes all four divergences. No digest-format, staging-layout, or provenance-schema change.

Tests

  • New duplicate_file_names_are_refused in the world_compile test module: duplicated helper (error names the file), duplicated main.roc, and a unique-name control that still validates.
  • Real-crate run on the laptop: cargo test --lib world_compile — 21 passed / 0 failed (20 pre-existing + the new test); cargo fmt --check clean.
  • Probe re-run with the patched validator (goal-workspace log probe-2026-10-27-laneB-dupcompile/out-fixed.log): DUP1/DUP2 now refuse naming the file; the unique-name control is unchanged.

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

@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) source/creator Filed by the new-issue-creator job priority/low Nice to have; do when convenient app/id Package/app: id (pkgs/ or apps/ in this repo) effort/xs Trivial: expected under 30 minutes of work labels Oct 28, 2026
@dezren39
dezren39 requested a review from a team as a code owner October 28, 2026 05:04
@coderabbitai

coderabbitai Bot commented Oct 28, 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 30 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: f1ef89a8-f56a-4b4b-b898-cacbd4fcb8c3
Commits

Reviewing files that changed from the base of the PR and between 1da6d84 and 1b4812b.

Files selected for processing: 1
  • pkgs/id/src/world_compile.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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T05:06:04.182336Z 1b4812b 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

app/id Package/app: id (pkgs/ or apps/ in this repo) effort/xs Trivial: expected under 30 minutes of work kind/bug Something isn't working (prefixed form of the classic bug label) priority/low Nice to have; do when convenient source/creator Filed by the new-issue-creator job

Projects

None yet

1 participant