Commit graph

10 commits

Author SHA1 Message Date
darrenhinde
f773b290ce chore(evals): comprehensive cleanup, documentation, and test infrastructure improvements
Documentation:
- Add ARCHITECTURE.md with comprehensive system review
- Add GETTING_STARTED.md for new users
- Add DOCUMENTATION_CLEANUP.md tracking cleanup changes
- Add SCRIPTS_ORGANIZATION.md documenting script reorganization
- Remove outdated docs (TESTING_CONFIDENCE.md, TEST_REVIEW.md, SESSION_STORAGE_FIX.md)
- Update README files with current information

Script Organization:
- Move 12 scripts from framework root to organized directories:
  - scripts/debug/ (4 files): Session debugging tools
  - scripts/test/ (6 files): Test execution scripts
  - scripts/utils/ (2 files): Utility scripts
- Add comprehensive scripts/README.md with usage examples

Test Infrastructure:
- Add 5 new context loading tests for openagent
- Add result-saver.ts for test result persistence
- Add interactive results dashboard (index.html)
- Add error-handling.test.ts for framework testing
- Add result-saver.test.ts with comprehensive unit tests

Evaluator Improvements:
- Enhance context-loading-evaluator with better detection
- Update run-sdk-tests.ts with improved result handling

Agent Configuration:
- Add .opencode/agent/AGENT.md for agent definition

Test Utilities:
- Add test-agent-manual.mjs for manual testing
- Update test_tmp/README.md with usage guidelines

This commit consolidates multiple improvements:
- Better organization (scripts, docs)
- Improved testing infrastructure
- Comprehensive documentation
- Cleaner codebase structure
2025-11-26 21:34:27 +00:00
darrenhinde
12d087b55f refactor(evals): split test-runner into modular components for better maintainability
- Split test-runner.ts (884 lines) into 4 focused modules:
  - test-runner.ts (411 lines): Thin orchestrator for lifecycle management
  - test-executor.ts (392 lines): Core test execution logic
  - result-validator.ts (253 lines): Result validation logic
  - event-logger.ts (128 lines): Event logging utilities

- Improved Single Responsibility Principle compliance
- Added dependency injection for logger interfaces
- Enhanced testability through modular design
- Maintained full backward compatibility

Benefits:
- Easier to understand and maintain
- Each component can be unit tested independently
- Clear separation of concerns
- No breaking changes to existing consumers
2025-11-26 21:33:38 +00:00
darrenhinde
f872007919 fix(evals): update openagent tests to use multi-turn prompts for write operations
OpenAgent requires text-based approval before executing write/edit tools.
Updated tests to use multi-turn prompts:
1. First prompt: Request the task
2. Second prompt: 'Yes, proceed' to approve

Also added TESTING_CONFIDENCE.md documenting current test reliability:
- Opencoder: HIGH confidence (4/4 tests passing)
- OpenAgent: MEDIUM confidence (multi-turn works, context loading needs verification)
2025-11-26 11:29:18 +00:00
darrenhinde
0d1718e551 fix(evals): use test_tmp directory for test artifacts and add cleanup
- Create evals/test_tmp/ directory for test-created files
- Update all tests to write files to test_tmp/ instead of project root
- Add cleanup logic to test runner (before and after tests)
- Add comprehensive HOW_TESTS_WORK.md documentation
- Remove src/ directory that was accidentally created by tests

This prevents tests from polluting the project directory with test artifacts.
2025-11-26 10:14:29 +00:00
darrenhinde
8eb4b31ef4 feat(evals): add opencoder test suite and fix expected violation handling
- Create separate test folder for opencoder agent with 4 tests
- Update openagent tests to use multi-turn prompts for approval workflow
- Fix test runner to properly handle expectedViolations with shouldViolate: true
- Add mustUseAnyOf behavior expectation for flexible tool matching
- Add unit tests for timeline-builder and context-loading-evaluator
- Update documentation to reflect agent-specific test structure
- Remove outdated AGENT_DETECTION_STATUS.md

Opencoder tests: 4/4 passing
Key insight: openagent uses text-based approval, opencoder uses tool permissions only
2025-11-26 01:52:18 +00:00
darrenhinde
e43eaff317 feat(evals): add BehaviorEvaluator and improve test validation
- Add BehaviorEvaluator for validating agent behavior expectations:
  - mustUseTools/mustNotUseTools validation
  - minToolCalls/maxToolCalls validation
  - requiresApproval/requiresContext/shouldDelegate checks

- Fix test schema to allow behavior alone (without expectedViolations)
- Add 41 unit tests for BehaviorEvaluator, TestCaseSchema, and YAML loading
- Improve test-runner event logging with meaningful tool/message details
- Fix glob import for ESM compatibility
- Add new test cases for bash, context loading, and approval scenarios
2025-11-26 01:10:51 +00:00
darrenhinde
c0a8395878 chore: clean up redundant documentation and old test files
- Delete 5 temporary root-level docs (alignment, migration, summaries)
- Delete 1 redundant agent guide (merged into main guide)
- Delete 4 old openagent files (test scenarios, results, old runner)
- Delete tests/simple/ directory (old synthetic test data)
- Delete 3 old framework test scripts

Result: 62% fewer documentation files (21 → 8)
Kept only essential docs with clear purposes
2025-11-22 15:23:09 +00:00
darrenhinde
cc96acc50e feat: add 5 essential workflow tests and reorganize with agents/ structure
- Add 5 workflow tests (task, context loading, stop-on-failure, conversational)
- Add 1 shared test (agent-agnostic approval gate)
- Reorganize: opencode/ → agents/ for clearer structure
- Rename: sdk-tests/ → tests/ for simplicity
- Update test runner paths to new structure
- Add comprehensive documentation (test plan, guides, migration)
- Update all documentation with new paths

Total: 13 tests (was 6, added 7)
Coverage: +31% workflow compliance
All tests passing: 11/11 (100%)
2025-11-22 15:20:59 +00:00
darrenhinde
478c8e3e85 feat: implement SDK-based evaluation framework with real agent testing
- Replace planned framework with working SDK implementation using @opencode-ai/sdk
- Add 6 YAML test cases across developer/business/edge-case categories (100% passing)
- Implement 4 evaluators for openagent.md rule compliance (approval-gate, context-loading, delegation, tool-usage)
- Add real-time event streaming and session recording
- Configure opencode/grok-code-fast as default model (zero API costs)
- Add comprehensive documentation (SDK_EVAL_README.md, test-design-guide.md, TEST_SCENARIOS.md)
- Support v2 schema with behavior-based expectations instead of message counts
- Enable model-agnostic test design that works across Claude, GPT-4, and Grok
- Add subagent invocation syntax documentation to openagent.md
2025-11-22 14:30:11 +00:00
darrenhinde
f4b3d56aa2 Add evaluation framework structure and OpenCode logging documentation
- Add comprehensive evaluation framework in evals/
  - Reusable framework for testing OpenCode agents
  - OpenAgent-specific test configuration
  - Scalable structure for multiple agents

- Add OpenCode logging system documentation
  - Complete schema documentation for session storage
  - Model and provider tracking details
  - Performance analysis examples
  - Cost optimization strategies

- Update .gitignore
  - Ignore evals/results/ directory
  - Ignore tasks/ directory (temporary)

Structure:
- evals/framework/ - Reusable evaluation framework
- evals/opencode/openagent/ - OpenAgent tests
- dev/ai-tools/opencode/logging-and-session-storage.md - Logging docs
2025-11-21 14:50:44 +00:00