harbor run -t openthoughts/tasktrove-exp-rle-heavy-padding-v2-5k-heavy-2849harbor download openthoughts/tasktrove-exp-rle-heavy-padding-v2-5k-heavy-2849Noise preface: This project lives somewhere between a garage-band prototype and a production-grade microservice, perched on the edge of a coffee-fueled epiphany. The workstation has more tabs open than there are neurons firing, and somewhere in the middle there’s a sticky note that says “FogLAMP readings, PostgreSQL, endpoints,” which is oddly the quiet center of the universe. If you’re skimming for a clean blueprint, you’ll have to dig through a forest of unrelated musings, irrelevant code snippets, and console gremlins that pretend to be productive. In other words: ignore the glitter and focus on the core contract below. Also, if you happen to trip over a stray console.log about temperature sensors in a weather-app microservice, that’s not part of this task—just a harmless detour.
Long-winded backstory and tangents occasionally surface, because real life is a tangle of small decisions that somehow culminate in an API you can actually run. A tiny coffee shop near the office pretends to be a data platform, the barista talks in SQL jokes, and somewhere in the background a CI job tries to build a Docker image while humming a tune about “Asset” and “Sensor.” If you’re here for a clean-room spec, you’ve come to the right door, but you’ll have to wade through the theatre to reach the door.
Background tangential note about unrelated tech vibes: Sometimes teams get excited about Redis caches, message queues, or GraphQL wrappers, but none of that is required here. The goal is a minimal, self-contained async REST API that reads from PostgreSQL and returns data in exact shapes and formats the tests expect. Treat any mention of Redis or GraphQL as red herrings and keep your eyes on the PostgreSQL foglamp.readings table and the user_ts timestamps.
Now, back to the actual requirements, with the original task kept intact for precise testing. Below is the task as provided (heavy padding included around it to bury the essentials). The core requirements have not changed.
ORIGINAL TASK: Task: Implement a self-contained REST API service to expose FogLAMP readings from PostgreSQL in the exact shapes and filtering the tests expect.
What to build
A small Python async web API (preferably FastAPI or a minimal Flask/FastAPI with async support) that serves data from the PostgreSQL table foglamp.readings in database foglamp.
The API must implement the following endpoints and behavior exactly as the tests expect:
GET /foglamp/asset
GET /foglamp/asset/{asset_code}
GET /foglamp/asset/{asset_code}/{sensor}
GET /foglamp/asset/{asset_code}/{sensor}/series
GET /foglamp/asset/{asset_code}/{sensor}/summary
Cross-cutting details and constraints
Acceptance criteria
Deliverables
Appendix of nonessential flair and stray signals