Spaces:
Running
Running
Commit ·
3bcc2b8
1
Parent(s): da84c63
minor bug fixes
Browse files- requirements.txt +1 -0
- server/environment.py +15 -13
- server/workflow_engine.py +1 -1
requirements.txt
CHANGED
|
@@ -2,6 +2,7 @@ fastapi==0.135.2
|
|
| 2 |
uvicorn[standard]==0.40.0
|
| 3 |
pydantic==2.12.5
|
| 4 |
numpy==2.2.4
|
|
|
|
| 5 |
faker==40.12.0
|
| 6 |
openai==2.15.0
|
| 7 |
httpx==0.28.1
|
|
|
|
| 2 |
uvicorn[standard]==0.40.0
|
| 3 |
pydantic==2.12.5
|
| 4 |
numpy==2.2.4
|
| 5 |
+
pandas>=2.0.0
|
| 6 |
faker==40.12.0
|
| 7 |
openai==2.15.0
|
| 8 |
httpx==0.28.1
|
server/environment.py
CHANGED
|
@@ -90,7 +90,7 @@ class OrgOSEnvironment:
|
|
| 90 |
# 1. Validate app exists
|
| 91 |
if action.app not in self._apps:
|
| 92 |
return self._build_obs(
|
| 93 |
-
reward=
|
| 94 |
done=False,
|
| 95 |
message=f"Unknown app '{action.app}'. Valid apps: {list(self._apps)}",
|
| 96 |
)
|
|
@@ -103,7 +103,7 @@ class OrgOSEnvironment:
|
|
| 103 |
self._rule_score = max(0.0, self._rule_score - 0.08)
|
| 104 |
extra_penalty = rule_penalty
|
| 105 |
return self._build_obs(
|
| 106 |
-
reward=
|
| 107 |
done=False,
|
| 108 |
message=f"Rule violation: {reason}",
|
| 109 |
)
|
|
@@ -115,7 +115,7 @@ class OrgOSEnvironment:
|
|
| 115 |
if result.get("schema_error"):
|
| 116 |
self._efficiency -= 0.02
|
| 117 |
return self._build_obs(
|
| 118 |
-
reward=
|
| 119 |
done=False,
|
| 120 |
message=(
|
| 121 |
f"Stale schema: field '{result['schema_error']}' is no longer valid. "
|
|
@@ -127,7 +127,7 @@ class OrgOSEnvironment:
|
|
| 127 |
if not result.get("success"):
|
| 128 |
self._efficiency -= 0.02 # penalize failed/no-op actions
|
| 129 |
return self._build_obs(
|
| 130 |
-
reward=
|
| 131 |
done=False,
|
| 132 |
message=result.get("message", "Operation failed"),
|
| 133 |
)
|
|
@@ -207,14 +207,16 @@ class OrgOSEnvironment:
|
|
| 207 |
for name, app in self._apps.items()
|
| 208 |
}
|
| 209 |
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
#
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
|
|
|
|
|
|
| 218 |
|
| 219 |
# Workflow progress
|
| 220 |
completed_steps = self._workflow.get_completed()
|
|
@@ -233,7 +235,7 @@ class OrgOSEnvironment:
|
|
| 233 |
return OrgOSObservation(
|
| 234 |
done = done,
|
| 235 |
reward = round(float(reward), 6),
|
| 236 |
-
current_score = float(self._last_score),
|
| 237 |
workflow_id = self._workflow_id,
|
| 238 |
step_count = self._step_count,
|
| 239 |
app_states = app_states,
|
|
|
|
| 90 |
# 1. Validate app exists
|
| 91 |
if action.app not in self._apps:
|
| 92 |
return self._build_obs(
|
| 93 |
+
reward=-0.05,
|
| 94 |
done=False,
|
| 95 |
message=f"Unknown app '{action.app}'. Valid apps: {list(self._apps)}",
|
| 96 |
)
|
|
|
|
| 103 |
self._rule_score = max(0.0, self._rule_score - 0.08)
|
| 104 |
extra_penalty = rule_penalty
|
| 105 |
return self._build_obs(
|
| 106 |
+
reward=extra_penalty,
|
| 107 |
done=False,
|
| 108 |
message=f"Rule violation: {reason}",
|
| 109 |
)
|
|
|
|
| 115 |
if result.get("schema_error"):
|
| 116 |
self._efficiency -= 0.02
|
| 117 |
return self._build_obs(
|
| 118 |
+
reward=-0.20,
|
| 119 |
done=False,
|
| 120 |
message=(
|
| 121 |
f"Stale schema: field '{result['schema_error']}' is no longer valid. "
|
|
|
|
| 127 |
if not result.get("success"):
|
| 128 |
self._efficiency -= 0.02 # penalize failed/no-op actions
|
| 129 |
return self._build_obs(
|
| 130 |
+
reward=-0.01,
|
| 131 |
done=False,
|
| 132 |
message=result.get("message", "Operation failed"),
|
| 133 |
)
|
|
|
|
| 207 |
for name, app in self._apps.items()
|
| 208 |
}
|
| 209 |
|
| 210 |
+
flat_hints = self._drift.get_hints()
|
| 211 |
+
|
| 212 |
+
# # Schema hints (partial — agent must probe to discover full mapping)
|
| 213 |
+
# schema_hints = self._drift.get_hints()
|
| 214 |
+
# # Flatten to dot-notation: {"jira.priority": "severity", ...}
|
| 215 |
+
# flat_hints: Dict[str, str] = {}
|
| 216 |
+
# for app_name, field_map in schema_hints.items():
|
| 217 |
+
# for canonical, drifted in field_map.items():
|
| 218 |
+
# if canonical != drifted:
|
| 219 |
+
# flat_hints[f"{app_name}.{canonical}"] = drifted
|
| 220 |
|
| 221 |
# Workflow progress
|
| 222 |
completed_steps = self._workflow.get_completed()
|
|
|
|
| 235 |
return OrgOSObservation(
|
| 236 |
done = done,
|
| 237 |
reward = round(float(reward), 6),
|
| 238 |
+
current_score = round(float(self._last_score),4),
|
| 239 |
workflow_id = self._workflow_id,
|
| 240 |
step_count = self._step_count,
|
| 241 |
app_states = app_states,
|
server/workflow_engine.py
CHANGED
|
@@ -118,7 +118,7 @@ WORKFLOW_GOALS: Dict[str, str] = {
|
|
| 118 |
"B": (
|
| 119 |
"Workflow B — Employee Onboarding: "
|
| 120 |
"A new support engineer has joined the West team. "
|
| 121 |
-
"Employee ID: EMP-NEW-001, Name:
|
| 122 |
"Steps required: "
|
| 123 |
"(1) create an onboarding record in Workday for EMP-NEW-001, "
|
| 124 |
"(2) provision Jira access for EMP-NEW-001 via Workday, "
|
|
|
|
| 118 |
"B": (
|
| 119 |
"Workflow B — Employee Onboarding: "
|
| 120 |
"A new support engineer has joined the West team. "
|
| 121 |
+
"Employee ID: EMP-NEW-001, Name: Jordan Riley, department: support, territory: west. "
|
| 122 |
"Steps required: "
|
| 123 |
"(1) create an onboarding record in Workday for EMP-NEW-001, "
|
| 124 |
"(2) provision Jira access for EMP-NEW-001 via Workday, "
|