Repository navigation
Conversation
4c79c88 to
091d64e
Compare
|
Adversarial review before this leaves draft: three rounds under each of two models (six in all), each round with a fresh context in a throwaway worktree of the branch, the diff against the #6521 commit it is stacked on, the body, and the prior rounds' dispositions. Findings: 45 in total (2 blocker, 22 major, the rest minor or question). 44 accepted and fixed on the branch (four of them by withdrawing an |
091d64e to
6dc0dd4
Compare
|
Adversarial review of this push, on the delta since Findings: 32 in total, 0 blocker, 3 major, the rest minor or question. 30 accepted and fixed on the branch; 1 reported as pre-existing on Verification on this head: the pure |
6dc0dd4 to
cccbd8b
Compare
|
Adversarial review of this push, on the delta since Findings: 22 distinct across the six rounds (the two models overlapped on five), 1 blocker, 6 major, the rest minor or question; 21 accepted and fixed on the branch, 1 rejected with the reason below. What the rounds drove: the seven new Go files are listed in the Bazel manifests Verification on this head: the pure |
cccbd8b to
810c3af
Compare
|
Audit of the push from Base. New third commit, What it does: for a store without Rounds on the third commit, five in all across two models, and what they changed:
Verification on |
|
Out of draft. @bee-ghosttrack: this is rebased onto |
bee-ghosttrack
left a comment
There was a problem hiding this comment.
Reviewed at 810c3af190 (merge-base 2704d8a954; main is 15 commits further at bcf4da3c65 and merge-tree is clean, the four overlapping files being additive on different keys). The ref-blind reset-data from #6521 is closed the way the out-of-draft note says, and the third commit's ordering holds under mutation. One thing to fix before this stands on its own, one small one, and notes.
Ran here (go1.27.1, dolt 2.3.5), all ok unless noted: go build ./...; go vet -tags gms_pure_go on cmd/bd and internal/config; CGO_ENABLED=0 go test -tags gms_pure_go -c ./cmd/bd/; python3 tools/bazel/go_srcs.py --check; gofmt on the 30 changed Go files; the body's 31-group -run on ./cmd/bd/ (148 PASS, 0 FAIL, 0 SKIP); go test ./internal/config/; BEADS_TEST_EMBEDDED_DOLT=1 -run TestEmbeddedGitDataRef on the real engine with the dolt CLI on PATH (4 PASS, 102s, no skip, so the planted-violation case ran). golangci-lint did not run here (the local v2.12.2 binary is built with go1.26 and panics on go1.27 sources); CI's Lint is the authority for that.
Mutations, each in a scratch worktree, reverted:
CommitPendinghunk removed:TestResetDataOrderembedded cases FAIL (calls = [push];returned <nil>), server cases PASS. Exactly the claim.- Commit moved after the remote delete: "embedded commit failure leaves the remote's ref in place" FAILS (
refs/dolt/units/order changed … -> ""). - Post-prompt server recheck dropped: both server cases FAIL.
lsRemoteDoltDataRefshanded""instead of the recorded ref:TestEmbeddedGitDataRefRemoteAddPushesToRefAndBootstrapReadsItFAILS ondeleted_refs([refs/heads/__dolt_remote_info__], want the data ref). WithoutBEADS_TEST_EMBEDDED_DOLT=1that pin SKIPs; CI sets it inmain.ymlandpr-risk.yml, so it is run.
1. MAJOR, please fix — the default-branch / existing-ref guard covers two of the four paths that create origin on the configured ref
guardGitDataRefTarget is called from dolt.go:484 (push-time adoption) and dolt.go:1842 (remote add). Two more paths wire origin on sync.remote-ref with no probe in front of them:
config_apply.go:367-368: a fresh origin takessyncRemoteRefForURL(federationRemote)and callsAddRemoteWithRefdirectly. The comment above it says it "follows sync.remote-ref like every other path that creates one (init, bootstrap, push-time adoption)" — but init and bootstrap only wire a remote after their probe found the ref absent, and adoption runs the guard; apply has neither.init_proxied_server.go:425:CreateRemoteWithRef(ctx, "origin", routed, syncRemoteRefForURL(routed)), same.
ValidateGitDataRef is format-only, so bd config set sync.remote-ref refs/heads/main is accepted. Commit that, then bd config apply on federation drift (or a proxied bd init) wires origin on the forge's default branch, and the next bd dolt push does not adopt (origin exists), so the guard never runs; by the help text's own words the push replaces the branch tip with Dolt storage. The guard's non-terminal branch already errors instead of prompting, so running it on these two paths fails closed without a UX change; if you would rather apply never prompt at all, pass a confirm that returns false. A test like TestEnsureDoltRemoteGuardedRunsGuardOnWritesOnly for each would pin it.
2. MINOR, please fix — the guard and the adoption warning print the raw URL
git_data_ref_target.go:67, 71, 77 and dolt.go:496 format url / remoteURL as given. The adoption path's URL is the git origin, which can carry https://x-access-token:<tok>@…. This PR's own redactRemoteURL (sync_remote.go:294, used 16 times in bootstrap.go and in init.go's ref branch) is the convention; these four sites and init.go:3386's no-ref branch miss it.
Notes, not asks
- Windows drive letters.
isGitBackedDoltRemoteURL(sync_remote.go:139-143) returns from the colon branch for any URL with a colon past position 0, soC:\repo\data.gitis false (hostChas no dot or@) and never reaches the local-path rule below. The comment says the drive letter must not be mistaken for a host, which is right, but the branch returns false there instead of falling through. If dolt'slooksLikeLocalPathaccepts that form, bd refuses--refon a remote dolt treats as git-backed, and bootstrap drops a committed key with a warning. Worth one Windows-shaped case inTestIsGitBackedDoltRemoteURL. gitDoltInfoRef(dolt_remote_reset_data.go:27) is the literalrefs/heads/__dolt_remote_info__, while the PR adds the env-awareconfig.DoltRemoteInfoRef()and uses it for validation only. Under aDOLT_REMOTE_INFO_BRANCHoverride reset-data deletes the wrong marker ref; harmless in the normal case (dolt's marker push is best-effort), and the validator already refuses the override's branch as a data ref, so this is consistency, not safety.- URL-first argument injection into
git ls-remotepredates this PR and the new probe does not add a-refusal on the URL (the ref side is covered:refs/prefix required,ValidateGitDataRefArgrefuses a leading dash). The URL comes from the command line or.git/config, not committed config, so hardening only; a one-line refusal would match the ref side. replaceOriginRemote(config_apply.go:273) keepscurrent.Refwhile the add path takes the configured key, so a ref-only change in committed config is never "drifted". Defensible, and the two paths differ; the_ =on the restore-after-failed-add is pre-existing.remote add originwithout--refresolves through the merged reader, so a user-globalsync.remote-reflands in the committed workspaceconfig.yaml, and beside a non-git URL it refuses rather than drops with a warning. The body's "dropped with a warning" is bootstrap/init only; fine, just narrower than stated.- Proxied init now stores
proxiedInitDoltRemoteURL(remoteURL)(a forge URL without.gitbecomes itsgit+form), pinned byTestProxiedInitDoltRemoteURL. That is a routing change beyond the ref and belongs in the body. - The probe-then-add window is inherent and the probe is advisory; nothing to do.
Everything else I checked holds as described: argument-phase validation on both commands before storage opens, the sync.Once warning on a malformed committed value, the explicit-ref refusal and configured-ref drop on non-git URLs, no guard on a no-op re-add, reset-data reading r.Ref from ListRemotes through the shared decoder with a non-string git_ref erroring and persistedRemoteInfosFor never consulted, parseDoltDataRefs keeping exact matches only, the reader order (env, local, workspace in both spellings, merged) with workspace winning over user-global, the key surviving remote remove, the ref cleared on refuse plans, and //go:build cgo on the new helper-dependent test files.
Requesting changes on 1; 2 while you are there. Happy to re-read the delta.
810c3af to
3ce1096
Compare
|
Audit of the push from Base. New fourth commit,
One more thing the rounds found that the review did not name: Rounds, three under each of two models on the delta, each a fresh context in a throwaway worktree with the full diff against Verification on @bee-ghosttrack: the delta since |
bee-ghosttrack
left a comment
There was a problem hiding this comment.
Re-read at 3ce1096f68 (merge-base d652def9db; main is 1 commit further at 8d7d7fef16, the RBE worker-env pin, no file in common). The two items from 2026-10-01 are closed, the four paths are behind one guard, and the guard's own fail-open gap is shut. Approving.
The rebase. git range-diff from 810c3af190: commit 2 is patch-identical; commit 1 differs only by the four embedded-cmd-test-shards.txt rows and the two-value config.UnsetYamlConfig in bootstrap.go; commit 3 only by its CHANGELOG line. Exactly the three hand merges the push note names.
Ran here (go1.27.1, dolt 2.3.5), all ok: gofmt on the branch's Go files; go build ./...; go vet -tags gms_pure_go on cmd/bd and internal/config, and again GOOS=windows CGO_ENABLED=0; CGO_ENABLED=0 go test -tags gms_pure_go -c ./cmd/bd/; python3 tools/bazel/go_srcs.py --check; git diff --check; the body's -run set plus TestGuardGitDataRefTarget|TestProbeGitDataRefTarget|TestReplaceOriginRemote|TestDryRunRemoteApply|TestRedactRemoteURL (24 PASS, 0 SKIP); go test ./internal/config/; BEADS_TEST_EMBEDDED_DOLT=1 -run TestEmbeddedGitDataRef on the real engine (4 PASS, 190s, no skip; the new bd init refuses the key on the origin's default branch case ran under both ref shapes); scripts/ci/gen_embedded_cmd_shard_manifest.py --check 50 passes on this head and on main alike; the 31 changed Go files are each listed in their BUILD.bazel. golangci-lint did not run here (same toolchain mismatch as last time); the Bazel lanes on this head are the authority for nogo and gazelle, and at the time of writing Bazel / execution mode, dolt-server lane and integration are green with the six Dolt tiers still running on the fork pool.
Mutations, each in a scratch worktree on this head, reverted, each caught by the test the body names for it:
addOriginRemotetakessyncRemoteRefForURLwithout the guard →TestOriginPathsWithoutPromptRunGuardfails on therefs/heads/mainadd.guardGitDataRefTargetadmits a failed probe without a terminal (the old branch) →TestGuardGitDataRefTargetfails at theyes=falserefusal.redactRemoteURLreturns a scheme-less URL raw →TestRedactRemoteURLfails on both token cases.guardInitDoltRemoteRefpassesfalsefor the consent on the unattended path →TestGuardInitDoltRemoteReffails at "a consented divergence takes the existing ref"; passingtruefails at "an existing ref must not be wired without a prompt". Both arms pinned.- The colon branch of
isGitBackedDoltRemoteURLreturns false past the scp check →TestIsGitBackedDoltRemoteURLfails on/srv/le:dgers.git,./le:dgers.git,C:/repo/data.git. replaceOriginRefskips the guard →TestReplaceOriginRemote's new case andTestDryRunRemoteApply's "move onto the default branch" both fail.createProxiedOriginRemotebypasses the guard →TestOriginPathsWithoutPromptRunGuardfails on the proxiedrefs/heads/maincreate.gitRemoteURLForLsRemoteleaves a scheme-less host/path alone →TestGitRemoteURLForLsRemotefails, andTestProbeGitDataRefTargetshows the mechanism:ssh: Could not resolve hostname reviewhost, git readingreviewhost:1234/code.gitas scp.doltInfoRefreturns the old literal →TestDoltInfoRefFollowsOverridefails on the override and on the disabled marker.- The
bd initcall site wires origin unconditionally (the guard call replaced bytrue) → the embeddedbd init refuses the key on the origin's default branchcase fails under both ref shapes: no refusal on stderr andoriginconfigured onrefs/heads/main. So the end-to-end pin reaches the call site, not only the helper.
I also read dolt'sNormalizeGitRemoteUrl,isScpLikeGitRemoteandlooksLikeLocalPathin the pinned module:isScpLikeForDoltandlooksLikeLocalPathForDoltare faithful mirrors, and the colon branch'surl.Parse("git+https://"+url)is the same fallthrough dolt takes, sohost:org/repo.git(non-numeric port) is "not git-backed" here where dolt errors, andC:/repo/data.gitis git+https on every non-Windows platform for both.
Point by point against the review: 1 (the two unguarded paths) is wider than I asked and closed on all four, with the dry run reporting the refusal it would make; the failed-probe fail-open was a real third gap and is the right call. 2 (raw URLs) covered at the four sites, init.go's no-ref line, the wrapped probe error, and the scheme-less userinfo form; spelling the result https:// is correct, since the userinfo was what kept host.example:443 from reading as scp. Windows drive letters, gitDoltInfoRef, -- on the URL, replaceOriginRemote keeping current.Ref (and now guarding against the new repository): all as described.
Two notes, not asks. (a) bd config apply on a URL change, and on a fresh origin, now returns an error result where the branch exists on the target or the probe fails, with the re-add as the way out; the previous behaviour wired origin silently, so this is the intended side of the trade, but it is a visible change for federation flows that moved a repository and already pushed the ref there, and the CHANGELOG line covers it. (b) The remedies call doltRemoteMatchesGitOrigin, which reads the git origin; they are built on a refusal only, as the body says, so the probe stays the only network read on the happy path.
3ce1096 to
930b655
Compare
|
Rebased onto Before the rebase I read the base's CI on The fifth commit, Rebase conflicts: one, Gates on The body still names |
bee-ghosttrack
left a comment
There was a problem hiding this comment.
Re-read at 930b655d8 after the rebase; the approval at 3ce1096f6 carries over to this head.
The four reviewed commits. git range-diff d652def9d..3ce1096f6 77ab98079..9ca0bfd8d: commits 2, 3 and 4 are =; commit 1 differs only in .github/scripts/embedded-cmd-test-shards.txt (the shard-15 line main added beside yours, both kept), as your comment says. gen_embedded_cmd_shard_manifest.py --check 50 exits 0 at 930b655d8, exact-once coverage; a main-side control exits 0 too.
The fifth commit is one line in cmd/bd/bootstrap.go: the wrapper resolves through resolveSyncRemoteRefIn(beadsDir), which reads the env var, then config.WorkspaceYamlValueStrictWithLocal (plain os.ReadFile of the two YAML files under beadsDir), then the merged configuration. Nothing on that path reaches beads.FindBeadsDir or the git context cache. main's wrapper never resolved a ref, so the regression was this branch's alone, as you read it.
Both-SHA probe of the claim, since your probe test was not committed: a zz_probe_test.go declared after the worktree test, chdir into a fresh t.TempDir(), assert git.IsWorktree() is false; run as go test ./cmd/bd -count=1 -run 'TestDetectBootstrapAction_WorktreeSynthesizedDirPrefersSyncOverDefaultSharedDB$|TestZZProbeGitContextClean$' under GOTOOLCHAIN=go1.26.7.
9ca0bfd8d(the four reviewed commits): worktree test PASS, probe FAIL —IsWorktree() true from fresh dir, the context primed by the previous test.930b655d8: both PASS.
Merge gate. At 20:55Z the Bazel tiers on 930b655d8 were still in progress (cmd/bd Dolt-server, embedded Dolt, proxied-server, server-Dolt storage, pure-Go and js/wasm, integration, test); dolt-server lane, execution mode and both Package Gates are green. The cmd/bd Dolt-server tier is the one that showed the shard-5 failure on the previous head, so that is the result that closes this out; I will read it when it lands.
930b655 to
b1c84c1
Compare
|
Rebased onto One conflict, One line changed beyond the rebase: Gates on One observation from the review, left alone because changing it is not a rebase: |
bee-ghosttrack
left a comment
There was a problem hiding this comment.
Rebase read at b1c84c1 (force-push over my approval at 930b655), on a probe worktree at a printed HEAD, 0 dirty.
- Merge base moved 77ab980 → d4ca893 (current main).
git range-difftwo-range form: commits 2–5 are=; only commit 1 differs. - Net-patch interdiff (manifest and CHANGELOG context excluded) has exactly two content deltas: the four new
TestEmbeddedGitDataRef*manifest rows moved from the retired 50-shard block into main's 100-shard block (shards 61–64), andgit_data_ref_target_test.gonow calls the package's existinggitCommand(args...)helper (cmd/bd/helpers_test.go:74) instead of a rawexec.Command("git", …). Everything else is hunk-offset drift. gen_embedded_cmd_shard_manifest.py --checkrc 0 at the live 100-shard count (heaviest shard 156.7s).go vet ./cmd/bdok at the new head (tests compile); the four new tests by name underBEADS_TEST_EMBEDDED_DOLT=1: all four PASS (97s), HEAD b1c84c1, 0 dirty.
The approval stands on this head.
|
Maintainer note (bee): mergeStateStatus is DIRTY again since main moved past your 00:14Z rebase (#7553, #7554, #7552 landed; main 70887e7). Local probe at b1c84c1: |
…-ref Dolt takes the git ref a git-backed remote keeps its data on as a remote parameter (--ref on dolt remote add, dolt clone, DOLT_REMOTE, and DOLT_CLONE); the storage layer passes it through since the previous commit, and this commit exposes it. Two uses: a git host that only accepts pushes under refs/heads/, and one repository holding one Dolt database per unit of work on refs such as refs/dolt/units/<key>. Fixes gastownhall#6261. - bd dolt remote add --ref <ref>: a full ref only (refs/...), refused for a URL that is not git-backed before dolt sees it. For origin the ref is written to .beads/config.yaml as sync.remote-ref, read back when origin is re-added without --ref, and cleared by --ref refs/dolt/data or bd config unset. - A ref change replaces the remote only after confirmation; without a terminal it is refused with both refs named unless --yes is given. - bd bootstrap --ref overrides the key; the plan carries and prints the ref, all three clone modes pass it through, the probe of a git sync.remote or of the git origin looks at that ref, a fresh database created when the ref holds no data yet is wired to origin on it with the key persisted (config.yaml created first, and sync.remote written beside the key, when the remote came from the environment; both are written before origin is wired, and a failure names the remote add that finishes the job), and the ref is persisted beside sync.remote after a clone. An explicit default --ref clears the key on every plan. - bd init reads the key for its clone and for the origin it configures, including proxied-server mode; the ref is decided against the routed (git+) form of the URL; the proxied path stores that form for a URL dolt would not read as git-backed as written and leaves the rest, the scp form among them, as written; the stale-key hint on bd config set sync.remote judges the routed form too. - bd dolt remote list shows the ref; bd dolt remote reset-data rebuilds the configured ref and deletes only that ref and the info ref. - Docs: both commands' help, the configuration reference, a section in sync-setup for both uses, and a CHANGELOG entry. - cmd/bd/BUILD.bazel and internal/config/BUILD.bazel list the new files; no new dependency. - The ref that applies to a workspace is resolved in the order the configuration layers merge (BD_SYNC_REMOTE_REF, config.local.yaml, the workspace config.yaml in either spelling, then the user-global file), reading the workspace files directly so a committed empty value pins the default over a user-global ref; bd context, bd config get, and push-time adoption report and use that same value.
reset-data already reads the ref of a git-backed remote from the remote record and deletes only that ref and the info ref, but the confirmation prompt, the refusal without a terminal, and the JSON result named the URL alone. One repository can hold several databases on their own refs, and there the URL does not say which database is about to be replaced. - The prompt and the non-interactive refusal name the URL and the ref (resetDataTarget); a remote that is not git-backed has no ref and is named by its URL as before. - The JSON result gains ref as bd dolt remote add --json reports it: the recorded ref in canonical form when it is not the default, no key otherwise. bd dolt remote list --json shows the same for every remote bd created, since bd canonicalizes before recording; a remote added through dolt itself with an explicit --ref refs/dolt/data lists verbatim. The refs deleted, the default among them, stay in deleted_refs. - TestResetDataTargetNamesTheRef covers both ref shapes, the default in both spellings, and the three non-git kinds; the end-to-end test runs reset-data without --yes and without a terminal first and checks the refusal names the ref and leaves it in place, then decodes the --json result and checks ref and that deleted_refs holds the remote's ref and never refs/dolt/data.
…emote Since gastownhall#5795 every Push variant of the embedded store commits pending working-set changes before it pushes. reset-data deletes the remote's data ref (or clears the file store) and then pushes, so a commit that fails at that point, a constraint violation in the working set for one, left the remote without its data ref and the user with the "re-run bd dolt push --force" hint and a remote no clone can bootstrap from. This holds for the default ref on main today, not only for a custom one. For a store with a private working set (embedded), commit pending changes after the confirmation and before anything on the remote is removed: a failing commit now returns with the remote as it was and a hint naming bd dolt commit. For a store that reports pending changes (server mode, where the working set is shared), keep refusing while anything is uncommitted, and check again after the confirmation: another session can write while the prompt waits, and committing here would publish that session's unfinished work. The prompt's sentence about pending changes follows the store mode, and the help text names both behaviors instead of promising a refusal the embedded store never made (its detector has been server-only from the start). TestResetDataOrder drives the command with a fake store and a real bare git remote: embedded commits before it pushes and a failing commit leaves the planted ref and never pushes; server mode checks twice around the prompt, refuses a working set dirtied between the checks, and never commits. The end-to-end test leaves a row in the working set (auto-commit off) before the reset and reads it back from the workspace bootstrapped from the ref; with the dolt CLI on PATH it also plants a foreign-key violation (checks off, recorded by `dolt constraints verify`, which is what makes DOLT_COMMIT refuse) and asserts the reset fails on the commit with the remote's ref unchanged.
…redact URLs guardGitDataRefTarget ran on bd dolt remote add and on push-time adoption, but the other paths that create origin on sync.remote-ref had no probe in front of them: bd config apply adding a fresh origin on federation drift or moving it to a new URL, proxied bd init, and direct bd init whenever it wires a fresh database to the remote instead of bootstrapping from it (the origin probe reports a branch holding source as found, and the clone of it is what reports no data). And the guard itself admitted the ref when the probe failed, before any terminal or yes check, so a setup script's remote add and a CI push with --yes could wire the default branch of a repository they could not read. ValidateGitDataRef is format-only, so a committed refs/heads/main reached each of them, origin was wired on the forge's default branch, and the next push did not adopt (origin existed), so the guard never ran and the push would have replaced the branch tip with Dolt storage. - guardGitDataRefTarget treats a failed probe as a refusal without a terminal, yes or not, since yes cannot vouch for a default branch and nobody reads the warning on an unattended run; with a terminal it warns and goes on as before. - refuseGitDataRefTarget is the guard for a path that cannot ask: the default branch, an existing ref, and a ref the probe cannot read are all refusals, each naming the calling path's remedy (gitDataRefRemedy: how to take an existing ref on purpose, how to move to a free one). The remedies paste into a shell as one command, URL and ref quoted and the URL credential-free: bd dolt remote add origin ... --ref ... --yes (with --allow-git-origin when the URL is the git origin) where the workspace owns its store; bd sql with a DOLT_REMOTE call over a proxied server, where remote add is refused; a re-add of origin for a move by bd config apply, whose ref comes from the remote record rather than the key. bd config apply runs it on a fresh origin (addOriginRemote), on a URL change (replaceOriginRef, against the new repository, since the ref was admitted against the old one), and in the dry run (dryRunRemoteApply), which reports the refusal the live run would make as an error result instead of promising an add; proxied bd init runs it in createProxiedOriginRemote; direct bd init asks in interactive mode with a terminal (the resolved non-interactive value, so BD_NON_INTERACTIVE and CI count), refuses otherwise, takes an existing ref without asking when the user authorized the divergence (destroy token or typed confirmation; the default branch stays refused, and so does a ref the probe cannot read whenever nobody is watching, a pty under --non-interactive included), and in every case leaves origin unconfigured, names the bd dolt remote add origin that finishes the job, and goes on, as it does when the add itself fails: init does not run twice, and the next push adopts the git origin rather than sync.remote, the right remote only when the two are the same repository, so the remedy is the add and never the key alone. The remedies are built on a refusal only, since building one reads the git origin. Pinned by TestGuardGitDataRefTarget (the failed probe), TestGuardedSyncRemoteRef, TestGuardInitDoltRemoteRef, TestOriginPathsWithoutPromptRunGuard, TestReplaceOriginRemote, TestDryRunRemoteApply, and an end-to-end case where bd init with the key on the origin's default branch initializes, says why origin is not wired, and leaves the branch tip as it was. - The guard's messages, the probe's own error (git's first stderr line, credential-scrubbed, through gitLsRemoteProbeError), the adoption warning and the adoption announcement under --yes, init's no-ref confirmation and its probe-failure note print the URL through redactRemoteURL, which now also drops the userinfo of a scheme-less user:token@host/repo.git, a form dolt reads as https: the adoption URL is the git origin, which CI configures with a token in its userinfo. The result is spelled https://, since the userinfo was what kept a dotted host before the first colon (host.example:443/repo.git) from reading as an scp address, for dolt and git alike, and bootstrap persists the redacted URL into sync.remote and the remedies paste it. - isGitBackedDoltRemoteURL falls through from a colon that makes no scp host to the path rules, as dolt's NormalizeGitRemoteUrl does, so a Windows drive-letter or UNC path ending in .git is git-backed on Windows and /srv/le:dgers.git is on every platform; before, the colon branch returned false there and bd refused --ref on a remote dolt treats as git-backed. TestIsGitBackedDoltRemoteURL carries the cases by GOOS; the Windows lanes build and smoke-test rather than run this package, so the Windows expectations are by reading filepath.IsAbs. - gitRemoteURLForLsRemote gives a scheme-less host/path ending in .git the https:// dolt gives it, so a probe reads the repository dolt will push to; git alone reads host:1234/repo.git as an scp address, and a probe of the wrong endpoint failed and, on the interactive path, warned and admitted the ref. A git remote name such as origin is left alone, as is everything git reads already. - reset-data deletes the info ref dolt publishes under the DOLT_REMOTE_INFO_BRANCH override, not the literal default, and none when an empty override disables the marker, since the default name is then an ordinary branch that may hold data; TestDoltInfoRefFollowsOverride. The local pin of that name is gone; TestResetDataRefNamesMatchDolt checks config's against dolt's. - The probes' and reset-data's git ls-remote and git push take the URL after --, so a URL can never read as an option, matching the leading dash refusal on the ref side. - The CHANGELOG entry says where the guard refuses.
…e directory it plans detectBootstrapAction(beadsDir, cfg), the wrapper every planning test calls, resolved the ref with resolveSyncRemoteRef, which rediscovers the workspace from the working directory through beads.FindBeadsDir. The command path never used it (bd bootstrap resolves the ref once and calls detectBootstrapActionForRef), so in production the two directories were the same, but the discovery reads the process-wide git context, and a test that plans from inside a worktree fixture left that context primed with the fixture's common dir after the fixture was removed. The cmd/bd Dolt-server tier showed it on this branch: rules_go assigns tests to shards by declaration index, the new test functions moved TestCLI_Import into the shard right after TestDetectBootstrapAction_WorktreeSynthesizedDirPrefersSyncOverDefaultSharedDB, and its in-process bd init read IsWorktree()=true with a common dir under a cleaned-up TempDir, so the workspace gate's parent did not exist and init refused. On main the same pair leaves no context behind; on every commit of this branch it did. - The wrapper resolves the ref with resolveSyncRemoteRefIn(beadsDir): the environment, the local layer, the workspace file, then the merged configuration, for the directory it was handed, the merged layer being the process's. Nothing on the path touches the git cache any more, and a caller that plans a directory other than the one discovery would find reads that directory's key. - Verified with a probe test (not committed) that chdirs into a fresh temp dir after the worktree test and asserts IsWorktree() is false: fails on each of the four earlier commits, passes with this one and on main; the body's -run set passes.
b1c84c1 to
d3dd0bc
Compare
|
Rebased onto One conflict, Range-diff against Gates on |
bee-ghosttrack
left a comment
There was a problem hiding this comment.
Incremental re-review of the rebase b1c84c1f5 → d3dd0bc43 (onto ce70b261c), read as a range-diff against my 10-14 approval rather than as a fresh pass.
Patch identity. git range-diff <oldbase>..b1c84c1f5 ce70b261c..d3dd0bc43: commits 2–5 are =; commit 1 is ! and the interdiff is exactly the four TestEmbeddedGitDataRef* rows of .github/scripts/embedded-cmd-test-shards.txt moving from shards 61–64 to 56–59. Same file set on both sides of commit 1; nothing else moved. That matches the description.
Conflict resolution. scripts/ci/gen_embedded_cmd_shard_manifest.py 100 --weights=duration --check exits 0 on d3dd0bc43; the manifest diff against main is the four added rows and nothing else.
Behaviour on the new base. BEADS_TEST_EMBEDDED_DOLT=1 go test ./cmd/bd/ -run TestEmbeddedGitDataRef -count=1 -v: 4/4 PASS, 0 SKIP (129s) — so the ref-following bootstrap paths are fine over #6943's migration 0070 / write fence.
go test ./scripts/ -v -count=1: 294 pass / 11 skip / 1 fail. The one failure, TestPRRunsGoTestsBazelSkips, wants stdversion in tools/nogo/analyzers.bzl VET_PASSES; it fails identically on origin/main ce70b261c and this PR touches neither the list nor the test — it is my local go1.27.1 (go.mod toolchain is 1.26.7) adding stdversion to go test's vet set, not this change. Noting it here so nobody re-derives it; it belongs in a separate main fix.
Approving again on d3dd0bc43.
|
Adding a use case this unblocks. We want to run #6521 already carries the ref in storage, but without this PR there's no CLI path to point the remote at a branch. Would be great to see this land. |
|
@bee-ghosttrack @sdghbtn any chance this could get merged soon? It's already approved, just needs a rebase again. We'd really like to use bd from Claude Code cloud agents and this is the only thing blocking writes there. Happy to test once it's rebased. |
|
Status from my side (bee, 2026-11-05): my approval stands at the current head |
What
The command layer for the storage primitives of #6521: a git-backed Dolt remote can be added, bootstrapped, listed, and reset on a git ref other than
refs/dolt/data.bd dolt remote add <name> <url> --ref <ref>. Only a full, well-formed ref name is accepted: git's check-ref-format rules (so norefs/heads/*pattern that a latergit ls-remotewould expand), and not dolt's effective remote info branch (refs/heads/plus__dolt_remote_info__or whateverDOLT_REMOTE_INFO_BRANCHnames; dolt adds that prefix unconditionally), which dolt overwrites after every push. A bare branch name, a typo such asref/heads/x, or an empty value is an error naming the rule, checked in cobra's argument phase, before the root pre-run opens any storage. The same rules run inbd config set sync.remote-ref(config.ValidateGitDataRef), and a hand-edited committed value that fails them is ignored with one warning instead of reaching dolt or git. A ref on a URL dolt does not treat as git-backed is refused by bd before dolt sees it, naming the rule and the remedy; git-backed follows dolt's ownNormalizeGitRemoteUrl: agit+scheme, or afile/http/https/sshURL, an scp-stylehost:path, or an absolute local path ending in.git. A ref underrefs/heads/orrefs/tags/is checked against the repository with onegit ls-remote --symrefbefore the remote is created or replaced, never on a re-add that changes nothing: the repository's default branch is refused outright, and a ref that already exists is taken only with--yesor a confirmed prompt, because dolt's first push replaces the ref's tip with Dolt storage. A probe that fails says nothing about the ref, the default branch included, so with a terminal it warns and does not block, and without one it is a refusal,--yesor not, since nobody reads the warning on an unattended run. The same guard runs on every path that creates or movesoriginon the configured ref without having proved what the ref holds (bd bootstrapwires a remote only after its probe found the ref absent or a clone proved Dolt data on it, so it needs none): whenbd dolt pushadopts the git origin (a prompt with a terminal, as onremote add); whenbd config applyadds a fresh origin on federation drift or moves it to a new URL (checked against the new repository, since the ref was admitted against the old one), and in its dry run, which reports the refusal the live run would make; when proxiedbd initconfigures origin; and whenever directbd initwires a fresh database to the configured remote on the ref rather than bootstrapping from it (the clone of the ref found no Dolt data, the probe found the ref absent, or the probe failed; the origin probe reports a branch holding source as found, and a clone that succeeded is proof the ref holds Dolt data and is not re-checked). The paths that cannot ask (bd config apply, proxiedbd init, andbd initin non-interactive mode:--non-interactive,BD_NON_INTERACTIVE=1,CI=true, or no terminal) refuse the default branch, an existing ref, and a ref the probe could not read; the refusal names the remedy of its path for taking an existing ref on purpose, shell-quoted and credential-free:bd dolt remote add origin <url> --ref <ref> --yeswhere the workspace owns its store (with--allow-git-originwhen the URL is the git origin), abd sqlcall ofDOLT_REMOTEover a proxied server, whereremote addis refused, and for a move bybd config apply, whose ref comes from the remote record rather than the key, a re-add of origin with--yesor with another--ref. A remote divergence the user confirmed duringbd init(the destroy-token flow) counts as consent to take an existing ref; the default branch is refused either way, and so is a ref the probe cannot read whenever nobody is watching, a pty under--non-interactiveincluded.bd config applyreports the refusal as an error result, in its dry run too, which runs the same read-only probe and exits non-zero where the live run would instead of promising an add; proxiedbd initfails as it does when the remote cannot be created; directbd initleaves origin unconfigured, says why, names thebd dolt remote add origin <url> --ref <ref>that finishes the job, and goes on, as it does when the add itself fails. Init does not run twice, and the nextbd dolt pushadopts the git origin rather thansync.remote, which is the right remote only when the two are the same repository, so the remedy is the add and never a change to the key alone; adoption preferring the git origin over a configuredsync.remoteismain's behavior and a follow-up.--ref refs/dolt/datais the default.A ref only exists on a git-backed remote, so a ref beside a
sync.remotethat is not one (file://,dolthub://, a remotesapi endpoint) is handled before dolt sees it: an explicitbd bootstrap --refthere is refused naming the URL, and a configured key is dropped from the plan, from thebd initclone and origin (embedded, server, proxied-server), and frombd config apply, with one warning naming the key and how to clear it;bd dolt remote add origin <url>without--refis the one path that refuses instead of dropping, since the add is explicit and the user can name the ref.bd config set sync.remoteprints the same hint when a key is set and the new URL cannot carry it, judged in the routed form bootstrap and init store: a forge URL without.gitgets no hint, since itsgit+form carries the ref. A git origin that is a local path without.gitis spelledgit+file://when a ref is in play, by bootstrap, init, and push-time adoption alike, since a scheme-less, host-less path is an origin shape dolt does not read as a git repository: it goes to the DoltHub remotesapi host. Afile://or relative-path origin without.gitis not respelled; the ref is dropped there with the default-ref warning, and the plan's reason says the clone looks at the default ref. For a forge URL, whichbd initandbd bootstraproute to itsgit+form before handing it to dolt, the ref is decided against that routed form:https://gitlab.com/org/repois not git-backed as written, itsgit+https://form is.bd config applykeeps origin's ref when it recreates the remote on a URL change, and on the restore after a failed add.sync.remote-refin.beads/config.yaml(a YAML-only key besidesync.remote), written whenoriginis added with a ref, read whenoriginis re-added without--refand whenbd dolt pushadopts the git origin as the Dolt remote, where a git origin that is not git-backed for dolt, such as a bare path, is adopted on the default ref with a warning, and cleared by--ref refs/dolt/dataonoriginand bybd bootstrap --ref refs/dolt/datafor the workspace it bootstraps.bd dolt remote remove originclearssync.remoteand keeps the key: it is the workspace's statement of where the data lives, so remove followed by add lands on the same ref instead of moving the data to the default with no prompt. Clearing writes the empty value, which means the default, rather than removing the key, because the two differ once async.remote-refexists in the user-globalconfig.yaml: an absent workspace key lets that value through, an empty one pins the default for every clone of the committed file. The ref that applies to a workspace is resolved in the order the configuration layers are merged,BD_SYNC_REMOTE_REF(empty counting as unset, as the merged reader has it),config.local.yaml, the workspace'sconfig.yamlin either spelling, then the merged configuration, which at that point holds only the user-global value; the two workspace files are read directly rather than through the merged reader because that reader lets a flatsync.remote-ref:line in the user-global file shadow a nested workspace value (its lookup tries the joined path before the nested one), which would undo the pin.bd bootstrap,bd init, the origin probe,bd contexton both routes, push-time adoption,bd config get sync.remote-ref, thesync.remoteset hint, and the key clear that--ref refs/dolt/dataonoriginperforms all use that one resolver, sobd config getreports the ref that governs the workspace and an explicit default pins it here whichever layer the ref came from; the bootstrap paths that persist or clear the key in a workspace they are creating read that one file alone, since their question is what the file says.TestResolveSyncRemoteRef_WorkspaceValueWinsOverUserGlobalpins absent, empty, set, flat, local-layer, and environment cases against both global spellings.bd config set sync.remote-ref ""(orrefs/dolt/data) says it pins the default;bd config unset sync.remote-refremoves the key in either spelling since fix(config): dotted keys round-trip through SetYamlConfigInDir/UnsetYamlConfig (bd-zj95, 1.3.1) #6574 taught unset the nested form, and its hint says the next configured value is read. A committed file whose nestedsync:block sits in a wholly indented root mapping is a shape generic unset does not reach onmaineither (fix(config): bd config unset reported success while the key stayed set #5760 taught it the indented flat key); it is not special-cased here.bd config setandunsetshow the side effect;bd contextshows the ref beside the remote on both the direct and the proxied-server route. Every read of the key accepts the flatsync.remote-ref:spelling and the nestedsync:block alike.Re-adding a remote on a different ref changes where its data is pushed, so it asks first; without a terminal it is refused with both refs named unless
--yesis given. A different URL on the same ref keeps today's confirmation.bd bootstrap --ref <ref>overrides the key; the plan carries and prints the ref,sync_remote_refin--json; the text plan names the remote and the ref on a local plan that wires the new database to a remote as well as on a clone, so the user confirms against what the run will do to a remote; all three clone modes pass it through the primitives, and the ref is persisted besidesync.remoteonce the plan has run. Since fix(bootstrap): probe git remotes for dolt data instead of rejecting; exit non-zero when bootstrap declines (#5743, #5663) #6037, bootstrap probes async.remotethat looks like a code repository (a.gitsuffix, a well-known forge) for Dolt data instead of rejecting it, clones when the data is there, and otherwise falls through to local recovery or a fresh database wired to that remote; a probe failure is a blocked plan with a non-zero exit. With a ref, every step of that follows the ref: the probe of thesync.remoteand of the git origin asks for the ref, the clone passes it, the messages and the blocked plan'sgit ls-remotehint name it, and a fresh database created because the ref holds no data yet getsoriginon that ref with the key persisted, creatingconfig.yamland writingsync.remoteinto it, credential-free, when the remote came from the environment and none exists, so the firstbd dolt pushand the team's other clones agree on where the data lives. The key and the remote are recorded beforeoriginis wired, and a failure to record them is an error naming thebd dolt remote add origin <url> --ref <ref>that finishes the job, with--allow-git-originwhen the URL is the git origin, not a warning: the database then exists with no origin, which one command repairs, rather than an origin on a ref no other clone can learn of. An explicit--ref refs/dolt/dataclears a configured key on every plan it runs, including one that wires no remote, and the note printed for such a plan says so instead of "no effect"; with no key configured it writes nothing, so it and a plainbd bootstrapleave the same files. A plan that recovers from a local backup or a git-trackedissues.jsonlafter a failed probe wires no remote and carries no ref, so its JSON and the--refnote agree; a blocked plan carries the ref it could not verify only beside the remote itsgit ls-remotehint names; a Blocked plan with no such remote, the server-moderefuseplan of Fix: bd bootstrap can also silently create an empty server-mode database #6503 among them, carries no ref and no remote, so--jsonshows neither. A ref underrefs/heads/orrefs/tags/that the probe finds is reported as found, not as Dolt data, since only a ref underrefs/dolt/proves that; the dry run says so, and the clone reports what the ref holds. An explicit--refthat cannot apply to the configuredsync.remoteexits non-zero naming the URL; thebd initrefusal for a remote that already holds Dolt history names the probed ref.bd initreads the key for its clone and for the origin remote it configures, in embedded, server, and proxied-server modes; the proxied-server path now routes a URL dolt would not read as git-backed as written, a forge URL without.git, to itsgit+form as direct init does (a change to what proxied init stores, not only to the ref;mainstored the forge URL raw), stores a URL dolt already reads as git-backed as written, the scp form among them since bd's rewrite togit+ssh://would turn its relative path absolute, and decides the ref against the stored form. bd's URL comparison does not fold the/./dolt keeps in that stored scp form, so a re-add of the same scp URL in a proxied workspace reads as a URL change;mainstored the scp form raw there too, so this is pre-existing, and a/./fold indoltremote.Normalizeis a follow-up beside fix(bootstrap): probe git remotes for dolt data instead of rejecting; exit non-zero when bootstrap declines (#5743, #5663) #6037's relative-path note.bd dolt remote listshows the ref (text and JSON);bd dolt remote reset-datadeletes and rebuilds the ref the remote record carries, neverrefs/dolt/datawhen a ref is set, and deletes only the exact data ref and the info ref out of whatgit ls-remotereturns, so the other databases a repository holds on their own refs are untouched (the info ref is oneDOLT_REMOTE.mdmarker branch that dolt force-pushes again on every push). The confirmation prompt and the refusal without a terminal name that ref beside the URL, since on such a repository the URL alone does not say which database is replaced; the JSON result carriesrefasbd dolt remote add --jsondoes, the recorded ref in canonical form when it is not the default and no key otherwise, with the refs actually deleted indeleted_refs;bd dolt remote list --jsonshows the same for every remote bd created, since bd canonicalizes before recording, and prints verbatim what dolt recorded for a remote added through dolt itself (an explicit--ref refs/dolt/datathere lists as such). The history-squash runbook now points atreset-datainstead of a hard-codedrefs/dolt/datadeletion.The storage layer's cold-start remedy for a server this bd does not own stays as feat(storage): carry the git data ref of a git-backed Dolt remote #6521 words it, a
DOLT_REMOTE("add", "--ref", ...)call throughbd sql, rather than thebd dolt remote add --refthis PR adds: in that GH#2118 windowensureDoltRemoteGuardedfalls back to the persisted remotes, finds the same URL and ref, and returns without a SQL add, so the command would not repair the condition the message describes.Docs: the flag on both commands' help,
sync.remote-refin the configuration reference, one section indocs/getting-started/sync-setup.mdcovering both uses (a branch underrefs/heads/for a host that refuses other refs; several databases in one repository on their own refs), and a CHANGELOG entry. The branch shape gets a paragraph on what a data branch is exposed to thatrefs/dolt/datanever was, workflow triggers and rulesets that cover all branches, anddocs/reference/protected-branches.mdcarries the same qualifier. The generateddocs/cli-reference/pages follow the release pin and are untouched.bd dolt remote reset-datacommits pending working-set changes before it removes anything on the remote. Since fix(embeddeddolt): commit pending changes before push (#5433) #5795 the embedded store commits pending changes inside every push, so the command's delete-then-push order could remove the remote's data ref and then fail on the commit (a constraint violation in the working set, for one), leaving a remote no clone can bootstrap from; that held forrefs/dolt/dataonmain, not only for a custom ref. The embedded store now commits first and a failing commit returns with the remote untouched and a hint namingbd dolt commit. Server mode, whose working set is shared, keeps refusing a dirty working set and checks again after the confirmation prompt, because another session can write while the prompt waits. The prompt's sentence about pending changes follows the store mode, and the help text names both behaviors.After the first review: the target guard runs on every path that wired
originon the configured ref without it (the first bullet describes where and how each path refuses); the guard's messages, the probe's own error (git's first stderr line, credential-scrubbed, as the bootstrap probe reports it), the push-time adoption warning and the adoption announcement under--yes, init's no-ref confirmation and its probe-failure note print the URL throughredactRemoteURL, the adoption URL being the git origin with whatever userinfo CI put in it, andredactRemoteURLitself now drops the userinfo of a scheme-lessuser:token@host/repo.git, which dolt reads as https, and spells the resulthttps://, since the userinfo was what kept a dotted host before the first colon (host.example:443/repo.git) from reading as an scp address, for dolt and git alike, and bootstrap persists the redacted URL intosync.remoteand the remedies paste it (theurlfields ofremote list --jsonandreset-data --json, and the other messagesmainalready printed, are as they were);isGitBackedDoltRemoteURLfalls through from a colon that makes no scp host to dolt's path rules, so a Windows drive-letter or UNC path ending in.gitis git-backed on Windows (and/srv/le:dgers.giteverywhere) instead of being refused for--refon a remote dolt treats as git-backed, for the URL as given toremote add; a git origin still goes throughdoltremote.Normalizefirst, which spells a drive-letter pathgit+C:\..., a pre-existing shape neither bd nor dolt reads as git-backed. The Windows lanes build and smoke-test rather than run this package, so the Windows expectations inTestIsGitBackedDoltRemoteURLare by readingfilepath.IsAbs. The probe reads the URL in the form dolt stores it:gitRemoteURLForLsRemotegives a scheme-lesshost/path.gitthehttps://dolt gives it, where git alone would readhost:1234/repo.gitas an scp address and probe a different endpoint.reset-datadeletes the info ref dolt publishes under aDOLT_REMOTE_INFO_BRANCHoverride rather than the literal default, and none when an empty override disables the marker, since that name is then an ordinary branch; and the probes' andreset-data'sgit ls-remoteandgit pushtake the URL after--. The embeddedcmd/bdshard manifestmainnow checks in lists the fourTestEmbeddedGitDataRef*tests.Why
Fixes #6261. Dolt takes the ref as a remote parameter (
--refondolt remote add,dolt clone,DOLT_REMOTE,DOLT_CLONE); bd did not pass it through. Two uses: a git host that only accepts pushes underrefs/heads/, and one repository holding one Dolt database per unit of work on refs such asrefs/dolt/units/<key>.Built on #6521 as merged (
3efcd3571, with the maintainer fixup0801749d6), rebased ontomainatd652def9d. The command layer meets the fixup at three seams and changes nothing about them:bd dolt remote add --refandbd bootstrap --refvalidate the ref in the argument phase with the stricter command-level rules, soCreateRemoteWithRef's andBootstrapFromRemoteWithDBRef's add-time checks are a second gate that a well-formed ref passes; every ref the commands read comes fromListRemotes, which now goes through the oneGitRefFromParamsdecoder, soreset-dataand the re-add comparison see what the storage layer sees, and a SQL-visible remote record with an unreadablegit_refis an error before either acts. The one read that is not fail-closed ismain's own: in the GH#2118 window, where a fresh sql-server lists no remotes, the re-add path falls back to the persistedrepo_state.jsonthroughpersistedRemoteInfosFor, which warns and assumes no remote on any read error, a malformedgit_refincluded, and the add then proceeds as it would for an absent remote; that fallback and its warning aremain's and are unchanged here. The three follow-ups the adoption review on #6521 filed in the maintainers' ledger and quoted there (bd-2dozu, the untested rollback direction of the mirror probe;bd-xg5in, the proxied asymmetry argued from a code walk;bd-cbr9s, therepo_state.jsonflush and the pinnedalready existstext) are storage-layer and are not taken here.Three rebases brought the branch from the pre-fixup #6521 head to
2704d8a95. The first moved 170 commits ofmainunderneath and needed four hand merges:CHANGELOG.md(both entries kept);cmd/bd/config.go, wheremainextractedrunConfigUnsetYamlOnlyand had taught unset the nested spelling (#6574), which made the PR's own nested-clear hook forsync.remote-refredundant, so the hook is gone and the PR no longer touches that file;cmd/bd/sync_git.go, wheremain's#nosec G702note is kept over the ref argument;cmd/bd/bootstrap.go, where #6503'srefuseaction joins the Blocked derivation indetectBootstrapActionForRefand #6938's explicitBEADS_DIRbranch sits beside the ref-following origin probe. The second moved 17 commits and needed one hand merge, the reset-data prompt line where #5795's reworded sentence met this PR'sresetDataTargetcall (both kept). The third moved 15 commits and needed two, both inCHANGELOG.md(entries ordered under### Addedand### Fixed). The fourth, after the first review, moved 36 commits and needed one: #5760 madeconfig.UnsetYamlConfigreturn whether the key was set, inside the block this PR had already replaced withclearOriginSyncConfig, whose body now takes the two values. The fifth moved 107 more, to5e7367086, and needed one hand merge, inCHANGELOG.mdagain (the### Fixedentry's neighbors). The sixth moved 4 more, tod652def9d, Bazel and CI changes with no file in common with this branch.git range-diffacross each rebase showed nothing else moved; the audit comments on this pull request list what the adversarial rounds between the pushes changed.The third commit is a fix on
main's behavior that the rebase surfaced: an adversarial round on the rebase delta reproduced the reset-data ordering hazard against #5795 (ref deleted, then the commit failed, remote left without its data ref). It is separable; if the maintainers would rather take it alone, the first two commits stand without it.Verification
Both ref shapes,
refs/heads/issue-dataandrefs/dolt/units/team-12542, run through the end-to-end tests; the pure tests use them where a ref is compared or validated.Not exercised by any test here: the ref through
cloneViaServerandcloneViaCLIin server mode; theCreateRemoteWithRefcall itself insideconfigureProxiedInitDoltRemote's transaction in proxied-server mode;applyRemote's dry run against a real store (its decision isdryRunRemoteApply, pinned byTestDryRunRemoteApplyagainst a bare repository); andbd init's prompt under a terminal and its consent wiring (the guard takes the resolved interactivity and the confirmed-divergence flag as booleans, pinned byTestGuardInitDoltRemoteRef; no test drivesbd init --discard-remote --destroy-tokenwith a key, and the end-to-end case runs with--non-interactive). Each is a direct parameter pass into the primitives of #6521, checked by reading; everything up to that call, the routed URL, the configured ref, and the guard, runs increateProxiedOriginRemote, whichTestOriginPathsWithoutPromptRunGuarddrives against a bare repository besidebd config apply'saddOriginRemote(default branch and existing ref refused with a terminal attached and nothing created, free ref created on that ref), andTestProxiedInitDoltRemoteURLpins the routing. The end-to-end tests are embedded-mode only.