Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/protocol/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ The prompt gives no schedule and no certification rule.
- `predicators/agent_sdk/tools/env_tools.py`: the `env.*` namespace, the observation formatter, the ledger footer, and the recording writer.
- `predicators/agent_sdk/tools/skill_tools.py`: the `skills.*` namespace over the existing option grounding, `option_plan_to_policy`, and the divergence check on expected outcomes. In code the skills stay `_Option` objects; the agent-facing name is skill.
- `predicators/agent_sdk/prompts/play_system.md` and `play_query.md`: the continual prompts, with golden renders like the existing templates.
- `predicators/approaches/agent_continual_approach.py`: `AgentSessionMixin` plus the tool context, the session loop, session resume, and `learn.run` as a sub-session launcher over the existing synthesis code.
- `predicators/approaches/agent_continual_approach.py`: `AgentBaseApproach` plus the tool context, the session loop, session resume, and `learn.run` as a sub-session launcher over the existing synthesis code.
- `scripts/aggregate_scorecards.py`: scorecards to tables and curves, parameterised by the aggregation chosen later.
- `scripts/configs/empiric/benchmark.yaml`: the seven arms (`approaches.yaml`) on the five settings (`envs.yaml`) with the shared flags (`common.yaml`); a launch names its round with `--round` or a `ROUND` key, which suffixes every experiment id, and `--envs`, `--approaches` and `--seeds` pick a subset; one job per env and arm, one array task per seed.

Expand Down Expand Up @@ -450,8 +450,8 @@ First PyBullet result, the oracle arm on boil (train task then test task), job 2

Step 2, the agent arm, landed the same day:

- `predicators/approaches/continual_play_mixin.py`: `ContinualPlayMixin`, the play loop, mixed in front of each arm's phased base class (the way `AgentSessionMixin` adds its concern) so the arms keep the learning and session machinery of the phased classes without a class hierarchy of their own. It implements `play_level`: each session is a fresh context over the journal; after a session it deploys what the session wrote, records it in `attempts.md`, rebuilds the arm's data from the recorded episodes, and checkpoints.
- `predicators/approaches/agent_continual_approach.py`: the arms. `AgentContinualApproach` is C1's learner (hybrid simulator, parameter fit, predicate invention) on `AgentSimPredicateInventionApproach`; `AgentContinualModelFreeApproach` is the model-free baseline on `AgentModelFreeApproach`. There is no separate learning session (merged 2026-09-04): `AgentContinualApproach` attaches the model workbench (the phased synthesis `run_python` with the `sim` probe over the agent's `simulator.py` / `predicates.py`) to every play session, so the same session that acts also writes, fits and validates the model; `sim.predicates()` installs the invented predicates for the session's observation, Wait targets and divergence checks as soon as it loads them, and after the session the arm reloads the files and deploys the fit.
- `predicators/approaches/continual_play_mixin.py`: `ContinualPlayMixin`, the play loop, mixed in front of each arm's base class so the arms keep its learning and session machinery without a class hierarchy of their own. It implements `play_level`: each session is a fresh context over the journal; after a session it deploys what the session wrote, records it in `attempts.md`, rebuilds the arm's data from the recorded episodes, and checkpoints.
- `predicators/approaches/agent_continual_approach.py`: the arms. `AgentContinualApproach` is C1's learner (hybrid simulator, parameter fit, predicate invention) on `AgentSimPredicateInventionApproach`; `AgentContinualModelFreeApproach` is the model-free baseline on `AgentBaseApproach`. There is no separate learning session (merged 2026-09-04): `AgentContinualApproach` attaches the model workbench (the phased synthesis `run_python` with the `sim` probe over the agent's `simulator.py` / `predicates.py`) to every play session, so the same session that acts also writes, fits and validates the model; `sim.predicates()` installs the invented predicates for the session's observation, Wait targets and divergence checks as soon as it loads them, and after the session the arm reloads the files and deploys the fit.
- `predicators/agent_sdk/tools/continual_tools.py`: the play tools `env_observe`, `env_step`, `env_reset`, `give_up`, `skills_list`, `skills_invoke`, `skills_execute_plan`, thin text adapters over `ProtocolSession`. Every result ends with the ledger line and the context line. The model tools (`run_python` with `sim`) are attached by the model-based arm. Ending the run cannot happen inside a running SDK turn, so `give_up` records a request the arm acts on when the agent stops.
- `predicators/agent_sdk/prompts/play_system.md` and `play_query.md`, rendered by `agent_sdk/play_prompts.py`: the rules of section 4, the tools, the skill grammar, the sandbox, learning, the journal protocol and the context protocol; a round's query carries the level, the ledger and the context line, the observation with a render, the skills, the predicates, the model status, the journal and the attempts record (a continuation carries the observation, the ledger, the context line and the model status only).
The model arm's system prompt also carries the contract of its model files, `prompts/play_model_contract.md`: the `simulator.py` API (the three top-level names, the rule signature by observability, the physics-command channel, `ParamSpec`) organised around the kinds of process the ground-truth simulators model, the rules for writing conditions, the hidden-state block under partial observability, and the `predicates.py` surface, so a run's agent never has to reverse-engineer the API from docstrings.
Expand Down
2 changes: 1 addition & 1 deletion predicators/agent_sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SessionConfig:
"""Agent session construction: model, budgets, and sandbox choice.

Consumed by the three session managers and by
``AgentSessionMixin._ensure_agent_session``, which builds one
``AgentBaseApproach._ensure_agent_session``, which builds one
instance per session and passes it to whichever manager it
constructs.
"""
Expand Down
2 changes: 1 addition & 1 deletion predicators/agent_sdk/local_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Usage
-----
When the ``agent_sdk_use_local_sandbox`` flag is ``True``, the
``AgentSessionMixin`` creates a ``LocalSandboxSessionManager`` in place
``AgentBaseApproach`` creates a ``LocalSandboxSessionManager`` in place
of the normal ``AgentSessionManager``::

