honcho/tests/deriver
lilyplasticlabs 7e835759dc fix(dreamer): address CodeRabbit feedback on b89997c
- enqueue.py: read-modify-write preserves last_dream_at when writing baseline
- dream_scheduler.py: explicit-level filter on execute_dream count query
- test fixture: pin DOCUMENT_THRESHOLD and ENABLED_TYPES for stability
- integration test: timezone-aware assertion on last_dream_at

Regression test added for enqueue sibling-drop (symmetric to c8fe40a).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 18:13:12 -04:00
..
README.md create Representation class and use it to unify all formatting (#214) 2025-10-07 15:28:44 -04:00
__init__.py Vineeth/dev 1027 (#177) 2025-08-06 16:20:22 -04:00
conftest.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
test_deriver_processing.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
test_enqueue_dream.py fix(dreamer): address CodeRabbit feedback on b89997c 2026-04-17 18:13:12 -04:00
test_queue_operations.py feat: webhooks (#168) 2025-08-06 17:52:35 -04:00
test_queue_processing.py fix: Various Codex Audits (#386) 2026-02-13 12:00:15 -05:00
test_representation_crud.py feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
test_vector_reconciliation.py fix: Various Codex Audits (#386) 2026-02-13 12:00:15 -05:00

README.md

Deriver Testing

This directory contains tests for the deriver system, which handles background processing of messages to extract insights and update working representations.

Structure

  • conftest.py - Shared fixtures for deriver testing
  • test_queue_operations.py - Tests for basic queue operations
  • test_deriver_processing.py - Tests for deriver processing logic
  • test_queue_processing.py - Tests for queue manager and work unit processing

Key Fixtures

Database Fixtures

  • sample_session_with_peers - Creates a session with multiple peers having different observation configurations
  • sample_messages - Creates sample messages for testing
  • sample_queue_items - Creates queue items with various payload types (representation, summary)

Queue Fixtures

  • create_queue_payload - Helper to create queue payloads for testing
  • add_queue_items - Helper to add queue items to the database
  • create_active_queue_session - Helper to create active queue sessions for work unit tracking

Mocking Fixtures

  • mock_critical_analysis_call - Mocks the critical analysis LLM call
  • mock_queue_manager - Mocks the queue manager for testing
  • mock_representation_manager - Mocks the representation manager operations

Testing Patterns

Creating Queue Items

# Create representation payloads
payload = create_queue_payload(
    message=message,
    task_type="representation",
    observer=observer_peer.name,
    observed=message.peer_name
)

# Add to queue
queue_items = await add_queue_items([payload], session.id)

Testing Work Units

# Create a work unit
work_unit = WorkUnit(
    session_id=session.id,
    task_type="representation",
    observer=observer,
    observed=observed
)

# Test string representation
assert str(work_unit) == f"({session.id}, {observed.name}, {observer.name}, representation)"