Skip to content

feat(checkpoint): isolate dolt root + disable telemetry (loreweaver-l6n)#160

Merged
jbongaarts merged 2 commits into
mainfrom
feat/loreweaver-l6n-dolt-root-isolation
Jun 6, 2026
Merged

feat(checkpoint): isolate dolt root + disable telemetry (loreweaver-l6n)#160
jbongaarts merged 2 commits into
mainfrom
feat/loreweaver-l6n-dolt-root-isolation

Conversation

@jbongaarts
Copy link
Copy Markdown
Owner

Summary

DoltCli invocations inherited the user's global dolt home (~/.dolt via HOME/USERPROFILE), so the checkpoint/test path both read and polluted the user's personal dolt state:

  • thousands of queued telemetry files accumulated 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.

This PR makes every dolt invocation hermetic:

  • DOLT_ROOT_PATH now points at a Loreweaver-owned dir under the managed cache (managedDoltRoot = <managedDoltDir>/root).
  • Telemetry is disabled via a pre-written config_global.json ({"metrics.disabled":"true"}) in that isolated home, plus DOLT_DISABLE_EVENT_FLUSH=true as belt-and-suspenders.

DOLT_ROOT_PATH 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.

Why this is acceptable (tradeoffs)

  • Moving the root gives up only that loreweaver-invoked dolt no longer reads the user's personal global config/credentials. Safe here: the checkpoint path already sets identity per-repo (--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.
  • Disabling metrics loses no local functionality (metrics are pure outbound telemetry, separate from the version-update check). DoltHub just stops receiving events from loreweaver's automated invocations — arguably more correct.

Verification

  • npm run check ✅ · npm test ✅ (1228 passed | 3 skipped — documented integration skips)
  • Empirical: 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.
  • New tests: managedDoltRoot precedence (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

Joseph Bongaarts and others added 2 commits June 5, 2026 23:09
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>
@jbongaarts jbongaarts merged commit 9ca5ab3 into main Jun 6, 2026
11 checks passed
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