Spaces:
Sleeping
Sleeping
Commit Β·
d4ab0f1
0
Parent(s):
first commit
Browse files- .gitignore +20 -0
- Dockerfile +3 -0
- README.md +12 -0
- __init__.py +3 -0
- client.py +4 -0
- drift.py +4 -0
- eval.py +4 -0
- eval_data/seeds.json +1 -0
- graders.py +4 -0
- models.py +4 -0
- openenv.yaml +7 -0
- pyproject.toml +36 -0
- requirements.txt +9 -0
- scenarios.py +4 -0
- server/__init__.py +0 -0
- server/app.py +4 -0
- server/environment.py +4 -0
- tests/__init__.py +0 -0
- tools/__init__.py +0 -0
- tools/base.py +4 -0
- tools/calendar.py +4 -0
- tools/chat.py +4 -0
- tools/crm.py +4 -0
- tools/docs.py +4 -0
- tools/mail.py +4 -0
- training/__init__.py +0 -0
- training/grpo_kaggle.ipynb +26 -0
- training/grpo_smoke.py +4 -0
- training/train.py +4 -0
.gitignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
| 3 |
+
*.pyo
|
| 4 |
+
*.pyd
|
| 5 |
+
.env
|
| 6 |
+
.venv/
|
| 7 |
+
venv/
|
| 8 |
+
*.egg-info/
|
| 9 |
+
*.egg
|
| 10 |
+
.pytest_cache/
|
| 11 |
+
.mypy_cache/
|
| 12 |
+
.ruff_cache/
|
| 13 |
+
eval_data/baselines.json
|
| 14 |
+
schemashift-grpo-*/
|
| 15 |
+
wandb/
|
| 16 |
+
.ipynb_checkpoints/
|
| 17 |
+
.DS_Store
|
| 18 |
+
Thumbs.db
|
| 19 |
+
*.log
|
| 20 |
+
insurance_video/*.mp4
|
Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Placeholder β will be filled in Phase 7.
|
| 2 |
+
# Target base: ghcr.io/meta-pytorch/openenv-base:latest
|
| 3 |
+
# Expose port 7860 for HF Spaces Docker SDK.
|
README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SchemaShift β OpenEnv Hackathon Round 2
|
| 2 |
+
|
| 3 |
+
RL environment where a workflow agent completes multi-step SaaS admin tasks across tools (Mail, Calendar, CRM, + stretch: Chat, Docs) while tool APIs drift mid-episode. Trains adaptive tool use β a meta-skill frontier LLMs lack.
|
| 4 |
+
|
| 5 |
+
**Team Tripod:** Yashash Sheshagiri (lead), Gajanand V Dhayagode, Likith B S
|
| 6 |
+
**Event:** Meta Γ Hugging Face Γ PyTorch Hackathon 2026 Β· April 25β26, 2026 Β· Bangalore
|
| 7 |
+
**Themes:** Multi-Agent Β· Long-Horizon Β· World Modeling
|
| 8 |
+
**Sub-themes:** Patronus (Schema Drift) Β· Scaler (Multi-App Enterprise)
|
| 9 |
+
|
| 10 |
+
## Status
|
| 11 |
+
|
| 12 |
+
Scaffolding (Phase 0). See `SchemaShift_Phase_Plan.md` for build phases.
|
__init__.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""SchemaShift β OpenEnv RL environment for adaptive tool use under API drift."""
|
| 2 |
+
|
| 3 |
+
__version__ = "0.1.0"
|
client.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""SchemaShiftEnvClient β HTTP client for TRL GRPO training loop.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 8.
|
| 4 |
+
"""
|
drift.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""DriftInjector β fires scheduled drift events against tools mid-episode.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 3.
|
| 4 |
+
"""
|
eval.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Baseline eval harness for heuristic + LLM agents.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 9.
|
| 4 |
+
"""
|
eval_data/seeds.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{}
|
graders.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Composable rubric grader + dense step-level reward shaping.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 5.
|
| 4 |
+
"""
|
models.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Pydantic schemas for SchemaShift actions, observations, and rewards.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 1.
|
| 4 |
+
"""
|
openenv.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Placeholder β will be filled in Phase 7.
|
| 2 |
+
# spec_version: 1
|
| 3 |
+
# name: schemashift
|
| 4 |
+
# type: space
|
| 5 |
+
# runtime: fastapi
|
| 6 |
+
# app: server.app:app
|
| 7 |
+
# port: 7860
|
pyproject.toml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["setuptools>=68", "wheel"]
|
| 3 |
+
build-backend = "setuptools.build_meta"
|
| 4 |
+
|
| 5 |
+
[project]
|
| 6 |
+
name = "schemashift"
|
| 7 |
+
version = "0.1.0"
|
| 8 |
+
description = "OpenEnv RL environment for adaptive tool use under API schema drift."
|
| 9 |
+
readme = "README.md"
|
| 10 |
+
requires-python = ">=3.10"
|
| 11 |
+
authors = [
|
| 12 |
+
{ name = "Yashash Sheshagiri" },
|
| 13 |
+
{ name = "Gajanand V Dhayagode" },
|
| 14 |
+
{ name = "Likith B S" },
|
| 15 |
+
]
|
| 16 |
+
license = { text = "Apache-2.0" }
|
| 17 |
+
dependencies = [
|
| 18 |
+
"fastapi>=0.110",
|
| 19 |
+
"uvicorn>=0.27",
|
| 20 |
+
"pydantic>=2.6",
|
| 21 |
+
"httpx>=0.27",
|
| 22 |
+
"python-dotenv>=1.0",
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
[project.optional-dependencies]
|
| 26 |
+
dev = ["pytest>=8.0"]
|
| 27 |
+
ui = ["gradio>=4.20"]
|
| 28 |
+
eval = ["openai>=1.30"]
|
| 29 |
+
|
| 30 |
+
[tool.setuptools]
|
| 31 |
+
packages = ["schemashift", "schemashift.tools", "schemashift.server", "schemashift.training"]
|
| 32 |
+
package-dir = {"schemashift" = "."}
|
| 33 |
+
|
| 34 |
+
[tool.pytest.ini_options]
|
| 35 |
+
testpaths = ["tests"]
|
| 36 |
+
pythonpath = ["."]
|
requirements.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
openenv-core==0.2.3
|
| 2 |
+
fastapi>=0.110
|
| 3 |
+
uvicorn>=0.27
|
| 4 |
+
pydantic>=2.6
|
| 5 |
+
gradio>=4.20
|
| 6 |
+
openai>=1.30
|
| 7 |
+
httpx>=0.27
|
| 8 |
+
python-dotenv>=1.0
|
| 9 |
+
pytest>=8.0
|
scenarios.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Scenario definitions (E1-E3 easy, M1-M3 medium, H1-H3 hard).
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 4 (easy) and Phase 11 (medium+).
|
| 4 |
+
"""
|
server/__init__.py
ADDED
|
File without changes
|
server/app.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""FastAPI server + Gradio replay UI. Exposes /health, /reset, /step, /state, /tasks, /grader.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 7.
|
| 4 |
+
"""
|
server/environment.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""SchemaShiftEnvironment β episode scheduler. reset/step loop with drift ticks + grader.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 6.
|
| 4 |
+
"""
|
tests/__init__.py
ADDED
|
File without changes
|
tools/__init__.py
ADDED
|
File without changes
|
tools/base.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""BaseTool + EndpointSchema β abstract contract for all SaaS tool APIs.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 2.
|
| 4 |
+
"""
|
tools/calendar.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""CalendarAPI β list_events, create_event, update_event, delete_event + drifts.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 3.
|
| 4 |
+
"""
|
tools/chat.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""ChatAPI (stretch) β list_channels, post_message, get_history + drifts.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 10 stretch (only if Thursday checkpoint passes).
|
| 4 |
+
"""
|
tools/crm.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""CRMAPI β search_contacts, get_contact, create_contact, update_contact + drifts.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 4.
|
| 4 |
+
"""
|
tools/docs.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""DocsAPI (stretch) β create_page, get_page, update_page + drifts.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 10 stretch (only if Sunday onsite, everything else solid).
|
| 4 |
+
"""
|
tools/mail.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""MailAPI β list_messages, send_message, get_message + 3 drift handlers.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 2.
|
| 4 |
+
"""
|
training/__init__.py
ADDED
|
File without changes
|
training/grpo_kaggle.ipynb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"metadata": {},
|
| 6 |
+
"source": [
|
| 7 |
+
"# SchemaShift GRPO Training (Kaggle T4) β Placeholder\n",
|
| 8 |
+
"\n",
|
| 9 |
+
"Will be filled in Phase 8."
|
| 10 |
+
]
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"metadata": {
|
| 14 |
+
"kernelspec": {
|
| 15 |
+
"display_name": "Python 3",
|
| 16 |
+
"language": "python",
|
| 17 |
+
"name": "python3"
|
| 18 |
+
},
|
| 19 |
+
"language_info": {
|
| 20 |
+
"name": "python",
|
| 21 |
+
"version": "3.10"
|
| 22 |
+
}
|
| 23 |
+
},
|
| 24 |
+
"nbformat": 4,
|
| 25 |
+
"nbformat_minor": 5
|
| 26 |
+
}
|
training/grpo_smoke.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""5-step smoke test of GRPO loop against local env. Uses dummy reward.
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 8.
|
| 4 |
+
"""
|
training/train.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Standalone GRPO training script (mirrors the Kaggle notebook for CLI runs).
|
| 2 |
+
|
| 3 |
+
Will be filled in Phase 8.
|
| 4 |
+
"""
|