oneie
Version:
Build apps, websites, and AI agents in English. Zero-interaction setup for AI agents (Claude Code, Cursor, Windsurf). Download to your computer, run in the cloud, deploy to the edge. Open source and free forever.
237 lines (175 loc) • 6.01 kB
Markdown
---
title: Tests
dimension: things
category: cascade
tags: agent, ai, knowledge
related_dimensions: knowledge, people
scope: global
created: 2025-11-03
updated: 2025-11-03
version: 1.0.0
ai_context: |
This document is part of the things dimension in the cascade category.
Location: one/things/cascade/docs/examples/1-4-knowledge-management/tests.md
Purpose: Documents tests for feature 1-4: knowledge management system
Related dimensions: knowledge, people
For AI agents: Read this to understand tests.
---
# Tests for Feature 1-4: Knowledge Management System
**Feature:** 1-4-knowledge-management
**Status:** Tests Defined → Design Phase
**Quality Agent:** agent-quality.md
---
## User Flows
### Flow 1: Capture Lesson Learned
**User goal:** Specialist adds lesson after fixing problem
**Time budget:** < 2 minutes to write lesson
**Steps:**
1. Specialist fixes problem
2. Specialist opens `lessons-learned.md`
3. Specialist writes lesson with template
4. Specialist includes problem, solution, pattern
5. Lesson saved
6. Lesson searchable immediately
**Acceptance Criteria:**
- [ ] Lesson template clear and easy to follow
- [ ] Required fields enforced (problem, solution, pattern)
- [ ] Lesson written in < 2 minutes
- [ ] Lesson added to correct category
- [ ] Lesson includes example code
- [ ] Lesson immediately searchable
---
### Flow 2: Search Knowledge Base
**User goal:** Problem solver finds similar issues
**Time budget:** < 5 seconds
**Steps:**
1. Problem solver analyzes test failure
2. Problem solver searches lessons learned
3. System returns relevant lessons
4. Problem solver reviews results
5. Problem solver references similar issue or creates new
**Acceptance Criteria:**
- [ ] Search by keywords: < 5 seconds
- [ ] Search by category: < 2 seconds
- [ ] Results ranked by relevance
- [ ] Returns 0-10 most relevant lessons
- [ ] Highlights matching text
- [ ] Search works even with typos
---
### Flow 3: Load Pattern Template
**User goal:** Specialist applies pattern to implementation
**Time budget:** < 3 seconds
**Steps:**
1. Specialist needs to implement feature
2. Specialist loads relevant pattern
3. Pattern template displayed
4. Specialist copies and adapts template
5. Implementation follows pattern
**Acceptance Criteria:**
- [ ] Pattern loaded: < 1 second
- [ ] Template includes placeholders
- [ ] Variables documented
- [ ] Example included
- [ ] Usage instructions clear
- [ ] Common mistakes documented
---
### Flow 4: Promote Lesson to Pattern
**User goal:** System recognizes repeated lesson becomes pattern
**Time budget:** < 10 minutes to create pattern
**Steps:**
1. Same lesson appears 3+ times
2. System or human identifies repetition
3. Extract common structure
4. Create pattern template with variables
5. Document in patterns/ directory
6. Future lessons reference pattern
**Acceptance Criteria:**
- [ ] Repeated lessons detected (3+ occurrences)
- [ ] Pattern creation guided by template
- [ ] Pattern includes all required sections
- [ ] Pattern documented clearly
- [ ] Pattern referenced from lessons
- [ ] Future work uses pattern
---
### Flow 5: Knowledge Accumulation Over Time
**User goal:** System gets smarter with each problem solved
**Time budget:** Ongoing
**Steps:**
1. Week 1: 0 lessons, 8 basic patterns
2. Month 1: 20+ lessons, 8 patterns
3. Month 3: 60+ lessons, 15 patterns (7 promoted)
4. Quarter 1: 150+ lessons, 25+ patterns
5. Features built faster (reference existing knowledge)
**Acceptance Criteria:**
- [ ] Lessons accumulate continuously
- [ ] Patterns promoted from lessons
- [ ] Knowledge referenced in new work
- [ ] Repeat problems decrease over time
- [ ] Feature velocity increases
- [ ] Quality improves continuously
---
## Technical Tests
### Unit Tests
**Lesson Capture:**
- [ ] `addLesson(lesson)` validates structure
- [ ] `addLesson()` requires problem, solution, pattern
- [ ] `addLesson()` adds to correct category
- [ ] `addLesson()` generates lesson ID
- [ ] `addLesson()` logs event
**Knowledge Search:**
- [ ] `search(query)` returns ranked results
- [ ] `search(query, category)` filters by category
- [ ] `getLessons(category, limit)` returns recent lessons
- [ ] `getPattern(category, name)` returns pattern
- [ ] `getRelated(lessonId)` finds related lessons
**Pattern Management:**
- [ ] `createPattern(lesson)` extracts template
- [ ] `createPattern()` identifies variables
- [ ] `createPattern()` documents usage
- [ ] `loadPattern(name)` returns template
---
### Integration Tests
**Lesson to Pattern Promotion:**
- [ ] Detect 3 similar lessons
- [ ] Extract common structure
- [ ] Create pattern template
- [ ] Update lessons to reference pattern
- [ ] Future work uses pattern
**Knowledge in Workflow:**
- [ ] Problem solver searches lessons
- [ ] Problem solver references similar issues
- [ ] Specialist loads patterns
- [ ] Specialist applies patterns
- [ ] Specialist captures new lessons
**Knowledge Accumulation:**
- [ ] Week 1: 5 lessons added
- [ ] Month 1: 20 lessons total
- [ ] Month 3: Pattern promoted
- [ ] Quarter 1: 25+ patterns
---
### E2E Tests
**Complete Knowledge Cycle:**
- [ ] Problem occurs (test fails)
- [ ] Problem solver analyzes
- [ ] Problem solver searches lessons (finds 0)
- [ ] Specialist fixes problem
- [ ] Specialist captures lesson
- [ ] Lesson searchable
- [ ] Future problem: lesson found
- [ ] 3rd occurrence: pattern promoted
**Knowledge Impact:**
- [ ] Month 1: 20% problems repeat
- [ ] Month 3: 10% problems repeat (lessons help)
- [ ] Quarter 1: 5% problems repeat (patterns prevent)
- [ ] Feature velocity increases 2x (less figuring out)
---
## Definition of Done
- [ ] Lessons learned structure defined
- [ ] Pattern library organized
- [ ] 8 basic patterns created
- [ ] Knowledge query system works
- [ ] Lesson capture workflow documented
- [ ] Pattern discovery process defined
- [ ] All tests pass
---
**Next:** Design phase - Knowledge base structure and search architecture