KeiSeiKit-1.0/_primitives/_rust/kei-task/atoms/add-dependency.md
Parfii-bot 0be354a920 KeiSeiKit-public — clean state
Single-commit clean baseline after security scrub of niche-tells,
project codenames, internal jargon, and contributor-email leaks.

Contents:
- 100 Rust crates (_primitives/_rust/)
- 37 agent manifests (_manifests/) + generated specs (_generated/)
- 67 user-invocable skills (skills/)
- 33 hooks (hooks/)
- Composition blocks (_blocks/)
- Documentation (docs/, README.md)
- TS adapter packages (_ts_packages/)
- Assembler (_assembler/)
- Roles (_roles/)
- Templates (_templates/)
- Forgejo CI (.forgejo/)

Author: Denis Parfionovich <info@greendragon.info>

License: see LICENSE.
2026-05-01 12:09:03 +08:00

2 KiB

atom kind version input output errors side_effects idempotent timeout_ms deprecated stability keywords related
kei-task::add-dependency command 0.1.0
schema required example
schemas/add-dependency-input.json
from
to
from to dep_type
42 17 blocks
schema example
schemas/add-dependency-output.json
ok
true
code http_analog description
SelfDependency 400 A task cannot depend on itself
code http_analog description
InvalidDepType 400 dep_type must be one of: blocks, feeds_into, subtask_of, milestone_of, assigned_to, depends_on
code http_analog description
CycleDetected 409 The new edge would close a cycle in the task DAG
code http_analog description
StoreError 500 Underlying SQLite store failed to insert the dependency row
op domain
write kei-task-db
false 5000 null stable
task
dependency
dag
blocks
graph
kei-task::create

kei-task::add-dependency

Inserts a typed edge from -> to in the task DAG, rejecting cycles and self-loops at write time. Edge is stored idempotently via INSERT OR IGNORE — re-adding the same triple is a no-op.

Example

kei-task add-dependency 42 17 --dep-type blocks

Stdout:

dep: 42 -> 17 (blocks)

Programmatic callers receive:

{ "ok": true }

Gotchas

  • dep_type defaults to "blocks". Empty string is also treated as "blocks" for CLI convenience.
  • Cycle check is transitive — the implementation walks the existing DAG from to and refuses if it can reach from.
  • Both task ids must already exist; missing ids do NOT surface a dedicated error code in the current impl and bubble up as StoreError via foreign-key violation.
  • Re-adding an existing edge is silently idempotent (INSERT OR IGNORE) even though the atom declares idempotent: false — that flag reflects the CONTRACT (callers should not rely on retry semantics), not the specific SQL behaviour.