* test(cli): pin --format json == --json on show, list, ready and memories
Before-parity pin P7 (gap analysis 2026-10-17, section 5a). The hidden
root --format flag is an alias for --json (GH#2612). It is a root
persistent flag, so a subcommand that registers a --format of its own
shadows it (the GH#6278 hazard): `bd list` already does and passes `json`
through by hand, and a graph-preview fork that added a local --format to
`bd show` made `bd show ID --format json` exit nonzero.
TestEmbeddedFormatJSONAliasMatchesJSON runs show, list, ready and memories
with --json and then with `--format json`, `--format=json` and a leading
`bd --format json <verb>`, and requires exit 0 and byte-identical stdout.
It adds bdRunStreams, a small helper returning stdout, stderr and the exit
status separately, which the following pins reuse.
The new TestEmbedded* function is listed in the bd_test srcs and placed in
the 100-shard embedded cmd manifest by
gen_embedded_cmd_shard_manifest.py --write (incremental).
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cli): pin the ordinary --if-revision compare-and-swap contract
Before-parity pin P8 (gap analysis 2026-10-17, section 5a). --if-revision
is the decimal int64 compare-and-swap merged in #7203, and gascity's
bdstore_conditional.go classifier reads both its exit status and its
machine body. A second, opaque-token meaning for the same flag in another
kind of workspace must leave the ordinary one unchanged.
TestEmbeddedIfRevisionOrdinaryCAS pins, through the real binary:
- a stale decimal token on update, close, assign and delete (preview
and --force) exits 13, prints nothing on stdout, writes nothing, and
ends stderr with a precondition_failed body naming the id and the
expected and current revisions as exact JSON integers;
- a non-decimal token exits 1 with the "invalid --if-revision" refusal
in text and --json modes, never 13, and writes nothing;
- the current token applies on update, close, assign and delete.
It is the ordinary-workspace half of
TestGraphPreviewIfRevisionOutsideLinkModeIsUpstreamCAS from the
donnabox/codex/preview3-source-catchup-46aa branch (added in 3d16d826be,
revised in 1640940fa9, 3ff2fe73ce, 55dbb61156, 653369305a and
97446d1f08), ported onto this package's embedded helpers. The port drops
the graph-only forget refusal, extends the stale and non-decimal cases
from update/delete to close and assign, and compares revisions as
json.Number rather than float64, since they are int64 values past 2^53.
It is named TestEmbedded* so the bazel-embedded lane, which discovers
`^func TestEmbedded` in *_embedded_test.go, runs it; the existing
TestIfRevisionMatchAndMismatch is not discovered there. The file is
listed in the bd_test srcs and placed in the 100-shard embedded cmd
manifest by gen_embedded_cmd_shard_manifest.py --write (incremental).
Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Donna Box <dbox@boxenllc.com>
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cli): pin version, config set, history and show --as-of shapes
Before-parity pin P10 (gap analysis 2026-10-17, section 5a): the
store-less and history-adjacent commands a later versioned-history or
graph slice could change by accident.
- TestEmbeddedVersionOutputShape: `bd version` with no arguments exits
0 and prints one "bd version <version> (<build>...)" line, in a
workspace and outside one; --json is one object with version, build
and schema_version (plus commit and branch when known) agreeing with
the text line, and --format json prints the same document; an
argument exits 1 and points at `bd versions <arg>` (#6661), on stderr
or as the --json error, through the real binary rather than RunE.
- TestEmbeddedConfigSetOtherKeysSkipTheVersionedHistoryScan: in a store
holding a row the pre-enable scan refuses over, `bd config set` and
`bd config set-many` of another key with the value "true" exit 0,
store it, print no refusal and leave the switch off; the switch
itself is still refused afterwards, as a control.
- TestEmbeddedHistoryAndShowAsOfReadDoltCommits: with versioned history
recording, `bd history <id> --json` is still the Dolt-commit history
(an array of CommitHash/Committer/CommitDate/Issue entries with full
32-character Dolt hashes, no recorded-version fields, and the same
hashes in the text output), and `bd show <id> --as-of <hash>` with a
hash from it is the Dolt AS OF read in show's JSON shape, not the
R7.1 as-of read over issue_versions; `--as-of main` reads the branch
head.
The three TestEmbedded* functions are placed in the 100-shard embedded
cmd manifest by gen_embedded_cmd_shard_manifest.py --write (incremental).
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Donna Box <dbox@boxenllc.com>