Test Plan¶
How to verify pi-vault-mind works for agents, humans, and human-in-the-loop (HITL) workflows.
Three personas¶
| Persona | Role | How they interact |
|---|---|---|
| Agent | LLM / pi | Discovers tools, calls them with correct parameters, reads promptGuidelines |
| Human | User | Types /wiki init, reviews output, runs commands |
| Human-in-the-loop | Approver | Confirm/reject via strict mode or /wiki approve batch review |
Agent-only test (autopilot mode)¶
Goal: The agent captures facts without human interaction.
Agent flow:
describe_wiki→ confirms schema fieldsappend_wikiwithmode="autopilot"- Checks dedup → appends if unique
- Returns success confirmation
Verify:
Returns the entry.
Human-only test (commands)¶
Goal: A human can set up and use the collection without the agent writing code.
# 1. Install
pi install npm:pi-vault-mind
# 2. Check health
/wiki validate
# 3. Scaffold
/wiki init
# 4. Check config created
cat pi-vault-mind.config.json
# 5. Index docs (if wiki collections exist)
/wiki reindex
# 6. Search
wiki_search(query="authentication strategy")
# 7. Check stats
wiki_stats
Expected: No tool calls needed; all interaction is via slash commands.
Human-in-the-loop test (strict mode)¶
Goal: Agent proposes entries; human approves each one.
Agent flow:
append_wikiwithmode="strict"ctx.ui.confirmfires → human sees a dialog- Human clicks Approve → entry appended
- Or human clicks Reject → agent sees rejection, pivots
Verify dialog shows:
- Full JSON of proposed entry
- Collection name
- "Approve entry for 'main'?"
Human-in-the-loop test (gated + approval batch)¶
Goal: Agent queues many facts; human reviews all at once.
Agent flow (5x):
append_wikiwithmode="gated"each time- Facts go to
collections/pending.jsonl
Human later types:
Verify:
- Each pending entry shows in a confirm dialog
- Approve → moved to
collections/main.jsonl - Reject → stays in
collections/pending.jsonl(or removed) - Final count message: "Approved 4 → 'main'. Rejected 1."
Context injection test¶
Goal: Typing a keyword triggers automatic context loading.
Setup: Ensure config has:
"injectors": [
{ "name": "draft-context", "regex": "draft\\s+(\\S+)", "collection": "main", "filterField": "tag" }
]
Add an entry:
append_wiki(collection="main", mode="autopilot", entry={id:"r1", domain:"auth", source:"s1", fact:"SSO required", tag:"login", artifact:""})
Test:
Expected: The before_agent_start event injects all entries where tag === "login" into the system prompt.
Verify by checking the LLM response references "SSO required".
Indexing test (wiki pipeline)¶
Goal: Documents are searchable after indexing.
# 1. Have markdown files in ./docs
ls docs/*.md
# 2. Add to wiki (via /wiki init or direct collection config)
# 3. Index (BM25 + embeddings)
/wiki reindex
# 4. Check status
wiki_status
# Expected: shows collection, file count, zero pending embeddings
# 5. Search
wiki_search(query="deployment strategy", limit=3)
# Expected: returns relevant markdown chunks
Export test¶
Goal: Data portability.
Verify: Files are valid CSV/Markdown with schema headers.
Regression checklist¶
Run before each release:
| Check | How |
|---|---|
| Build | pnpm build → zero errors |
| Check | pnpm check → zero errors (biome + tsc) |
| Version | cat package.json \| grep version matches planned release |
| Changelog | CHANGELOG.md has entry for this version |
| Skills manifest | skills/vault-mind/SKILL.md has valid frontmatter |
| No stale refs | No wiki-ledger, qmd-init, /approve-ledger, or _ledger tool names in docs |
Smoke test (one-liner)¶
If this sequence completes without errors, the extension is healthy.