Commit graph

16 commits

Author SHA1 Message Date
CI Bot
37c97e0b79 fix(init): guard JSONL init against remote history
_codex-gpt-5.5-xhigh on behalf of CI Bot_

Agent-Signature: codex-gpt-5.5-medium on behalf of matt wilkie
Agent-Signature: claude-unknown-model-high on behalf of matt wilkie
Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of matt wilkie
2026-06-22 15:28:38 -07:00
Kevin Glynn
d585928bb3
feat(init): add --init-if-missing for idempotent init (#3490) (#4332)
* feat(init): add --init-if-missing for idempotent init (#3490)

bd init aborts with exit 1 when the workspace is already initialized,
forcing scaffold scripts to pre-stat .beads/embeddeddolt/<prefix> to tell
"already initialized" (benign) apart from real errors. Add an opt-in
--init-if-missing flag: when the workspace already exists, init prints a
benign "Skipping init: workspace already initialized." to stderr and exits 0.
Default behavior (flag absent) is unchanged - exit 1 with the existing
"already initialized ... Aborting" message.

The flag is intercepted only at the existing checkExistingBeadsData guard
call site; detection logic and the --force/--reinit-local paths are untouched.

Docs regenerated via scripts/generate-cli-docs.sh and generate-llms-full.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(init): abort --init-if-missing on explicit prefix mismatch

--init-if-missing silently skipped whenever a workspace already existed,
even if the caller passed an explicit --prefix that differed from the
existing workspace. That masked a real mismatch: `bd init --prefix bar
--init-if-missing` against an existing `foo` workspace exited 0 and
ignored the requested prefix.

Now, when --prefix is set explicitly (and --database is not), compare the
requested prefix against the existing workspace's recorded DoltDatabase
and abort on a genuine mismatch; matching or undeterminable cases still
skip benignly. Extracts the prefix->dbName normalization into shared
helpers so the guard derives exactly the same name init records, and
factors the decision into a pure, unit-tested helper.

Refs #3490

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(init): don't mask operational errors or --database mismatch under --init-if-missing

Two idempotent-init correctness fixes on top of #4332 (reviewer Bernoulli):

1. checkExistingBeadsData now distinguishes the benign "already initialized"
   outcome (errWorkspaceAlreadyInitialized, carried by a workspaceExistsError
   that keeps the user-facing message) from operational errors such as an
   unreadable .beads/embeddeddolt directory. --init-if-missing skips only the
   benign case; an operational error still aborts instead of being masked as a
   successful idempotent skip.

2. An explicit --database mismatch now aborts --init-if-missing, mirroring the
   existing --prefix guard. --database is the authoritative database selector,
   so it is checked even when --prefix is also set.

Tests: initIfMissingDatabaseMismatch table; checkExistingBeadsDataAt returns a
sentinel-matching error for an existing database and a non-matching
(operational) error when embeddeddolt is unreadable.

Agent-Signature: claude-opus-4-8-high on behalf of maphew

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-06-18 09:51:27 -07:00
coffeegoddd☕️✨
316cfc697b /{cmd,docs,internal,website}: remove pass 2026-05-27 16:32:28 -07:00
coffeegoddd☕️✨
a106722705 /{cmd,docs,internal,website}: wire up 2026-05-27 15:30:47 -07:00
coffeegoddd☕️✨
e4b4d846c4 /{docs,website}: gen docs for new flags 2026-05-27 14:43:15 -07:00
coffeegoddd☕️✨
885eacb3df /{docs,website}: gen docs 2026-05-27 13:40:11 -07:00
Eugene Brevdo
5d33b4c891
init: run Codex project setup by default
Run Codex project setup during `bd init` using the existing setup installer, and stage generated Codex project files in the bootstrap commit.

Also refresh the generated setup/init docs for the new default behavior.

Co-authored-by: Eugene Brevdo <ebrevdo@gmail.com>

_codex-gpt-5.5-medium on behalf of CI Bot_
2026-05-26 13:03:37 -07:00
Medhat Galal
99565c0d25 Merge remote-tracking branch 'upstream/main' into AI/import-path-config-upstream
# Conflicts:
#	cmd/bd/config.go
#	cmd/bd/init_templates.go
#	docs/CLI_REFERENCE.md
#	docs/CONFIG.md
#	website/docs/cli-reference/config.md
#	website/versioned_docs/version-1.0.0/cli-reference/config.md
#	website/versioned_docs/version-1.0.4/cli-reference/config.md
2026-05-22 00:40:02 -04:00
matt wilkie
3988db7e0d
fix(init): make JSONL auto-export opt-in (#4063)
* fix(init): make JSONL auto-export opt-in

Default export.auto and export.git-add to false for new repos, make the init prompt opt-in, and update docs/tests to describe JSONL as an optional viewer/interchange/backup export rather than core sync behavior.

Fixes GH#4062

* refactor(auto-export): check commit before throttle

Move cheap Dolt commit change detection ahead of the auto-export throttle and extract the throttle decision into a tested helper. This keeps the default-off design while carrying the compatible part of Jeremy Longshore's GH#4061 refactor.

Based-on: 313e1f8258

Co-authored-by: jeremylongshore <jeremylongshore@users.noreply.github.com>

* docs: regenerate versioned CLI references
* docs: call out JSONL export opt-in change

---------

_codex-gpt-5.5-medium on behalf of CI Bot_
_codex-gpt-5.5-high on behalf of matt wilkie_
Co-authored-by: CI Bot <ci@beads.test>
2026-05-21 16:21:00 -07:00
Medhat Galal
eea1cce5ab Merge remote-tracking branch 'upstream/main' into AI/import-path-config-upstream
# Conflicts:
#	docs/CONFIG.md
2026-05-21 02:05:29 -04:00
matt wilkie
39f3148fc2
docs: clarify export versus database backup (#4048)
* docs: clarify export versus database backup
* docs: remove remaining JSONL backup wording
2026-05-20 16:19:23 -07:00
coffeegoddd☕️✨
4b5936df91 /{docs,website}: generate docs 2026-05-19 12:59:04 -07:00
Medhat Galal
95930c4449 Regenerate CLI reference docs 2026-05-19 14:39:23 -04:00
matt wilkie
0c47b3c5ac
fix(init): use git origin as default Dolt remote (#3909)
* fix(init): wire git origin as Dolt remote

Default bd init now treats a git origin as the Dolt remote, persists sync.remote, and still skips synthesis in --stealth. JSONL auto-export/import paths now warn or skip based on sync.remote so exports do not masquerade as cross-machine sync.

Docs and generated agent/CLI references now state that Dolt is canonical, refs/dolt/data is the sync channel, and .beads/issues.jsonl is export/interchange/backup only.

_codex-gpt-5-xhigh on behalf of maphew_

* test: keep embedded command stderr out of parsed stdout

Embedded command tests parse IDs and JSON from command output. The new auto-export warnings correctly go to stderr, but several tests used CombinedOutput and treated warnings as stdout, which broke CI shards that parse issue IDs or JSON lists. Capture stdout separately on success while preserving combined output for error diagnostics.\n\n_codex-gpt-5-medium on behalf of CI Bot_

---------

Co-authored-by: CI Bot <ci@beads.test>
2026-05-13 07:02:39 -07:00
coffeegoddd☕️✨
e4f0f9b196 /{docs,website}: gen docs 2026-05-10 07:20:21 -07:00
matt wilkie
c97c416242
docs: publish v1.0.4 docs snapshot (#3845)
* docs: publish v1.0.4 docs snapshot

* release: guard docs version snapshots
2026-05-09 14:42:25 -07:00