Commit graph

37 commits

Author SHA1 Message Date
Jozef Izso
42064c46fe
Sync Linear milestones as local epics (#3528) 2026-05-05 07:45:30 -07:00
matt wilkie
a9e437a0a8
Merge pull request #3655 from kevglynn/feat/linear-retry-after-adaptive-backoff
feat(linear): parse Retry-After headers and add rate-limit circuit breaker
2026-05-02 19:05:11 -07:00
kev
3e804cd39f fix(linear): address maintainer feedback on PR #3655
- 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
2026-05-02 19:00:25 -04:00
Sean Brandt
b78a62cf10
github: classify rate-limit 403s and stop the push loop when one hits (#3624)
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.
2026-05-02 14:24:57 -07:00
matt wilkie
3e56f0b214
Document Linear external_ref pre-linking (#3517)
* Document Linear external ref prelinking (bd-ly3)
* Fix Linear sync dependency graph handling
* Fix init remote clone routing
* Fix stale gate help text
* Fix init remote cherry-pick integration
* Fix init remote flag handling
* Fix Linear prelink hydration blockers
* Fix Linear relation dependency gating
* Fix ready list parent filtering
* Deduplicate dry-run dependency previews by stored identity
2026-04-27 06:05:30 -07:00
matt wilkie
2f60a10fc5
Import Linear relations as dependencies (#3519)
* Fix gate and cook regressions (bd-r2l)

* Import Linear relations as dependencies (bd-ly3)
2026-04-26 20:30:02 -07:00
Steven Syrek
f0057c7828
ci: install dolt binary on Linux and macOS test runners (#3440)
* ci: install dolt binary on Linux and macOS test runners

Install dolt via the official install.sh on Linux and via Homebrew on
macOS so the main test job can exercise the ~24 test gates that
previously silently skipped on every PR when dolt was absent from PATH.

Matches the installation pattern already used by nightly.yml.
Docker-testcontainer gates (testDoltServerPort == 0 skips) remain
skipped — a known GitHub Actions hang documented in
scripts/repro-dolt-hang/INCIDENT-REPORT.md and nightly.yml:37-41
prevents enabling testcontainers here.

* test: require dolt binary under GITHUB_ACTIONS

Add testutil.RequireDoltBinary: skips when the dolt CLI is absent
locally but fails the test under GITHUB_ACTIONS. Replace bare
exec.LookPath("dolt") skip-gates with the helper so ~24 tests that
previously fell through silently in CI now run — and hard-fail if
the CI workflow ever drops the dolt install step.

tests/regression/regression_test.go uses an inline variant because
its gate lives in TestMain, and internal/remotecache/cache_test.go
duplicates the helper inline to avoid an import cycle
(testutil -> doltutil -> remotecache).
2026-04-24 06:58:40 -07:00
matt wilkie
c446a2ef09
fix(linear): harden push against data clobbering (#3328)
Closes #3289, #3309, #3252, #3253 — hardens Linear push: requires explicit linear.state_map.* config, rejects ambiguous state resolution, narrows push dedup to pushable fields, blocks unscoped project-filtered push from creating unlinked beads, and adds regression test for the orphan-ownership rule (parent-filtered push must not update external issues Beads hasn't claimed via external_ref).
2026-04-18 08:36:13 -07:00
coffeegoddd☕️✨
50f715b124 /{cmd,internal}: move local only state to dolt ignored tables 2026-04-14 14:47:30 -07:00
Harry Miller
ef621e5be5
feat: add IssueIDs filter to SyncOptions for selective sync (#2957)
Adds engine-level IssueIDs filter to SyncOptions, enabling selective sync for both push and pull paths.

Co-authored-by: Harry <harry_miller@trimble.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 22:24:47 -07:00
Harry
870cb83e37 fix: remove dead rig routing code and unused variable after rebase
openStoreForRig was removed by upstream refactor (d7629204). Remove
the --rig flag and rig routing from runReadyExplain. Also remove
unused 'now' variable in engine.go introduced during conflict
resolution.
2026-03-30 09:23:01 -07:00
Harry
11d366cf5d tests: add coverage for explain logic, cycle detection, and engine warnings
Extract BuildReadyExplanation into types package as a pure function,
enabling unit tests without Dolt dependency. Add 8 test cases covering:
empty input, ready with/without deps, resolved blockers, parent links,
blocked issues with missing blockers, cycles, and full scenario.

Add 7 Dolt integration tests for cycle detection:
- conditional-blocks cycles (prevented by AddDependency)
- mixed blocks + conditional-blocks cycles
- waits-for intentionally excluded from cycle detection
- self-dependency rejected for all dependency types
- ready work respects conditional-blocks
- blocked issues include blocker details

Add 4 engine tests:
- createDependencies with valid deps
- createDependencies with unresolvable external refs (warns)
- createDependencies with empty input
- warn() collects messages and triggers OnWarning callback

Types package coverage: 89.6% → 91.0%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:15:52 -07:00
Harry
2efa094bc5 Add integration test coverage for partial failures, warnings, and self-deps
- Enhance mockTracker with createFailAfter/createCount for partial
  failure simulation (previously only supported all-or-nothing errors)
- TestEnginePushPartialFailure: 3 issues, fail after 2 creates,
  asserts Created=2, Errors=1, warnings collected
- TestEngineSyncCollectsWarnings: verifies result.Warnings is populated
  from push failures (tests the bd-5cx warning collection fix)
- TestAddDependency_SelfDependencyRejected: verifies self-dependency
  check returns error (tests the bd-2qr self-dep guard)

Fixes: bd-3jd

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:15:24 -07:00
Harry
8d41e70e2d Surface sync engine warnings in SyncResult and fix silent failure paths
- Collect warnings in Engine.warnings during Sync() and populate
  result.Warnings (field existed but was never used)
- Fix createDependencies: return error count, stop silently discarding
  GetIssueByExternalRef errors (previously used _ discard)
- Fix external_ref update failure: now increments stats.Errors when
  the local link-back fails after creating an external issue
- Add Errors field to PullStats and propagate to SyncResult
- Dependency creation failures now counted as Skipped in pull stats

Fixes: bd-5cx

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:12:55 -07:00
Harry
733b8fab89 Sanitize external tracker content for terminal display and add response size limits
- Add ui.SanitizeForTerminal() to strip ANSI escape sequences, OSC sequences,
  and C0/C1 control characters from external content before terminal display.
  Preserves printable UTF-8, newlines, and tabs.
- Apply sanitization in tracker engine dry-run output (3 call sites)
- Add MaxResponseSize (50MB) and io.LimitReader to Linear client to prevent
  OOM from malformed API responses (was the only tracker without this guard)
- Add comprehensive test suite for sanitization (17 test cases including
  ANSI injection, screen clearing, OSC title change, control characters)

Fixes: bd-u9u

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:12:26 -07:00
Harry
3ae2ef3a5a feat: multi-project/team support for Linear, Jira, and ADO
Add support for syncing issues across multiple projects/teams in all
three tracker integrations, with shared infrastructure to avoid
duplicating logic.

Shared infrastructure (internal/tracker/multiproject.go):
- ParseCommaSeparated: splits comma-separated config values
- DeduplicateStrings: removes duplicates preserving order
- ResolveProjectIDs: config precedence (CLI > plural > singular)

Linear (closes #2791):
- Tracker: map[string]*Client with per-team routing
- FetchIssues iterates all teams, deduplicates by issue ID
- UpdateIssue routes to owning team via FetchIssueByIdentifier
- Config: linear.team_ids / LINEAR_TEAM_IDS + --team flag

Jira:
- projectKey string → projectKeys []string
- FetchIssues uses JQL IN clause (single query, no iteration)
- Config: jira.projects / JIRA_PROJECTS + --project flag

ADO:
- project string → projects []string
- WIQL uses TeamProject IN clause (single query)
- Config: ado.projects / AZURE_DEVOPS_PROJECTS + --project flag

All singular config keys remain supported for backward compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-28 13:40:39 -07:00
emma
083181e1ea feat: reimplement Notion sync on REST data sources (fix-merge PR #2759)
Adds internal/notion/ package with direct REST API client, field mapping,
and tracker adapter. Adds bd notion init/connect/status/sync commands.
Enhances tracker engine: conflict detection before pull, label sync,
no-op skip, batch push interface, RFC3339Nano timestamps. Removed dead
matchesFetchOptions function, added gosec nolint for Notion API client.

Co-Authored-By: Osamu Okano <okano.osamu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 19:20:40 -07:00
gregorycollins-usmobile
5297286bb2
feat(linear): add --parent flag to limit sync push to a ticket tree (PR #2853)
* feat(linear): add --parent flag to limit sync push to a ticket tree

Adds --parent=TICKET to bd linear sync --push, restricting the push
to the named beads ticket and all its transitive descendants via
parent-child dependencies.

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

* test(tracker): add tests for ParentID push filter

Six cases: basic parent+children, deep transitive descendants,
leaf with no children, non-parent-child edges not followed,
empty ParentID pushes all, dry-run with parent filter.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 19:30:42 -07:00
lizzy
9dc875a98e feat: add --list and --doc flags to bd help for CLI doc generation (GH#2527)
Cherry-pick Go code from community PR #2527 (maphew): adds --list flag to
enumerate all commands, --doc flag to generate per-command Docusaurus markdown,
and sidebar position mapping. Also includes lazy getGitContext() in hooks dir
resolution and test skip improvements for missing Dolt server.

Co-authored-by: matt wilkie <maphew@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:25:40 -07:00
obsidian
3872308568 refactor(tests): migrate all test files from StartTestDoltServer to container-native API
Migrate 12 TestMain files to use EnsureDoltContainerForTestMain/TerminateDoltContainer
instead of the removed StartTestDoltServer/TestDoltServer API.

Replace testServer.IsCrashed()/CrashError() crash detection with standalone
testutil.DoltContainerCrashed()/DoltContainerCrashError() in 6 test files.

(bd-m7sy)
2026-03-03 10:07:32 -08:00
Xexr
376122ba46
fix: prevent test suite from leaking databases onto production Dolt server (#2089)
Set BEADS_TEST_MODE=1 unconditionally in all 9 TestMain functions that
interact with Dolt, before the test server nil check. Previously, test
mode was only set when the test Dolt server started successfully — if it
failed, tests silently connected to production on port 3307 and created
testdb_/beads_* databases that were never cleaned up.

Also:
- Fix doctorTestServerPort() fallback from 3307 (production) to 0
- Add dolt_purge_dropped_databases() to both cleanup functions
- Add isolated test Dolt server to integration test TestMain which had
  no server at all, causing bd init subprocess to hit production

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: beads/crew/lydia <steve.yegge@gmail.com>
2026-02-24 22:26:30 -08:00
beads/crew/emma
11f5f432ed feat(testutil): branch-per-test isolation for dolt, tracker, molecules (L2)
Replace database-per-test with Dolt branch-per-test using COW snapshots
for three internal packages. Each TestMain creates one shared database
with committed schema; each test branches from main via DOLT_CHECKOUT
with MaxOpenConns=1 for session-level isolation.

New infrastructure:
- testutil.StartTestBranch / CleanTestBranches / SetupSharedTestDB
- dolt.Config.MaxOpenConns field wired into openServerConnection
- dolt.CreateIgnoredTables for wisps tables (not in commits)

cmd/bd and doctor packages stay on database-per-test because they
reopen stores from metadata.json via NewFromConfig, which creates new
connections on main branch.

Closes: bd--6tf4

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 16:16:56 -08:00
mayor
efdd6f73dc fix: prevent tests from connecting to prod Dolt server
- Add TestMain wrappers for molecules and tracker packages to spin up
  isolated test Dolt servers instead of hitting prod on port 3307
- Harden applyConfigDefaults: in test mode, BEADS_DOLT_PORT always
  overrides cfg.ServerPort (even if set from metadata.json)
- Add hard panic guard in dolt.New() if test mode tries to use prod port
- Clear GT_ROOT in TestDoltServerIsRunning to avoid finding daemon PID
- Set BEADS_DOLT_PORT in cmd/bd test server setup for bd init path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:54:26 -08:00
beads/crew/collins
6219b8692d fix: CI formatting, lint, and test failures blocking release
1. FORMATTING: gofmt 14 files.

2. LINT:
   - Delete dead code cmd/bd/bootstrap.go (unused bootstrapEmbeddedDolt)
   - Prefix unused 'actor' param in wisps.go updateWisp with _
   - Prefix unused 'ctx' param in telemetry.go buildTraceProvider with _

3. TESTS: Add skipIfNoDolt to test helpers that call dolt.New() without
   a running test server. In CI (no dolt installed), these tests now skip
   instead of failing with "server unreachable at 127.0.0.1:3307".
   Delete TestOpenFromConfig_Embedded and TestOpenFromConfig_DefaultsToEmbedded
   which tested removed embedded Dolt functionality.

   Fixed packages: beads_test, cmd/bd, cmd/bd/doctor, cmd/bd/doctor/fix,
   internal/tracker, internal/utils

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:53:35 -08:00
Pierre-Alexandre Entraygues
6e4ad9b283
feat(otel): opt-in OpenTelemetry instrumentation (#1940)
* feat(otel): comprehensive OpenTelemetry instrumentation

Phase 1 (telemetry foundation + SQL + CLI + AI):
- Add internal/telemetry package: Init/Shutdown, Tracer/Meter helpers,
  stdout + OTLP/gRPC exporters, noop providers when disabled
- Add internal/telemetry/storage.go: InstrumentedStorage decorator for
  SDK consumers with bd.storage.* counters and duration histograms
- Instrument DoltStore SQL layer (execContext, queryContext, queryRowContext)
  with dolt.exec / dolt.query / dolt.query_row spans
- Instrument Anthropic API calls in compact/haiku.go and find_duplicates.go
  with bd.ai.input_tokens, bd.ai.output_tokens, bd.ai.request.duration
- Add bd.command.<name> span in PersistentPreRun/PostRun with actor attribute

Phase 2 (VC ops, hooks, sync, metrics):
- Add dolt.commit / dolt.push / dolt.force_push / dolt.pull / dolt.branch /
  dolt.checkout / dolt.merge spans for Dolt version-control procedures
  (these bypass execContext so needed dedicated spans)
- Add bd.db.retry_count counter in withRetry (server mode retries)
- Add bd.db.lock_wait_ms histogram in AcquireAccessLock (flock contention)
- Add ephemeral.count / ephemeral.nuke spans for SQLite ephemeral store
- Add hook.exec spans in hooks_unix/windows runHook (background root spans)
- Add tracker.sync / tracker.pull / tracker.push / tracker.detect_conflicts
  spans with per-phase stats attributes in tracker/engine.go
- Add bd.issue.count gauge (by status) in InstrumentedStorage.GetStatistics
- Fix: call initAIMetrics via sync.Once in newHaikuClient so ai metrics
  are actually registered

Configuration:
  BD_OTEL_ENABLED=true              enable (default: off, zero overhead)
  BD_OTEL_STDOUT=true               write to stdout for dev/debug
  OTEL_EXPORTER_OTLP_ENDPOINT=...  ship to Jaeger/Grafana/Honeycomb/etc.

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

* refactor(otel): align with VictoriaMetrics HTTP stack

- Switch metric exporter: gRPC → HTTP (otlpmetrichttp)
- Activation: BD_OTEL_METRICS_URL presence (no more BD_OTEL_ENABLED flag)
  matches GT_OTEL_METRICS_URL convention from the local observability stack
- BD_OTEL_METRICS_URL=http://localhost:8428/opentelemetry/api/v1/push
- BD_OTEL_LOGS_URL=http://localhost:9428/insert/opentelemetry/v1/logs (reserved)
- Traces: stdout only (BD_OTEL_STDOUT=true); noop otherwise since VictoriaMetrics
  is a metrics-only backend — no trace overhead in production
- Remove: otlptracegrpc, otlpmetricgrpc
- Update docs/OBSERVABILITY.md to match the diffusiontown README style

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

* feat(otel): capture hook stdout/stderr and bd.args in spans

- hook.exec span now records stdout and stderr as span events after
  the hook process exits (including partial output on timeout)
- Output is truncated to 1024 bytes; the event carries both the text
  (output) and the original size (bytes) as attributes
- bd.command.<name> span now includes bd.args with the raw CLI
  arguments (e.g. "create 'title' -p 2")

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

* fix(otel): address review feedback — stale comment, span leak, hot-path alloc

1. Fix stale BD_OTEL_ENABLED comment in main.go (actual env vars are
   BD_OTEL_METRICS_URL and BD_OTEL_STDOUT)
2. Use defer+named returns in Merge() to prevent span leaks
3. Cache doltSpanAttrs() via sync.Once to avoid per-call allocation

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: beads/crew/emma <steve.yegge@gmail.com>
2026-02-22 15:36:57 -08:00
Steven Syrek
634bf5d4a0 refactor(storage): define Storage interface, decouple from concrete DoltStore (bd-l3o)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:11:08 +01:00
beads/crew/emma
dd01a655b9 fix: repair test suite for Dolt-only backend (bd-h0zvj.4)
Fix pre-existing test failures from Dolt-Native Pruning phases 1-8.
All internal/* packages and cmd/bd/doctor now pass. Remaining 19
failures in cmd/bd are routing (9), init path checks (7), and tips (3).

Key fixes:
- Remove type assertions on concrete *dolt.DoltStore (not an interface)
- Fix DATETIME timezone bug: normalize timestamps to UTC before storage
- Replace SQLite datetime() syntax with MySQL DATE_SUB() in stale tests
- Remove --backend flag from init test invocations (flag removed)
- Update doctor tests for Dolt-only backend behavior
- Skip/remove tests for removed features (CompactableStorage,
  FederatedStorage, ExportToMultiRepo, merge driver, no-db mode)
- Add issue_prefix config in test stores that create issues
- Fix export_hashes → interactions table reference in schema test

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-15 18:17:16 -08:00
beads/crew/emma
a5da57e39b refactor: remove storage factory, memory backend, and provider abstraction (Phase 7)
Strip out the multi-backend storage layer: factory pattern, memory/in-memory
provider, connection string parsing, local provider, and associated tests.
Inline Dolt as the sole storage backend. Part of Dolt-Native Beads v2 epic.

WIP - SQLite removal in progress, more cleanup phases to follow.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-15 11:27:39 -08:00
beads/crew/emma
8f00fb7e76 refactor: wire Jira CLI through SyncEngine, delete duplicated sync code
Replace Python-script-based Jira sync with native Go REST API client.
Jira CLI now follows same thin pattern as Linear/GitLab: create tracker,
create engine, call engine.Sync(). Completes Phase 4 of dolt-y60t.

- Implement Jira REST API v3 client (search, get, create, update)
- Add ADF (Atlassian Document Format) plain text conversion
- Wire Jira tracker IssueTracker methods with real API calls
- Complete jiraFieldMapper.IssueToBeads/IssueToTracker
- Delete conflict.go (Engine handles conflicts), scripts.go (Python
  dependency removed), Jira-specific stat types (Engine types used)
- Fix engine pull guard: skip locally-modified issues unconditionally,
  let Phase 2 conflict detection handle them

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 17:59:33 -08:00
beads/crew/emma
5a5407fafe refactor: wire Linear/GitLab CLI through SyncEngine, delete duplicated sync code
Phase 4 of the tracker engine migration. Rewrites `bd linear sync` and
`bd gitlab sync` to use the shared tracker.Engine instead of bespoke
pull/push/conflict-detection functions.

- Rewrite runLinearSync: create tracker → set hooks → Engine.Sync()
- Add buildLinearPullHooks (hash-based ID generation with collision avoidance)
- Add buildLinearPushHooks (FormatDescription, ContentEqual, StateCache, ShouldPush)
- Add BuildStateCacheFromTracker to internal/linear for CLI hook access
- Rewrite runGitLabSync: create tracker → set hooks → Engine.Sync()
- Add buildGitLabPullHooks (timestamp-counter-random ID generation)
- Add conflict-aware pull to Engine (skip locally-modified issues when prefer-local)
- Delete linear_sync.go (419 lines), linear_conflict.go (191 lines), gitlab_sync.go (563 lines)
- Remove tests for deleted sync functions (covered by engine_test.go)
- Keep utility function tests (generateIssueID, parseGitLabSourceSystem, getConflictStrategy)

Net: -2077 lines. CLI is now thin: parse flags, create tracker, call Engine.Sync().

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 17:29:05 -08:00
beads/crew/emma
7de76f36ac fix: wire FormatDescription hook in doPush, add GenerateID/FormatDescription tests
Self-review found two issues:
1. FormatDescription was declared in PushHooks but never called in doPush.
   Now applied to a shallow copy before CreateIssue/UpdateIssue to avoid
   mutating local data.
2. GenerateID hook had no test coverage. Added tests for both success and
   error (collision) cases, plus FormatDescription test that verifies
   local issue is not mutated.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 17:00:44 -08:00
beads/crew/emma
3728ac1f08 feat: add PullHooks/PushHooks to SyncEngine for battle-tested CLI behaviors
Phase 3 of tracker refactor (dolt-y60t.3). Adds optional hook callbacks
to the Engine so tracker adapters can opt into proven CLI patterns:

PullHooks: ShouldImport (filter before conversion), TransformIssue
(description formatting/normalization), GenerateID (hash-based IDs).

PushHooks: ShouldPush (custom filtering), ContentEqual (content-hash
dedup to skip unnecessary API calls), FormatDescription (tracker-specific
rendering), BuildStateCache/ResolveState (batch workflow state resolution).

Also adds ExcludeEphemeral to SyncOptions for wisp filtering on push.

Dropped from original plan: tombstone filtering (Dolt handles natively),
UseImporter delegation (importer package tied to dying JSONL/SQLite infra).

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 16:47:07 -08:00
beads/crew/emma
3c45dcbde4 refactor: inline tracker adapters into internal packages
Move IssueTracker implementations from internal/tracker/adapters/{linear,gitlab}/
directly into internal/{linear,gitlab}/ and create a new minimal Jira tracker.
Each package now registers itself via init(), eliminating the adapter indirection
layer. Delete the adapters/ directory entirely.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 16:18:37 -08:00
mayor
8319a85141 fix: gofmt tracker adapter files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 14:26:19 -08:00
beads/crew/emma
cf4ffec013 feat: add GitLab adapter for tracker framework (GH#1150)
Wraps internal/gitlab client and mapping as a tracker.IssueTracker
plugin, completing the adapter pattern for both existing integrations.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 14:16:02 -08:00
beads/crew/emma
7b3148d139 feat: add Linear adapter for tracker framework (GH#1150)
Wraps internal/linear client and mapping as a tracker.IssueTracker
plugin. Also removes ephemeral type filtering from engine — callers
use ExcludeTypes instead of hardcoded Gas Town internals.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 14:13:01 -08:00
beads/crew/emma
9d29ffd236 feat: add plugin-based issue tracker framework (GH#1150)
Implements shared interfaces and sync engine for external tracker
integrations (Linear, GitLab, Jira, etc.), eliminating duplication
between adapters. Design from PRs #1564-#1567, updated for Dolt-only.

- IssueTracker: 14-method plugin interface for tracker adapters
- FieldMapper: bidirectional field conversion between beads and trackers
- Engine: Pull→Detect→Resolve→Push sync with conflict resolution
- Registry: thread-safe plugin registration via init() functions

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 14:09:40 -08:00