fix: home resolution follows mined data, not a bare directory - #34
Merged
Conversation
resolve_emulo_home chose ~/.emulo whenever that directory merely existed. Emulo Pro and the release tooling both create ~/.emulo for unrelated reasons (pro/, autopilot/, release-keys/, release-builds/), so on any machine that upgraded from Ditto the miner stopped seeing the profile store and segment cache still living in ~/.ditto. Measured on a real upgraded machine before the fix: cached segments 0 (272 reports orphaned in ~/.ditto) worker calls 112 profiles 0 (59 files orphaned) After: cached segments 104 worker calls 9 A 12x cost reduction on every re-mine, and re-mining was previously running against an empty profile store. The intent in the original comment was right; the test was wrong. Decide on the presence of mined data (profiles/, cache/reports, cache/segments), not on whether someone happened to mkdir the folder. tests/test_home_resolution.py covers all five paths: fresh machine, upgraded user, the regression itself, a genuinely migrated home, and both env-var overrides. NOTE: test_release_runtime_hashes_match_canonical_repository_bytes now fails, because .agents/skills/emulo/runtime.json pins emulo.py for the v0.6.1 release and this changes those bytes. That pin controls what installs on other people's machines, so it is deliberately NOT updated here. Shipping this needs a version bump and a real release, not an edited pin. The new digest, if that release is cut, is: emulo.py e696bec245be88317a8136abb9bc03a7b36611bdbaaeffe0e226f3bec2c3dddb Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
resolve_emulo_homechose~/.emulowhenever that directory merely existed:Emulo Pro and the release tooling both create
~/.emulofor unrelated reasons(
pro/,autopilot/,release-keys/,release-builds/). The moment any ofthem run, the legacy fallback stops firing and the miner loses sight of the
profile store and segment cache still living in
~/.ditto.The intent in the original comment was right. The test was wrong: it asks whether
someone happened to
mkdirthe folder, not whether the folder holds any mineddata.
Impact, measured on a real upgraded machine
272 cached reports were orphaned. Every re-mine paid full price, and it ran
against an empty profile store, so a user could re-mine repeatedly and never
build on prior work.
Anyone who used Ditto before the rename and has anything create
~/.emuloisaffected. That includes every Pro user.
The fix
Decide on the presence of mined data (
profiles/,cache/reports,cache/segments), not on directory existence. No data is moved;EMULO_HOMEandthe legacy
DITTO_HOMEstill win outright.Tests
tests/test_home_resolution.py, 8 cases: fresh machine, upgraded user, theregression itself, a cache-only home mid-migration, a genuinely migrated home,
both env-var overrides, and the
home_holds_mined_datapredicate.Full suite: 415 passing.
🤖 Generated with Claude Code