feat(checkpoint): isolate dolt root + disable telemetry (loreweaver-l6n)#160
Merged
Merged
Conversation
DoltCli invocations inherited the user's global dolt home (~/.dolt via
HOME/USERPROFILE), so the checkpoint/test path read and polluted the
user's personal dolt state: it accumulated thousands of queued telemetry
files in ~/.dolt/eventsData, and dolt's event-flush goroutine made a
network call on commands like `init` — the suspected trigger for the
transient Windows 0xc0000005 init crash investigated in loreweaver-cjs,
and a likely contributor to dolt-test flakiness under parallel load.
Every dolt invocation now runs with DOLT_ROOT_PATH pointed at a
Loreweaver-owned dir under the managed cache (managedDoltRoot =
<managedDoltDir>/root), with metrics disabled via a pre-written
config_global.json in that isolated home plus DOLT_DISABLE_EVENT_FLUSH as
belt-and-suspenders. This relocates only dolt's GLOBAL home (config +
eventsData); checkpoint repos still live in the cwd passed to DoltCli and
are unaffected. Because the metrics config write lands in the isolated
root, it never mutates the user's ~/.dolt — preserving the existing
DoltCli "never mutate the user's global dolt config" invariant.
Verified: a full Dolt-gated suite run leaves the user's ~/.dolt untouched
({} config, 0 events) while the managed root carries metrics.disabled and
accumulates 0 events.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…very call
Review follow-up on loreweaver-l6n: ensureDoltRoot() only wrote
config_global.json when it did not already exist, so an isolated config
that existed but lacked "metrics.disabled" left telemetry enabled.
Now every call reads the managed config_global.json, sets
"metrics.disabled":"true" (preserving any existing keys), and rewrites it.
Missing/empty file is treated as {}; a present-but-invalid (non-object)
JSON file FAILS FAST with DoltConfigError rather than silently
overwriting unrelated data or proceeding with telemetry on. Ordinary fs
failures stay best-effort so a dolt call is never broken by setup.
Still scoped to managed dolt root / telemetry isolation: no change to
checkpoint repo storage, DOLT_DISABLE_EVENT_FLUSH retained, and the
user's ~/.dolt is never read or written.
Adds 5 ensureDoltRoot unit tests (create, merge-preserving-keys, empty,
invalid-JSON, non-object-JSON).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
DoltCliinvocations inherited the user's global dolt home (~/.doltviaHOME/USERPROFILE), so the checkpoint/test path both read and polluted the user's personal dolt state:~/.dolt/eventsData, andinit— the suspected trigger for the transient Windows0xc0000005init crash investigated in loreweaver-cjs, and a likely contributor to dolt-test flakiness under parallel load.This PR makes every dolt invocation hermetic:
DOLT_ROOT_PATHnow points at a Loreweaver-owned dir under the managed cache (managedDoltRoot = <managedDoltDir>/root).config_global.json({"metrics.disabled":"true"}) in that isolated home, plusDOLT_DISABLE_EVENT_FLUSH=trueas belt-and-suspenders.DOLT_ROOT_PATHrelocates only dolt's global home (config +eventsData); checkpoint repos still live in the cwd passed toDoltCliand are unaffected. Because the metrics config write lands in the isolated root, it never mutates the user's~/.dolt— preserving the existingDoltCli"never mutate the user's global dolt config" invariant.Why this is acceptable (tradeoffs)
--local, explicit--name/--email) and uses no remotes/credentials. The only (hypothetical) cost is a future feature wanting to reuse a user's DoltHub login/remotes.Verification
npm run check✅ ·npm test✅ (1228 passed | 3 skipped — documented integration skips)~/.doltuntouched ({}config, 0 events) while the managed root carriesmetrics.disabledand accumulates 0 events.managedDoltRootprecedence (pure) + a Dolt-gated integration guard asserting isolation (config written in isolated home, no event backlog).Closes loreweaver-l6n. Follow-up from loreweaver-cjs.
🤖 Generated with Claude Code