* feat: add SlotSet/SlotGet/SlotClear to Storage interface
Metadata slot operations for key-value pairs stored in issue metadata
JSON. Used by gt for delegation tracking, hook state, and other
per-issue data.
- SlotSet: set or overwrite a metadata key
- SlotGet: read a metadata key (error if not found)
- SlotClear: remove a metadata key (no-op if absent)
Implemented in DoltStore, EmbeddedDoltStore, and InstrumentedStorage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add SlotSet/SlotGet/SlotClear stubs to configStore test mock
The configStore mock in jira/tracker_test.go was missing the three new
Storage interface methods, causing go vet to fail.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: mayor <jim@wordelman.name>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: beads/crew/emma <steve.yegge@gmail.com>
Replace BIGINT AUTO_INCREMENT with CHAR(36) UUID primary keys on 6 tables
(events, comments, issue_snapshots, compaction_snapshots, wisp_events,
wisp_comments) to eliminate duplicate PK collisions during Dolt federation.
- Change Event.ID and Comment.ID from int64 to string
- Change GetAllEventsSince to use time.Time instead of int64 high-water marks
- Add migration 010 to convert existing BIGINT PKs to UUID
- Remove resetAutoIncrements band-aid (no longer needed)
- Generate UUIDs in Go before INSERT for comments (ImportIssueComment)
- Schema version bumped from 6 to 7
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>
Add beforeTestsHook implementation that starts a dedicated Dolt
sql-server in a temp directory on a dynamic port. Tests now create
testdb_* databases on this isolated server instead of the production
one, preventing lock contention and server crashes.
Also fix telemetry/storage.go RunInTransaction signature to match
the updated Storage interface (commitMsg parameter).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/obsidian
Rig: beads
Role: polecats
* 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>