Commit Graph

819 Commits

Author SHA1 Message Date
Steve Yegge
2e87329cf8 WIP: Implement content-hash based collision resolution (bd-89)
- Replace timestamp-based collision scoring with deterministic content hashing
- Add hashIssueContent() using SHA-256 of all substantive fields
- Modify ScoreCollisions to compare hashes and set RemapIncoming flag
- Update RemapCollisions to handle both directions (remap incoming OR existing)
- Add CollisionDetail.RemapIncoming field to control which version gets remapped
- Add unit tests for hash function and deterministic collision resolution

Status: Hash-based resolution works correctly, but TestTwoCloneCollision still
fails due to missing rename detection. After Clone B resolves collision,
Clone A needs to recognize its issue was remapped to a different ID.

Next: Add content-based rename detection during import to prevent
re-resolving already-resolved collisions.

Progress on bd-86.

Amp-Thread-ID: https://ampcode.com/threads/T-b19b49e8-b52a-463d-b052-8a526a500260
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 17:11:40 -07:00
Steve Yegge
c5e7ad8d71 Add bd-86: Epic for making two-clone workflow work 2025-10-28 16:57:04 -07:00
Steve Yegge
b19c24ac55 bd sync: 2025-10-28 16:30:54 2025-10-28 16:30:54 -07:00
Steve Yegge
ef1ca3265d Keep local version (84 issues, removed duplicates) 2025-10-28 16:29:09 -07:00
Steve Yegge
923c48d5f6 bd sync: 2025-10-28 16:28:58 2025-10-28 16:28:58 -07:00
Steve Yegge
2432f30821 bd sync: 2025-10-28 16:27:07 2025-10-28 16:27:07 -07:00
Steve Yegge
d5ab6c8fa0 bd sync: merge duplicates 2025-10-28 16:26:12 -07:00
Steve Yegge
7d575a0267 bd sync: 2025-10-28 16:23:40 2025-10-28 16:23:40 -07:00
Steve Yegge
304a16c157 Merge main - keep local version
Amp-Thread-ID: https://ampcode.com/threads/T-f3675ea3-98d6-448d-a18a-9c8dc4a0c7a0
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 16:22:09 -07:00
Steve Yegge
9af5f6b997 bd sync: 2025-10-28 16:21:41 2025-10-28 16:21:41 -07:00
Steve Yegge
c45588c39c bd sync: 2025-10-28 16:20:59 2025-10-28 16:20:59 -07:00
Steve Yegge
92efd45460 bd sync: 2025-10-28 16:18:45 2025-10-28 16:18:45 -07:00
Steve Yegge
9a109902b4 Consolidate documentation: move maintainer docs to docs/, remove redundant files
- Move RELEASING.md and LINTING.md to docs/ (maintainer-only content)
- Delete WORKFLOW.md (agent workflow content belongs in AGENTS.md)
- Delete TEXT_FORMATS.md (technical details belong in ADVANCED.md)
- Update all cross-references to point to new locations
- Keep CLAUDE.md (required by Claude Code)

Reduces root-level docs from 20 to 16 files with clearer organization.

Amp-Thread-ID: https://ampcode.com/threads/T-fe1db4f3-16c6-4a79-8887-c7f4c1f11c43
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 15:46:12 -07:00
Steve Yegge
3841e6c0cf bd sync: 2025-10-28 14:48:33 2025-10-28 14:48:33 -07:00
Steve Yegge
7d366461a5 bd sync: 2025-10-28 14:22:11 2025-10-28 14:22:11 -07:00
Steve Yegge
7985214e25 bd sync: 2025-10-28 14:21:23 2025-10-28 14:21:25 -07:00
Steve Yegge
cc79e232f5 Remove unreachable functions from import_shared.go (bd-18)
- Removed renameImportedIssuePrefixes and supporting functions
- Removed unused imports (fmt, sort, strings, utils)
- Saved ~130 LOC of dead code
- All tests pass
2025-10-28 14:20:04 -07:00
Steve Yegge
ee4bd834f0 bd sync: 2025-10-28 14:19:39 2025-10-28 14:20:04 -07:00
Steve Yegge
781e300d33 Add event-driven daemon architecture (Phase 1 foundation)
- Add fsnotify dependency for file watching
- Create daemon_debouncer.go: batch rapid events (500ms window)
- Create daemon_watcher.go: monitor JSONL and git refs changes
- Create daemon_event_loop.go: event-driven sync loop
- Add mutation channel to RPC server (create/update/close events)
- Add BEADS_DAEMON_MODE env var (poll/events, default: poll)

