Give the seeded fly-scan Plan real defaults, and its Method a real schema - #767
Merged
Conversation
…hema
Every witnessed Run at 2-BM binds 2BM_fly_scan_plan_v1 (the one Plan
CAPTURE_WATCH_PLAN_ID names), and that Plan's default_parameters was {}.
record_witnessed_run merges the Plan's declared defaults into a Run's
effective_parameters unmodified, so an empty Plan produces an empty Run:
measured live on 2026-09-01, all 2031 witnessed runs carried effective_
parameters == {}. The record said "this followed the fly scan plan" and
the fly scan plan said nothing.
Fixing this needed two writes in order: the Method (fly_scan) declares
no parameters_schema, and Plan.default_parameters validates STRICT
against it, so a non-empty default is rejected until the schema exists.
Verified live against arcturus before touching the seeder: PATCHing
defaults before POSTing the schema returns 400, confirming the ordering
is load-bearing, not incidental.
seed_acquisition_recipe now accepts optional parameters_schema /
default_parameters and applies them via the existing update slices
(idempotent no-op when unchanged, so a re-run against an
already-seeded deployment converges rather than duplicating events).
Wired for fly_scan only; dark_field/flat_field are unaffected. The
Plan defaults are explicitly flagged UNCONFIRMED: they were read from
baseline PV observations on the live host, not declared by 2-BM staff,
and need confirmation before the 2026-09-09 beamtime.
repetitions is declared in the schema with no default, on purpose: the
angle count varies per scan, so no single number is honest as a
Plan-level default. Per-run Plan selection (letting different scan
kinds bind different Plans) is deferred until the first beamtime shows
what actually varies.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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.
Summary
2BM_fly_scan_plan_v1, and that Plan'sdefault_parameterswas{}— measured live on 2026-09-01, all 2031 witnessed runs carriedeffective_parameters == {}.parameters_schemaon thefly_scanMethod (required first:Plan.default_parametersvalidates STRICT against it) and non-emptydefault_parameterson the Plan, wired throughseed_acquisition_recipeso a fresh deployment seeds both.repetitionsis declared with no default on purpose: angle count varies per scan.Test plan
test_fly_scan_plan_declares_non_empty_defaults, mutation-verified (reverting the seeder wiring turns it red)tests/integration/test_pilot_seed_postgres.pygreen, including the existing re-run-changes-nothing idempotency testtests/unit/api/test_pilot_seed.py+tests/unit/recipe/green (1325 tests)ruff/pyright/tachclean🤖 Generated with Claude Code