Add cycle detection performance benchmarks (bd-311)
- Created comprehensive benchmark suite for cycle detection - Tested linear chains, tree structures, and dense graphs - Results: 3-4ms overhead per AddDependency is acceptable - Documented findings in test file and DESIGN.md - Closed bd-311 and epic bd-307
This commit is contained in:
@@ -228,12 +228,12 @@
|
||||
{"id":"bd-304","title":"Create SYNC.md comprehensive guide","description":"Create detailed SYNC.md guide covering all aspects of git-based synchronization.","design":"Sections:\n1. Introduction\n2. Quick Start\n3. Manual Git Workflow\n4. bd sync Command\n5. bd daemon Background Sync\n6. Git Hooks\n7. Conflict Resolution\n8. Best Practices\n9. Troubleshooting\n10. FAQ\n\nInclude examples, code snippets, and diagrams.","acceptance_criteria":"- SYNC.md created with all sections\n- Quick start guide for new users\n- Detailed workflow examples\n- Conflict resolution guide\n- Best practices section\n- Troubleshooting with solutions\n- FAQ with common questions\n- Code examples working\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T01:40:06.562753-07:00","updated_at":"2025-10-16T10:36:49.352494-07:00","dependencies":[{"issue_id":"bd-304","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T01:40:06.59025-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-305","title":"Create API.md for gateway API documentation","description":"Create comprehensive API.md documenting the gateway REST API and WebSocket protocol.","design":"Sections:\n1. Introduction\n2. Authentication\n3. REST Endpoints\n4. WebSocket Protocol\n5. Error Handling\n6. Rate Limits\n7. Examples\n\nFor each endpoint:\n- URL and method\n- Request parameters\n- Request body schema\n- Response schema\n- Error responses\n- Code example","acceptance_criteria":"- API.md created with all sections\n- All endpoints documented\n- Request/response schemas\n- WebSocket protocol docs\n- Error codes and handling\n- Rate limit documentation\n- Examples in multiple languages\n- Links from README.md\n\n---","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T01:40:06.631897-07:00","updated_at":"2025-10-16T10:36:49.352984-07:00","dependencies":[{"issue_id":"bd-305","depends_on_id":"bd-251","type":"blocks","created_at":"2025-10-16T01:40:06.672163-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-306","title":"Close GH-11 (Docker support) or update with sync approach","description":"Resolve GitHub issue 11 about Docker support - either close as completed via gateway or update with new sync approach.","design":"Review GH-11 requirements:\n- User wants to use beads across multiple dev machines\n- Docker hosting was proposed solution\n\nNew approach:\n- Phase 1: Pure git-based sync (no Docker needed)\n- Phase 2: Optional Docker gateway for convenience\n- Addresses use case without mandating server\n\nUpdate GH-11 with:\n- Link to DESIGN-GIT-SYNC.md\n- Explain git-based approach\n- Note optional Docker gateway\n- Ask for feedback\n\nClose issue when sync features implemented.","acceptance_criteria":"- GH-11 reviewed and understood\n- Comment added explaining sync approach\n- Link to design document\n- User feedback requested\n- Issue closed when Phase 1-2 complete\n- Documentation cross-referenced","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T01:40:06.674765-07:00","updated_at":"2025-10-16T10:36:49.353466-07:00"}
|
||||
{"id":"bd-307","title":"Fix circular dependency detection and prevention","description":"Implement robust detection, prevention, and user guidance for circular dependencies that cross edge types. Current system only prevents cycles within \"blocks\" type dependencies, allowing cross-type cycles (e.g., A blocks B, B parent-child A) that can hide work from ready list and confuse dependency visualization.","design":"Analysis shows that cycle prevention is type-specific (blocks only) while detection is type-agnostic. All current operations are safe from infinite loops (depth-limited), but semantic confusion and future maintenance hazards exist. Need validation, warnings, and potentially full cross-type prevention.","acceptance_criteria":"- Cross-type cycles are prevented or warned about\n- Semantic validation prevents child→parent dependencies\n- Users receive clear diagnostic messages\n- Documentation explains cycle handling behavior\n- All existing safe operations remain protected","status":"open","priority":1,"issue_type":"epic","created_at":"2025-10-16T10:27:48.21284-07:00","updated_at":"2025-10-16T10:36:49.354202-07:00"}
|
||||
{"id":"bd-307","title":"Fix circular dependency detection and prevention","description":"Implement robust detection, prevention, and user guidance for circular dependencies that cross edge types. Current system only prevents cycles within \"blocks\" type dependencies, allowing cross-type cycles (e.g., A blocks B, B parent-child A) that can hide work from ready list and confuse dependency visualization.","design":"Analysis shows that cycle prevention is type-specific (blocks only) while detection is type-agnostic. All current operations are safe from infinite loops (depth-limited), but semantic confusion and future maintenance hazards exist. Need validation, warnings, and potentially full cross-type prevention.","acceptance_criteria":"- Cross-type cycles are prevented or warned about\n- Semantic validation prevents child→parent dependencies\n- Users receive clear diagnostic messages\n- Documentation explains cycle handling behavior\n- All existing safe operations remain protected","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-10-16T10:27:48.21284-07:00","updated_at":"2025-10-16T13:32:31.150118-07:00","closed_at":"2025-10-16T13:32:31.150118-07:00"}
|
||||
{"id":"bd-308","title":"Add semantic validation for parent-child dependency direction","description":"Prevent backwards parent-child dependencies where child tasks depend on their parent epics. This is semantically incorrect - parents should depend on children completing, not the reverse.","design":"Add validation in AddDependency that checks if dep.Type == DepParentChild and validates the direction is correct (parent depends on child, not child on parent). Reject with clear error message if direction is backwards.","acceptance_criteria":"- Child→parent dependencies are rejected with clear error\n- Parent→child dependencies work as expected\n- Error message explains correct direction\n- Tests cover both valid and invalid cases","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T10:28:24.205615-07:00","updated_at":"2025-10-16T13:04:55.724216-07:00","closed_at":"2025-10-16T13:04:55.724216-07:00","dependencies":[{"issue_id":"bd-308","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T10:28:40.951661-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-309","title":"Add diagnostic warnings when cycles are detected after dep add","description":"Run DetectCycles() after adding dependencies and warn users if cycles exist. Provide clear, actionable messages about which issues form the cycle and potential impact on ready work visibility.","design":"In bd dep add command, after successful dependency addition, call DetectCycles(). If cycles found, print warning to stderr showing cycle path and explanation. Include suggestion to run 'bd dep cycles' for full analysis.","acceptance_criteria":"- Warnings appear after dep add when cycles exist\n- Warning shows cycle path clearly\n- Explains impact on ready work calculation\n- Suggests next steps for user\n- Does not block operation (warning only)","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T10:28:24.215511-07:00","updated_at":"2025-10-16T13:00:35.578468-07:00","closed_at":"2025-10-16T13:00:35.578468-07:00","dependencies":[{"issue_id":"bd-309","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T10:28:40.946661-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-31","title":"Test issue for design field","description":"Testing the new update flags","design":"## Design Plan\\n- Add flags to update command\\n- Test thoroughly\\n- Document changes","acceptance_criteria":"- All three fields (design, notes, acceptance-criteria) can be updated\\n- Changes persist in database\\n- bd show displays the fields correctly","notes":"Implementation complete. All tests passing.","status":"closed","priority":3,"issue_type":"task","created_at":"2025-10-14T14:43:06.91361-07:00","updated_at":"2025-10-16T10:36:49.355948-07:00","closed_at":"2025-10-15T03:01:29.573031-07:00"}
|
||||
{"id":"bd-310","title":"Document cycle handling behavior and limitations","description":"Add comprehensive documentation explaining which dependency types are checked for cycles, why cross-type cycles matter, what operations are safe, and how users should think about dependency design.","design":"Add comments to AddDependency explaining cycle checking logic. Update README.md with section on cycles. Add to DESIGN.md explaining technical decisions. Include examples of problematic and correct dependency patterns.","acceptance_criteria":"- Code comments explain cycle checking\n- README has user-facing cycle guidance\n- DESIGN.md has technical rationale\n- Examples show good and bad patterns\n- Explains ready work implications","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T10:28:24.227839-07:00","updated_at":"2025-10-16T13:16:36.548345-07:00","closed_at":"2025-10-16T13:16:36.548345-07:00","dependencies":[{"issue_id":"bd-310","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T10:28:40.941951-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-311","title":"Benchmark cycle detection performance on large dependency graphs","description":"Measure performance impact of cross-type cycle checking on large graphs (1000+ issues). Determine if optimization needed before enabling full prevention. Test various graph structures (sparse, dense, deeply nested).","design":"Create benchmark test with synthetic dependency graphs of varying sizes and structures. Measure AddDependency performance with type-specific vs all-types cycle checking. Document findings and optimization recommendations if needed.","acceptance_criteria":"- Benchmark test covers 100, 1000, 5000 issue graphs\n- Tests sparse and dense dependency patterns\n- Measures time for both checking approaches\n- Documents results in comments or DESIGN.md\n- Recommends optimization if \u003e100ms impact found","status":"open","priority":2,"issue_type":"task","created_at":"2025-10-16T10:28:24.231469-07:00","updated_at":"2025-10-16T10:36:49.356851-07:00","dependencies":[{"issue_id":"bd-311","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T10:28:40.950429-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-311","title":"Benchmark cycle detection performance on large dependency graphs","description":"Measure performance impact of cross-type cycle checking on large graphs (1000+ issues). Determine if optimization needed before enabling full prevention. Test various graph structures (sparse, dense, deeply nested).","design":"Create benchmark test with synthetic dependency graphs of varying sizes and structures. Measure AddDependency performance with type-specific vs all-types cycle checking. Document findings and optimization recommendations if needed.","acceptance_criteria":"- Benchmark test covers 100, 1000, 5000 issue graphs\n- Tests sparse and dense dependency patterns\n- Measures time for both checking approaches\n- Documents results in comments or DESIGN.md\n- Recommends optimization if \u003e100ms impact found","status":"closed","priority":2,"issue_type":"task","created_at":"2025-10-16T10:28:24.231469-07:00","updated_at":"2025-10-16T13:32:25.012845-07:00","closed_at":"2025-10-16T13:32:25.012845-07:00","dependencies":[{"issue_id":"bd-311","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T10:28:40.950429-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-312","title":"Implement cross-type cycle prevention in AddDependency","description":"Expand cycle detection to check ALL dependency types, not just \"blocks\" type. Currently A blocks B, B parent-child A is allowed but creates a cross-type cycle that hides work from ready list.","design":"Modify cycle check in AddDependency to traverse all dependency types using recursive CTE without type filter. Check if adding new dependency would create cycle across any combination of types. Include depth limit (100) to prevent infinite traversal.","acceptance_criteria":"- Cross-type cycles are prevented\n- Error message indicates cycle would be created\n- All dependency types are checked in traversal\n- Performance is acceptable (add benchmark)\n- Tests cover various cross-type cycle scenarios","notes":"Implementation complete with oracle feedback addressed:\n- Removed type filter from cycle detection (checks all types)\n- Extracted maxDependencyDepth=100 constant shared by AddDependency and DetectCycles\n- Moved cycle check before INSERT to avoid unnecessary write on failure\n- Added index verification (idx_dependencies_issue exists)\n- Added 6 comprehensive tests: self-dependency, related cycles (2-node, mixed), cross-type cycles (2-node, 3-node, discovered-from)\nAll tests pass.","status":"closed","priority":1,"issue_type":"task","assignee":"amp","created_at":"2025-10-16T10:28:30.313676-07:00","updated_at":"2025-10-16T10:59:07.970922-07:00","closed_at":"2025-10-16T10:38:05.442259-07:00","dependencies":[{"issue_id":"bd-312","depends_on_id":"bd-307","type":"parent-child","created_at":"2025-10-16T10:28:40.965071-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-313","title":"Fix false positive merge conflict detection in auto-import","description":"Merge conflict detection (bd-270) was too naive - matched \"=======\" substring anywhere in JSONL, including inside issue descriptions that document merge conflicts. This caused constant false alarms.\n\nRoot cause: Used bytes.Contains() instead of checking for standalone lines.\n\nFix: Check conflict markers only as standalone lines (trimmed), not embedded in JSON strings.","status":"closed","priority":0,"issue_type":"bug","created_at":"2025-10-16T12:22:37.218047-07:00","updated_at":"2025-10-16T12:22:51.404603-07:00","closed_at":"2025-10-16T12:22:51.404603-07:00","dependencies":[{"issue_id":"bd-313","depends_on_id":"bd-270","type":"discovered-from","created_at":"2025-10-16T12:22:37.22312-07:00","created_by":"stevey"}]}
|
||||
{"id":"bd-314","title":"Test issue B","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-10-16T12:59:36.947124-07:00","updated_at":"2025-10-16T13:00:14.492863-07:00","closed_at":"2025-10-16T13:00:14.492863-07:00","dependencies":[{"issue_id":"bd-314","depends_on_id":"bd-315","type":"blocks","created_at":"2025-10-16T12:59:41.791641-07:00","created_by":"stevey"}]}
|
||||
|
||||
Reference in New Issue
Block a user