Skip to content

Agent tool surface: submit_plan, one run_python, probe-loaded drafts - #161

Merged
yichao-liang merged 9 commits into
masterfrom
bl-merge-10-agent-tools
Sep 1, 2026
Merged

Agent tool surface: submit_plan, one run_python, probe-loaded drafts#161
yichao-liang merged 9 commits into
masterfrom
bl-merge-10-agent-tools

Conversation

@yichao-liang

Copy link
Copy Markdown
Collaborator

Rewrites the agent tool surface: one solve surface for every arm with the legacy tool rosters removed, one run_python tool with a path argument, predicate and sampler drafts loading through the probe, evaluate_option_plan renamed to submit_plan as the one gated commit, the deployed model defined as the agent's published sim.fit, journal.md owned by the agent while the harness logs attempts.md, and the explorer executing the agent's sketch verbatim.

Commits:

  • tests: bridge policy test builds its own painting env instead of reusing the cache
  • agent tools: one solve surface for every arm, legacy tool rosters removed
  • agent tools: one run_python tool for every session, with a path argument
  • agent tools: predicate and sampler drafts load through the probe
  • sim learning: the deployed model is the agent's published sim.fit
  • journal: journal.md is the agent's file, the harness logs attempts.md
  • explorer: the agent's sketch executes verbatim, no post-query belief refinement
  • agent tools: evaluate_option_plan becomes submit_plan, the one gated commit
  • tests: yapf realignment after the sampler-loader helper rename

Part of the bridge-learning merge stack.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQkk8ycwwwiSKraDw88FVm

@yichao-liang
yichao-liang force-pushed the bl-merge-09-run-refactor branch from 7c1e41b to 6fface9 Compare September 1, 2026 13:27
@yichao-liang
yichao-liang force-pushed the bl-merge-10-agent-tools branch 2 times, most recently from 5ba3975 to ee86a9e Compare September 1, 2026 13:56
@yichao-liang
yichao-liang force-pushed the bl-merge-09-run-refactor branch 2 times, most recently from e58fc03 to 11bcbbe Compare September 1, 2026 14:21
@yichao-liang
yichao-liang force-pushed the bl-merge-10-agent-tools branch from ee86a9e to 621fd8b Compare September 1, 2026 14:21
@yichao-liang
yichao-liang force-pushed the bl-merge-09-run-refactor branch from 11bcbbe to e3de74e Compare September 1, 2026 14:43
@yichao-liang
yichao-liang force-pushed the bl-merge-10-agent-tools branch from 621fd8b to 592db38 Compare September 1, 2026 14:43
@yichao-liang
yichao-liang force-pushed the bl-merge-09-run-refactor branch from e3de74e to 77506ba Compare September 1, 2026 15:01
@yichao-liang
yichao-liang force-pushed the bl-merge-10-agent-tools branch 2 times, most recently from 386d6af to d073090 Compare September 1, 2026 15:26
@yichao-liang
yichao-liang force-pushed the bl-merge-09-run-refactor branch from 77506ba to c1817b3 Compare September 1, 2026 15:26
@yichao-liang
yichao-liang changed the base branch from bl-merge-09-run-refactor to master September 1, 2026 15:39
…ing the cache

get_or_create_env(CFG.env) returned whichever painting env an earlier
test module had built - with the default 50 train tasks - so the
assertion that reset_config's num_train_tasks=1 took effect failed
whenever the test ran after another painting test in the same process.
create_new_env honours the current config.
…oved

The inspect_* / propose_* / retract_abstractions / generate_* /
refine_plan_sketch / evaluate_predicate_on_trajectory tools were never
offered to the learning arms and only survived as the fallback surface
of arms that left agent_planner_use_explore_python at its False
default. Every arm with a simulator now gets the same solve roster:
evaluate_option_plan (+ evaluate_policy in policy mode), explore_python
over the belief probe, and record_journal; a simulator-free planner
gets none of them. The flag and its keep-replaced-tools companion are
gone, along with the ProposalBundle plumbing (iteration_proposals,
planning_results) that only the deleted tools ever filled, the
proposed_code sandbox dir, the agent_option_learning approach that was
built on the proposal tools, and the stale design doc describing them.

