feat: task dependency CRUD — create/update deps via CLI and API#2
Draft
0pfleet wants to merge 3 commits intohyperb1iss:mainfrom
Draft
feat: task dependency CRUD — create/update deps via CLI and API#20pfleet wants to merge 3 commits intohyperb1iss:mainfrom
0pfleet wants to merge 3 commits intohyperb1iss:mainfrom
Conversation
Adds a targeted relationship deletion method that removes relationships of a specific type between two entities in a single Cypher query. Used by the dependency CRUD to remove DEPENDS_ON edges without needing to fetch-filter-delete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds add_depends_on/remove_depends_on fields to UpdateTaskRequest, enabling dependency management after task creation. Both sync and async (worker) paths handle DEPENDS_ON relationship creation and deletion. Extracts _build_update_data() helper to stay under PLR0915 statement limit after adding the new fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- create: Add --depends-on flag, switch from generic POST /entities to dedicated POST /tasks endpoint (create_direct, no worker queue) - update: Add --add-dep and --remove-dep flags for post-creation dependency management - client: Add create_task() method, add dep params to update_task() The create command now uses the task-specific endpoint which handles BELONGS_TO and DEPENDS_ON relationships synchronously, eliminating the need for the --sync flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the #1 gap identified in the Sibyl audit: users cannot build dependency chains after task creation. The dependency reader (graph traversal, cycle detection, topological sorting via
sibyl explore dependencies) was complete, but the writer was missing.PATCH /tasks/{task_id}now acceptsadd_depends_on/remove_depends_onfor post-creation dependency managementsibyl task create --depends-on task_aaa,task_bbbwires dependencies at creation time via the dedicatedPOST /tasksendpointsibyl task update task_xxx --add-dep task_yyy --remove-dep task_zzzmutates dependencies after creationRelationshipManager.delete_between()helper for targeted DEPENDS_ON edge removal in a single Cypher queryMotivation
Sibyl had a full dependency reader but an incomplete writer:
POST /tasksaccepteddepends_onat creation, but the CLI never wired it (used genericPOST /entitiesinstead)PATCH /taskshad no dependency mutation support at allWhat changed
sibyl_core/graph/relationships.pydelete_between()— single-query edge deletion between two nodessibyl/api/routes/tasks.pyadd_depends_on/remove_depends_ontoUpdateTaskRequest, handle in sync + async pathssibyl/jobs/queue.pysibyl/jobs/entities.pysibyl_cli/client.pycreate_task()method (dedicated endpoint), add dep params toupdate_task()sibyl_cli/task.py--depends-on,--add-dep,--remove-depflags; switch create toPOST /tasksDesign decisions
POST /entitiestoPOST /tasks: The generic endpoint queued a worker job that calledcreate_direct()anyway (no LLM extraction for tasks). The dedicated endpoint does the same thing inline, eliminating the worker round-trip and pending state complexity. The--syncflag was removed as it's no longer needed.delete_between()returns count (not bool): Follows the pattern ofdelete_for_entity()— bulk-style operations return count, scalar operations (delete()) return bool._build_update_data()extracted as helper: The PATCH handler hit PLR0915 (too many statements) after adding dep handling. Extracting the field mapping keeps it clean.Test plan
ruff checkpasses on all 3 packages (core, api, cli)ty check— no new type errors (11 pre-existing warnings in unrelated files)pytestsibyl-core — 769 passedpytestapi — 1229 passed, 1 failed (pre-existing:test_tools_managetries live FalkorDB connection)sibyl task create --title "Test dep" --depends-on task_aaa,task_bbb sibyl task update task_xxx --add-dep task_yyy sibyl task update task_xxx --remove-dep task_yyy sibyl explore dependencies task_xxx🤖 Generated with Claude Code