Skip to content

fix(cli): the web build fingerprint hashes file content, so an identical rewrite keeps the cache - #575

Merged
arrzdev merged 1 commit into
mainfrom
fix/web-fingerprint-content
Nov 17, 2026
Merged

arrzdev merged 1 commit into
mainfrom
fix/web-fingerprint-content

Conversation

@arrzdev

@arrzdev arrzdev commented Nov 17, 2026

Copy link
Copy Markdown
Owner

fingerprint(), the web build cache key used by run/build, hashed each file's path + size + mtime. A step that rewrites a file with identical bytes gives it a fresh mtime, so the cache was thrown away for nothing. nativeFingerprint() already hashes content for exactly this reason (generateAssets re-stamps byte-identical files, and an mtime hash there never hit).

This switches fingerprint() to path + content. The walk, SKIP_DIRS (.output included) and SKIP_FILES are unchanged. The measured cost (2026-09-02, playground app, 422 files / 11.0 MB) is 11.3 ms by content against 3.0 ms by mtime, in a 29 s build. CLI output does not change.

docs/roadmap/dev-loop-debt.md drops §B into its "discharged" table, and the roadmap README count moves from four items to three. The old suggested-order note tied §B to the "framework-only change reports ✓ web build · cached" bug in docs/DEVELOPMENT.md. This change does not fix that bug: neither fingerprint hashes framework source. The note now sits under "Known-unfixed" with that explanation.

Reproduce:

  1. On main, fingerprint an app tree, rewrite one source file with the same bytes and a later mtime, then fingerprint again. The hash changes.
  2. The new test below does exactly this and fails on main.

Verify:

  • npx vitest run bin/lib/fingerprint.test.mjs. On main without the fix: 1 failed | 12 passed. Fails on fingerprint — did anything the web bundle is built FROM change? > holds when a step rewrites a file with identical bytes and a fresh mtime — what it contains, not when it was touched. With the fix: 13 passed.
  • pnpm gate: exit 0. Biome checked 739 + 403 files with no fixes. Test Files 344 passed | 1 skipped (345), Tests 5108 passed | 17 skipped (5125). publint, attw and the dist checks passed.

Tested on: Linux (WSL2), Node 22, unit suite + full gate.
Not tested: a real adaptv build ios/run cache hit on a device. Only the hash function changes, and the existing callers compare it as before.

@arrzdev
arrzdev marked this pull request as ready for review November 17, 2026 07:42
@arrzdev
arrzdev merged commit 373378c into main Nov 17, 2026
6 checks passed
@arrzdev
arrzdev deleted the fix/web-fingerprint-content branch November 17, 2026 07:46
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