manager = LocalSandboxSessionManager(...)
Expand Down
9 changes: 4 additions & 5 deletions predicators/agent_sdk/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
class SessionManagerProtocol(Protocol):
"""Structural interface shared by the three session managers.

Implemented by :class:`AgentSessionManager` (in-process, no
sandbox), ``LocalSandboxSessionManager`` (in-process, sandbox cwd +
hooks), and ``DockerSessionManager`` (stateless container per
query). Consumers - ``AgentSessionMixin`` and the agent explorers -
must depend on this, not a concrete manager.
Implemented by :class:`AgentSessionManager` (in-process, no sandbox)
and ``LocalSandboxSessionManager`` (in-process, sandbox cwd +
hooks). Consumers such as ``AgentBaseApproach`` must depend on this,
not a concrete manager.
"""

session_id: Optional[str]
Expand Down
8 changes: 4 additions & 4 deletions predicators/agent_sdk/tools/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ class ToolContext:
# label output by phase (e.g. attempt-log headers) can attribute
# entries to the learning cycle instead of "pre-test phase".
learn_cycle_index: Optional[int] = None
# Managed by AgentSessionMixin: populated from
# `_build_synthesis_mcp_tools` at session-open, reset to [] for
# solve sessions. Approaches should not write to this directly —
# override the builder hook instead.
# Dynamic SdkMcpTool instances the approach attaches for a session
# (the play tools, a round's run_python);
# AgentBaseApproach._ensure_agent_session checks their names
# against the declared tool list.
extra_mcp_tools: list = field(default_factory=list)
# Extra Claude Agent SDK ``HookMatcher`` instances applied to the
# next session that's started. Read once at session start, then
Expand Down
4 changes: 2 additions & 2 deletions predicators/agent_sdk/tools/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def list_session_tool_names(
Args:
mcp_filter: Subset of ``ALL_TOOL_NAMES`` to keep. ``None`` (the
default) lists every MCP tool.
extra_mcp_tools: Synthesis tools supplied for the session
(e.g. by ``_build_synthesis_mcp_tools``). Their names are
extra_mcp_tools: Dynamic tools the approach attached for the
session (``ToolContext.extra_mcp_tools``). Their names are
read off each tool's ``name`` attribute.
include_builtin: Whether to include the Claude built-in tools
(``Bash``, ``Read``, ``Write``, …).
Expand Down
Loading
Loading