OpenWriterControle/evals/framework/scripts/debug/debug-session.mjs
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

35 lines
1 KiB
JavaScript

import { createOpencodeClient } from '@opencode-ai/sdk';
import { SessionReader } from './dist/collector/session-reader.js';
import { TimelineBuilder } from './dist/collector/timeline-builder.js';
const client = createOpencodeClient({
baseUrl: 'http://localhost:3721'
});
const sessionId = 'ses_54285cf4effeB8lTpo4r5v3swc';
const reader = new SessionReader(client);
const builder = new TimelineBuilder(reader);
console.log('Building timeline...\n');
const timeline = await builder.buildTimeline(sessionId);
console.log(`Timeline events: ${timeline.length}\n`);
// Show event types
const eventTypes = {};
timeline.forEach(e => {
eventTypes[e.type] = (eventTypes[e.type] || 0) + 1;
});
console.log('Event types:');
Object.entries(eventTypes).forEach(([type, count]) => {
console.log(` ${type}: ${count}`);
});
// Show tool calls
const toolCalls = timeline.filter(e => e.type === 'tool_call');
console.log(`\nTool calls: ${toolCalls.length}`);
toolCalls.forEach((tc, i) => {
console.log(` ${i + 1}. ${tc.data.tool} - ${tc.data.state}`);
});