harbor run -t openthoughts/tasktrove-exp-rpt-curriculum-hard-curriculum-hard-0253harbor download openthoughts/tasktrove-exp-rpt-curriculum-hard-curriculum-hard-0253Goal
app. The app object must have an attribute APP which is a Flask application instance. The solution should be robust to concurrent requests, handle edge cases, and be structured across multiple modules under /app to illustrate a clean architecture.Public interface
app defined in /app/context.py.app must have an attribute APP which is a Flask application instance. Test code will import with: from context import app and then use app.APP (e.g., app.APP.config, app.APP.test_client(), etc.).Flask app setup
app.APP.test_client()).app.config['DATABASE'] if present (the tests may set this to a temporary file path). The endpoints need not rely on a real database, but you should handle the config gracefully and document the behavior.Architecture and file layout (multi-file design)
app object and wire things together (acts as the entry point for tests).from context import app and should expose app.APP as the Flask app instance.Endpoints required by tests (two endpoints; behavior defined below)
Endpoint 1: GET /mug/api/dmp/file/whole
jsonify with a structure that includes an "usage" key. Example: {"usage": {"requests": 1}}. The exact structure under "usage" is flexible as long as the key exists.Endpoint 2: GET /mug/api/dmp/file/region
file_id=testtest0000&chrom=19&start=3000000&end=3100000.file_id, chrom, start, end.file_id="default", chrom="chr1", start=1, end=10000).{"regions": [{"file_id": "...", "chrom": "...", "start": ..., "end": ..., "score": ...}]}.Edge cases and robustness (mandatory)
Performance and concurrency considerations
Technical details and constraints
from context import app in the tests.app object with an APP attribute containing the Flask app instance.from context import app.Notes for implementer
app. Do not rename it or expose additional top-level objects required by tests.Deliverable
app.APP as a functional Flask application with the two endpoints described above.