Commit graph

73 commits

Author SHA1 Message Date
matt wilkie
ef3ffd45b3
feat(migrate): add --force flag as CLI twin of BD_ALLOW_REMOTE_MIGRATE (#4654)
* feat(migrate): add --force flag as CLI twin of BD_ALLOW_REMOTE_MIGRATE

The remote-migrate gate (#4259) refuses to auto-apply pending schema
migrations to a remote-backed database because two clones migrating
independently fork the schema unrecoverably. Until now the only unlock
was the env var BD_ALLOW_REMOTE_MIGRATE=1, which is awkward at the CLI
and can leak into child processes (git hooks, dolt subprocesses). The
--force flag is the natural CLI form of the designated-migrator escape
hatch: it is set before both autoMigrateOnVersionBump and the main store
open in the root PersistentPreRunE via a package-level bool, so it never
leaks out of the process. The env var remains supported for scripted/CI
use and is documented as a parenthetical alongside the new primary form.

Agent-Signature: claude-sonnet-4-6-high on behalf of matt wilkie

* fix(embeddeddolt): point lenient-gate guidance at bd migrate --force

The soft-fail (warn-and-continue) gate warning for read-only and
working-set-reconcile opens still named the env-var escape hatch; align
it with the new primary form introduced for the strict gate.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie

* fix(migrate): reject --force with preview flags; harden override lifecycle

Review findings on the --force flag (cross-vendor: codex gpt-5.5 + claude
opus):

- --force combined with --dry-run/--inspect must fail before the store
  opens: with the gate overridden, the open itself applies pending
  migrations, so the preview flag would be honored only after the
  destructive work it exists to prevent (codex P2).
- Set-or-clear the override unconditionally so it is self-clearing under
  any future in-process root-command reuse (reviewer nit).
- Lock the agent-safety contract against the new flag form: AgentDirective
  must not embed 'bd migrate --force' any more than the env form (nit).

Agent-Signature: claude-fable-5-high on behalf of matt wilkie
2026-07-07 15:58:18 -07:00
matt wilkie
939e85e20b docs: regenerate CLI reference for agent.profile config key
Follow-up to #4585: the agent.profile prime/config help text landed
without a CLI docs regen, tripping check-doc-flags.sh on main
(strict freshness probe, no PR diff base to attribute drift).
Regenerated with CGO_ENABLED=0 -tags gms_pure_go per AGENTS.md.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 13:52:51 -07:00
matt wilkie
c3d68d9f9d
docs: regenerate CLI reference after clean-databases prefix-list change (#4631)
Main went red at the 'Check doc flags freshness' gate: 64d67e09
(chore(dolt): converge bd dolt clean-databases prefix list) updated the
command help text without regenerating the generated docs. Regenerated
with scripts/generate-cli-docs.sh (pinned pure-Go binary); delta is the
prefix list line in both generated files, nothing else.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie
2026-07-07 09:28:10 -07:00
Scott Hamilton
b7d483f963
fix(cli): register --gated flag on bd mol ready subcommand (#3744)
Why: the help text advertised --gated on bd mol ready but Cobra flags do not propagate between sibling commands, so the advertised flag was a hard error; this registers it on molReadyGatedCmd directly. Landed manually (auto-merge disabled) after the branch was updated past the #4623 main-CI fixes and the full check suite ran green.

Co-Authored-By: Scott Hamilton <scotthamilton77@gmail.com>
Co-Authored-By: matt wilkie <maphew@gmail.com>
2026-07-07 06:42:43 -07:00
Kevin Glynn
c36afd74e1
feat(q): add --parent for hierarchical quick capture (#4597)
bd q is designed for scripting and agent integration, but batch-creating
epic breakdowns required falling back to the heavier bd create --parent.

Mirrors create.go's parent handling: validate the parent exists, inherit
its labels (create's default), reserve the hierarchical child ID via
GetNextChildID/WithReservedChildCounter, add the parent-child dependency
after CreateIssue, and follow up with the post-write Dolt commit
(GH#2009 pattern). Output stays ID-only.

Closes #4596

Assisted-by: Claude:claude-fable-5 [Cursor]

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 05:50:25 -07:00
matt wilkie
5d6ffc7c37
docs: regenerate CLI reference (fixes doc-flags-freshness after #4613) (#4616)
The hand-port of gastownhall/beads#3759 (PR #4613) added inline help text
to `bd linear sync` but deliberately skipped a docs regen to avoid
pulling in unrelated churn. "Check doc flags freshness" failed on main
afterward because `docs/CLI_REFERENCE.md` and the website CLI reference
pages had also drifted from several other recent merges (new issue types
spike/story/milestone, the `bd unclaim` command, `bd formula schema`
flag, `bd types --sections`) - the freshness check compares the whole
generated doc set, not per-PR.

Regenerated via `./scripts/generate-cli-docs.sh` using a pinned
CGO_ENABLED=0 -tags gms_pure_go build of bd, confirming no federation
churn (identical diff whether generated via the script's own build or
the pinned pure-Go binary). `./scripts/generate-cli-docs.sh --check`
now passes.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie
2026-07-06 23:03:41 -07:00
matt wilkie
31a6ec9511
feat: add bd unclaim command to release stuck issues (replaces #3694) (#4614)
* feat: Add bd unclaim command to release stuck issues

- Add UnclaimIssue method to storage interface and implementations
- Add bd unclaim CLI command: clears assignee, resets status to 'open'
- Improve claim error message when issue has assignee but status is 'open'
  (now suggests using bd unclaim)
- Update documentation: CLI_REFERENCE.md, QUICKSTART.md, setup templates
- Add unclaim tests
- Fix telemetry wrapper to implement UnclaimIssue method
- Add test mocks for UnclaimIssue in jira tests

* docs: regenerate CLI reference for bd unclaim

Runs scripts/generate-cli-docs.sh to add the bd unclaim entry that
gastownhall/beads#3694 introduced but whose CLI_REFERENCE.md/website
delta was lost in the conflict resolution during the cherry-pick.
Scoped to only the unclaim addition; unrelated doc drift already
present on main (formula/lint/types/linear entries) is left untouched.

Agent-Signature: claude-fable-5-medium on behalf of matt wilkie

---------

Co-authored-by: Abner S. Alves Junior <abnersajr@gmail.com>
2026-07-06 22:51:35 -07:00
Jim Wordelman
3e10077dc5
feat(preflight): implement --fix mode for vendorHash and version sync (#4054)
* feat(preflight): implement --fix mode for vendorHash and version sync

- Add fixNixHash(): uses sentinel-hash trick with nix build to compute
  and write the correct vendorHash into default.nix when go.sum has
  uncommitted changes; prints clear error if nix not in PATH
- Add fixVersionSync(): syncs cmd/bd/version.go to match default.nix
  version field (default.nix is source of truth)
- Add runFixes(): wires both to --fix flag with human-readable and
  --json output modes
- Remove outdated 'not yet implemented / bd-lfak.3-5' stub
- Preserve original file permissions on all writes

Closes be-xra8, be-roho

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: sync CLI_REFERENCE.md --fix help text with live CLI (be-xra8, be-roho)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(preflight): regenerate website CLI reference for --fix flag (be-laor)

Update website/docs and both versioned_docs variants to reflect --fix
flag description change from 'not yet implemented' to 'vendorHash, version sync'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: release gate PASS for be-xra8+be-roho (bd preflight --fix mode)

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-07-06 22:33:29 -07:00
Jack J Garzella
7be354810f
feat(formula): make primitives discoverable to coding agents (GH#3621) (#3781)
* feat(formula): add bd formula schema reflection-driven primitive index (beads-9ib)

Generates internal/formula/schema_gen.go from types.go via go:generate,
exposing all 18 exported structs (Formula, Step, LoopSpec, OnCompleteSpec,
etc.) with field types, json/toml tags, required-flag, and doc comments.

Surfaced via:
  bd formula schema                 # list every primitive
  bd formula schema loop            # show LoopSpec fields
  bd formula primitives on_complete # alias + snake_case match
  bd formula schema --json          # machine-readable

Lookup prefers exact match over Spec/Rule(s) suffix-strip, so "gate"
resolves to Gate (not GateRule). Fields tagged json:"-" (Step.SourceFormula,
Step.SourceLocation) are excluded.

TestSchemaGenIsCurrent re-runs the AST walker in-memory and byte-diffs
against the committed schema_gen.go, so a new struct in types.go without
a regen will fail CI.

Item 2 of GH#3621.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(formula): point bd formula --help at the primitive index (beads-lnf)

Extends the cobra Long descriptions on `formula`, `formula list`, and
`formula show` so an agent reading any of them is told that
`bd formula schema` (alias `primitives`), the curated
`examples/formulas/primitives/` directory, and the website primitives
reference exist. Without these pointers, agents land on the formula
surface and conclude there is no primitive index — which is the exact
failure mode GH#3621 is closing.

Adds cmd/bd/testdata/formula_help.txt as the regression gate: a
scripttest that runs `bd formula --help` (plus `--help` on the list
and show subcommands) and asserts the four pointers are present. If
someone deletes a pointer, the snapshot fails.

website/docs/cli-reference/formula.md is auto-generated from the Long
descriptions via `bd help --doc formula`, so the website doc inherits
the pointers on its next regeneration with no manual edit.

Item 1 of GH#3621.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(formula): curated primitive examples + smoke harness (beads-0sp)

Adds examples/formulas/primitives/ with one minimal `.formula.toml` per
empirically wired primitive in internal/formula/types.go:

  loop-count    LoopSpec.count       expand body 3x → .iter1.work…
  loop-range    LoopSpec.range/var   {n} substitutes into title
  children-epic Step.Children        epic + children w/ sibling needs
  branch-fanin  ComposeRules.Branch  fork-join, deploy depends on 3 sibs
  condition     Step.Condition       var-driven step inclusion
  gate-timer    Step.Gate            sibling gate-typed issue blocks step

Each fixture has a header doc-comment explaining the primitive in
plain language; README.md indexes them with a one-line description
each and points back at `bd formula schema`.

cmd/bd/formula_primitives_test.go is the smoke harness: for each
fixture it parses, cooks through the full transformation pipeline
(loops → branches → gates → advice → expansions → conditions), and
asserts the primitive's observable effect on the cooked subgraph
(issue IDs, blocking deps, substituted titles, gate await_type).
Cooks against an in-memory subgraph rather than a Dolt-backed temp
DB so the harness exercises the primitive transformation, not the
persistence/auto-export infrastructure.

A subtest fails if a fixture is added to the directory without a
registered assertion in cases[] — the harness exists to prove
primitives are wired, not just that fixtures parse.

Explicitly omits an `on_complete` fixture; that primitive is a
runtime no-op as of v1.0.3 and ships with beads-i02's resolution,
not this epic.

Item 3 of GH#3621.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(formula): satisfy CI gosec G306 + regen CLI doc for new help text

Two CI fixes for the formula primitives PR:

  - internal/formula/cmd/schemagen/main.go:26 — drop WriteFile perms
    from 0644 to 0600 (gosec G306).
  - website/docs/cli-reference/formula.md and the v1.0.0 mirror —
    regenerated from the updated `bd formula --help` Long text via
    scripts/generate-cli-docs.sh, using a CGO_ENABLED=0 bd build to
    match CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(formula): distinguish schema from wired primitives

* fix(formula): regen schema_gen.go for rebase onto current main

Upstream main's Formula struct gained an Intent field after PR #3781 was
opened; regenerate schema_gen.go via go generate so
TestSchemaGenIsCurrent passes after rebasing the PR's commits onto
current main.

Maintainer fix-merge for gastownhall/beads#3781.

Agent-Signature: claude-fable-5-medium on behalf of matt wilkie

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-07-06 22:26:41 -07:00
Wldc4rd
c8de26d4a6
feat(prime): cap injected memories with count/char budgets and a visible elision banner (#4569)
* feat(prime): cap injected memories with count/char budgets and a visible elision banner

bd prime injects every persistent memory, whole, in alphabetical key
order, with no cap. Hook hosts cap what they ingest from SessionStart
(Claude Code persists ~25K tokens and previews far less), so a large
memory set silently loses everything past the cut -- and because the
order is alphabetical, whether a memory survives is an accident of its
key's first letter, unrelated to importance. On a real workspace with
102 memories (~160KB, ~40K tokens) roughly 80% of memories were never
ingested on any session start, which surfaced as agents "forgetting"
in-flight work after every compaction.

Add two opt-in caps, resolved flag-over-config so hook commands or
repos can adopt them without touching every hook line:

  --max-memories N      / prime.max-memories
  --max-memory-chars N  / prime.max-memory-chars

Caps apply at whole-memory boundaries and at least one memory is
always emitted, so a single oversized memory can exceed the char
budget rather than vanish. When entries are elided, a banner ahead of
the entries -- where host truncation cannot hide it -- reports how
many were cut and points at bd memories for the rest: a capped prime
never silently drops context. An explicit flag value of 0 forces
unlimited over a configured cap. Defaults leave output byte-identical
to today.

Keys stay in sorted order because the memory store keeps no
timestamps; recency- or pin-aware selection needs sidecar metadata and
is left as follow-up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(prime): validate cap config keys, banner names only the binding cap

Maintainer follow-ups from review of #4569, kept on the contributor
branch so the PR can merge as-is:

- validateYamlConfigValue gains non-negative-integer cases for
  prime.max-memories / prime.max-memory-chars. Without them a typo like
  `bd config set prime.max-memory-chars 25k` reported success while
  viper's GetInt coerced the value to 0 = uncapped, silently disabling
  the cap the user believed was active - the exact failure this feature
  exists to prevent.
- The elision banner now names only the cap that actually fired. With
  both caps configured and only one binding, it previously listed both,
  producing self-contradictory output ("showing 3 of 10 ... capped by
  max-memories=50") and steering users to the wrong knob.
- Flag help and doc comments now say the char cap counts bytes of the
  memory entries only (header and banner excluded), matching the
  implementation; document the keys in docs/CONFIG.md alongside their
  peers.
- gofmt alignment in recognizedConfigKeys; reuse existing sortedKeys()
  and truncate() helpers instead of inline re-implementations.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie

* docs(cli): regenerate CLI reference for prime memory-cap flags

Regenerated with scripts/generate-cli-docs.sh (pinned pure-Go build) so
the check-doc-flags CI job passes; #4569 added two bd prime flags
without refreshing the generated docs.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie

---------

Co-authored-by: Charlie Coutts <240021994+Wldc4rd@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: CI Bot <ci@beads.test>
2026-07-06 15:29:49 -07:00
Jim Wordelman
c4e51986b0
feat(prune): reference-aware bd prune skips closed beads cited by open beads (be-jewoem, be-u2mw2x) (#4023)
* pm: decompose be-zej8mz → 3 builder beads for reference-aware prune

Child beads:
- be-jewoem: core implementation in cmd/bd/purge.go
- be-u2mw2x: --help and README docs update
- be-0wt833: bench asserting <5s on 10K-open-bead fixture (blocked on core)

Plan at docs/plans/reference-aware-prune.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(prune): reference-aware bd prune skips closed beads cited by open beads (be-jewoem, be-u2mw2x)

Implements be-5sn FR-01 through FR-06:

- buildReferencedSet scans description/notes/comments of every non-closed
  bead for literal candidate IDs using word-boundary regexp alternation.
  Uses Statuses filter (not ExcludeStatus) to avoid the PG coverage gap
  (be-jdeief guardrail per be-5sn §15).

- runPurgeOrPrune filters referenced beads after pinned-filtering when
  scope.cmdName == "prune" && !scope.ignoreReferences.

- All 4 human output paths updated: preview, dry-run, force, nothing-to-do.
  referenced_skipped/referenced_count always in prune JSON; absent in purge.
  referenced_ids_sample omitted when 0 (per be-zej8mz §5).

- --ignore-references flag registered in pruneCmd.Flags() only; purge
  init() unchanged so bd purge --ignore-references gives "unknown flag".

- pruneCmd.Long gains reference-protection paragraph per be-zej8mz §3.

- README.md adds Maintenance section documenting prune, purge, and the
  reference-aware skip with --ignore-references escape hatch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(prune): NFR-02 bench test for buildReferencedSet on 10K-bead fixture (be-0wt833)

TestPruneLargeFixture generates 10K open beads × ~5KB bodies + 100 closed
candidates with 20 seeded references; asserts buildReferencedSet completes
<5s and returns exactly the seeded IDs.

Passes in ~1.2s on a standard dev machine. Skips under -short.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(prune): regen CLI reference + release gate PASS (be-jewoem)

Regenerate CLI docs with CGO_ENABLED=0 -tags gms_pure_go binary built
from PR HEAD. Adds --ignore-references flag to prune command docs in
CLI_REFERENCE.md and three website prune.md pages.

Gate evaluation: all 6 criteria PASS (AC-6 integration tests deferred
to be-zkzw per reviewer).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(contributor): bd-umbf contributor namespace isolation (Children 1-3)

Child 1 (be-c7696f): Auto-configure contributor routing in bd init
when upstream remote is detected. Non-interactive, idempotent — skips if
routing.contributor is already set. Creates ~/.beads-planning, sets
routing.mode=auto, routing.contributor, sync.remote=upstream, and pins
git beads.role=contributor.

Child 2 (be-9d2b67): bd export --exclude-owner flag and config-driven
export.exclude_owners / export.exclude_owner config. Filters issues by
created_by before writing JSONL. --verbose emits filtered count.

Child 3 (be-3c5a0f): New bd migrate-personal command. Finds project DB
issues whose created_by matches the current git identity, prompts for
confirmation, then moves them to the planning repo (routing.contributor),
copying labels, dependencies, and comments atomically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(init): match autoConfigureForkContributor output to be-0ccf34 design spec

Three variants were missing; the one present used wrong symbol (✓ instead of ▶).

Happy path: ▶ header, upstream URL echoed, three ✓ action lines, opt-out hint last.
Opt-out path (--role=maintainer on a fork): ⚠ with explanation and recovery hint.
Re-init path (routing already configured): ⚠ with existing path and reconfigure hint.
Non-interactive/quiet: silent (unchanged).

Pass roleFlag through to autoConfigureForkContributor so the opt-out variant fires
when --role=maintainer is given explicitly on a fork.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(contributor): separate insert/delete phases in migrate-personal; suppress nonInteractive output

migrate-personal now copies all issues to planning DB first, then
deletes them from project DB in a single transaction via DeleteIssues.
A mid-loop failure before the delete phase leaves no issues deleted,
making re-runs safe.

Also pass quiet || nonInteractive to autoConfigureForkContributor so
bd init --non-interactive does not emit fork-detection output.

Fixes B4 and the nonInteractive gap from be-72b53f review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(prune): regen CLI reference — add bd migrate-personal, update bd export flags

Regenerated from bd 1.0.4 dev (9ed33b68d) with CGO_ENABLED=0 -tags gms_pure_go.
Fixes B1: bd migrate-personal was missing from docs/CLI_REFERENCE.md and
all website cli-reference pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(gate): update be-jewoem release gate to cover bd-umbf scope

Expands gate scope from be-jewoem/be-u2mw2x only to include bd-umbf
Children 1-3 commits added to the branch. Documents blocker resolution
status (B1/B2/B4 resolved, B3 pending validator), updates CI results to
latest all-green run 26009209774, and marks overall gate ON HOLD pending
validator tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(gate): update be-jewoem gate — PR description refreshed, B3 dependency chain clarified (2026-05-19)

* test(contributor): be-f9a104 — bd-umbf export+migrate-personal tests

6 tests for bd-umbf Children 2-3 per be-f9a104 scope:

cmd/bd/export_exclude_owner_test.go (be-9d2b67):
- TestExportExcludeOwner_flag: --exclude-owner=alice filters alice's issues
- TestExportExcludeOwner_config: export.exclude_owners config drives filter
- TestExportExcludeOwner_verbose: --verbose reports filtered count

cmd/bd/migrate_personal_test.go (be-3c5a0f):
- TestMigratePersonal_noopWhenEmpty: no matching issues → 0/success
- TestMigratePersonal_movesIssues: personal issues moved to planning repo
- TestMigratePersonal_abortOnNoConfirm: EOF stdin → abort, issues stay

All gate on BEADS_TEST_EMBEDDED_DOLT=1. Fork-detection init tests
covered by be-de99a6 (tests/be-de99a6-fork-detect) per PM scope.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(test): be-36oa — skip TestMigratePersonal_movesIssues on Dolt unavailable

Broaden the skip condition in TestMigratePersonal_movesIssues to also skip
when the planning dir's Dolt server is unavailable (BEADS_DOLT_AUTO_START=0
leaves port=0, causing dolt.New() to fail). Adds "dolt", "cannot connect",
and "server" to the skip-trigger strings alongside the existing routing
and actor-mismatch conditions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(init): be-de99a6 — fork-detection UX output format tests

4 embedded tests for autoConfigureForkContributor output per be-de99a6:

- TestBdInit_ForkAutoContributor: upstream remote → 'Fork detected' in output,
  routing.mode=auto set
- TestBdInit_ForkAutoContributor_Idempotent: second init run → routing.mode
  still 'auto' (no double-write)
- TestBdInit_ForkAutoContributor_MaintainerFlag: --role=maintainer → routing.mode
  NOT set to auto
- TestBdInit_ForkAutoContributor_NonInteractive: --quiet → no '▶' block, but
  routing still configured

All gate on BEADS_TEST_EMBEDDED_DOLT=1. Uses initForkRepo helper to
add upstream remote for fork detection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(bd-umbf): be-jewoem B3 — fix yaml/DB store mismatch in export owner-filter and fork routing

Two real bugs found while landing the B3 validator tests:

1. buildOwnerExcludeSet (export.go) was only reading export.exclude_owners
   from the database. The export.* prefix is yaml-only (config.yaml), so
   config set via 'bd config set export.exclude_owners' was invisible to the
   filter. Now reads yaml first, falls back to database.

2. autoConfigureForkContributor (init_contributor.go) was writing
   routing.mode, routing.contributor, and sync.remote via store.SetConfig
   (database). Those keys carry the routing.*/sync.* prefixes which are
   yaml-only. Reading back via 'bd config get routing.mode' always returned
   empty. Now uses config.SetYamlConfig for these keys; idempotency check
   updated to read from yaml too.

Also: update TestBdInit_ForkAutoContributor to verify routing config state
rather than output text (suppressed in non-TTY test environments); remove
temporary debug_fork_test.go; mark B3 RESOLVED in release gate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(lint): drop unused ctx+store params from autoConfigureForkContributor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: release gate PASS for bd-3852 (orphaned children doctor check)

* fix(rebase): update second autoConfigureForkContributor call to 2-arg signature

Later commits in this branch dropped ctx and store params from
autoConfigureForkContributor. The second call site added by be787e4b5
still used the old 4-arg form; update to match the final 2-arg form.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(rebase): drop #4028-superseded fork-detect; take main init.go/init_contributor.go (be-15y28)

PR #4028 landed autoConfigureForkContributor on main. PR #4023 had its own
version of init.go and init_contributor.go plus a fork_detect_embedded_test.go
that collided with TestEmbeddedInit/fork_auto_contributor, causing CI to fail.

Take origin/main's init.go and init_contributor.go verbatim; remove
fork_detect_embedded_test.go. The unique features — reference-aware prune,
export --exclude-owner, bd migrate-personal — are untouched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(prune): scan active custom statuses in reference-aware skip

buildReferencedSet scanned only the built-in non-closed statuses, so a closed bead cited by a bead in an active *custom* status (status.custom) was unprotected and could be deleted by 'bd prune --pattern ... --force'. Now include every configured custom status whose category != done (via GetCustomStatusesDetailed); the read is required, not best-effort, so a destructive prune never silently under-scans. Adds TestPrune_protectsBeadCitedByCustomStatusBead. Addresses maphew's review of PR #4023 (be-e2nb).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(export): apply export.exclude_owners to auto-export

The export.exclude_owners safety net was applied only by manual 'bd export'; the git-committed auto-export (.beads/issues.jsonl) did not filter, so contributor/personal issues could still leak into git history and PRs. exportToFile now applies the same owner filter (config-sourced owners). Adds TestAutoExportExcludeOwner_config. Addresses maphew's review of PR #4023 (be-e2nb).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(migrate-personal): all-or-error copy preserving comments before delete

migrate-personal copied labels/deps/comments best-effort (warnings) and used event-style AddComment, then deleted the source -- so a partial copy could silently drop comments and dependencies while reporting success. Make the copy all-or-error in two passes (create all issue rows, then copy relations so same-prefix intra-set deps resolve), roll back the planning-DB rows and abort before touching the project DB on any failure, and copy comments via ImportIssueComment (structured row + original timestamp). Adds TestCopyIssueRelations_preservesCommentWithTimestamp and TestMigratePersonal_preservesComments. Addresses maphew's review of PR #4023 (be-e2nb).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(ci): register TestPruneLargeFixture in check-testing-short allowlist

Large-fixture bench introduced in this PR was blocked by pr-policy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(docs): restore version-1.0.5 migrate-personal CLI reference

The 2026-06-03 main merge (72a2a2521) pulled in main's wholesale website
doc regeneration, which dropped
website/versioned_docs/version-1.0.5/cli-reference/migrate-personal.md
(migrate-personal is new in this PR and absent on main). check-doc-flags'
generate-cli-docs.sh --check then failed: the live bd emits the command but
the 1.0.5 snapshot lacked the page, turning Build Artifacts, PR Policy,
Check doc flags freshness, and the CI Gate rollup red.

Regenerated with scripts/generate-cli-docs.sh ./bd — only this file
changed (index.md and llms-full.txt already reference the command).
Verified the full pr-policy sequence passes locally: build-tags,
go-install-guidance, versions, doc-flags (incl. llms-full), doc-freshness,
testing-short, and the jsonl guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(gate): finalize be-jewoem gate — re-review PASS, CI green 2026-06-04

Re-review PASS confirmed (gm-wisp-765hi, 2026-05-22, commit 9cfe6206f).
Post-review CI/docs commits (merge, CI allowlist, version-1.0.5 docs)
are non-behavioral. CI run 26924427657: 51/51 checks SUCCESS.
PR #4023 mergeStateStatus: CLEAN. Gate: definitive PASS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(docs): true up CLI reference after upstream rebase

Mechanical doc-conflict resolution during the rebase onto upstream/main
(cb33b566a) picked a stale --include-infra description and live
top-level command count. Re-run scripts/generate-cli-docs.sh to
resync docs/CLI_REFERENCE.md and website/docs/cli-reference/* with the
post-rebase bd binary; scripts/check-doc-flags.sh passes clean.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie

* test(export): teach fakeStateHashStore GetConfig for auto-export owner-exclude path (fixes PR Core panic)

buildOwnerExcludeSet reads export.exclude_owners / export.exclude_owner
from the store as a database fallback after the YAML-only lookup. The
fake store used by the auto-export tests embeds a nil storage.DoltStorage
and never implemented GetConfig, so any exercised auto-export path
(TestMaybeAutoExportExportsOnStateHashChange et al.) panicked on the
embedded nil interface. Add a GetConfig stub returning ("", nil), the
same pattern used by other embedded-nil-interface fakes in this package
(captureOptsStore, mockRefStore).

Agent-Signature: claude-code-sonnet-5-medium on behalf of matt wilkie

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-07-05 15:57:27 -07:00
Chad Woolley
32dacb8fc1
feat(create): add status flag for initial issue status (#4536)
Add bd create --status/-s so new issues can start directly in a built-in or configured custom status. Explicit --status wins over defer-derived status while preserving defer_until.

Reuse the same custom-status validation shape as bd update and normalize typed custom status config during create insertion so values like review:wip validate as review.

Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of thewoolleyman

Co-authored-by: thewoolleyman <chad@thewoolleyman.com>
2026-07-05 11:15:48 -07:00
Jim Wordelman
fffed97d38
feat(dolt): git-origin collision guard in bd dolt remote add + bd doctor (be-7eu1d) (#4153)
* test(cli): be-lbhy2 dolt.local-only enforcement gate tests (TDD, be-3v2ou)

Failing tests for be-3v2ou (dolt.local-only enforcement, FR-01 to FR-05).
All tests fail or refuse to compile until the builder adds isDoltLocalOnly().

cmd/bd/dolt_local_only_test.go (unit, no build tag):
  - TestIsDoltLocalOnly_FalseByDefault
  - TestIsDoltLocalOnly_TrueWhenConfigSet
  - TestIsDoltLocalOnly_FalseAfterUnset
  - TestMaybeAutoPush_SkipsWhenLocalOnly

cmd/bd/dolt_local_only_embedded_test.go (build:embeddeddolt):
  - TestDoltLocalOnly_Push_ExitsZeroWithMessage
  - TestDoltLocalOnly_Push_LocalStoreCopy
  - TestDoltLocalOnly_Push_JSON_DisabledStatus
  - TestDoltLocalOnly_Pull_ExitsZeroWithMessage
  - TestDoltLocalOnly_Pull_JSON_DisabledStatus
  - TestDoltLocalOnly_RemoteAdd_RefusesExitOne
  - TestDoltLocalOnly_RemoteAdd_ErrorOnStderr
  - TestDoltLocalOnly_ConfigRoundTrip
  - TestDoltLocalOnly_DoltStatus_ShowsDisabled

Message copy from be-0jyq7 (UX spec). Exact strings asserted so the builder
cannot ship copy drift.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(dolt): implement dolt.local-only enforcement (be-3v2ou, FR-01 to FR-05)

- Add isDoltLocalOnly() in dolt_local_only.go (reads dolt.local-only config key)
- bd dolt push: exit-0 no-op with 'Remote sync is disabled...' message when set;
  --json emits {status:disabled,reason:dolt.local-only=true} via outputJSONRaw
- bd dolt pull: same exit-0 no-op + 'Nothing to pull.' message
- bd dolt remote add: exit-1 error to stderr ('cannot add Dolt remote: ... disabled')
- bd dolt status: appends 'Remote sync: disabled (dolt.local-only=true)' indicator
  in both embedded and server-mode text paths
- maybeAutoPush: guard fires before getStore() (before any store interaction)
- Fix test build tag: cgo (not embeddeddolt) to match CI embedded test convention
- Fix TestDoltLocalOnly_ConfigRoundTrip: bd config get returns "(not set ...)" not ""

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(dolt): git-origin collision guard in bd dolt remote add + bd doctor (be-7eu1d, FR-06 to FR-09)

- dolt_remote_guard.go: guardNormalizeURL() + doltRemoteMatchesGitOrigin() helpers
- dolt.go: --allow-git-origin flag; refuse (or warn) when Dolt remote URL matches git origin
- doctor/types.go: CategoryDolt = "Dolt Storage" + add to CategoryOrder
- doctor/remotes.go: CheckDoltRemoteGitOrigin() warning check
- doctor.go: wire Check 7f1 into the doctor run

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(cli): regenerate CLI reference for --allow-git-origin

The PR added the --allow-git-origin flag to 'bd dolt remote add' but
did not regenerate docs, failing the 'doc flags freshness' check.
Output of ./scripts/generate-cli-docs.sh ./bd — adds the flag to
docs/CLI_REFERENCE.md and the dolt.md command pages (latest + versioned
snapshots).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(dolt): remove duplicate isDoltLocalOnly declaration from init.go

The function was extracted to dolt_local_only.go in the stacked PR but the
original declaration in init.go was not removed, causing a redeclared-in-block
build error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(cli): regenerate CLI reference for git-origin guard and doctor checks

Full regeneration for the complete PR: --allow-git-origin flag,
--force flag on dolt remote remove, and the bd doctor CheckDoltRemoteGitOrigin
check. Also regenerates federation.md for completeness. Output of
./scripts/generate-cli-docs.sh ./bd and ./scripts/generate-llms-full.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style(doctor): gofmt cmd/bd/doctor.go

The be-7eu1d git-origin guard block left double blank lines around the
new "Check 7f1" stanza, failing `make fmt-check` (CI "Check formatting"
and the gofmt stage of "PR Lint"). gofmt collapses them to single blanks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(cli): regenerate CLI reference + llms-full with pure-go bd

The previous regen (07dcb9a81) was built with a CGO-enabled bd, which
includes the CGO-only `bd federation` subcommands. CI builds the docs
binary with CGO_ENABLED=0 (scripts/ci/pr-policy.sh build_docs_binary),
so check-doc-flags rejected the extra federation subcommand pages.

Regenerated docs/CLI_REFERENCE.md, the federation cli-reference pages
(live + versioned 1.0.0/1.0.4/1.0.5), and website/static/llms-full.txt
with a CGO_ENABLED=0 binary. check-doc-flags + check-doc-freshness now
pass locally under LC_ALL=C.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* style(doctor): gofmt cmd/bd/doctor.go (remove stray blank line)

Fixes the 'Check formatting' CI failure on this PR — the only
PR-introduced gofmt miss among the changed Go files.

* fix(dolt): normalize git+https/git+ssh/SCP URLs in remote collision guard and doctor

Address @maphew's review on PR #4153 (be-e7k8):

1. Add doltremote.CanonicalForComparison() — normalizes both sides of a
   URL comparison to Dolt's git+ prefix form, then strips trailing slashes
   and .git. This makes https://github.com/org/repo.git compare equal to
   git+https://github.com/org/repo.git, and git@github.com:org/repo.git
   equal to git+ssh://git@github.com/org/repo.git.

2. Replace the simple guardNormalizeURL helper in dolt_remote_guard.go and
   normRemoteURL in doctor/remotes.go with doltremote.CanonicalForComparison
   so both paths share one implementation and stay in sync.

3. Fix build tag on dolt_remote_origin_guard_embedded_test.go from
   embeddeddolt to embeddeddolt && cgo: the file delegates to bdDoltSeparate
   which lives in a cgo-only file, so the embeddeddolt-only tag caused a
   compile failure under CGO_ENABLED=0 + embeddeddolt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(dolt): remove dead --force flag from bd dolt remote remove

The --force flag was registered on doltRemoteRemoveCmd but the Run
function never read it via cmd.Flags().GetBool("force") or any other
means, so it had no effect. Remove the flag registration rather than
wiring it up, per review on PR #4153, and regenerate the CLI reference
docs (docs/CLI_REFERENCE.md, website/docs/cli-reference/dolt.md,
website/static/llms-full.txt) so the dead flag no longer appears in
generated documentation.

Agent-Signature: claude-sonnet-5-high on behalf of matt wilkie
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(dolt): check outputJSONRaw error in local-only status paths

main changed outputJSONRaw to return an error after this branch was
written; the two dolt.local-only JSON status sites now handle it with
the same stderr idiom as the neighboring outputJSON callers, fixing the
errcheck CI failure on PR #4153.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-07-04 14:37:51 -07:00
matt wilkie
3eda9c2652
Merge pull request #4568 from maxinflection/fix/dolt-status-shared-server
fix(dolt): probe SQL for bd dolt status in shared-server mode (GH#3218)
2026-07-04 11:17:11 -07:00
matt wilkie
742a7d29c6 docs: refresh dolt status CLI reference
Regenerate the generated CLI reference after the bd dolt status help text update in PR #4568.

Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie
2026-07-04 10:54:47 -07:00
Steve Yegge
e97839a2e1
feat(lease): land the leasing stack + schema v54 (claim-TTL, heartbeat, reclaim) (#4537)
* fix(dolt): retry mutate+commit methods on serialization conflict (1213/1205)

ClaimIssue, ClaimReadyIssue, UpdateIssue and CloseIssue each hand-rolled
their own tx (BeginTx + DOLT_ADD/DOLT_COMMIT + Commit) outside
withRetryTx, so a concurrent writer that lost Dolt's optimistic
commit-time merge surfaced MySQL 1213/1205 as a hard failure instead of
retrying. Dolt has no real row locking — FOR UPDATE / SKIP LOCKED are
parse-only no-ops (https://www.dolthub.com/blog/2023-10-23-hold-my-beer/)
— so retry is the only safety net under N concurrent workers. These four
are the work-queue hot paths: `bd ready --claim`, claim, update, close.

Move each body into a withRetryTx closure (which owns BeginTx and the
final Commit and retries serialization failures with backoff), preserving
the single-tx CAS/mutation + DOLT_COMMIT atomicity exactly. On retry,
ClaimReadyIssue re-scans the ready front from a fresh snapshot and claims
the next available issue.

Tested: TestEmbeddedReadyClaimConcurrent, TestEmbeddedReadyConcurrent,
TestEmbeddedCloseConcurrent, TestEmbeddedUpdateConcurrent and the
non-concurrent embedded Update/Close/Ready tests pass; build + vet clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(dolt): add concurrent work-queue drain test (Gas Station claim invariant)

N workers concurrently dequeue one shared ready-front via ClaimReadyIssue
until empty; asserts every issue claimed exactly once, none stranded, no
double-claims, and no serialization error ever surfaces (withRetryTx absorbs
the 1213/1205 from the claim-CAS cell collision). This is the regression guard
for the multi-agent claim queue that #4491 makes safe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(lease): claim-TTL + heartbeat + reclaim for dead-worker recovery

Gas Station v1.1 (wy-5r9j). A claim was previously permanent: a worker that
died mid-task stranded its issue in_progress forever. This adds a lease so a
claim can expire and be recovered.

Schema (migration 0054): add lease_expires_at, heartbeat_at (DATETIME) and
row_lock (BIGINT) to issues (and wisps, for uniform issueops routing), plus
idx_issues_lease for the reaper scan. assignee doubles as the lease owner.

Lifecycle (shared issueops, so both server-mode DoltStore and EmbeddedDoltStore
get it):
  - Claim stamps lease_expires_at = now + TTL (default 5m, WithLeaseTTL to
    override), heartbeat_at = now, and a fresh row_lock.
  - bd heartbeat <id> — owner-only; pushes the lease forward and rewrites
    row_lock. Fails (ErrNotClaimable/ErrAlreadyClaimed) once the lease is gone.
  - bd reclaim --older-than <dur> — reverts in_progress issues whose lease
    expired more than <dur> ago back to ready (clears assignee/started_at,
    records a lease_reclaimed event). Default grace 2×TTL.

The row_lock trick: Dolt has no row locking and merges concurrent commits
cell-by-cell, so a heartbeat (writes heartbeat_at) racing a reclaim (writes
status) would silently cell-merge into a zombie — an open/unassigned issue that
still carries the worker's fresh heartbeat. Every mutating path (claim, close,
update, heartbeat, reclaim) now rewrites the shared row_lock cell, forcing the
loser to a 1213/1205 serialization conflict that withRetryTx replays. All lease
paths are withRetryTx/withConn wrapped.

Tests (real Dolt): TestRowLockForcesConflictOnDisjointCellWrites proves the bug
without row_lock (silent merge to zombie) and correctness with it (conflict);
TestConcurrentHeartbeatReclaimClose is the integration race (live workers
heartbeat+close vs a continuous reaper vs dead workers) asserting exactly-once,
no lost close, no zombie; plus claim/heartbeat/reclaim unit coverage on both
backends.

Note: lease columns are second-granular DATETIME (Dolt rounds), so sub-second
TTLs are meaningless — production TTL is minutes. Heartbeat writes a Dolt
commit, so cadence must stay ≪ claim cadence to avoid history bloat.

Fixes the test coupling in TestMigration0053PromotesRigWisps, which assumed the
rig-wisp repair was always LatestVersion().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci+docs: allowlist lease stress tests; scope the row_lock invariant comment

- Add TestConcurrentWorkQueueDrain and TestConcurrentHeartbeatReclaimClose
  to the check-testing-short.sh allowlist; both are real-Dolt runtime/stress
  skips and were failing ci-pr-policy.
- freshRowLock doc said "EVERY mutating path" rewrites row_lock, which
  overstates it. Scope it to status/ownership/lease-mutating paths (the set
  the reclaim/heartbeat races care about) and document the invariant + why
  orthogonal-cell writers (is_blocked, compaction, deps, rename, reopen) are
  intentionally exempt, so a future writer does not silently reintroduce the
  zombie-merge bug.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(show): surface lease_expires_at/heartbeat_at in bd show (--json + text) (wy-9cdw)

Migration 0054 added lease_expires_at/heartbeat_at (and internal row_lock) to
the issues/wisps tables for the claim/heartbeat/reclaim leasing feature, but
bd show could not observe lease state — you had to drop to raw SQL.

- types.Issue: add LeaseExpiresAt/HeartbeatAt (*time.Time, omitempty), matching
  the StartedAt nullable-timestamp convention. row_lock stays unexported.
- sqlbuild.IssueSelectColumns: append lease_expires_at, heartbeat_at to the
  canonical hydration list (flows to every stack via the shared constant).
- issueops.ScanIssueFrom: scan + map the two nullable columns (before the
  trailing extra dests, keeping positional parity across all scan sites).
- bd show text view: emit a muted 'Lease: expires <rel> (heartbeat <rel> ago)'
  line only for in_progress issues holding an active lease; add formatTimeUntil
  as the forward-looking mirror of formatTimeAgo.
- types_test: assert lease keys appear when set, are omitted when nil, and that
  row_lock is never surfaced.

* fix(lease): settle v54 review blockers

Address #4537 review blockers before landing v54: keep heartbeat off wisps in both backends, keep direct status/assignee updates from leaving stale leases, guard the down migration, and emit reclaim JSON as snake_case.

Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie

* fix(lease): cover lease fields in tests and hooks

Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-07-03 23:28:55 -07:00
matt wilkie
7d8063d1d4
docs(cli): regenerate CLI reference for bd remember bare-key reads (#4545)
Main has been red since 9ee97c264 (remember read-paving) landed without
a docs regen: docs/CLI_REFERENCE.md and the website remember page
drifted from live --help, failing the strict CLI-docs freshness probe
in Build Artifacts / PR Policy / doc-flags jobs on every push to main.

Regenerated with scripts/generate-cli-docs.sh (pinned CGO_ENABLED=0
build). Diff is exactly the new bare-key recall paragraph and example.

Agent-Signature: claude-fable-5-high on behalf of matt wilkie

Claude-Session: https://claude.ai/code/session_0167xsjJDukVKE7BE1i4W2wE

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 09:14:33 -07:00
coffeegoddd☕️✨
6d8c063143 /docs: regen CLI reference for bd query --offset flag
Regenerated with the canonical pinned build (CGO_ENABLED=0,
-tags gms_pure_go) per the doc-flags freshness check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:47:29 -07:00
Julian Knutsen
26be6aa94c
fix(cli): handle unchecked output-helper errors + regen metrics CLI docs (#4482)
#4419's RunE refactor turned main CI red on two checks (Lint + 'Check doc
flags freshness'):

- golangci-lint errcheck flagged previously-unchecked error returns from the
  output helpers in the files #4419 touched (compact.go, create_proxied_server.go,
  dolt.go, restore.go). Wrap outputJSON/emitGraphApplyDryRun so a genuine
  encode failure is surfaced to stderr instead of silently dropped.
- For the three outputJSONError sites in 'bd dolt remote add/list/remove',
  discard the return explicitly (_ =): outputJSONError always returns the
  &exitError{Code:1} sentinel after writing the JSON envelope, and the
  following os.Exit(1) sets the exit code -- logging it would corrupt the
  stderr JSON-error contract for --json consumers. (Caught by red-team review.)
- Regenerate website/docs/cli-reference/metrics.md (the only stale generated
  doc; CLI_REFERENCE.md + llms-full.txt verified already in sync).

go build / go vet / gofmt / golangci-lint (0 errcheck) / check-doc-flags all pass.

Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 02:18:01 -07:00
CI Bot
894cbf66d1 merge: bring feat/cli-usage-metrics current with main for #4419 land
# Conflicts:
#	cmd/bd/init.go
2026-06-23 06:24:13 +00:00
matt wilkie
dfa8ea4813
fix(docgen): generate CLI docs in one process (#4474)
Add a bulk help docs writer that emits the root CLI reference and website command pages from a single Cobra walk. Update the shell generator to call that mode, preserve the pure-Go docs binary guard, and refresh historical versioned CLI docs only when release snapshotting requests a specific version.

Agent-Signature: codex-gpt-5.5-medium on behalf of matt wilkie
2026-06-22 18:25:58 -07:00
silvanshade
4d3a552424
Fix rig bead durability (#4373)
* Fix rig bead durability (bds-vwz)

* fix: keep rig beads out of infra migration

* fix: repair durable rig wisps

Restore migration 0035 to its frozen upstream shape and add a forward repair migration for existing type=rig rows that were routed into wisps.

Keep type=rig durable while excluding it from ready work, and cover the repair path with CLI-backed schema tests plus Dolt-server tests where available.

Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of matt wilkie

* fix: make rig wisp repair migration upgrade-safe

Guard migration 0053 so older workspaces without local wisp tables no-op instead of failing, while keeping the fresh-Dolt CLI migration bundle able to exercise rig wisp repair fixtures.

Regenerate CLI reference docs for the updated infra type help text.

Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie

---------

Co-authored-by: silvanshade <silvanshade@users.noreply.github.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-06-22 17:06:35 -07:00
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
Eddie the Engineer
05b29caf55 fix(metrics): maintainer adoption fixes for usage-metrics + RunE refactor
Maintainer fixups for PR #4419 folded into one commit on top of the
contributor branch.

Security (blocker): metrics consent and endpoint are resolved from the
user-global config only (config.MetricsDisabledByUserConfig /
UserMetricsEndpoint). A project/BEADS_DIR config — highest viper precedence —
can no longer re-enable metrics or redirect the endpoint for a user who ran
`bd metrics off`.

First-run notice (major): the consent notice runs after the config-derived
json/quiet rebind and command classification, and is suppressed in
JSON/quiet/hook-json, BD_GIT_HOOK, hook/codex-hook/completion/shell-init/
version/prime, the metrics command, `init --stealth`, and the root
`bd --version` / `bd -V` probe, so it can never corrupt machine-readable or
hook/protocol output.

One cli_command event per invocation (major): delegating commands no longer
double-count. `bd ready --gated` and `bd mol wisp <proto>` record only their
own event by delegating to non-emitting cores (runMolReadyGatedCore /
runWispCreateCore), matching the existing runTodoListCore/runListCore pattern;
cardinality regression tests cover both aliases.

config get/show honor user-global metrics state (major): `bd config get
metrics.*` and `bd config show` report the user-global value (via
config.GetUserYamlConfig) that actually governs runtime behavior, with the
user-global path as the location, instead of a project value that has no
runtime effect.

Metrics cleanup on os.Exit paths (major): CheckReadonly and the reachable
pre-run gates (no-DB, fresh-clone, schema-skew, remote-migrate-gate, identity
mismatch) call the shared metrics.CloseAndFlush before exiting, so events
queued earlier in the run are still written and scheduled for upload instead
of stranded until the next clean exit. main()'s post-command tail uses the
same helper. `bd q` now creates its event before the readonly guard and labels
the readonly operation "q".

Telemetry coverage (major): recompute-blocked converted to RunE + HandleError
and emits a cli_command event; `metrics on/off/example` and `version` emit
cli_command events.

Consistency / minor cleanups: added SilenceUsage/SilenceErrors to the
ADO/GitHub/GitLab/Notion push/pull commands to match the jira/linear siblings
in the same file; corrected the inverted env-override "saved config" status
text; preserved 0600 when unsetting user-global config keys.

Pre-review CI repair (earlier in this commit): lint, stealth-init
cleanliness, proxied-server error handling, and regenerated CLI docs.

Tests: user-global opt-out vs project override at the config readers, runtime
resolvers, and `config get`; first-run notice suppression across
hook/protocol/json/quiet/stealth/root-version contexts; event cardinality for
the todo/ready-gated/wisp aliases; and CloseAndFlush persistence.

Original contributor commits preserved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 20:44:48 +00:00
Stephanie Jarmak
749cc63e8d
docs(list): warn that repeated -s/--status silently overwrites (#3916) (#3917)
`bd list --status open --status in_progress` returns only `in_progress`
matches because cobra's StringP flag silently overwrites prior values
on repeat. The canonical multi-status form is the comma-separated
variant (`--status open,in_progress`), and the help text already names
it — but does not warn about the repeated-flag footgun.

Add a one-sentence note to the --status help text and regenerate the
checked-in CLI reference docs via
./scripts/generate-cli-docs.sh. No behavior change.

Closes gastownhall/beads#3916.

Co-authored-by: sjarmak <sjarmak@users.noreply.github.com>
2026-06-22 13:18:44 -07:00
matt wilkie
b4d999fa9e
fix(compact): stop advertising the unimplemented Tier 2 compaction (#4465)
bd admin compact --tier 2 hard-errors "not yet implemented", yet the command
help, --stats output, and several docs advertised "Tier 2: Ultra compression
(90 days closed, 95% reduction)" as if it worked. Make the surface honest:

- Reject --tier != 1 early with a clear "not yet implemented; only --tier 1 is
  available" message instead of failing deep inside a mode.
- --stats labels Tier 2 "not yet implemented" and drops the bogus 95% savings
  estimate; the JSON tier2 block gains "implemented": false.
- Update command/flag help, the plugin skill doc, and the examples README;
  regenerate the generated CLI reference.

New embedded e2e asserts --tier 2 errors and --stats no longer advertises 95%.
No attempt to implement Tier 2 (semantics undefined); only the false
advertising is removed.

Refs #4463

Agent-Signature: claude-opus-4-8-high on behalf of maphew
2026-06-20 15:29:28 -07:00
matt wilkie
889ade6b7f
fix(compact): archive content before destructive compaction; make restore work (#4464)
Content compaction (bd admin compact) overwrote an issue's description and
cleared design/notes/acceptance_criteria in place with no archive, while the
issue_snapshots/compaction_snapshots tables built to hold that archive were
dead code (never written). The only recovery, bd restore, was display-only and
relied on a largest-history-row heuristic that dolt gc / history-squash can
erase. Net: compaction was effectively irreversible.

Wire the existing compaction_snapshots table: archive the full pre-compaction
content (snapshot_json BLOB) before the destructive overwrite, aborting if the
archive fails; add SnapshotIssue/GetCompactionSnapshot/RestoreFromSnapshot to
the CompactionStore interface on both Dolt and embedded stores; and rework
bd restore to restore from the snapshot (--apply writes it back; default stays
read-only display, with the old Dolt-history reconstruction as fallback).

Unit tests assert snapshot-before-overwrite ordering and abort-on-archive-
failure; an integration test covers the snapshot -> overwrite -> restore round
trip against a real Dolt store. CLI reference docs regenerated for the new flag.

Refs #4463

Agent-Signature: claude-opus-4-8-high on behalf of maphew
2026-06-20 14:12:07 -07:00
Steve Yegge
4e460b427b
fix(is_blocked): cross-mode full recompute repair for stale is_blocked (bd-6dnrw.37) (#4423)
* fix(is_blocked): cross-mode full recompute repair for stale is_blocked (bd-6dnrw.37)

The post-pull is_blocked recompute (bd-6dnrw.3) is scoped to the merge diff and
skips when a re-pull merges nothing (HEAD unchanged), so a recompute that failed
AFTER its merge committed — or a conflicted pull resolved by hand (which skips
the recompute) — left is_blocked stale with no repair: rerunning bd dolt pull
merged nothing and recomputed nothing. bd ready trusts is_blocked, so stale
values silently hide ready work or surface blocked work.

Core (internal/storage/issueops/blocked_consistency.go):
- RecomputeAllIsBlockedInTx: full mark/unmark fixpoint over every issue+wisp,
  returns rows corrected. Idempotent. Reuses the existing pass functions.
- CountIsBlockedInconsistenciesInTx: read-only COUNT of stale rows for detection.
  Its predicate mirrors the mark/unmark templates and is pinned to the repair by
  the dolt-package lockstep tests (a converged DB counts 0; any counted row is
  one a recompute pass flips), so detection cannot silently drift from repair.

Cross-mode repair:
- storage.BlockedRecomputer capability; DoltStore + EmbeddedDoltStore
  RecomputeAllBlocked (stage issues-only, matching the post-pull recompute).
- New 'bd recompute-blocked' command — works in BOTH embedded and server mode.
  bd doctor is server-mode only, so embedded users need a non-doctor entry point.
- bd doctor (server mode) gains a read-only "Blocked State" check and a
  'bd doctor --fix' dispatch running the same repair. Warn-only (does not fail
  OverallOK): new check shipping in a patch, is_blocked self-heals via the fix.

Secondary item (server recomputeBlockedAfterPull commits via s.Commit, which can
sweep a concurrent writer's changes) split to bd-6y5hx (P3, deferred): it is
subtle (after an auto-resolved merge the working set holds the whole merge
result, so a naive issues-only narrowing would drop merge results). The embedded
path already stages issues-only; the new repair path stages issues-only too.

Tests: 3 dolt lockstep tests (detect==repair, stuck-blocked, parent-child
cascade) + embedded wiring test. Smoke-tested on a real ~2000-issue embedded DB:
0 false positives. build/vet/gofmt/golangci-lint all clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: regenerate CLI reference for `bd recompute-blocked`

Run ./scripts/generate-cli-docs.sh + ./scripts/generate-llms-full.sh with
the canonical CGO_ENABLED=0 gms_pure_go build to pick up the new
`bd recompute-blocked` command. The adopted PR added the command but did
not regenerate the CLI docs, failing the PR doc-flags freshness checks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(is_blocked): guard full recompute against dirty graph; pin doctor blocked-state last

Maintainer adoption fixes for PR #4423 review (bd-6dnrw.37):

- Refuse a full is_blocked recompute when the committable graph tables
  (issues, dependencies) carry uncommitted working-set changes, across the
  server, embedded, and doctor-fix paths. The recompute derives flags from
  the current graph and stages only `issues`, so running it dirty would
  sweep unrelated issue edits into the repair commit or publish is_blocked
  derived from uncommitted dependency state. Dolt-ignored wisp tables are
  deliberately excluded from the guard: they are never committed and show
  as perpetually modified in dolt_status, so guarding on them would refuse
  the recompute in any workspace that uses wisps.

- Pin the doctor "Blocked State" fix to an explicit terminal priority so it
  provably runs after every graph-mutating fix (Dependency Keys,
  Orphaned/Child-Parent Dependencies, Cross-Table Duplicates) instead of
  relying on check-append order. This fixes a stale is_blocked left after
  `bd doctor --fix --fix-child-parent` removed a child-parent edge.

- Surface (no longer swallow) the doctor-fix Dolt stage/commit errors, and
  tolerate only the benign nothing-to-commit case.

Tests: dirty-issues and dirty-dependencies refusal, dirty-wisps still
repairs, clean repair+commit idempotence (dolt server-mode); fix-ordering
regression covering the --fix-child-parent case (cmd/bd); embedded wiring
test now commits its seed to match the fresh-process clean-tree precondition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Eddie the Engineer <ci@beads.test>
2026-06-19 23:14:09 -07:00
coffeegoddd☕️✨
9a8447ccf6 docs: regenerate CLI reference for bd ready --offset
Run ./scripts/generate-cli-docs.sh + ./scripts/generate-llms-full.sh
with the canonical CGO_ENABLED=0 gms_pure_go build to pick up the new
--offset flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-18 13:55:12 -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
matt wilkie
a006a3369f fix(cli): implement children pretty and defer reason
Why: #4365 reports two documented CLI affordances that either fail or require a second command. children advertised --pretty but rejected it, and defer had no way to capture the reason at deferral time.

What: add the children --pretty flag by delegating to list's existing tree renderer, add defer --reason by appending to notes during the status update, and refresh generated CLI docs.

Agent-Signature: codex-unknown-model-unknown-reasoning on behalf of matt wilkie
2026-06-13 21:22:38 -07:00
Julian Knutsen
e8ae7a291a
feat(count): add --include-infra for exact bd list cardinality parity (#4389)
* feat(count): add --include-infra for exact bd list cardinality parity

bd count hardcoded filter.SkipWisps=true (9a29a158f, Q2 SQL-COUNT rewrite),
so it only counted the durable issues table. bd list --include-infra merges
the wisps table — including no_history beads, which are durable work — so no
count invocation could match a list cardinality. On the production gascity
rig store that meant bd count --type task = 23,777 vs a list --include-infra
cardinality of 33,601: a 29% undercount that blocks Gas City from
implementing an exact Counter over the bd CLI (its bounded-read pagination
needs Total to be exact).

Changes:

- cmd/bd/count.go: new --include-infra flag mirroring bd list's flag.
  applyCountIncludeInfra reproduces the buildListFilter defaults that
  determine list's cardinality under --include-infra: wisps merge
  (SkipWisps=false), template exclusion (IsTemplate=false), default gate
  exclusion unless --type gate, and infra-type routing to the ephemeral
  tier using the store-configured infra set. Without the flag the filter
  construction is unchanged (SkipWisps=true), keeping the widely-scripted
  default byte-identical.
- internal/storage/{dolt,embeddeddolt}/counts.go: CountIssues now delegates
  to issueops.CountIssuesInTx (extended with the query param) instead of a
  hardcoded SELECT COUNT(*) FROM issues, so SkipWisps/Ephemeral routing
  matches SearchIssuesInTx. CountIssuesInTx previously had no production
  callers.
- internal/storage/issueops/count.go: CountIssuesByGroupInTx now honors
  SkipWisps/Ephemeral with the same merge semantics, so --by-* grouped
  counts under --include-infra report merged buckets instead of
  silently-wrong durable-only numbers.
- Tests (TDD): cmd/bd/count_filter_test.go pins the count filter against
  buildListFilter field-by-field; internal/storage/dolt/
  count_include_wisps_test.go asserts CountIssues == len(SearchIssues) for
  the trap filters (templates, no_history, ephemeral) and merged grouped
  counts; cmd/bd/count_embedded_test.go adds CLI-level count==list parity.
- Docs: regenerated CLI reference (also picks up pre-existing dep/import
  help-text drift so scripts/check-doc-flags.sh passes) and one pre-existing
  gofmt fix in issueops/search.go for ci-pr-lint.

Verification on the production gascity rig store (read-only):

  bd count --include-infra --type task  = 33,601
  bd list  --include-infra --type task --all --json --limit 0 | len = 33,601
  bd count --include-infra              = 42,631  (list equivalent: 42,631)
  bd count --include-infra --status open = 1,969  (list equivalent: 1,969)
  bd count --include-infra --by-type    : total 42,631, task bucket 33,601
  bd count --type task (no flag)        = 23,777  (stock bd 1.0.5: 23,777)

Gates: make ci-pr-core (go test -race -short), ci-pr-policy, ci-pr-lint,
go vet ./..., embedded count/list suites, full dolt + embeddeddolt
storage packages.

Fixes #4387

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(cli): write-intent routing for all mutating commands; count ephemeral parity; pin bulk dep cycle gate

Adopt-PR review fixes for PR #4389 on top of the pre-review CI repair.

Routed write surface (#4141, bd-6dnrw.32, GH#3231): bd-6dnrw.32 gave
read-only opens a real read-only path, which silently broke routed sibling
writes -- prefix-routed resolution opened the target read-only, so a mutating
command on a routes.jsonl-routed ID failed with "store is read-only". The
earlier CI repair restored update/comment/comments add/note/reopen; review
found the rest of the mutating surface still broken. Write intent now covers
every prefix-routed mutating command: assign, priority, tag, edit, delete
(single + batch), close (resolveCloseTargets), human respond/dismiss, link,
and dep add/--blocks/remove/bulk (via a new resolveIDWithRoutingForWrite).
The source issue's store opens writable so the write commits on the target
head; read paths, dependency-target ID resolution, dep tree, and contributor
auto-routing stay read-only, preserving the bd-6dnrw.32/GH#3231 guarantee
that routed reads never mutate a foreign project's history. Regression test
TestEmbeddedRoutedMutatingSiblingWritesCommitTargetHead pins assign/tag/
dep add/delete/close routed writes committing on the target head.

Count ephemeral parity (GH#4387): CountIssuesInTx returned the wisps count
unconditionally for an Ephemeral=true filter, while SearchIssuesInTx falls
through to the durable issues table when the wisps tier is empty. The scalar
fall-through landed first, but review (attempt 2) found the same fall-through
missing from the two sibling functions, so grouped counts and count-projection
searches still dropped a durable issues-table row flagged ephemeral=1:
CountIssuesByGroupInTx returned empty buckets while the scalar Total fell
through (sum(groups) != Total), and SearchIssuesWithCountsInTx returned nil
where SearchIssues returned the row. CountIssuesByGroupInTx and
SearchIssuesWithCountsInTx now mirror the scalar/list fall-through, so
bd count --include-infra --by-* and bd search --counts --include-infra match
bd list cardinality when only durable rows match. The scalar fall-through
comment is corrected to describe the durable ephemeral=1 defensive state
(a promoted bead carries ephemeral=0, so it never reaches this branch).
Regression tests TestCountIssuesEphemeralFallsThroughToDurable (scalar),
TestCountIssuesByGroupEphemeralFallsThroughToDurable (grouped), and
TestSearchIssuesWithCountsEphemeralFallsThroughToDurable (counts projection)
pin count==len(list) for that case; the merge path documents that list is the
disjoint-table corruption detector.

Bulk dep cycle gate (bd-6dnrw.8): unchanged from the pre-review repair --
TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate pins the whole-graph
cycle gate on bulk --no-cycle-check adds.

Validation (worktree, BEADS_TEST_EMBEDDED_DOLT=1, -tags gms_pure_go):
routed-write and count-parity regression tests pass; TestEmbeddedDep*,
cross-rig routing, dep/close/delete/link CLI suites, and the count
CLI/issueops suites pass; go build, go vet, gofmt, git diff --check clean.

Validation (attempt 2, grouped + counts-projection fall-through): go build
(issueops, dolt, cmd/bd) and go vet (issueops, dolt) clean; git diff --check
clean. The Dolt count/list parity suite passes against an isolated Dolt test
container (TestCountIssuesMergedMatchesSearch, the three ephemeral
fall-through regressions, TestCountIssuesByGroupIncludesWisps,
TestPR4107SearchIssuesWithCountsEphemeralFalseIncludesNoHistoryOnly); all
three fall-through regressions were verified failing on the pre-fix tree.
Embedded-engine fixtures that need the CGO/ICU build are exercised by the
GitHub PR workflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 04:14:28 -07:00
Dustin Brown
d00b890a33
fix(remote): remove cli invocations of 'dolt remote' and exclusively use store method and sql (#4236)
* /{cmd,internal}: remove dolt cli commands

* /cmd/bd/dolt.go: change remote add and remove to do less

* /internal/storage/dolt/credentials_test.go: remove old tests

* /{docs,website}: regen docs

* /internal/storage/dolt: pr feedback

* /website/static/llms-full.txt: regen doc

* docs: refresh versioned CLI docs

* fix: guard CLI routing for SQL remotes (bd-wisp-6ukh)

---------

Co-authored-by: Eddie the Engineer <julianknutsen@users.noreply.github.com>
2026-06-05 13:58:21 -07:00
coffeegoddd☕️✨
14322af05b /{docs,website,scripts}: holy fuck again 2026-06-03 15:16:55 -07:00
coffeegoddd☕️✨
f9a6f503c4 /{docs,website,scripts}: holy fuck again 2026-06-03 15:10:34 -07:00
coffeegoddd☕️✨
a143374ea0 /{docs,website}: again 2026-06-03 14:59:23 -07:00
coffeegoddd☕️✨
04a65cce81 /{cmd,docs,internal,website}: more ci fixes 2026-06-03 14:56:34 -07:00
coffeegoddd☕️✨
f783cbbede /{docs,website}: gen docs 2026-06-03 14:30:53 -07:00
Jim Wordelman
278b24ab4b
fix(init): honor dolt local-only remote wiring (#4227)
* fix(init): honor dolt local-only remote wiring (ga-vjefud.1)

* docs: regenerate CLI reference for dolt.local-only config help

The dolt.local-only config-set example added in cmd/bd/config.go was not
reflected in the generated CLI docs, so the "Check doc flags freshness" CI
job failed on PR #4227. Regenerate from live bd help: docs/CLI_REFERENCE.md,
the website cli-reference page, the 1.0.0/1.0.4 versioned snapshots, and
llms-full.txt. Generated under LC_ALL=C to match CI's glob collation order.

_Claude Opus 4.7 (beads/investigator) on behalf of quad341_

* docs(config): tighten dolt.local-only help wording + cover isDoltLocalOnly()

Maintainer follow-up on #4227. Two non-blocking review nits:

- The config-set example said "Suppress Dolt remote wiring and sync", but
  dolt.local-only only gates remote wiring at `bd init` time; it does not
  gate runtime `bd dolt push`/`pull`. Reword to "Skip wiring a Dolt sync
  remote during bd init" so the help matches the implemented scope.
  Mirrored into the five generated CLI-reference artifacts.

- Add TestIsDoltLocalOnly to exercise the new isDoltLocalOnly() config
  reader through the env path (BD_DOLT_LOCAL_ONLY). The existing
  TestLocalOnlyInitSkipsConfigureButPersistsExplicitRemote passed localOnly
  directly and never covered the config-reading helper.

Doc artifacts verified fresh with CGO_ENABLED=0 -tags gms_pure_go (matching
CI): check-doc-flags.sh, check-doc-freshness.sh, and both generate-*.sh
--check all pass.

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

---------

Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-05-28 15:41:38 -07:00
matt wilkie
a180c63066
fix(close): support per-id reasons (#4194)
* fix(close): support per-id reasons

Why: upstream GH#3279 reports repeated --reason values applying incorrectly across multi-ID close, while GH#3268 needs a ready zero-dependency regression guard to prevent queue drift.

_codex-gpt-5.5-medium on behalf of matt wilkie_

* docs: refresh close CLI references

_codex-gpt-5.5-medium on behalf of CI Bot_

* fix(close): preserve empty reason compatibility

Ignore empty --reason occurrences so explicit empty strings continue to fall back to the default close reason and do not conflict with --reason-file. Clarify that repeated reasons map to IDs by positional index.

_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-27 20:41:07 -07:00
matt wilkie
7229fb1d11
import: skip stale JSONL issue snapshots (#4204)
* import: skip stale JSONL issue snapshots

Skip imported JSONL issue records when the local row has a newer updated_at timestamp, and report stale skips without creating no-op commits.

_codex-gpt-5.5-medium on behalf of matt wilkie_

* import: report stale skipped JSONL IDs

Expose stale_skipped_ids in import results so JSON callers can distinguish imported IDs from records that were intentionally skipped as stale.

_codex-gpt-5.5-medium on behalf of maphew_
2026-05-27 20:40:12 -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
matt wilkie
5de494b85e
Merge pull request #3562 from quad341/release/be-l9q
feat(list): add --skip-labels hydration toggle
2026-05-26 15:13:54 -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
coffeegoddd☕️✨
e898babbe6 /{cmd,docs,website}: gen docs again 2026-05-26 10:13:11 -07:00
coffeegoddd☕️✨
3080839f11 /{cmd,docs,website}: gen docs 2026-05-26 10:03:22 -07:00
Jim Wordelman
70c82c0363 docs(list): regenerate CLI reference for --skip-labels (be-rqm7yb)
CI's "Check doc flags freshness" gate was failing because the new
--skip-labels flag added in this PR wasn't reflected in the generated
CLI reference. Regenerated via ./scripts/generate-cli-docs.sh.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:26:19 -07:00