The digest renderers the prompts and the probe share move from
tools/inspection.py to tools/digests.py. The refine_plan_sketch tool
tests now drive sim.refine on the probe (same parser and search core),
including the evaluator-gated require_solved path.

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
The solve-phase explore_python and the synthesis-phase run_python were
the same exec core under two names. Both sessions now offer run_python:
the static instance binds the belief probe over the deployed model, a
synthesis session attaches its own instance (fit data + the probe over
the candidate simulator) under the same name and create_mcp_tools
skips the static one when it is attached. The tool also accepts
`path`, a .py file inside the sandbox executed in the same persistent
namespace, so helpers and sweeps can be developed as files with
Write/Edit instead of being pasted inline each call; a path that
resolves outside the sandbox is refused (the PreToolUse hook does not
see MCP calls). Settings and context fields follow the rename
(agent_sdk_python_call_timeout, python_call_deadline).

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
evaluate_predicate_quality and evaluate_sampler were "reload the file,
install the draft, report" tools; they are now sim.predicates() and
sim.samplers() on the belief probe, so a synthesis session's only
tool is run_python and every validation surface lives on `sim`. The
loaders keep their behaviour (snapshot into *_versions/, validate,
install into the approach so refinement sees the draft, milestone /
sanity report) and are registered per session in
ToolContext.probe_artifact_loaders; the probe raises a clear error
where a session has no such file. The subclass hook that used to
return extra tools becomes _install_extra_synthesis_surfaces.

The converted evaluator-gate test now draws 200 samples so its
certified and rejected paths are exercised at every probe seed.

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
_fit_params_after_synthesis used to refit from scratch after every
learn session, silently replacing the values the agent's GO/NO-GO
check had validated. sim.fit now publishes the full FitResult (point
estimate plus the Laplace bundle the exploration ensemble is
calibrated from), its SSE, and the physical values it applied; after
the session the approach deploys exactly that fit when it ran on the
final simulator.py content over the deployed parameter set. The
harness fits itself only when no such fit exists (the session ended
UNFITTED or out of turns, or an oracle sim program ran with no
session) and logs a FIT FALLBACK warning saying the deployed values
were never validated by the agent. The learn prompt states the
contract.

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
record_journal is gone. The agent keeps ./journal.md with the ordinary
file tools (agents were already bypassing the tool with Write), and
the harness records each task's goal + initial state and every
attempt's outcome and captured or best refused plan in its own
./attempts.md, which the agent is told not to edit. Solve prompts
inject both (tail-capped), the facts-only guidance moved into the
prompt, and the test-phase archive/rollback covers both files so an
evaluation's notes never leak into the next one. Learn sessions can
add to the journal the same way, so the learn roster is run_python
alone.

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
…refinement

The explorer used to run its own belief-model refinement on the
returned sketch (search over unparameterized steps, info-seeking
pooling, seeded fill of a failing tail) and derive the early-stop
verdict from that pass, so there were two refinement surfaces and two
verdict sources. Now the plan the agent hands back is grounded and
executed exactly as written: every explicit parameter runs verbatim,
a step left without parameters gets one uniform draw from the
option's box and a warning, Wait steps keep their annotated targets,
and the belief verdict is False unless the session's plan passed the
capture gate (which still executes verbatim as a solve and is
replayed for the cycle). The agent refines and validates in-session
(sim.refine / sim.run / evaluate_option_plan); the explorer-only
pinning and pool-size settings go with the harness pass.

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
…commit

evaluate_option_plan conflated evaluation with submission: any
goal-reaching run on the current task was captured as the answer, so
the agent could not test a candidate there without committing to it,
while task_idx and rollout_seed made the same tool a diagnostic probe.
Evaluation now lives entirely on the probe (sim.run on any task, from
any state, at any seed, with trials=N for the same gate as a preview)
and submit_plan / submit_policy are the explicit commit: they run the
plan or policy on the CURRENT task from its true initial state through
the unchanged capture gate (validation repeats, physics and rule-param
margins, evaluator legitimacy) and capture on pass. A FLAKY report now
points at sim.run(plan, seed=S) to reproduce the failed rollout.

Claude-Session: https://claude.ai/code/session_01Pbv9TvedRD2iKyoKMJKx6H
@yichao-liang
yichao-liang force-pushed the bl-merge-10-agent-tools branch from d073090 to e81c5f7 Compare September 1, 2026 15:42
@yichao-liang
yichao-liang merged commit c23b8c0 into master Sep 1, 2026
14 checks passed
@yichao-liang
yichao-liang deleted the bl-merge-10-agent-tools branch September 1, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant