harbor run -t openthoughts/tasktrove-exp-rpt-curriculum-medium-curriculum-medium-0385harbor download openthoughts/tasktrove-exp-rpt-curriculum-medium-curriculum-medium-0385You are to implement a small in-memory simulation of a ClickHouse test environment. The solution must live under /app/ and expose a package at /app/helpers/ with the following structure and behaviors. The goal is to satisfy the tests without requiring a real ClickHouse installation.
Key goal
What to implement (package layout)
Component signatures and responsibilities
Behavior details aligned with tests
Initial failing query:
Flushing logs:
Log counting after flush:
Additional edge cases and input validation (MEDIUM level)
Input validation
Edge case 1: Multiple nodes in a single cluster
Edge case 2: Repeated flushes
Edge case 3: Unknown log levels in count queries
Edge case 4: Case-insensitive handling
Hints to implement (not a full solution)
Compatibility notes
Deliverable
A minimal, well-documented Python package implementing:
The implementation must be self-contained, require no external dependencies, and work with the tests described above (including the two-node scenario if extended in tests). The code should be readable, with clear docstrings/comments explaining the in-memory logging mechanism and the supported SQL paths.