The FAQ opened by calling beads a "git-based issue tracker", which
contradicts the Dolt-native architecture documented elsewhere (README
opens with "Distributed graph issue tracker for AI agents, powered by
Dolt"; the FAQ itself later explains `bd dolt push` / `bd dolt pull`
and Dolt branches independent of git branches).
Newcomers reading the FAQ first formed an incorrect mental model:
storage backend = git, sync mechanism = git push/pull. In reality,
issues live in a local Dolt database and sync via Dolt remotes; git
is only involved for project code (and optionally for ferrying the
exported `.beads/issues.jsonl` between machines).
Replaced "git-based issue tracker" with "version-controlled issue
tracker" — accurate without dropping the "Dolt" vendor name in the
opening line (newcomers do not yet recognize Dolt; it is introduced
later in the FAQ where context is built up).
Also fixed downstream misframings in the same file:
- "Git-First, ..." differentiator header -> "Offline-First, ..."
- "git-synchronized task memory" -> "version-controlled task memory"
- "Git-native sync" -> "Built-in sync" (Taskwarrior comparison)
- "Sync via git commits" -> "Sync via `bd dolt push` / `bd dolt pull`"
- "bd's git-based sync" -> "bd's version-controlled storage" + cell-level merge
- "Sync happens via git push/pull" -> "Sync happens via `bd dolt push` / `bd dolt pull`"
Left genuine git references untouched: the merge-conflict section
showing JSONL diffs (issues.jsonl is a real git-tracked artifact for
portability), git hooks, `bd init`'s git interaction, the "walks up
like git" auto-discovery analogy, and the worktree FAQs.
Tracking: mybd-ujr
GH: #3683
PR: #3706 (precursor)
Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The published reference page documented `.beads/config.toml` and `BEADS_*`
env vars, but the live implementation has used YAML config (`config.yaml`)
and the `BD_*` env prefix for some time — the site has been misleading
newcomers ever since. Rewritten against `internal/config/config.go` and
`internal/config/yaml_config.go` to match live behavior.
Updates both `website/docs/reference/configuration.md` and the
`version-1.0.0` versioned snapshot, since v1.0.0 itself shipped with
the YAML/BD_* implementation (`SetConfigType("yaml")` and
`SetEnvPrefix("BD")` are present in the v1.0.0 source).
Tracks: mybd-hxq
Refs: GH#3683 (newcomer trust-gap pattern), PR #3706
(mybd-p71 doc inventory that surfaced this).
Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: fix broken xref to docs/EXTENDING.md in extension example
The extension example README referenced docs/EXTENDING.md in three
places, but that file was deliberately deleted in the SQLite -> Dolt
migration (see CHANGELOG entry "Deleted deprecated docs - removed
EXTENDING.md and MULTI_REPO_HYDRATION.md (SQLite-era, no longer
applicable)"). Anyone following the example hits a broken link.
Removed all three references. The example README is itself the
canonical reference for the extension pattern, so no redirect target
is needed.
Note: other docs in the repo still reference the deleted EXTENDING.md
(docs/ADVANCED.md, docs/CONFIG.md, examples/library-usage/README.md,
website/docs/reference/advanced.md). Those are out of scope for this
fix and should be addressed in follow-up issues.
Tracking bead: mybd-q71
GH: #3683
PR: builds on follow-up audit from PR #3706
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: fix remaining broken xrefs to deleted EXTENDING.md across repo
Round 1 (commit ddeff314c) only fixed the extension example README
because the original prompt scoped that PR narrowly. The bead
(mybd-q71) acceptance is repo-wide ("no broken xrefs anywhere"), so
this follow-up sweeps the rest in the same PR per the project's
"one issue per PR" rule.
Per-file treatment (EXTENDING.md was deleted in commit 508387377
before v1.0.0 was tagged, so even the v1.0.0 versioned snapshot has
been broken since release):
- docs/ADVANCED.md (3 refs):
* Note in Extensible Database section: drop trailing "See
EXTENDING.md for details" — the surrounding sentence about
Dolt-era alternatives stands on its own.
* Bold "See EXTENDING.md for complete documentation" line:
redirect to the canonical working example
(examples/bd-example-extension-go).
* Next Steps bullet: same redirect.
- docs/CONFIG.md (2 refs):
* Namespace doc for compact_*: replace "(see EXTENDING.md)" with
"(used by `bd admin compact`)" — the doc itself describes the
keys, no external reference needed.
* See Also bullet: replace with link to docs/ADVANCED.md
(Extensible Database section).
- examples/library-usage/README.md (1 ref):
* See Also bullet: replace EXTENDING.md link with link to the
sibling bd-example-extension-go example.
- website/docs/reference/advanced.md (1 ref):
* Custom Tables section: replace EXTENDING.md link with link to
the bd-example-extension-go README on GitHub.
- website/versioned_docs/version-1.0.0/reference/advanced.md (1 ref):
* Same fix as the live docs. EXTENDING.md was deleted before
v1.0.0 release (commit 508387377 is an ancestor of tag v1.0.0),
so this versioned snapshot has been broken since cut and a fix
here doesn't violate frozen-in-time correctness — the link was
never valid in the v1.0.0 release.
- website/static/llms-full.txt (1 ref, auto-generated artifact):
* Updated to match the corrected source so the on-disk artifact
isn't broken until next regeneration.
- beads.go and internal/beads/beads.go (package doc comments):
* Replaced "see docs/EXTENDING.md" / "see EXTENDING.md" with a
pointer to examples/bd-example-extension-go. These were real
broken pointers in published Go source comments.
CHANGELOG.md historical entries left untouched (intentional history).
cmd/bd/info.go:747 left untouched (it's a programmatic CHANGELOG
entry rendered by `bd info`, equivalent to a CHANGELOG line).
Verification:
grep -rn 'EXTENDING\.md' --include='*.md' .
returns only CHANGELOG.md hits.
Tracking bead: mybd-q71
GH: #3683
PR: #3713 (round 2)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: CI Bot <ci@beads.test>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add Go-side dedup in searchTableInTx to ensure SearchIssues never
returns the same issue ID twice, regardless of how many dependency
subqueries match. This prevents bd list from showing issues multiple
times when they have more than one blocks dependency.
* fix: replace deprecated --force flag with --reinit-local in init error messages
Four error messages in init.go suggested 'bd init --force --prefix <x>'
when a workspace was already initialized. The --force flag was deprecated
in favor of --reinit-local, but the error messages were never updated.
Fixes#3684
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test: add regression tests for GH#3684 --reinit-local in error messages
Add TestCheckExistingBeadsData_SuggestsReinitLocal with two subtests
(embedded_dolt, sqlite_db_file) that verify the 'already initialized'
error messages recommend --reinit-local instead of the deprecated --force.
Also strengthen existing guard tests (server_mode_with_dolt_dir_blocks_init,
embedded_mode_with_existing_db_blocks_init, embedded_metadata_ignores_ambient)
with GH#3684 assertions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat(linear): adopt issueBatchCreate/issueBatchUpdate for 50x efficiency
Implements tracker.BatchPushTracker interface on linear.Tracker.
Adds BatchCreateIssues and BatchUpdateIssues methods that chunk
inputs into groups of 50 (Linear's per-call limit). Graceful
fallback to per-issue mutations on batch failure.
* fix(linear): address BatchPush correctness blockers from maphew review
Three correctness issues flagged in PR #3654 review:
1. Skip semantics: BatchPush now fetches each existing issue before
updating and compares with PushFieldsEqual (title, description,
priority, status). Unchanged issues are added to result.Skipped
instead of being re-pushed unconditionally. forceIDs bypasses the
check, matching the single-issue path in engine.go:doPush.
2. Batch-create result mapping: results are now matched by title rather
than array index. Linear's issueBatchCreate API does not guarantee
response order matches input order; index-based mapping silently
associated wrong ExternalRefs with issues. Unmatched inputs are
recorded in result.Errors with the title for debugging.
3. Multi-team state cache: build a StateCache per configured team at the
start of BatchPush. Updates to issues belonging to non-primary teams
resolve workflow state IDs against that team's cache, not the primary
team's. The primary cache is used only for creates (which always target
the primary team).
Add four regression tests covering: unchanged-issue skip, forceIDs bypass,
title-based result mapping with reversed API response, and per-team state ID
selection in a two-team setup.
* fix(linear): prevent duplicate issues from batch-create correctness gaps
Two correctness fixes addressing maphew's re-review blockers on PR #3654:
1. Title-based result correlation is unsafe for duplicate titles.
BatchPush now detects duplicate titles before batching. Issues with
duplicate titles are routed through single-create with idempotency
markers (CreateIssueIdempotent) instead of the batch mutation where
title-based correlation would silently lose one duplicate.
2. Full-chunk fallback after ambiguous batch failure risks duplicates.
BatchCreateIssues no longer falls back to creating the entire chunk
when the batch mutation returns success=false or an API error. Instead
it searches for each issue's idempotency marker to discover which were
partially created, returns only confirmed issues, and errors on the
rest. If the recovery search itself fails, the error propagates rather
than risking duplicates.
Supporting infrastructure ported from feat/linear-idempotency-markers:
- idempotency.go: GenerateIdempotencyMarker, AppendIdempotencyMarker
- FindIssueByDescriptionContains, CreateIssueIdempotent on Client
* fix(linear): gofmt client.go and tracker_test.go
Fix Check formatting CI failure — two files had formatting drift
from the merge conflict resolution.
Reconcile local metadata.json against the authoritative server state in
shared-server/server mode. Repairs two drift cases:
1. Stale dolt_database when another server DB matches the local project_id
2. Stale/missing local project_id when the configured DB has one
Also hardens the server metadata probe:
- Escapes backticks in database names to prevent SQL injection
- Distinguishes expected probe errors (table/DB not found) from unexpected
ones (permission denied, connection failures) so reconciliation does not
act on an incomplete server inventory
Co-authored-by: Bella-Giraffety <thalia.geraghty@fiserv.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The LightDark() arguments were reversed: light gray (#bfbdb6) was shown
on light backgrounds (invisible) and dark gray (#5c6166) on dark backgrounds
(poor contrast). Swap them so each variant is legible on its intended
background.
Closes#3611
Add staleness detection so agents and devs automatically get fresh
Linear data without retry infrastructure.
- New staleness library (internal/linear/staleness.go): WriteLastPull,
ReadLastPull, IsPullStale, IsWithinDebounce, GetStalenessInfo
- --pull-if-stale flag on bd linear sync with configurable --threshold
(default 20m) and 5-minute debounce to prevent agent loops
- bd prime auto-pulls when stale and LINEAR_API_KEY is set
- Per-session stderr warning on any bd command when data is stale
- 14 new tests covering all staleness functions
Design validated by three adversarial reviewers (architecture,
performance, agent-native). Morning storm (50 devs) = 1% of rate
limits. Scales to 500 devs safely.
Refs: PLAN.md d16, btl-seo
`Ephemeral=&false` in SearchIssuesInTx previously only queried the issues
table, skipping the wisps table entirely. But NoHistory beads (ephemeral=0,
no_history=1) live in the wisps table and must survive export.
Extend the wisps merge pass to also run when Ephemeral=&false. The WHERE
clause (`ephemeral=0 OR ephemeral IS NULL`) already exists in the wisps
query via BuildIssueFilterClauses — so NoHistory beads are included while
true ephemeral wisps (ephemeral=1) are correctly excluded.
Fixes the regression flagged in GH#3659 review: `TestExportNoHistoryBeadRoundTrip`
documents that NoHistory beads must survive export/import. (GH#3649)
OAuth-only sync path (no LINEAR_API_KEY required):
- Tracker.Init() now checks for OAuth credentials first
(LINEAR_OAUTH_CLIENT_ID + LINEAR_OAUTH_CLIENT_SECRET), constructs
NewOAuthClient per team when present, and only falls back to API key
when OAuth is absent. Missing both is a clear error naming both options.
Lint fixes:
- oauth.go: add //nolint:gosec on DefaultOAuthTokenURL (G101 false
positive — URL path component, not a credential)
- oauth.go: change defer resp.Body.Close() to
defer func() { _ = resp.Body.Close() }() to satisfy errcheck
- .golangci.yml: add unparam exclusion for getLinearConfig (ctx param
kept for context propagation)
Docs/code precedence alignment:
- getLinearConfig: env vars now take precedence over config.yaml for
yaml-only keys (was reversed). Matches documented precedence:
OAuth > LINEAR_API_KEY > config file.
Tests:
- TestTrackerInitOAuthOnly: validates OAuth client construction without
API key
- TestTrackerInitNoAuthFails: validates error message when no auth
configured
The PR introduced exportIncludeMemories as a new package-level flag but
did not add it to saveAndRestoreGlobals, making test outcomes
order-dependent when export tests toggle it.
Add all six export flag globals (exportOutput, exportAll,
exportIncludeInfra, exportScrub, exportNoMemories,
exportIncludeMemories) to the savedGlobals snapshot so that
saveAndRestoreGlobals atomically covers all export state. Tests that
already call saveAndRestoreGlobals now get full isolation without manual
t.Cleanup per-global.
Addresses maintainer feedback on GH#3660.
- Format types.go (struct field alignment was off by one space)
- parseRetryAfter: use http.ParseTime for HTTP-date form (RFC 1123 /
RFC 850 / ANSI C) instead of time.Parse(time.RFC1123) — the latter
requires an exact timezone abbreviation while http.ParseTime accepts
the canonical GMT form mandated by RFC 9110 §10.2.3
- Add MaxRetryAfterDelay (300s) cap on server-provided Retry-After
delays; log a warning to stderr and clamp when the hint exceeds the cap
- Wire linear.rate_limit_floor / LINEAR_RATE_LIMIT_FLOOR through both
Tracker.Init() and getLinearClient() so the config key is functional
via `bd config set linear.rate_limit_floor <n>` and the env var
- ErrRateLimitExhausted now implements RateLimitExhausted() bool;
engine.go uses an interface check (no import cycle) to abort the
push loop immediately on quota exhaustion instead of cascading the
error across every remaining issue
- Tests: extend TestParseRetryAfter with HTTP-date future/past cases;
add TestExecute_RetryAfterCapApplied to confirm the cap path is taken
Fix 1 (double description formatting): Tracker.CreateIssue was calling
BuildLinearDescription(issue) to format the description, but the sync
engine's FormatDescription hook already calls BuildLinearDescription
before invoking CreateIssue. For issues with AcceptanceCriteria/Design/
Notes, this caused those sections to be appended twice in the Linear
description. Fix: use issue.Description directly in CreateIssue, trusting
the caller to have pre-formatted it.
Fix 2 (retry race in CreateIssueIdempotent): The previous implementation
called CreateIssue (which goes through Execute's retry loop) after the
initial marker search. If issueCreate reached Linear but the HTTP response
was lost, Execute could retry the mutation and create a duplicate issue
with the same idempotency marker. Fix: add createIssueSingleAttempt that
runs the mutation exactly once. After any failure, re-search for the
marker before returning the error so callers can safely retry
CreateIssueIdempotent without creating duplicates.
Also documents the concurrent multi-source limitation (Linear provides no
server-side uniqueness enforcement; the dedup window is bounded by search
index propagation).
Adds regression tests:
- TestCreateIssueNoDoubleFormatDescription: verifies AC/Design sections
appear exactly once in the description sent to Linear
- TestCreateIssueIdempotentRecoverAfterAmbiguousFailure: verifies that an
ambiguous create failure (5xx response) followed by a recovery search
returns the already-created issue with deduped=true
Removing the lock file after unlocking creates a lifecycle race: a blocked
waiter acquires the old inode (between flock release and os.Remove), then a
third process creates a new file at the same path and locks it — both
processes believe they hold the lock.
Fix: never call os.Remove in Release(). Truncate diagnostic metadata while
still holding the flock, then release. The stable path is reused by
subsequent AcquireSyncLock calls via O_CREATE|O_RDWR.
Also:
- Handle writeLockInfo's Truncate error (was silently discarded with _ =)
- Add #nosec G304 to readLockInfo (path is program-constructed, not user input)
- Update test: assert lock file persists and is empty after Release, not removed
Fix-merged for release prep: preserved the contributor rate-limit handling and added the maintainer fix to avoid sleeping after the final retry attempt. Auto-merge after CI.
Fix-merged for release prep: preserved the contributor Linear type mappings and added exact-only matching to avoid story false positives such as history. Auto-merge after CI.