Skip to content

Acquisition plan, part 4: a saved plan runs as the sentence it was saved as - #197

Merged
pskeshu merged 1 commit into
developmentfrom
feat/acquisition-templates
Sep 26, 2026
Merged

pskeshu merged 1 commit into
developmentfrom
feat/acquisition-templates

Conversation

@pskeshu

@pskeshu pskeshu commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

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:

  • forwards the DIC channel and the per-embryo endings to orchestrator.start;
  • applies slices and exposure to exactly the embryos the run will image (a reference embryo is untouched), as the pane's start route does;
  • sets the laser preset on the controller once for the run. A preset the controller refuses stops the run from starting — every timepoint would otherwise image with the wrong lasers.

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_config into volume_geometry and 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's save_tactic tool 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.js gains toStructure / fromStructure and 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 in wire(); 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

#194 The engine: the DIC overview as a subject of its own; per-embryo termination; status and per-embryo routes
#195 The pane: the plan, said as one sentence beside Start
#196 The run: embryo-wise rows with per-embryo stop/ending; the DIC strip on Embryos
this Templates: a saved plan runs as its sentence; the laser preset is real

🤖 Generated with Claude Code

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>
@pskeshu
pskeshu merged commit 42a74aa into development Sep 26, 2026
2 checks passed
@pskeshu
pskeshu deleted the feat/acquisition-templates branch September 26, 2026 04:27
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