Spaces:
Configuration error
Configuration error
File size: 2,794 Bytes
3a53bad 0dc243b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
Data models for the Lint Coding Agent Environment.
The lint_coding_agent environment is a simple test environment that echoes back messages.
"""
from openenv.core.env_server.types import Action, Observation
from pydantic import Field
from typing import Dict, Any, Optional
class LintCodingAgentAction(Action):
"""
Action schema for the Lead Architect.
The agent provides the fix and an explanation that tracks orchestration intent.
Optional fields with defaults prevent 422 Validation Errors during
high-latency inference or manual UI testing.
"""
code_solution: Optional[str] = Field(
default="",
description="The full code fix or specific patch for the repository."
)
explanation: Optional[str] = Field(
default="Direct architectural intervention.",
description="Reasoning for the fix; utilized for tracking sub-agent logic or taxation."
)
class LintCodingAgentObservation(Observation):
"""
Observation schema for the VFS (Virtual File System) Search Space.
Provides the multi-file repository state, environment feedback, and
curriculum progression.
"""
level: int = Field(
default=1,
description="Current difficulty level in the 15-level roadmap."
)
language: str = Field(
default="Python",
description="The primary programming language of the current task."
)
problem_statement: str = Field(
default="",
description="The technical objective, bug description, or mission prompt."
)
code_context: str = Field(
default="{}",
description="JSON-stringified Virtual File System (VFS) map containing repo files."
)
last_test_results: Optional[str] = Field(
default=None,
description="Standard output from linters, compilers, or test suites."
)
# --- MANDATORY FIELDS FOR OPENENV PROTOCOL ---
# These must be explicitly defined to allow the SDK to handle state transitions.
reward: float = Field(
default=0.0,
description="The scalar reward signal from the previous action transition."
)
done: bool = Field(
default=False,
description="Boolean flag indicating if the episode/curriculum has concluded."
)
# --- EXTENSIBILITY ---
metadata: Dict[str, Any] = Field(
default_factory=dict,
description="Extended context for tool discovery (MCP), file structure, or sub-agent logs."
) |