Pilot refactor per locked substrate schema. kei-task migrated to atom
layout:
- atoms/<verb>.md — YAML frontmatter + human body for 3 verbs
- atoms/schemas/<verb>-{input,output}.json — JSON Schema draft-07
- src/atoms/<verb>.rs — typed Input/Output/Error + pub fn run()
- src/atoms/mod.rs — module registry
- Cargo.toml [package.metadata.keisei] — crate-level substrate data
- src/main.rs — dispatcher for 3 pilot commands via atoms::
Zero behaviour change: 7/7 integration tests pass before and after
(create_and_get, update_persists, cycle_detected, milestone_linking,
dependency_chain_traversal, task_graph_edges, search_finds_task).
main.rs still has 5 non-migrated subcommands (update, graph,
dependency-chain, milestone, link-milestone) — scope discipline, they
migrate in later passes. main.rs 120 → 132 LOC.
Stream B pilot reference — other crates follow this pattern in v0.24+.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 KiB
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 |
|
|
|
|
false | 5000 | null | stable |
|
|
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_typedefaults to"blocks". Empty string is also treated as"blocks"for CLI convenience.- Cycle check is transitive — the implementation walks the existing
DAG from
toand refuses if it can reachfrom. - Both task ids must already exist; missing ids do NOT surface a
dedicated error code in the current impl and bubble up as
StoreErrorvia foreign-key violation. - Re-adding an existing edge is silently idempotent (
INSERT OR IGNORE) even though the atom declaresidempotent: false— that flag reflects the CONTRACT (callers should not rely on retry semantics), not the specific SQL behaviour.
Related
- kei-task::create — create endpoints of the edge first