Files
ai-workflow-skill/docs/tests/repo-memory/link/link-creates-relation-between-entries.md
T

29 lines
787 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Case: `link-creates-relation-between-entries`
## 用例意义
验证 `link` 可以在两条已存在 entry 之间建立一条可持久化的关系记录。
## 前置条件
- 空数据库已完成 `init`
- 已存在两条 entry`#1 term:AITask``#2 chain:ai-insight.get`
## 输入
```bash
repo-memory link --db TMPDIR/repo-memory.db --from-id 1 --to-id 2 --relation related_to
sqlite3 TMPDIR/repo-memory.db "SELECT relation FROM knowledge_links WHERE from_entry_id = 1 AND to_entry_id = 2;"
```
## 预期输出
- `link` 命令退出码为 `0`
- `link` 输出 `linked #1 -[related_to]-> #2`
- SQL 查询返回一行 `related_to`
## 断言结论
- `link` 的副作用已落库,而不是只打印成功提示
- 关系是定向的,方向由 `from-id``to-id` 决定