Add repo-memory CLI test docs
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Repo Memory `ingest` Test Plan Index
|
||||
|
||||
## Case Files
|
||||
|
||||
| Case Slug | File | Coverage Note |
|
||||
| --- | --- | --- |
|
||||
| `ingest-imports-docs-ai-markdown` | [ingest-imports-docs-ai-markdown.md](./ingest-imports-docs-ai-markdown.md) | imports markdown sections under `docs/ai` as confirmed knowledge entries |
|
||||
| `ingest-rejects-when-no-markdown-found` | [ingest-rejects-when-no-markdown-found.md](./ingest-rejects-when-no-markdown-found.md) | rejects an empty scan tree with a stable error message |
|
||||
| `ingest-imports-headingless-markdown-as-single-entry` | [ingest-imports-headingless-markdown-as-single-entry.md](./ingest-imports-headingless-markdown-as-single-entry.md) | imports headingless markdown as one fallback `Overview` entry |
|
||||
@@ -0,0 +1,45 @@
|
||||
# Case: `ingest-imports-docs-ai-markdown`
|
||||
|
||||
## 用例意义
|
||||
|
||||
验证 `ingest` 会扫描 `docs/ai` 下的 Markdown,并把 section 导入为可检索的 durable knowledge entry。
|
||||
|
||||
## 前置条件
|
||||
|
||||
- `TMPDIR/repo` 是一个已提交初始 commit 的 Git 仓库
|
||||
- `TMPDIR/repo/docs/ai/repo-memory.md` 内容至少包含:
|
||||
|
||||
```md
|
||||
# Repo Memory
|
||||
|
||||
## Module Map
|
||||
|
||||
- gateway
|
||||
- app/app
|
||||
|
||||
## Danger Zones
|
||||
|
||||
- shared libs first
|
||||
```
|
||||
|
||||
- `TMPDIR/repo-memory.db` 尚不存在
|
||||
|
||||
## 输入
|
||||
|
||||
```bash
|
||||
repo-memory ingest --db TMPDIR/repo-memory.db --repo TMPDIR/repo
|
||||
repo-memory list --db TMPDIR/repo-memory.db --repo repo
|
||||
```
|
||||
|
||||
## 预期输出
|
||||
|
||||
- `ingest` 退出码为 `0`
|
||||
- `ingest` 输出 `ingested 1 docs from ABS_REPO`
|
||||
- `list` 输出包含 `module:repo-memory:module-map [confirmed]`
|
||||
- `list` 输出包含 `danger:repo-memory:danger-zones [confirmed]`
|
||||
|
||||
## 断言结论
|
||||
|
||||
- 一个 Markdown 文件中的多个 section 会被拆成多条知识 entry
|
||||
- `ingest` 会自动初始化数据库并注册 repo
|
||||
- 从 `repo-memory.md` 导入的 `Module Map`、`Danger Zones` 会被分类为不同 kind
|
||||
@@ -0,0 +1,38 @@
|
||||
# Case: `ingest-imports-headingless-markdown-as-single-entry`
|
||||
|
||||
## 用例意义
|
||||
|
||||
验证 `ingest` 遇到没有任何 Markdown heading 的文档时,不会跳过,而是回退为单条导入 entry。
|
||||
|
||||
## 前置条件
|
||||
|
||||
- `TMPDIR/repo` 是一个已提交初始 commit 的 Git 仓库
|
||||
- `TMPDIR/repo/docs/ai/repo-memory.md` 存在,内容只有普通段落,没有任何 `#` heading,例如:
|
||||
|
||||
```md
|
||||
This repository keeps AI memory notes near docs/ai.
|
||||
Gateway owns ingress and app/app owns orchestration.
|
||||
```
|
||||
|
||||
- 空数据库已完成 `init`
|
||||
|
||||
## 输入
|
||||
|
||||
```bash
|
||||
repo-memory ingest --db TMPDIR/repo-memory.db --repo TMPDIR/repo
|
||||
repo-memory list --db TMPDIR/repo-memory.db --repo repo
|
||||
repo-memory search --db TMPDIR/repo-memory.db --repo repo --query "Gateway orchestration"
|
||||
```
|
||||
|
||||
## 预期输出
|
||||
|
||||
- `ingest` 退出码为 `0`
|
||||
- `ingest` 输出 `ingested 1 docs from ABS_REPO`
|
||||
- `list` 输出包含 `decision:repo-memory:overview [confirmed]`
|
||||
- `search` 输出包含 `decision:repo-memory:overview`
|
||||
|
||||
## 断言结论
|
||||
|
||||
- headingless markdown 不会被忽略
|
||||
- 该类文档会以回退 heading `Overview` 导入为单条 entry
|
||||
- 回退导入的 entry 仍然可以被 `list` 与 `search` 正常消费
|
||||
@@ -0,0 +1,27 @@
|
||||
# Case: `ingest-rejects-when-no-markdown-found`
|
||||
|
||||
## 用例意义
|
||||
|
||||
验证 `ingest` 在扫描目录存在但没有 Markdown 文件时,会返回稳定的失败信息而不是静默成功。
|
||||
|
||||
## 前置条件
|
||||
|
||||
- `TMPDIR/repo` 是一个已提交初始 commit 的 Git 仓库
|
||||
- `TMPDIR/repo/docs/ai/` 目录存在但为空
|
||||
- 空数据库已完成 `init`
|
||||
|
||||
## 输入
|
||||
|
||||
```bash
|
||||
repo-memory ingest --db TMPDIR/repo-memory.db --repo TMPDIR/repo
|
||||
```
|
||||
|
||||
## 预期输出
|
||||
|
||||
- 命令退出码为 `1`
|
||||
- stderr 包含 `no markdown files found under ABS_REPO/docs/ai`
|
||||
|
||||
## 断言结论
|
||||
|
||||
- `ingest` 不会把“没有可导入文档”误报为成功
|
||||
- 错误边界发生在导入阶段,repo 路径本身仍然是合法的
|
||||
Reference in New Issue
Block a user