Post-merge review of #6658 (landed as 5b9e938b5) found two guidance defects
in the #6575 data-behind stop. The gate itself is correct; both are in the
remedy chain it prints.
1. The shared arm prescribed `bd migrate schema`, which cannot succeed in the
state that prints it. A data-behind refusal has a remote by construction —
behind-ness is read from `remotes/<name>/<branch>` — and the verb consent
(`sharedMigrateConsent`) has exactly one reader, inside `sharedNoRemoteGate`,
reachable only on the `!hasRemote` branch. So after the pull the retry routed
`smartAutoMigrate -> shared -> fallbackReasonSharedStore`, whose blunt body
prescribes the `bd migrate --force` the data-behind body explicitly says not
to use. The option, `dataBehindBody`, `AgentDirective`, `fallbackReasonNote`
and both `--global` retargets now name `bd migrate schema --force`, which
trips `forceOrEnvConsent` via `isForcedMigrate`.
Retargeting the command rather than widening the consent read is deliberate:
with a remote configured, #4259's cross-clone fork risk still demands the
designated-migrator confirmation, which is what `sharedNoRemoteGate`'s own
comment says the scoping is for.
2. The JSON payload's `docs` pointer stayed on the migrate-or-adopt anchor,
whose ordering rule says `bd dolt pull` is refused on every
pending-migration open — contradicting the `pull-first` option in the same
payload. The `IsDataBehind()` arm now points at a new "Clone behind the
remote" section, and the two living ordering rules (upgrading.md,
init-safety.md) record the exception.
Tests: the consent step is now checked by running it — the command is taken
from `Options()`, resolved through the same cobra lookup and predicates the
root pre-run uses, and fed to the real gate against a remote-backed shared
fixture, with the shipped bare verb as the counterfactual. Asserting the
option's wording is what let the dead command ship. `docs` is pinned in
`TestHandleRemoteMigrateGateJSON_DataBehind`.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>