refactor(web): test file cache identity through its public helpers - #10219
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped encapsulation refactor: the hashing behavior and production cache-key helpers remain unchanged, while the test now exercises those public helpers directly. The only production-file change removes an unused internal export, with no repository consumers or customer-facing behavior affected. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
The file-content hash was exported only for a unit test, although the file preview uses the cache-key functions that wrap it.
Keep the hash private and check same-length edits through
projectFileCacheKey. Remove the redundant identical-call assertion and retain the editor identity tests for local edits, external edits, and environment changes.Verification: all 3 focused tests pass, web typecheck passes, and focused lint/format checks pass. Runtime behavior and rendered UI are unchanged, so screenshots do not apply.
Model: gpt-6 astra. Harness: Codex in T3 Code.
Note
Make
fileContentRevisionprivate and test cache identity viaprojectFileCacheKeyfileContentRevisionin fileContentRevision.ts, making the hash helper private to its moduleprojectFileCacheKeyhelper instead of the now-private functionfileContentRevisiondirectly will no longer find the export; the hashing algorithm and revision format are unchangedMacroscope summarized 9fce39c.