Acquisition plan, part 4: a saved plan runs as the sentence it was saved as - #197
Merged
Merged
Conversation
Part 4 of the acquisition configurator, and the last. Templates already existed — the tactic library under agent/tactic_library/, listed by Operate's "Saved tactic" mode and run through the tactic executor. Two things were missing: a plan rich enough to save, and a way to save one from the pane. THE EXECUTOR RUNS THE WHOLE PLAN It ran a standing_timelapse's cadence and stop condition and dropped everything else, so a saved plan would have run as something other than what its sentence says. It now forwards the DIC channel and the per-embryo endings, applies slices and exposure to exactly the embryos the run will image (as the pane's start route does), and sets the laser preset on the controller once for the run. A preset the controller refuses stops the run from starting, because every timepoint would otherwise image with the wrong lasers. The same for the pane's own start route, which collected the preset into a dict and never used it — choosing "488 and 561" changed nothing about the run. It is set before the run starts now, and refused the same way. THE PANE SAVES; THE LIBRARY SAYS "Save this plan…" beside Start writes the plan as a template through a new POST /api/tactic_library — the same document the agent's save_tactic tool writes, so a plan saved from the pane and one the agent saved are one kind of thing, listed together. The library lists each plan as its sentence, said for the embryos marked NOW: the template holds the plan, the roster is today's. acquisition-plan.js gains the two conversions — a plan to a structure and back — and a test that a plan survives the round trip and says the same sentence. Templates seeded by the Adaptive start before any of this carry only cadence and a stop; they still read as plans, and still run. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 4 of 4 (after #194, #195, #196). Templates already existed —
agent/tactic_library/, listed by Operate's Saved tactic mode, run through the tactic executor. Two things were missing: a plan rich enough to save, and a way to save one from the pane.The executor runs the whole plan
It ran a
standing_timelapse's cadence and stop condition and dropped everything else — a saved plan would have run as something other than what its sentence says. It now:orchestrator.start;Templates seeded by the Adaptive start before any of this carry only cadence and a stop; they still read as plans, and still run exactly as before.
The pane's start route actually sets the preset
It collected
laser_configintovolume_geometryand never used it, so choosing 488 and 561 on the pane changed nothing about the run. It is set before the run starts now, and refused the same way (502, with the controller's reason; nothing starts).The pane saves; the library says
Save this plan… beside Start writes the plan as a template through a new
POST /api/tactic_library— the same document the agent'ssave_tactictool writes, so a plan saved from the pane and one the agent saved are one kind of thing, listed together. Saved tactic mode lists each plan as its sentence, said for the embryos marked now — the template holds the plan, the roster is today's — and Run tactic runs it whole.acquisition-plan.jsgainstoStructure/fromStructureand a test that a plan survives the round trip and says the same sentence.Verified
Headless browser, library routes stubbed, four seeded embryos: Save this plan… is visible only in Adaptive mode; saving posts
{name, kind: standing_timelapse, structure: {cadence_s: 300, stop_condition: "duration:12h", laser_config: "488 and 561", dic: {…every_seconds: 600…}, …}, rationale: <the sentence>}; Saved tactic lists it as Every 5 min: SPIM volumes (50 slices · 10 ms · 488 and 561) of 4 embryos + one DIC overview every 2 rounds from the centroid · after 12 h.; picking it and pressing Run tactic posts{library_id, embryo_ids: [4]}. No page errors.Tests:
tests/test_acquisition_templates.py— 11 (the executor forwards the plan whole; settings land on exactly the run's embryos; the preset is set once; a pre-channels template runs as before; a refused preset stops the start; the save route writes the agent's document, and refuses without a name, a plan, or a store; the pane's save is wired inwire(); the library says sentences).tests/test_timelapse_start_route.py+3 (preset set / not touched / refused).tests/js/acquisition-plan.test.mjs+4 (round trip, legacy structure, spec parsing, rounds rounding). Full suite at the 16 baseline; ruff/mypy clean; the rig's storage untouched.The four parts, together
🤖 Generated with Claude Code