Three generated-content defects from the adversarial review, all
structurally invisible to the drift gate (generated-vs-generated):
- Usage lines now mirror Cobra's help template: a runnable command shows
its UseLine, a command with subcommands shows '<path> [command]', both
when both apply. Previously bare UseLine() stamped 'bd mol [flags]' on
30 parent pages — a line the binary never prints.
- The generated CLI index publishes the Global Flags block; the binary
prints it on every --help but no page carried it.
- docsmint neutralizes prose lines that Mintlify's prebuild would dedent
into MDX ESM blocks (a line beginning 'export'/'import' outside a
fence gets wrapped in a code span). This is why /cli-reference/mail
returned HTTP 200 while rendering only a parse-error placeholder —
reproduced, fixed, and covered by a planted-hazard test; fenced
content stays verbatim.
Also rewords check-cli-docs-drift.sh's early-PASS message, which
asserted 'the supplied binary differs' as the cause when uncommitted
local edits produce the same result.
All 113 pages + docs/CLI_REFERENCE.md regenerated through the pipeline;
TDD'd in cmd/bd/help_all_test.go and tools/docsmint/docsmint_test.go.
Verified live: /cli-reference/mail renders real content, zero parse
errors; generate-cli-docs.sh --check, docsync, freshness, and
mint broken-links all pass on this tree.
Adversarial review reproduced four dead references from the built
binary that the earlier printed-path sweep missed (two pointed at the
deleted website/ tree, which the sweep's docs/-anchored patterns never
covered): the --server help in bd init (second STORAGE-BACKENDS
occurrence), bd formula's narrative-reference pointer, the
remote-migrate gate's docs URL, and the whats-new Dolt guide entry.
Also updates the storage-backends pointer in the emitted Postgres
schema comment.
Per decision 7, bd's user-facing strings now reference the Mintlify-era
paths: prime policy-profiles help, storage-backend comparison help
(store_factory_nocgo, init --backend), init-safety help (recovery
playbooks now docs/recovery/init-safety.md; the ADR reference now
engdocs/adr/), the pk-fork-refused recovery URL (dolt.go), doctor's plugin
suggestions (claude.go) and managed-handoff pointer, aider setup guidance
and the shared recipe template (quickstart URL), and the agent instruction
templates (sync-concepts URL, quickstart URL). bd mol pour's help no
longer claims molecules are 'synced with git' — they sync via Dolt like
any other bead.
Also corrects the stale claude recipe ProjectPath metadata
(.claude/settings.local.json -> .claude/settings.json; the dedicated
installer has written settings.json since the migration sweep).
This repo's AGENTS.md managed section is refreshed to the new template
body (hash bacef91e, has-remote variant preserved), and agents.md.tmpl's
embedded marker matches. Template tests updated to pin the new fragment;
CLI docs regenerated.
Recorded, not fixed (behavior-level, see the decision record):
routing.mode's maintainer/contributor no-op values and the
sync.require_confirmation_on_mass_delete key with no consumer.
Note: TestCheckBeadsRole_NotConfigured/_NotGitRepo in cmd/bd/doctor fail
on any machine with beads.role in the global git config (no HOME
isolation) — pre-existing, unrelated to this change.
Per the decision record (engdocs/decisions/2026-07-10-mintlify-docs-overhaul.md):
bd's doc generator is vendor-neutral. `bd help --docs-root` now writes
docs/CLI_REFERENCE.md plus a generic per-command tree (title/description
frontmatter, portable CommonMark, HTML-comment markers) into build/cli-docs/
— uncommitted staging, gitignored. All site-generator-specific output leaves
the binary: Docusaurus frontmatter, sidebarPositionMap, the website/ writers,
the Mintlify writers, the docs.json nav splice, and the --docs-version
snapshot flag are gone from cmd/bd.
tools/docsmint (Go, unit-tested) is the Mintlify post-processor: it turns
the staging tree into the committed docs/cli-reference/ pages (JSX comment
markers, extensionless route links) and splices the CLI Reference pages
array in docs/docs.json. scripts/generate-cli-docs.sh runs both stages;
--check seeds the committed artifacts into a scratch root, regenerates, and
diffs, exactly as before.
Regenerated output: the 113 pages are byte-identical through the new
pipeline; docs.json nav ordering is now plain filename sort;
docs/CLI_REFERENCE.md drops the removed --docs-version flag.
`bd help --doc <cmd>` stdout is likewise generic now (no Docusaurus
id/slug/sidebar_position).
- mint.sh + make docs-dev: local preview of the docs/ Mintlify site
(Node 22 handling modeled on the Gas City wrapper).
- test/docsync: Go guard keeping docs/ and docs.json in exact
correspondence — every nav entry has a file, every page is in the nav
(tiny stub allowlist for paths released bd binaries print), published
pages use root-relative extensionless links that resolve, and engdocs/
plus curated root markdown keep exact GitHub-style paths. Wired into
make check-docs.
- .github/workflows/docs-mintlify.yml: docsync + baseline-aware
mint broken-links check on PRs touching docs/**.
- Retire scripts/sync-website-docs.sh and its mirror-drift gate: the six
mirrored files now live once in the Mintlify site; the committed
Docusaurus mirrors stay frozen so the parallel-run site keeps building.
- Repoint inbound links to moved docs across README, guides, examples,
npm-package, plugin resources, and Go comments; add docs/SYNC_CONCEPTS.md
pointer stub (bd's agent templates print that path). Runtime strings in
cmd/bd (prime.go, store_factory_nocgo.go, init_git_hooks.go) still print
old paths — covered by stubs, flagged in the PR.
bd help --docs-root now additionally writes docs/cli-reference/ in Mintlify
form (frontmatter title as H1, extensionless root-relative links, JSX
auto-generated markers since Mintlify parses .md through MDX) and rewrites
the CLI Reference pages array inside docs/docs.json via a textual splice
that leaves the rest of the file byte-identical — the ~113 nav entries are
never hand-maintained. The Docusaurus outputs (docs/CLI_REFERENCE.md,
website/docs/cli-reference/, versioned snapshots) are unchanged.
generate-cli-docs.sh --check seeds docs/docs.json and docs/cli-reference/
into its scratch root and diffs both; check-cli-docs-drift.sh adds them to
GEN_PATHSPECS and the regeneration fingerprint; docs-autofix-push.sh
allowlists the new generated paths; check-doc-flags.sh scans the new
docs/ subdirectories and requires command coverage in docs/cli-reference/.
Includes the initial docs/docs.json scaffold (nav mirrors the Docusaurus
sidebar IA) and the generated docs/cli-reference/ pages.
TDD: new emitter behavior covered in cmd/bd/help_all_test.go
(Mintlify page format, nav splice correctness + idempotence, bare-root
generation without docs.json).
Relocate contributor- and maintainer-facing material out of docs/ so the
directory can become the user-facing Mintlify site. Moves preserve subpaths
(adr/, design/, staged-for-removal/ intact). messaging.md, UI_PHILOSOPHY.md,
and AGENT_SIGNING.md move per their DOC_INVENTORY dispositions (design doc,
design philosophy, maintainer convention).
Inbound links updated repo-wide: root guides, CONTRIBUTING, AGENTS,
workflows, lint config, scripts (check-doc-freshness now resolves the
inventory at engdocs/DOC_INVENTORY.md), Go comments, and the synced website
metadata page (regenerated via sync-website-docs.sh + generate-llms-full.sh).
The emitted help text in cmd/bd/init_safety_help.go still references
docs/adr/0002-init-safety-invariants.md; changing it would change bd's
runtime output, which is out of scope for this branch (flagged in the PR).
* fix(label): support comma-separated multi-label add/remove; fail hard on bad issue IDs (bd-vu5kv)
'bd label add <id> a b c' silently applied only 'c': the grammar treats
the last arg as THE label and everything before it as issue IDs, and
unresolvable IDs were skipped with a stderr warning while the command
exited 0. An agent hit this in the wild and only noticed because
'bd ready --label ...' came back empty.
Two changes:
- The final positional arg now splits on commas, so
'bd label add bd-123 a,b,c' adds all three labels in one transaction
(same convention as 'bd create --labels a,b,c'). Same for remove.
- Issue-ID args that fail to resolve are now a hard error before any
mutation, instead of warn-and-continue. When several ID-position args
fail, the error hints at the comma-separated form, which is exactly
the space-separated-labels mistake.
The reserved 'provides:' check now runs against every label in the
list. Regenerated CLI reference docs (freshness probe) and updated
docs/LABELS.md.
Closes bd-vu5kv
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012VBUR4qkHbssPomBDuJgkQ
* docs: sync website label mirrors
Agent-Signature: codex-gpt-5.6-terra-high on behalf of matt wilkie
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
Routine issue history already lands in the database events tables. Stop creating or appending the interactions JSONL sidecar by default, add audit.enabled for explicit sidecar use, and expose database events via bd history --events.
Fixesgastownhall/beads#4687
Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie
* Fix prime guidance for local-only repositories
* Honor authority profiles in local-only prime guidance (#4321)
Keep the contributor behavior while allowing team-maintainer profiles to
commit locally, and isolate the regression test from ambient workspace state.
Agent-Signature: codex-gpt-5.6-sol-high on behalf of maphew
---------
Co-authored-by: matt wilkie <maphew@gmail.com>
Cursor support is anemic compared to Claude Code and Codex. It ships
only a static rules file: no agent lifecycle hooks, so `bd prime`
context is never injected at session start and is silently lost after
context compaction, and it has no `bd init` auto-install, no `--global`
scope, no shared agent skill, and no `bd doctor` coverage.
This PR brings Cursor up to the same footing as the tier-1 integrations.
- `bd setup cursor` now installs agent lifecycle hooks
(`.cursor/hooks.json`) alongside the rules file, wiring
sessionStart/preCompact/postToolUse to a hidden `bd cursor-hook`
command so Beads context survives compaction:
* sessionStart injects full `bd prime` context into new sessions
* preCompact arms a one-shot refresh marker
* postToolUse re-injects `bd prime` once after a compaction, then
no-ops
- `bd init` auto-installs Cursor (rules + skill + hooks) and stages
`.cursor/`
- `bd setup cursor --global` writes `~/.cursor/hooks.json` +
`~/.agents/skills/beads`
- Canonical rules: `.cursor/rules/beads.mdc` wraps the shared
`recipes.Template` instead of a hand-maintained copy
- Shared agent skill (`.agents/skills/beads`), removed only once neither
Cursor nor Codex still relies on it
- `bd doctor` reports Cursor Integration, Settings Health, and Hook
Completeness checks with agent-mode enrichment
Shared hook mechanics (prime runner + one-shot refresh marker) are
factored into `cmd/bd/agent_hook.go` and reused by codex-hook.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
An adversarial fable red-team of the multi-backend PR surfaced 19 findings; the
verified, non-regressing subset is fixed here (two were confirmed intentional and
left as-is with clarified comments).
Dolt-parity (high):
- sqlkit tx AddLabel/RemoveLabel/CloseIssue recorded no audit event, unlike both
Dolt references, so bd label add/remove and bd batch / mol squash close lost
their EventLabel*/EventClosed rows on Postgres/MySQL/SQLite. Delegate to the
same issueops with-event helpers the embedded oracle uses.
- Heartbeat left updated_at stale on Postgres/SQLite (no ON UPDATE trigger;
MySQL/Dolt auto-bump), so bd stale diverged. Stamp updated_at on the heartbeat
UPDATE (claim already stamps it, so no double-assign).
Correctness / hardening:
- postgres/mysql/sqlite stampSchemaVersion: idempotent insert (ON CONFLICT /
INSERT IGNORE / INSERT OR IGNORE) + re-read, so concurrent first provisions do
not fail one opener with a duplicate-key error.
- sqlkit tx SetConfig now syncs custom_statuses/custom_types like the oracle.
- pgdialect INSTR->POSITION leaves the call loud when both args carry a
placeholder, preventing a silent parameter swap.
- creds command runner uses cmd.exe on Windows (sh is POSIX-only).
- Dolt gateway credential command is gated on the Dolt backend, not just
shared-server mode (was failing closed for SQL workspaces).
- Scrub pg/mysql URL passwords from the bd.args telemetry span.
Conformance rigor:
- E2E normalize() maps zero/epoch timestamps to <ZERO-TS> so a lost timestamp no
longer reads as byte-identical to a real one.
- E2E logs its candidate set and honors BEADS_CONFORMANCE_REQUIRE so a
sqlite-only run cannot masquerade as full coverage.
Docs/hygiene:
- Scrub dev-machine paths (/data/tmp/pg-recon, proposal_2.md, "proof-wedge") from
the Postgres schema DDL comment; clarify the SQLite timestamp comment.
Deliberately not changed (would regress): sqlkit UpdateIssue uses the without-event
variant to MATCH dolt-server (only embedded differs); sub-second timestamp
precision is an intentional per-backend waiver (whole-second round-trip is the
portable contract) — forcing round-down would discard PG/SQLite fidelity.
Verified: embedded + postgres + mysql + sqlite + server-dolt TestConformance and
the pg/mysql/sqlite E2E differential all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Maintainer fixup for the choose-your-own-storage-backend PR, amended across the
pre-review CI-repair and the review-loop apply-fixes iterations so contributor
commits stay intact under one maintainer commit.
CI repair (pre-review):
- default.nix: bump vendorHash for the added Postgres/MySQL driver deps.
- conformance.yml: provision the Postgres service DB with a C-locale cluster so
text ORDER BY sorts by code point, matching Dolt's utf8mb4_0900_bin oracle.
Review fixes — blockers:
- uow/doltserver_tx: on a non-serialization DOLT_COMMIT failure, ROLLBACK on the
pinned session before releasing it, and poison (pool-discard via driver.ErrBadConn)
the connection when the rollback also fails, so a later borrower can't inherit an
open transaction and implicitly commit orphaned writes. Satisfies the existing
doltserver_tx_test rollback/poison cases.
- sqlitedialect: translate GREATEST/LEAST to SQLite scalar max/min so the
ReconcileChildCounters upsert (GREATEST(last_child, ?)) no longer aborts creation
or import of hierarchical dotted issue IDs (e.g. x-1.2) on the SQLite backend.
Review fixes — majors:
- conformance: add a portable dotted hierarchical child-ID scenario (x-1, x-1.1,
x-1.2, x-1.2.1) exercising the ReconcileChildCounters GREATEST path on every
backend — the coverage hole that let the SQLite blocker ship green. Verified
against the embedded-Dolt oracle and the real SQLite driver.
- postgres: warn at provision/open when the database collation is not code-point
ordered (C/POSIX/C.*), since text ORDER BY otherwise diverges from Dolt silently.
- sqlite: pin the pool to one connection and add busy_timeout + WAL to the DSN so
overlapping operations wait instead of surfacing a raw "database is locked"
(matches the Dolt backend's single-connection posture). Adds a concurrency guard.
- cmd/bd: gate explicit `bd dolt commit` / `bd vc commit` with a typed
storage.ErrUnsupported on non-Dolt backends instead of the no-op Commit printing
"Committed."; internal opportunistic auto-commit is untouched.
Review fixes — attempt 2 (stale init backend-flag test contract):
- cmd/bd/init_test, init_embedded_test: the init backend-flag tests still asserted
the pre-#3151 one-backend contract (--backend=sqlite must fail "SQLite backend
has been removed"; --backend=postgres is an "unknown backend"), so
`go test ./cmd/bd -run '^TestInitBackendFlag$'` failed in a clean environment now
that sqlite/postgres/mysql are supported pluggable backends. Rewrite
TestInitBackendFlag and the cgo TestEmbeddedInit sibling (rejected_backends →
sql_backend_flags) for the new contract: --backend=sqlite initializes and
persists backend=sqlite; --backend=postgres is recognized and fails only on
missing connection config (not "unknown backend"); a genuinely unknown backend
is still rejected. Pin BEADS_DIR and scrub BEADS_*/BD_* so the subtests are
hermetic against an ambient .beads or Dolt server.
Cleanups (non-gating):
- cmd/bd/init: extract checkExistingSQLBackend so the added SQL-backend branches
don't inflate checkExistingBeadsDataAt's complexity, and load config once.
- configfile: correct the stale "Deprecated: always dolt" Backend field comment.
Review fixes -- attempt 3 (SQLite datetime parity blocker + conformance/rewrite
hardening of the storage-parity gate):
- sqlite/dsn: add _time_format=datetime. Without it modernc binds time.Time via
t.String() ("2026-07-09 12:34:56.123 +0000 UTC"), a shape SQLite's date functions
cannot parse, so the counts mega-query's DATE_FORMAT(created_at,...) (strftime on
SQLite) returns NULL and deps_json exposes a zero created_at while Dolt emits the
real timestamp. datetime stores whole-second "2026-07-09 12:34:56", matching
Dolt/MySQL datetime(0). Verified end-to-end against the real modernc driver.
- conformance: add ReadyWorkDepCreatedAtParity -- imports a dependency with a known
created_at (the bd import / CreateIssuesWithFullOptions bound-time.Time path) and
asserts the counts-rendered deps_json created_at equals it, closing the blind spot
that let the SQLite blocker ship green (the counts tests only checked DependencyCount).
Proven to fail on the pre-fix DSN and pass on both the fixed SQLite backend and the
embedded-Dolt oracle.
- conformance: add ClaimReadyIssueConcurrentExclusivity -- races 24 workers over 8
ready issues and asserts each is claimed exactly once, exercising the SQL backends'
multi-writer claim property that was previously only asserted, never raced. Gated to
the multi-connection dialects (postgres/mysql) via DialectName; SQLite (single-conn
pool) and embedded-Dolt skip.
- conformance.sh: run the embedded-Dolt reference conformance with
BEADS_TEST_EMBEDDED_DOLT=1 and fail loudly if it skips. It self-skips without the env
var, so the parity gate was reporting success while never running the reference oracle.
- mysqldialect: drive the is_blocked-recompute error-1093 rewrite test from the real
issueops templates (new issueops.SelfReferentialRecomputeTemplates) instead of a
hand-copied fixture, so template drift fails a non-gated test rather than only the
env-gated MySQL conformance suite. All four mark/unmark x issue/wisp templates
verified rewritten into the materialized derived-table form.
Note: the review re-flagged TestInitBackendFlag as failing, but it passes in a clean run
(plain and gms_pure_go, matching the scorecard's own rerun); the only cmd/bd failure in
this sandbox is an unrelated pre-existing embedded-Dolt/CGO test not in this PR's diff.
Review fixes -- attempt 4 (conformance-gate self-brick + all-wisps inline-dependency
drop blockers; Postgres error-log password-leak major):
- conformance.sh: anchor the embedded-Dolt reference skip/pass guards to top-level
result lines (^--- SKIP/PASS: TestConformance). The attempt-3 loud-fail guard used
an unanchored grep, so the indented, legitimate subtest skip of
ClaimReadyIssueConcurrentExclusivity (embedded-Dolt is single-writer) matched it and
false-failed the entire storage-parity gate on every run even when the top-level
suite passed. Whole-suite-skip protection is preserved.
- sqlkit/portable + embeddeddolt/create_issue: the all-wisps arm looped the
single-issue issueops.CreateIssueInTx, which runs no batch dependency-persist pass,
so an all-wisps batch carrying inline dependencies (e.g. importing no-history beads
with inter-bead edges -- export DOES include no-history beads, GH#2619) silently
dropped every edge (not even reported via OnSkippedDependency) and, one transaction
per issue, forfeited batch atomicity. Both now mark ephemeral, then run the whole
batch in ONE transaction through issueops.CreateIssuesInTx, matching the server-mode
DoltStore all-wisps arm. The embedded-Dolt reference oracle had the same latent drop,
so the oracle and the new SQL backends were corrected together to keep conformance
parity (the finding compared sqlkit against the server-mode DoltStore, which already
persisted these edges).
- conformance: add CreateAllWispsInlineDependencies -- an all-wisp batch with one valid
inter-wisp edge and one unresolvable edge; asserts the valid edge persists and the
unresolvable one is reported via OnSkippedDependency. Fails on the pre-fix per-issue
loop, passes on the batch path; verified on SQLite and the embedded-Dolt oracle, with
a full embedded-Dolt conformance re-run clean.
- pgdialect: scrub query-param/sslpassword secrets from pgx ParseConfig errors in Open
and OpenRaw (new ScrubDSNError). pgx's ParseConfigError redacts only URL userinfo, so
a postgres://u@h/db?password=SECRET DSN (the shape bd init connects with) leaked the
cleartext secret through the wrapped parse/TLS-config error into logs. Connect-time
errors were verified not to carry the password. Adds redact_error_test coverage for
the query-param, sslpassword, userinfo, and libpq-keyword shapes plus the real
Open/OpenRaw parse-failure path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rebase of PR #4601 (feat/choose-your-own-backend) onto current origin/main,
squashed to a single commit because the original 73-commit history built and then
removed the uowStore derisk spike incrementally, which does not replay cleanly
over the 125 commits main has since advanced (notably #4679, the ready-work
counts fix, which merged to main and is now inherited rather than re-applied).
The full pre-rebase history remains on the original branch tip for reference.
Contents (multi-backend feature + the six review follow-ups):
- bd init --backend=postgres|mysql|sqlite provisioning behind the Dolt-parity
seam; the three SQL backends share *sqlkit.Store over pluggable dialects and
carry a generated typed-unsupported shell for the non-core surface.
- Passwords in init DSNs are redacted before persisting to metadata.json (driver
parser + re-parse verification), with a negative-test matrix proving no secret
survives (pgdialect + mysql).
- The uowStore derisk spike and its report artifacts are removed; the shell
generator now lives in internal/storage/unsupportedgen (neutral name).
- Compile-time guard `var _ storage.DoltStorage = (*Store)(nil)` on each backend
plus a regen-idempotence test keep the generated skip lists honest.
- sqlkit exposes CountReadyWork so every SQL backend satisfies
storage.ReadyWorkCounter and inherits the shared page-pushed ready-counts path.
- Commercial/product names scrubbed from the feature's own code for vendor
neutrality.
Rebase reconciliations: adopted main's metadata-load hardening in the store
factories alongside the backend dispatch; combined the config interface
(GetMetadata + ReconcileVersion) and the conformance registrations (ReadyCounts +
Claim/lease); took main's versions of the shared-infra concurrency (uow
doltserver_tx) and delete-cascade (domain/issue_delete) evolutions; implemented
the interface's new UnclaimIssue on sqlkit (delegating to issueops) and added it
to the skip lists.
Verified: go build (cgo + CGO_ENABLED=0) and go vet clean; unit tests
(sqlbuild/issueops/pgdialect/mysql/unsupportedgen) and the SQLite conformance
suite green (RunAll, incl. ReadyCounts equivalence and Claim/lease on the real
sqlkit backend).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
singleIssueSnapshot compares updated_at at 1-second granularity, and a title
change is not otherwise reflected in the snapshot. The test created and updated
the issue back-to-back, so on a fast machine both landed in the same wall-clock
second, updated_at tied, and the snapshot compared equal — a spurious failure.
Seed the created issue's updated_at an hour in the past (CreateIssue honors a
non-zero UpdatedAt) so the title update's fresh timestamp is unambiguously newer.
No production change; the watch snapshot behavior is unchanged.
Co-authored-by: Test User <test@test.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`bd ready --json` had two O(N) hotspots on main. The counts mega-query's
reverse-blocker `rc` subquery keys on COALESCE(depends_on_issue_id, …), an
expression the pure-Go GMS analyzer cannot auto-index, so it re-scanned its
whole materialization once per candidate — O(candidates × blockers). And the
"Showing X of N" total re-ran that entire mega-query UNBOUNDED just to size N.
Changes:
- Generalize one counts builder: sqlbuild.SearchCountsSQL now takes an optional
`ids []string`. Empty ids = the predicate form (unchanged callers); non-empty
ids = the page-pushed form that constrains the driver and every count
subquery to the page, bounding rc by the page instead of the full graph.
Removes the drifted SearchCountsSQL/SearchCountsByIDsSQL duplication; the
projection order is defined once and DepTargetExpr is used throughout.
- issueops.runReadyCountsInTx resolves the ready-ID page with the cheap indexed
ID query, then hydrates counts constrained to those IDs, CHUNKED by
sqlbuild.QueryBatchSize so large pages stay within backend placeholder limits
(no quadratic fallback, no wasted ID pass). The page order is restored so the
result is byte-identical to the unbounded ORDER BY … LIMIT.
- issueops.CountReadyWorkInTx sizes N with indexed COUNT(*)s over the ready
predicate for the issues AND wisps families, minus the wisp-wins overlap —
identical to len(GetReadyWorkWithCounts(Limit=0)) even when wisps exist, with
no mega-query fallback.
- Add ReadyWorkCounter to internal/storage beside the other optional
capabilities; DoltStore and EmbeddedDoltStore implement CountReadyWork.
cmd/bd/ready.go zeroes the limit at the call site and unwraps to the
capability via storage.UnwrapStore, falling back to the unbounded query only
when a store predates it.
- Extract the shared scan/dedupe loop (scanCountsRowsInTx).
- Conformance tests: page counts byte-identical to unbounded, and
CountReadyWork == len(unbounded), with fixtures for wisps and a page that
spans the chunk boundary.
Co-authored-by: Test User <test@test.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address Copilot review on #4677:
- buildProxiedServerClientInfo now writes a sidecar when only port or
idle-timeout is set (previously returned nil, dropping both values).
- Reword idle-timeout validation error to "non-negative" since 0 is valid.
- Cover port-only, idle-timeout-only, and round-trip persistence in tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(config): derive tracker config namespaces from the registry
`bd config set ado.org <org>` warned "not a recognized config key" (and
unhelpfully suggested "ai.org") even though ADO is a registered tracker
and the value persists correctly. The recognizer's allowlist hardcoded
jira./linear./github. but had drifted — it never gained ado. (GH#4427).
Rather than just add "ado.", make the tracker registry the single source
of truth: drop the hardcoded tracker prefixes from recognizedConfigPrefixes
and derive them at runtime from tracker.List() via a new
allRecognizedConfigPrefixes helper, used by both isRecognizedConfigKey and
suggestConfigKey. This eliminates the drift class so the next tracker is
covered automatically. As a bonus, a genuine typo near a tracker name
(e.g. "add.org") now suggests "ado.org" instead of "ai.org".
Also adds the missing tracker namespaces (gitlab, ado, notion) to the
'Common namespaces' help text.
Tests: extend TestIsRecognizedConfigKey with ado/gitlab/notion/linear/github
keys, add TestTrackerConfigPrefixesRecognized asserting every registered
tracker prefix is recognized, and a suggester case.
Fixesgastownhall/beads#4427
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: regenerate CLI reference for registry-derived config namespaces
The config-key registry change surfaces gitlab.*, ado.*, and notion.*
in the 'bd config set' help text; regenerate the committed CLI docs to
match so the doc-freshness gate passes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(preflight): make the readiness checklist project-aware
`bd preflight` always printed a Go/Nix-specific checklist (go test,
golangci-lint, gofmt, go.sum vendorHash, version.go vs default.nix)
regardless of the project's language, which is misleading in non-Go
repos (GH#4364).
Detect the stack from standard marker files and emit a tailored
checklist: go.mod -> go test/golangci-lint/gofmt; package.json ->
npm test/tsc; pyproject.toml or setup.py -> pytest/ruff; Cargo.toml ->
cargo test/clippy; otherwise a generic reminder. The beads-pollution
item is added for any beads workspace.
The repo's own rich Go+Nix checklist (gms_pure_go build tags, nix
vendorHash, version-sync) is preserved unchanged when preflight runs
inside the beads repo itself, detected via the go.mod module path, so
there is no regression for beads contributors.
Adds pure-Go tests covering each detected stack and the beads-repo
detection.
Fixesgastownhall/beads#4364
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(preflight): suppress gosec G304 on internal go.mod read
The isBeadsRepo go.mod read uses a variable path (repo root + fixed
filename), which gosec flags as G304. The path is constructed
internally, so annotate with //nolint:gosec following the existing
pattern in cmd/bd.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`bd remember` is a leaf command with ExactArgs(1), so a mistaken
`bd remember recall` (or any bare bd command name like `status`,
`forget`, `memories`) silently stored that word as a memory instead of
doing what the user intended — no dispatch, no confirmation (GH#4401).
Guard the content argument: if it is a single bare word that matches the
name or alias of a top-level bd command, refuse with an actionable hint
instead of writing a memory. Genuine insights are phrases (they contain
whitespace) so they pass untouched, and an explicit --key signals
deliberate intent and bypasses the guard, so storing the literal word is
still possible.
Adds a pure-Go regression test for the matcher.
Fixesgastownhall/beads#4401
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`bd -C <dir> migrate --update-repo-id` derived the new repository
fingerprint via `beads.ComputeRepoID()`, which shells out to git in the
process working directory. But `-C` does not chdir — it resolves
`BEADS_DIR` — so the fingerprint was computed from the caller's repo, not
the `-C` target. From a different repo it would stamp the target DB with
the wrong repo's fingerprint; from a non-git cwd it failed outright with
"not a git repository". Because repo_id lives in the synced metadata
table, the bad value propagates to every clone on the next push, turning
their doctors red with a misleading "database belongs to different
repository". `bd doctor` already computes this correctly via
`ComputeRepoIDForPath(beadsDir)`; migrate now does the same.
Fixes the same cwd-vs-`-C` defect in the plain `bd migrate` metadata
backfill (repo_id and clone_id) so it cannot reintroduce the wrong value.
Fixes#4361
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(gitlab): sync issue dependency links on push
After issue content syncs, mirror local beads dependency edges as GitLab
issue links: blocks -> GitLab blocks/is_blocked_by (direction-normalized),
related/relates-to -> a single relates_to link per unordered pair (deduped).
Children of synced epics also keep the epic's milestone during a
dependency-only sync. Reports links_pushed in --json.
Additive only (never deletes remote links). License-aware: blocks/
is_blocked_by needs GitLab Premium/Ultimate; on instances without it the
link is reported as a single curated, non-fatal message (links_license_skipped
in JSON) while relates_to and milestones still apply. Genuine (non-license)
link failures remain real warnings, kept distinct from the license case.
Feature: max-efe
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(gitlab): address review — drop dead RelationMap, add push link parity
Follow-up to maphew's review on #4294.
- Delete the dead GitLab RelationMap: issueLinksToDependencies maps link
types via hardcoded constants and ignores MappingConfig, so the field, its
default, and the test assertion were dead config surface implying a
configurability that does not exist. (Linear's RelationMap is untouched.)
- Give `bd gitlab push` dependency-link + epic-milestone parity with
`bd gitlab sync`: extract the shared pushGitLabDependencyLinks helper from
runGitLabSync's inline block and call it from runGitLabPush, scoped to the
requested IssueIDs. Render push output natively so the link pass runs
before the summary, dry-run ordering is correct, and the --json payload
carries links_pushed / links_license_skipped / milestones_updated, matching
sync in all output modes; also guard OnMessage under !jsonOutput.
Reviewed with /code-review + /codex (dry-run "Synced" line, output ordering,
and --json link-stat omission all caught and fixed here).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(gitlab): check outputJSON error in runGitLabSync (errcheck)
CI lint (first run on this branch, only-new-issues=false) flagged the
unchecked outputJSON return in the sync --json path. Return it, matching
runGitLabPush. Fixes the Lint / Build Artifacts / PR Lint failures.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(gitlab): carry closed state on push; surface failed-close in sync result
GitLab's POST /issues (and milestone/work-item creation) cannot set state,
so closed beads were pushed as opened issues and closed epics as active
milestones — milestone progress read 0/X even when all children were done.
- Close after create on all three paths (CreateIssue, createMilestone,
createTaskWorkItem) via a best-effort follow-up state_event=close.
- BeadsIssueToGitLabFields emits state_event close/reopen so the update path
flips both directions (reopening a bead reopens the GitLab issue). deferred
stays open — only "done" work counts toward milestone completion.
- A failed best-effort close now records a warning on TrackerIssue.Warnings,
which the engine drains into the sync result (visible in --json) instead of
a bare stderr print that left --json reporting errors:0 while the issue was
left open.
On close failure the created issue and its external_ref are still returned so
the next push doesn't create a duplicate (the push skip-guard means it won't
retry the close until the bead is next modified — hence the surfaced warning).
Reviewed via /code-review + Codex.
bd: max-9t6
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(create): let `--repo=<remote URL>` past the no-local-db PreRun guard
`bd create --repo <remote-url>` still died with "no beads database found"
when run from a directory with no .beads/ workspace, even though
create.go's remote-cache path (internal/remotecache) opens its own store
against the remote and never needs a local database at all.
This is a follow-up to gastownhall/beads#4615 (itself a reimplement of
#3774): #4615 taught PersistentPreRunE to resolve a *local* --repo path's
workspace so the local-path case works from a bare directory, but its
`!remotecache.IsRemoteURL(repoVal)` condition explicitly excluded remote
URLs, leaving them to fall through to the same "no beads database found"
exit the local-path fix was built to route around.
Extend that guard: when `create --repo` is a remote URL per
remotecache.IsRemoteURL, return from PersistentPreRunE immediately instead
of falling through to local database discovery, mirroring how other
store-free commands (noDbCommands, configCommandCanRunWithoutStore) already
skip store init. create.go's own remote-cache branch, gated on the same
IsRemoteURL check, opens the remote store and replaces the global `store`
before any create-issue logic that needs it runs.
That skip leaves `store` nil for two call sites in create.go that run
before the remote-cache branch (the production-database test-issue warning
and the --status custom-statuses lookup); both are now nil-guarded and
degrade to best-effort/built-in behavior rather than panicking, since prior
to this fix `create` never reached RunE with a nil store.
Adds a pure-Go regression test that hides the `dolt` CLI from PATH so the
downstream remotecache.Ensure failure is fast and deterministic ("dolt CLI
not found") rather than a real network call, while still proving the
earlier guard was bypassed. Manual repro against
https://doltremoteapi.dolthub.com/maphew/mybd confirms the failure mode
changes from the local "no beads database found" exit to a genuine
remote-cache network/permission error.
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* test(create): tolerate pure-go remote repo failure
Keep the remote --repo PreRun regression test focused on bypassing the no-local-db guard while accepting the pure-Go embedded-mode failure that occurs downstream before a hidden-dolt failure.
Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* 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
* feat(prime): add agent.profile config + BD_AGENT_PROFILE runtime knob (mybd-44me)
PR #4220 added the conservative/minimal/team-maintainer PROFILE VOCABULARY
to the generated Beads block and `bd prime` output, but selection stayed
implicit (driven by no-push / ephemeral-branch / no-git-remote checks).
This answers gh#3423 (follow-up to #4220) by adding first-class runtime
plumbing:
- New `agent.profile` config key (default "conservative"), validated with
a safe fallback to conservative on an unrecognized value (mirrors the
existing GetSovereignty() pattern in internal/config/sync.go).
- `BD_AGENT_PROFILE` env override, wired for free via viper's existing
AutomaticEnv + BD prefix/key-replacer wiring (no new BindEnv needed).
- `bd prime` now layers the explicit profile on top of its existing
implicit branches: when agent.profile=team-maintainer and no hard git
constraint applies (not stealth/local-only/ephemeral/no-push), the
close-protocol wording becomes definitive ("commit/sync/push as part of
routine work") instead of the prior ambiguous "may... when enabled"
text. Unset/conservative/minimal leaves existing wording unchanged.
- docs/SETUP.md and docs/CONFIG.md now point at the actual knob instead
of "edit your own AGENTS.md".
Deliberately out of scope: the generated AGENTS.md/CLAUDE.md template
text in internal/templates/agents/defaults/*.md and
internal/recipes/template.go still describes profiles narratively for
tools without config-file access; changing those golden templates is a
larger, separate follow-up.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Agent-Signature: claude-opus-4-8-high on behalf of matt wilkie
* fix(config): register agent. prefix as recognized config key
bd config set agent.profile team-maintainer succeeded but printed a
false "not a recognized config key" warning because cmd/bd/config.go's
allowlist never learned about the agent.* namespace added alongside
the agent.profile knob. Add "agent." to recognizedConfigPrefixes and
cover it in the isRecognizedConfigKey test.
Addresses Codex cross-vendor review finding (2026-07-07) on PR #4585.
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: port Windows hardening fixes
Port the live Windows/test hardening fixes from contributor PRs #3797, #3801, #3802, #3806, and #3812 onto current upstream/main.
#3801 is applied to the moved dbproxy server test path. The release-script test harness also normalizes Bash-visible paths so the fake bd is selected reliably from Windows-hosted test runs.
Co-authored-by: sms <114885497+seanmartinsmith@users.noreply.github.com>
Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie
* fix(test): keep release-script fixtures out of source tree, preserve PATH
releaseTestTempDir previously created .tmp-release-tests under the
source repo root, requiring a writable checkout to even start the
release-script tests. Use t.TempDir() instead so the tests run from
read-only checkouts and packaging build directories.
runReleaseDryRunWithEnv hard-coded PATH to "<fakebin>:/usr/bin:/bin",
dropping the caller's PATH entirely. On systems where bash or core
utilities live elsewhere (e.g. Nix/Guix), the inner `bash
scripts/release.sh` invocation then failed. Prepend the fake bd
directory to the caller's actual PATH (converted per-entry via
shellPath for Bash) instead of replacing it.
Addresses Codex cross-vendor review finding (2026-07-07) on PR #4600.
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
* fix(import): respect import.auto=false on empty DB in bd update (fixes#4304, mybd-3fvn)
shouldRunAutoImportJSONL gated the empty-database upgrade-recovery
auto-import (maybeAutoImportJSONL, GH#2994) on read-only/global/server-mode
flags only. It never consulted the import.auto config key, so
BD_IMPORT_AUTO=false (or import.auto: false in config.yaml) had no effect on
this path -- only the separate git-hook sync importer (importJSONLForSync)
honored it. Any write command (e.g. bd update) against a fresh/empty
database with a stale issues.jsonl present would silently auto-import it and
report success, exactly as reported in #4304.
Add the missing config.GetBool("import.auto") check to
shouldRunAutoImportJSONL. Explicit `bd import` is unaffected: it already
short-circuits on cmd.Name() == "import" regardless of this flag.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWVnjn3Bq4PSG1akpFpKnY
Agent-Signature: claude-sonnet-5-medium on behalf of matt wilkie
* fix(config): route import.auto through YAML config
bd config set import.auto previously treated the startup gate as a database-backed key, so the value landed where the auto-import checks never read it. Mark it YAML-only like import.path and cover both direct and config set-many routing tables.
Agent-Signature: codex-gpt-5.5-high on behalf of matt wilkie
* fix(config): exempt config-set of import.auto=false from pre-run auto-import
Running `bd config set import.auto false` (or `config set-many ...
import.auto=false`) triggered the very auto-import it was meant to
disable: shouldRunAutoImportJSONL runs in PersistentPreRun before the
config command writes the new value, so it still saw the old default
(true) and imported first when a stale .beads/issues.jsonl sat next to
an empty database. Add isDisablingImportAutoViaConfigCommand to detect
this specific invocation and skip the pre-run import so the master
switch takes effect on the same command that sets it.
Addresses Codex cross-vendor review finding (2026-07-07) on PR #4595
(mybd-ycu4).
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
* fix(doltremote): fold host case, strip creds, recognize user-less SCP in CanonicalForComparison
Closes false negatives in the git-origin collision guard / bd doctor remotes
check: host case now folded, embedded user[:pass]@ credentials stripped, and
user-less SCP form host:path recognized. http vs https kept distinct.
mybd-ootd. Follow-up to gastownhall/beads#4153.
Agent-Signature: claude-opus-4-8-high on behalf of matt wilkie
* fix(doltremote): preserve non-default SSH users in canonical comparison
CanonicalForComparison stripped any user@ prefix from an SSH authority
the same way it strips HTTP(S) transport credentials, so distinct
remotes like alice@example.com:repo.git and bob@example.com:repo.git
canonicalized to the same string. SSH userinfo selects the remote
account/home directory, not a credential, so it is now preserved
except for the conventional "git" user, which git hosts treat as the
default and which the userless-SCP form already folds against.
Also documents the accepted P3 trade-off (dotless SCP host aliases
like "github:org/repo.git" are not recognized as SCP-style, since the
dot-in-host heuristic is what distinguishes a hostname from a Windows
drive letter) as a code comment rather than a behavior change.
Addresses Codex cross-vendor review finding (2026-07-07) on PR #4576
(tracking: mybd-ycu4).
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
* fix(doltserver): reap leaked test dolt sql-servers (test-gated Pdeathsig + suite-exit sweep)
A 2026-07-05 dev-machine audit found 13 orphaned `dolt sql-server`
processes, ages up to 3+ days, each serving a now-deleted /tmp test
tempdir. detached dolt servers (Setpgid, no Pdeathsig) are a deliberate
production feature — a shared server must outlive the `bd` process that
started it — but that same detachment means a SIGKILLed test binary (or
its Relay wrapper) leaves its embedded server running forever with
nothing to reap it.
Two defense-in-depth pieces, both scoped to Linux (the leak evidence)
and gated so production behavior is untouched:
1. Test-gated Pdeathsig (internal/doltserver/procattr_linux.go). Split
procAttrDetached() out of doltserver_unix.go into a Linux file and a
non-Linux-unix file, since syscall.SysProcAttr.Pdeathsig only exists
on Linux. When BEADS_TEST_MODE=1, the detached server now also gets
Pdeathsig: SIGTERM, so it exits when the thread that spawned it dies.
Production (BEADS_TEST_MODE unset) stays byte-identical: Setpgid:
true only. Windows keeps its existing procAttrDetached untouched.
Pdeathsig fires on death of the spawning *thread*, which the Go
runtime can retire independently of the process — so this is
documented as a best-effort test-only backstop, not a guarantee.
2. Suite-exit sweep (internal/doltserver/sweep*.go). A pure selection
function (selectOrphanTestServerPIDs, unit tested) decides which
`dolt sql-server` processes are provably test debris: cmdline matches
dolt+sql-server AND either its working directory has been deleted
(Linux's /proc/<pid>/cwd grows a " (deleted)" suffix) or sits under a
suite-scoped root the caller explicitly vouches for as its own (e.g.
that suite's own testTempRoot). SweepOrphanedTestServers never
defaults to a global root like os.TempDir(): scripts/test.sh runs
packages in parallel (-p N), and virtually every suite's data dir
lives somewhere under os.TempDir() too, so a global root would make
one suite's TestMain sweep SIGTERM other suites' still-live servers
mid-run. A production shared server's data directory is never a
caller-scoped test root and never gets deleted out from under it, so
it can never match either condition.
SweepOrphanedTestServers() is wired into the TestMains most likely to
leak: cmd/bd's main CLI suite (which runs a real `bd` binary with
auto-start against its own testTempRoot-anchored .beads dir — the
strongest match for the observed /tmp/beads-bd-tests-* leaks),
cmd/bd/doctor's e2e suite (its own testBDDir), cmd/bd/doctor/fix and
internal/storage/dolt (each given a new suite-owned temp root created
for this purpose), internal/beads (its own suite root), and a new
TestMain for internal/doltserver's integration-tagged tests, which
previously had none at all despite calling doltserver.Start directly
against t.TempDir() (this one passes no root and relies solely on the
deleted-cwd signal). Non-Linux platforms get a no-op stub so all call
sites compile unchanged everywhere.
Agent-Signature: claude-sonnet-5-high on behalf of matt wilkie
* fix(doltserver): decouple Pdeathsig from BEADS_TEST_MODE, revalidate PID before sweep kills
Two P2 hardening gaps in the leaked-test-server reap logic added by this
PR:
1. procAttrDetached() gated Pdeathsig on the general-purpose
BEADS_TEST_MODE=1 flag, which is inherited across exec boundaries.
When a test execs a short-lived `bd` subprocess with BEADS_TEST_MODE=1
(e.g. `bd dolt start`, `bd init --server`, the config-apply restart),
Pdeathsig tied the newly detached dolt sql-server's life to that
subprocess, SIGTERMing it the moment the subprocess exited by design
and breaking any later `bd` invocation in the same test run. Split
this into a narrower BEADS_TEST_PDEATHSIG=1 flag, set only by the two
TestMains that actually call doltserver.Start directly in-process and
stay alive for the server's lifetime (internal/doltserver,
internal/storage/dolt). Auto-started servers were already unaffected
(resolveAutoStart disables auto-start under test mode).
2. SweepOrphanedTestServers sent SIGKILL to every PID that accepted the
initial SIGTERM without rechecking it still referred to the same
process, leaving a PID-reuse race window. Added isDoltServerProcess,
which re-reads /proc/<pid>/cmdline to revalidate identity immediately
before both the initial SIGTERM and the follow-up SIGKILL.
Addresses Codex cross-vendor review finding (2026-07-07) on
gastownhall/beads#4592.
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Route the nil-provider, uow-open, and commit failures through
FatalError / FatalErrorRespectJSON so they emit structured JSON under
--json, matching delete_proxied_server.go. Strengthen the
nonexistent-remote test to assert the failure names the remote.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Converge the cleanup-side `staleDatabasePrefixes` list in `bd dolt clean-databases` with the firewall-side `testDatabasePrefixes` from be-c5p, so both prefix lists are textually identical and `benchdb_` / `beads_test` are no longer leaked by cleanup.
Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Why: upstream main's Main workflow and nightly full tests were failing after
#4023 - buildReferencedSet compiled all candidate IDs into one large regexp
alternation and applied it to every open bead body, ~15-16s on the 10K-bead
fixture against TestPruneLargeFixture's 5s budget. Replaced with a linear
literal matcher grouped by first byte (0.46s on the same fixture), keeping the
existing word-boundary behavior, with a matcher boundary test for punctuation,
child IDs, and embedded-word false positives.
Also switches buildReferencedSetProxied (landed this morning in #4610) to the
same shared matcher, per the coordination agreed on that PR - the proxied path
no longer reintroduces the slow-scan profile.
Reviewed clean (no findings) in the 2026-07-07 Codex cross-vendor sweep of own
PRs (maphew/mybd reports/codex-cross-review-2026-07-07.md).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Why: bd prune and bd purge simply did not work against a proxied server. This
closes that gap on the right side of the storage seam - the delete-closed flow
routes through UnitOfWork and the existing domain use cases (SearchIssues,
GetCustomStatuses, GetCommentsForIssues, DeleteIssues), with the only domain
widening being a Cascade flag on DeleteIssuesParams. Every pre-existing
DeleteIssuesParams caller preserves the always-cascade contract; prune sets
Cascade=false to match the embedded path's cascade=false, force=true
semantics. Integration coverage spans requires-filter, dry-run, force,
reference protection, --ignore-references, JSON output, and dolt-commit.
Includes a maintainer follow-up commit restoring referenced_ids_sample parity
in the proxied JSON final result (flagged in review and by Copilot), with a
test guarding it.
Known follow-up, tracked on #4599: buildReferencedSetProxied mirrors the
embedded regexp-alternation reference scan that #4599 replaces with a linear
matcher; the proxied path will be switched to the shared matcher there so the
slow-scan profile does not return through proxied mode.
Co-authored-by: coffeegoddd☕️✨ <dustin@dolthub.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
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>
Push bead labels (issue_type-derived + custom labels) to Linear on `bd linear sync --push`, closing #3753.
Why: completes the #3772 pair - #3772 gave push-direction state mapping its outbound overrides, this PR makes labels flow beads -> Linear (they previously only flowed Linear -> beads, so pushed issues arrived label-less). Adds paginated `GetTeamLabels`, a per-team `LabelCache`, inversion of `label_type_map` for the push direction, label-aware `PushFieldsEqual` skip logic, and warnings for labels missing on the Linear team. Author rebased onto main same-day when asked; rebase verified clean against the pre-rebase diff (changed lines byte-identical, both #3772 and #3776 test sets preserved in mapping_test.go).
Local verification: gofmt clean, `CGO_ENABLED=0 go build -tags gms_pure_go ./...` ok, `go test ./internal/linear/...` ok, `go vet` clean. Failing PR checks (errcheck in formula_schema.go, testing.Short policy, unclaim/update claim tests) are base-branch breakage present on main at rebase time, since fixed by #4623 - unrelated to this change.
Co-Authored-By: kev <kglynn@pryoninc.com>
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>
types.custom and types.infra are first-class config keys: the type
resolver reads them (internal/config getConfigList), and bd types tells
users to run 'bd config set types.custom "..."'. But types. was missing
from recognizedConfigPrefixes, so 'bd config set types.custom ...' printed
a spurious 'not a recognized config key' warning even though it stored the
value. Add types. to the recognized prefixes so the warning no longer
fires for a documented key.
TestPruneLargeFixture's <5s budget is invalid under the race detector (~20s vs ~1.2s). The Main integration cmd/bd shard runs with -race; gate the timing assertion on a build-tag raceEnabled flag so only non-race builds enforce it. Correctness assertions still run under -race.
Repairs three independent failures that turned main red:
- fix(formula): check outputJSON error return in schema command (errcheck → Lint/PR Lint/Build Artifacts)
- test(quiet): run quiet embedded test under embedded Dolt instead of testing.Short (policy → PR Policy/Build Artifacts); also fixes a latent ID-parse bug so the test actually runs
- test(unclaim): fix stale --json and claim-error assertions from #4614 (Embedded Dolt Cmd shards 5 & 19)
Validated locally and by the PR's embedded-Dolt CI tier (all 20 cmd shards green).
`bd create --repo=<local path>` failed with "no beads database found"
when run from a directory with no .beads/ workspace, even though the
target repo had a valid one. PersistentPreRunE exited early with that
error before create.go's --repo handling ever ran.
Resolve the target repo's .beads/ workspace inside PersistentPreRunE when
`create --repo` names a local path, so store initialization points at the
target. Remote --repo URLs are left to create.go's remote-cache path.
Reimplementation of gastownhall/beads#3774: main's PersistentPreRunE has
drifted (the "no beads database found" block is now guarded by a
configCommandCanRunWithoutStore gate and a FindDatabasePath lookup), so
kevglynn's original one-block patch no longer applies. The diagnosis,
reproduction recipe, and expected behavior are kevglynn's; the embedded
regression test encodes the reproduction from GH#3774.
Agent-Signature: claude-fable-5-high on behalf of matt wilkie
Co-authored-by: kevglynn <kglynn@pryoninc.com>
* 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>
The HTML graph viewer was unusable for non-trivial graphs. Two distinct
bugs in cmd/bd/graph_export.go template:
1. CSS selector "svg { width: 100vw; height: 100vh }" matched every
<svg> on the page, including the 30x10 legend swatches for "blocks"
and "parent-child" edge types. Each swatch ballooned to viewport
size and stretched the #legend container over the graph. Scope to
#graph instead.
2. Initial zoom was a hardcoded "translate(width/4, height/4).scale(0.8)"
that doesn't read node positions — multi-layer graphs ran off-screen
to the right. Replace with a real fitToView() that reads the post-
simulation bounding box and transforms to fit with padding. Also adds
a "Fit View" button and repoints resetZoom() to call fitToView()
(matches user expectation of the existing Reset View button).
Co-authored-by: a3ackerman <user.email=28374790+A3Ackerman@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>