Phase 1 implementation: opt-in via BEADS_DAEMON_MODE=events
Target: <500ms latency (vs 5000ms), ~60% CPU reduction

Related: bd-49 (epic), bd-50, bd-51, bd-53, bd-54, bd-55, bd-56
Amp-Thread-ID: https://ampcode.com/threads/T-35a3d0d7-4e19-421d-8392-63755035036e
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 13:12:37 -07:00
Steve Yegge
97c676077d bd sync: 2025-10-28 12:31:47 2025-10-28 12:31:47 -07:00
Steve Yegge
96fb7ed29c bd sync: 2025-10-28 12:03:57 2025-10-28 12:03:57 -07:00
Steve Yegge
79b952fccf Optimize TestTwoCloneCollision: 3x faster with polling instead of sleeps
- Replace fixed 2s sleeps with smart polling (50-100ms intervals)
- Reduce daemon wait timeout from 5s to 1s with early exit
- Add timeout to daemon cleanup to prevent hanging
- Test now runs in ~18s instead of timing out at 60s

Amp-Thread-ID: https://ampcode.com/threads/T-51945255-d5fd-4b42-9816-c44ff4d3bdd1
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 11:52:27 -07:00
Steve Yegge
a4eb4fe451 Add two-clone collision test proving beads multi-agent workflow failure
- Creates TestTwoCloneCollision integration test
- Sets up 2 independent clones with git hooks and daemons
- Both file issues with same ID (test-1)
- Demonstrates databases don't converge after collision resolution
- Clone A: test-1='Issue from clone A', test-2='Issue from clone B'
- Clone B: test-1='Issue from clone B', test-2='Issue from clone A'
- Git status shows dirty state in both clones
- Test proves beads fails at basic multi-agent workflow

Also adds --json flag to create, ready, and list commands for
better test integration.

Amp-Thread-ID: https://ampcode.com/threads/T-8fa0ab6c-2226-4f9b-8e11-14e1156537fc
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 11:34:27 -07:00
Steve Yegge
e75f8c77a2 Merge beads.jsonl changes 2025-10-28 10:50:12 -07:00
Steve Yegge
d2920e3701 Remove cache_size from MCP docs and tests 2025-10-28 10:50:00 -07:00
Steve Yegge
d52851f452 bd sync: 2025-10-28 10:49:53 2025-10-28 10:49:53 -07:00
Steve Yegge
a0cbf2291a bd sync: 2025-10-28 10:48:13 2025-10-28 10:48:13 -07:00
Steve Yegge
322ab63b10 Remove daemon storage cache (bd-33, bd-34, bd-35)
- Deleted server_cache_storage.go (~300 lines)
- Removed cache fields from Server struct
- Simplified database routing to use s.storage directly
- Removed cache metrics from health and metrics endpoints
- Deleted server_eviction_test.go (cache eviction tests)
- Cleaned up limits_test.go (removed cache assertions)
- All tests passing
2025-10-28 10:33:19 -07:00
Steve Yegge
77095d9ac3 bd sync: 2025-10-28 10:33:10 2025-10-28 10:33:10 -07:00
Steve Yegge
1e3ffa839e bd sync: 2025-10-28 10:25:43 2025-10-28 10:25:43 -07:00
Steve Yegge
0f5e92b229 Update issue tracker 2025-10-27 23:20:19 -07:00
Steve Yegge
9edcb6f19f Remove cache fields from Server struct (bd-31)
- Removed storageCache, cacheMu, maxCacheSize, cacheTTL, cleanupTicker fields
- Removed cacheHits and cacheMisses metrics
- Removed cache size/TTL parsing from env vars in NewServer()
- Removed cleanup ticker goroutine from Start()
- Removed cache cleanup logic from Stop()
- Part of bd-29 epic to remove daemon storage cache

