Skip to content

feat(helix-decisions): rename adr-search and implement HelixDB sync - #2

Merged
kevinmichaelchen merged 22 commits into
mainfrom
feat/rename-adr-search-to-helix-decisions
Jan 17, 2026
Merged

feat(helix-decisions): rename adr-search and implement HelixDB sync#2
kevinmichaelchen merged 22 commits into
mainfrom
feat/rename-adr-search-to-helix-decisions

Conversation

@kevinmichaelchen

@kevinmichaelchen kevinmichaelchen commented Jan 6, 2026

Copy link
Copy Markdown
Owner

Summary

This PR renames adr-search to helix-decisions and implements the full HelixDB synchronization infrastructure.

Core Changes

  • Rename adr-search to helix-decisions to expand scope from ADR-specific search to general decision graph infrastructure
  • Add uuid field for distributed safety across branches (via helix-id)
  • Add content_hash and git_commit fields for immutability tracking
  • Enforce UUID validation on all decision documents

helix-daemon (New Shared Crate)

  • Phase 2: IPC server and client implementation
  • Phase 3: Queue management with request coalescing
  • Phase 4: Idle timeout for auto-shutdown

HelixDB Integration (Phases 3.1-3.3)

  • Phase 3.1: Add manifest and git_utils modules for tracking sync state
  • Phase 3.2: Implement HelixDB backend and wire storage layer
  • Phase 3.3: Delta detection, relationship resolution, and SyncStats tracking

Testing & Documentation

  • Integration tests for Phase 3.3 sync functionality
  • ADR-004: Trait-based storage architecture
  • Updated specs for all shared crates

Test Plan

  • Unit tests pass (cargo test)
  • Integration tests for sync flow
  • Clippy checks pass
  • Pre-commit hooks pass

Expand scope from ADR-specific search to general decision graph
infrastructure with semantic search.

Key changes:
- Rename crate: adr-search -> helix-decisions
- Rename types: ADR -> Decision, ADRSearcher -> DecisionSearcher
- Add uuid field for distributed safety across branches
- Add content_hash and git_commit for immutability tracking
- Update specs with ID scheme and immutability model
- Update documentation with new vision
- Updated helix-decisions specs (design, tasks, requirements) with Phase 3 architecture
- Added 10 critical HelixDB API corrections with working code examples
- Added FR-9: Incremental Indexing requirement with 3-stage detection
- Added Phase 3 performance targets (delta sync <50ms, search <100ms)
- Updated shared/AGENTS.md with helix-storage deprecation path
- Updated hbd/specs/design.md with HelixDB API patterns note
- helix-storage: Mark for removal, document why HelixDB replaces it
- helix-config: Add HelixDB storage paths section
- helix-embeddings: Add design and requirements specs with perf targets
- helix-discovery: Add design and requirements specs
- Update AGENTS.md with specs links for all crates
- Add ADR-004 establishing that shared crates don't depend on HelixDB
- Each tool defines its own storage trait with HelixDB as implementation
- Update shared/AGENTS.md to reflect architecture decision
- Simplify helix-config specs (documents paths, no HelixDB dependency)
- Update helix-embeddings specs (pure utility, returns Vec<f32>)

This enables loose coupling, testability, and flexibility.
… stub

