Spaces:
Sleeping
Sleeping
Commit History
-
Phase 6: finish deferred items + fix packaging
Closes the two items Phase 5 deliberately deferred, plus a real packaging bug. - /v1 back-compat alias: a tiny ASGI path-rewrite (_V1PathRewriteMiddleware) maps /v1/<path> to the existing unversioned handler — no route duplication, and the stable /reset|/step|/state contract is untouched. tests/test_api_v1.py asserts /v1/* responses are byte-identical to /* and the bare paths still work. - Trajectory-store concurrency: WAL journal mode + synchronous=NORMAL via a connect-time PRAGMA, and check_same_thread=False so the pooled SQLite connection is reused across worker threads. tests/test_db_pooling.py verifies WAL is on. - Packaging fix: switched [tool.setuptools] to find-packages with include globs and added env/learning/__init__.py, so a built wheel now ships every subpackage (env.agents/learning/safety/eval/connectors) instead of just top-level env. tests/test_packaging.py guards it. No grader change -> golden snapshots unchanged. 385 tests pass, coverage 82.46%, ruff…b67f537 -
Repositioning: world-class personal project (v1.0.0)
Drop all competition/hackathon framing and tighten the project into a standalone, portfolio-grade repo. Behavior of the environment, graders, and API is unchanged; this is reframing + cleanup + consolidation. De-hackathon: - Remove HF Space frontmatter from README; reword "OpenEnv-style" -> "RL-style" and "validator parity"/"validator-friendly" -> "score/log contract" / "numerically stable" across all docs and code docstrings. - Delete the OpenEnv manifest (openenv.yaml) and the dead openenv-core dep. - Rewrite DEPLOYMENT_GUIDE from an HF-submission checklist into a generic Docker/cloud deployment guide (HF Spaces kept as one optional target). - Rename tests/test_validator_parity.py -> tests/test_score_contract.py. - Remove empty stray dirs (Hackathon/, Hackathonenvlearning/, E:Meta/). UI consolidation: - Remove the duplicate Streamlit console (streamlit_app.py) and the streamlit dependency; the React dashboard is now the single served UI. Dependency & tooling: - Single runt…203345c
-
Wave 3: wire LLM metrics, gated scenario variants, multi-tenant auth
- llm_agent: record_llm_usage() on the LLM success path (lazy import, guarded). - Scenario variants behind SCENARIO_VARIANTS flag (default off -> byte-identical; on -> seed-deterministic choice over {task_id}*.yaml). +2 variant scenarios. - Opt-in multi-tenant auth (API_TENANTS=tok:tenant,...): per-tenant token + rate key + X-Tenant header; single API_AUTH_TOKEN unchanged; open by default. - +33 tests. Suite: 284 green.22b42b7
-
Phase 7: docs consolidation, architecture doc, API metadata + /version
- Enrich FastAPI OpenAPI metadata (description, license) and add a /version endpoint (semver); document the versioning policy. - Add docs/ARCHITECTURE.md (layers, request flow, key components, invariants, design decisions). - README: add a Documentation index (TECHNICAL_REFERENCE/ARCHITECTURE/RUNBOOK/ ROADMAP/CONTRIBUTING/SECURITY), the new health/version endpoints, and a Security & Configuration section. Kept the OpenEnv unversioned paths stable (a breaking /v1 move is deferred to avoid conflicting with validator parity). 204 tests passing, ruff clean.94970d2 -
Phase 6: observability ops (probes, lifespan, provisioning, runbook)
- Split health: /health/live (cheap liveness) and /health/ready (DB reachable -> 200/503); keep /health for back-compat. - Add a FastAPI lifespan that logs startup/shutdown (uvicorn maps SIGTERM to a graceful lifespan shutdown). - Add Prometheus scrape config, Grafana datasource provisioning, and an optional docker-compose observability stack (Prometheus + Grafana) under telemetry/. - Add docs/RUNBOOK.md (probes, metrics, alerts, log correlation, incident table, security toggles). - tests/test_observability.py: liveness/readiness, metrics format, /alerts wiring. (Alert rule evaluation was already wired via /alerts.) 203 tests passing, ruff clean.1be2435
-
Phase 2: opt-in API security (auth, CORS, rate limiting) + input hardening
- env/security.py: token auth helpers, fixed-window per-IP rate limiter, and identifier validation. - Gateway middleware now also does opt-in rate limiting (RATE_LIMIT_PER_MINUTE, default off -> 429) and opt-in auth (API_AUTH_TOKEN, default open; gates only mutating methods -> 401). Local dev/tests/validator unaffected by default. - CORSMiddleware with configurable CORS_ORIGINS (default *). - Validate episode_id on /replay, /episodes/{id}, /reports/episode/{id}; clamp /episodes pagination (page>=1, limit<=100). - Global exception handler returns generic JSON 500 with request_id, no traces. - Document the new env vars (.env.example) and update SECURITY.md scope note. - Add tests/test_security.py (8 tests). Full suite 173 passing.33e28bf -
Phase 1: add ruff + pre-commit tooling and apply lint/format pass
- Configure ruff (lint: E/F/I/W/UP/B; ignore E501 [formatter] and B008 [FastAPI]; format: double-quote) in pyproject.toml. - Add .pre-commit-config.yaml (ruff lint+format, prettier for dashboard sources, standard whitespace/EOF/yaml/toml hooks). - Apply 'ruff check --fix' + 'ruff format' across the repo (imports sorted, unused imports removed, consistent formatting) and fix the remaining lints (unused loop vars, dead conflicting_deadlines var, mid-file import in llm_agent). 'ruff check' is now clean; full suite stays green (165 passed). Validator log format preserved (test_validator_parity passes).6020272 -
Phase 1: structured logging + request-id correlation
- env/logging_config.py: configure_logging() (idempotent, level from settings) with a request_id field on every record via a ContextVar + filter. - API sets a per-request id (honoring an incoming X-Request-ID), echoes it in the response header, and logs unhandled errors with stack traces. - Add tests for header echo, contextvar roundtrip, idempotent setup. (Existing print()s are intentional CLI/stdout JSON and the validator-required inference [START]/[STEP]/[END] format, left untouched.)e38bd7c -
Phase 0: wire episode persistence, learning auto-save, and telemetry
- /baseline now persists each run via EpisodeRepository.save_episode and auto-saves above-threshold runs to the trajectory store (best-effort, failures logged not raised). - /replay falls back to the DB so it survives a restart. - Add an HTTP middleware recording request count/latency and api errors so /metrics reflects real traffic. - Fix Episode.to_dict() to deserialize decisions_json (was hardcoded []). - Set expire_on_commit=False so ORM objects returned from a closed session remain readable (fixes latent DetachedInstanceError in /episodes and /replay). - Add tests proving persistence, DB-backed replay, trajectory capture, metrics.21d8ce2
-
Allow OpenEnv reset POST without body
c265728 -
Add OpenEnv reset/step/state runtime API endpoints
0a0d94d
-
OpenEnv submission
f1ef7fc