Amp-Thread-ID: https://ampcode.com/threads/T-239a5531-68a5-4c98-b85d-0e3512b2553c
Co-authored-by: Amp <amp@ampcode.com>
2025-10-27 23:20:10 -07:00
Steve Yegge
c7477464fc bd sync: 2025-10-27 23:19:14 2025-10-27 23:19:14 -07:00
Steve Yegge
bbb1725c32 Replace getStorageForRequest with s.storage (bd-32)
- Replaced all getStorageForRequest(req) calls with direct s.storage access
- Updated 5 handler files: server_issues_epics.go (~8 calls), server_labels_deps_comments.go (~4 calls), server_compact.go (~2 calls), server_export_import_auto.go (~2 calls), server_routing_validation_diagnostics.go (~1 call)
- Only remaining references are in server_cache_storage.go (to be deleted in bd-33) and server_eviction_test.go (to be deleted in bd-34)
- Part of bd-29 epic to remove daemon storage cache

Amp-Thread-ID: https://ampcode.com/threads/T-239a5531-68a5-4c98-b85d-0e3512b2553c
Co-authored-by: Amp <amp@ampcode.com>
2025-10-27 23:14:38 -07:00
Steve Yegge
085a64f573 Remove CACHE_AUDIT.md, moved findings to bd-30 notes 2025-10-27 23:05:09 -07:00
Steve Yegge
4d67939c2c bd sync: 2025-10-27 23:05:06 2025-10-27 23:05:06 -07:00
Steve Yegge
c3786e3bc4 Add cache usage audit documentation (bd-30) 2025-10-27 23:02:48 -07:00
Steve Yegge
e39341a6b3 bd sync: 2025-10-27 23:02:43 2025-10-27 23:02:43 -07:00
Steve Yegge
6a199875ea Fix TestRepairMultiplePrefixes to bypass prefix validation
The test was failing because CreateIssue() now validates that issue IDs
match the configured prefix (bd-177). To simulate a corrupted database
with multiple prefixes, the test now directly inserts issues via SQL
instead of using CreateIssue().

This allows the test to verify the prefix repair functionality works
correctly without triggering validation errors.

Amp-Thread-ID: https://ampcode.com/threads/T-74d861bc-3abb-47f0-8080-64e46b452233
Co-authored-by: Amp <amp@ampcode.com>
2025-10-27 22:59:19 -07:00
Steve Yegge
9e062b97c8 bd sync: 2025-10-27 22:56:29 2025-10-27 22:56:29 -07:00
Steve Yegge
a46c2f79a9 Resolve merge conflicts: use importer package 2025-10-27 22:44:40 -07:00
dependabot[bot]
b882672673 Bump fastmcp from 2.12.4 to 2.13.0.1 in /integrations/beads-mcp
Bumps [fastmcp](https://github.com/jlowin/fastmcp) from 2.12.4 to 2.13.0.1.
- [Release notes](https://github.com/jlowin/fastmcp/releases)
- [Changelog](https://github.com/jlowin/fastmcp/blob/main/docs/changelog.mdx)
- [Commits](https://github.com/jlowin/fastmcp/compare/v2.12.4...v2.13.0.1)

---
updated-dependencies:
- dependency-name: fastmcp
  dependency-version: 2.13.0.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 22:41:01 -07:00
Steve Yegge
c69d4b4adb Fix variable shadowing in author detection 2025-10-27 22:30:36 -07:00
Lon Lundgren
9dcfa88711 Properly pipe BD_ACTOR through to Comment.Author field in bd comments add. Add flag to bd comments add to accept author. Precedence is now glag, BD_ACTOR, USER 2025-10-27 22:30:36 -07:00
Steve Yegge
af0582ae5d bd sync: 2025-10-27 22:26:46 2025-10-27 22:26:46 -07:00
Steve Yegge
fb21a319cd Fix bd-28: Auto-import should update issues, not create duplicates
Changed ResolveCollisions from true to false in auto-import logic.
This ensures git pull updates existing issues instead of creating duplicates.
2025-10-27 22:26:44 -07:00
Steve Yegge
393e57302d bd sync: 2025-10-27 22:26:40 2025-10-27 22:26:40 -07:00
Steve Yegge
eeb69c94bc Add test to prevent ResolveCollisions in auto-import (bd-247) 2025-10-27 22:23:23 -07:00
Steve Yegge
203b8934da bd sync: 2025-10-27 22:22:29 2025-10-27 22:22:29 -07:00
Steve Yegge
a8077f4623 bd sync: 2025-10-27 21:49:01 2025-10-27 21:49:01 -07:00