Phase 1 of daemon implementation per specs/tasks.md:
- Protocol structs: Request, Response, Command enum
- Error types with codes matching spec
- Client stub for Phase 2 IPC implementation
- helixd binary placeholder
- hbd: rename hbd-d to helixd, add daemon integration section
- helix-decisions: add IPC protocol, daemon lifecycle, rename/delete detection
- helix-docs: add daemon integration section
- Update tasks.md with daemon IPC tasks (Phase 3.4)
- Add Unix socket server with JSON line protocol
- Add client with auto-start daemon and retry logic
- Implement ping, status, shutdown commands
- Stub enqueue_sync/wait_sync for Phase 3
- Add integration tests for client-server communication
- 1MB message size limit for safety
- Add SyncQueue with per {repo_root, tool} queuing
- Implement request coalescing for duplicate enqueue_sync
- Add SyncJob state tracking (queued, running, done, error)
- Implement enqueue_sync and wait_sync command handlers
- Add broadcast-based state change notifications for wait_sync
- Integration tests for coalescing and status reporting
- Server tracks last activity timestamp
- Auto-shutdown after idle_timeout_ms with no active queues
- Add --idle-timeout CLI flag to helixd binary
- Default: 5 minutes (configurable, 0 to disable)
- Add --sync flag to block until index is up to date
- Wire CLI to enqueue_sync on invocation via daemon client
- Show warning when daemon unavailable (graceful degradation)
- Add tokio runtime for async daemon IPC
- Mark helix-daemon Phases 1-5 complete, add Phase 6 (Sync Worker) planned
- Mark helix-decisions Phase 3.4 (Daemon Integration) complete
- Update milestones table
- manifest.rs: ManifestEntry and IndexManifest for incremental indexing
  - Track file stats, content hash, vector ID for delta detection
  - JSON serialization, find by content hash (rename detection)
  - 11 unit tests

- git_utils.rs: List decision files via git or directory walk
  - git ls-files with fallback to recursive directory walk
  - 4 unit tests
…ase 3.2)

- Add helix_backend.rs with HelixDecisionBackend wrapping HelixGraphStorage
- Replace JSON helix-storage backend with HelixDB in storage.rs
- Fix get_chain to traverse incoming SUPERSEDES edges (toward current leaf)
- Add node_id field to ManifestEntry for stable node IDs across re-indexes
- Implement batch transaction semantics (nodes/vectors first, edges second)
- Store normalized repo-relative paths in both manifest and node properties
- Add pick_latest_superseding_node for deterministic chain traversal
- Update DecisionSearcher::new() to require repo_root parameter
- Remove helix-storage dependency from Cargo.toml
- Add path normalization and identity rules to design.md
- Document batching and transaction semantics
- Add edge update and vector update semantics
- Rename decision_id to id in secondary index documentation
- Add helix-daemon to shared AGENTS.md crate table
- Update tasks.md with batch/edge requirements
- Split delta.rs to_add into to_add (new) and to_modify (changed)
- Add unchanged_count to DeltaResult for complete stats
- Return SyncStats from searcher.sync() with timing info
- Print sync stats in CLI when changes occur
Add 11 integration test scenarios covering:
- Initial indexing (10 decisions)
- Delta detection (modify, add, delete)
- Large repo performance (<100ms delta sync)
- Chain traversal across supersedes edges
- Related query with all edge types
- Status filtering
- Storage persistence

Tests require embedding model and are marked #[ignore].
Run with: cargo test -p helix-decisions --test integration -- --ignored
…hip resolution

Fix 4 critical issues in incremental sync:

1. Path normalization: normalize decision paths before comparing with
   manifest to prevent full re-indexing on every sync

2. Relationship resolution order: resolve relationships after node
   commit so same-batch references can be found

3. Edge removal logic: always remove outgoing edges before adding
   new ones to prevent stale edges when relationships are dropped

4. Rename detection: detect renames via content_hash + decision_id
   matching to preserve vector_id and avoid re-embedding
- tighten rename detection to content-hash + uuid and update tests

- add strict check reporting for malformed frontmatter and missing uuid/title

- expose loader report API with coverage for invalid files

- update specs/docs to mark uuid required and document check
@kevinmichaelchen
kevinmichaelchen force-pushed the feat/rename-adr-search-to-helix-decisions branch from 49576de to d189ca3 Compare January 16, 2026 23:58
@kevinmichaelchen kevinmichaelchen changed the title feat(helix-decisions): rename adr-search to helix-decisions feat(helix-decisions): rename adr-search and implement HelixDB sync Jan 17, 2026
- Import SecondaryIndex from helix_db::helix_engine::types
- Use SecondaryIndex::Index() for secondary indices config
- Access .0 on tuple to get Database from secondary_indices HashMap
@kevinmichaelchen
kevinmichaelchen merged commit 39f8a82 into main Jan 17, 2026
6 checks passed
@kevinmichaelchen
kevinmichaelchen deleted the feat/rename-adr-search-to-helix-decisions branch January 17, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant