Skip to content

fix(id/web): anchor hashed-filename classification on the build contract (#6779) - #6799

Merged
dezren39 merged 1 commit into
mainfrom
queue/6779-hashed-filename-contract
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/6779-hashed-filename-contract

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fix

is_hashed_filename treated any 8+ lowercase-alphanumeric dotted segment as a content hash, so ordinary names (app.development.js, styles.darkmode.css, vendor.production.js, editor.settings.js) got a one-year immutable Cache-Control at a stable URL (#6779).

Implements the build contract pinned by lane code-q's triage on #6779 — a name is hashed iff one of the two web/dist emitters can produce it:

  • main. + exactly 8 base36 chars + .js (Bun --entry-naming=[name].[hash].js), plus that entry's .js.map sourcemap;
  • styles. + exactly 8 lowercase hex chars + .css (build-manifest.ts SHA-256-prefix rename).

Everything else gets no-cache. The module doc comment now states this contract and its sources. New tests cover the four false-positive names, longer/shorter segments, wrong stems with hash-shaped segments, and the sourcemap case; all pre-existing assets.rs cases are unchanged and still classify as before (including letters-only Bun hash main.bjbjbv7v.js).

Verification disclosure

The laptop's /home filled to 100% during this shift (filed as #6797); cargo test for the crate died with ENOSPC at the final lib-test compile, so the in-crate suite could not be run. Instead, the patched function was extracted verbatim from the patched assets.rs and executed standalone under rustc against a 27-case table (every existing suite case + all new acceptance cases): all pass. The change is a pure function with no other call-site impact; post-merge CI on main is the backstop for the in-crate suite.

Closes #6779.


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

@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 05:15
@coderabbitai

coderabbitai Bot commented Nov 7, 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 29 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: 2568537c-5d59-4762-980f-cf072232a531
Commits

Reviewing files that changed from the base of the PR and between c560db7 and 2cbdc11.

Files selected for processing: 1

  • pkgs/id/src/web/assets.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

chatgpt-codex-connector Bot commented Nov 7, 2026 •

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-07T05:16:58.054593Z 2cbdc11 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