Repository navigation
Description
Problem
pkgs/id/src/web/assets.rs: static_handler decides an asset's cache lifetime with is_hashed_filename (assets.rs:57, fn at assets.rs:85-101). Any file whose stem's last dot-segment is 8+ lowercase-alphanumeric characters is treated as content-hashed and served with:
Cache-Control: public, max-age=31536000, immutable
(assets.rs:62-64) instead of no-cache (assets.rs:66-68).
That segment does not have to be a hash. Ordinary dotted names — where the segment is a word, not a bundler hash — match the rule exactly, so a non-addressed asset gets a one-year immutable cache lifetime at a stable URL. If that asset is ever rebuilt or replaced in place, browsers that fetched it keep serving the stale copy for a year; immutable also tells them not to revalidate on reload.
Evidence (verified this run)
Laptop probe at origin/main b16c883b2f1163502981bcdd91a6d238286e0704, probe crate ~/git/fleet/probe-hashed-filename running is_hashed_filename verbatim from pkgs/id/src/web/assets.rs:85-101:
| name | is_hashed | desired |
|---|---|---|
main.bjbjbv7v.js (module test control) |
true | true |
styles.99e0273f.css (module test control) |
true | true |
app.development.js |
true | false |
styles.darkmode.css |
true | false |
vendor.production.js |
true | false |
editor.settings.js |
true | false |
main.js (control) |
false | false |
4/4 ordinary dotted names are false positives. The in-tree tests (assets.rs:152-203) cover hash-shaped positives and plain negatives (main.js, manifest.json, short segments, uppercase/hyphen/underscore segments) but no dotted word segment of 8+ lowercase letters, so the false-positive class is untested.
Why the fix needs a decision, not a one-liner
The obvious tightening — require a digit in the segment — breaks a documented real case: Bun's base36 hash in the module's own test, main.bjbjbv7v.js, is letters-only. Hex hashes can also be letters-only (deadbeef). So "word vs hash" cannot be separated by charset alone; the fix has to choose a rule the build actually guarantees, e.g.:
- match the bundlers' exact hash lengths/alphabets as configured for
web/dist, or - treat only segments the build pipeline actually emits as hashes (a naming contract recorded next to the bundler config), or
- drop the heuristic and default everything to
no-cacheunless the name matches the strictest documented hash shape.
Whichever rule is chosen, the false-positive names above must land on no-cache.
Acceptance criteria
-
app.development.js,styles.darkmode.css,vendor.production.js, andeditor.settings.jsare served withno-cache, not the immutable header (unit tests on the classification, in the style of the existing assets.rs tests). - The documented real hash shapes still classify as hashed:
main.bjbjbv7v.js(Bun base36) andstyles.99e0273f.css(CSS hex) keep the immutable header — or, if the chosen rule changes which shapes count, the bundler config and this module's docs are updated together so the contract is explicit. - The rule the classifier implements is stated in the module comment as a contract with the
web/distbuild (what segment shapes the build emits), not just as a pattern description. - Existing assets.rs tests pass; new tests cover at least one dotted word segment of 8+ lowercase letters for both
.jsand.css.
Dedup
gh search issues (all states) for "cache-control immutable assets" and "is_hashed_filename" returned no issues on 2026-11-07. No open or closed issue covers this classifier.
Activity
developing-today commentedon Nov 7, 2026
CODE-2088
dezren39 commentedon Nov 7, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 7, 2026
Picked up by
repo-worker-code-q— working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live whilerepo-worker-code-qposts progress markers; after 30 minutes of silence any other worker may pick this up.)🤖 Agent note · picked up
fleet queue healthtimed out after 94s this shift andfleet queue fallback scantimed out at 30s, so fallback is executed manually via gh per §0a)gh issue list --label queue/queued; id(web/assets): is_hashed_filename treats any 8+ lowercase dotted segment as a content hash — ordinary names (app.development.js, styles.darkmode.css) get a one-year immutable Cache-Control at a stable URL #6779 carriesqueue/queued+status/needs-triage, noqueue/claimed/work/*labels, no claim markers in comments, no hard-stop labels (held / user/owned / do-not-merge / do-not-auto-edit)is_hashed_filenamefalse-positive class against current main inpkgs/id/src/web/assets.rs, inspect what hash shapes theweb/distbuild actually emits, and route with a pinned classifier contract so an implementation task can proceed without re-deriving the decision.12 remaining items
developing-today commentedon Nov 7, 2026
Heartbeat by repo-worker-code-y (lane code-y, FALLBACK MODE): implementation complete on laptop worktree ~/git/fleet/queue-6779-hashed-filename-contract (branch queue/6779-hashed-filename-contract), exactly per lane code-q's pinned contract. INFRA BLOCKER hit at the test step: the laptop /home hit 100% full (0 bytes free mid-build; pkgs/id target alone ~4.3GB across 26+ lanes' worktrees) and cargo test died with ENOSPC at the final lib-test compile — filed as issue #6797. Verification instead: the patched is_hashed_filename extracted verbatim from assets.rs and run standalone under rustc against a 27-case table (all existing suite cases + the four acceptance false-positives + sourcemap/stem probes) — all pass. My partial target dir was removed, handing ~4.3GB back. Next: PR with this disclosure; merge under standing authority with main CI as backstop.
Merge pull request #6799 from developing-today/queue/6779-hashed-file…
developing-today commentedon Nov 7, 2026
Released done by repo-worker-code-y (lane code-y, FALLBACK MODE): issue #6779 fixed and merged via PR #6799 (merge be7346d); issue closed by the PR. Codex review on the PR completed with no findings.
🤖 Agent note · done
Outcome