Skip to content

Build the parameter object, behaviour unchanged - #55

Merged
syncytium2 merged 1 commit into
mainfrom
close-out-session
Aug 17, 2026
Merged

Build the parameter object, behaviour unchanged#55
syncytium2 merged 1 commit into
mainfrom
close-out-session

Conversation

@syncytium2

Copy link
Copy Markdown
Owner

Stage 1 of PR #53's proposal — the stage that costs nobody anything. The objects exist, the generator accepts one, no call site has to move, and every existing keyword call produces exactly what it did before.

The acceptance test is a test, not a promise

The spec path and the keyword path produce byte-identical trains, planted times, participants and realized onsets at the same seed. If that ever fails, migrating a call site changes the data while looking like a refactor.

Three decisions taken to get it built

All reversible, all flagged open in the proposal:

  • Recording shape lives in the spec with the fitted models rather than beside them. grid_sec has no default — it cannot be recovered from onsets, so a default would bake a guess about someone's microscope into a value object that then travels.
  • Keywords keep working, no deprecation warning yet. Several sessions are mid-flight; warning-spamming their runs to make a point about an API they have not been asked to adopt is a poor trade.
  • A spec plus a field the spec owns is a TypeError naming the field, rather than one silently winning. That is how a figure ends up labelled with settings it was not drawn at.

The part worth more than the object

The probe and the distractors stay out of the spec. They are test constructs nobody can measure from tissue, so they belong to the bench — which puts the generator/bench boundary in code after a week of it being conflated in conversation, twice by me.

Next, not in this PR

Bench moves to the spec form · the fitting stage returns one · a sapper rule against new bg_* call sites · then the slow-epoch axis, as the first change that costs no caller anything.

384 passed, 1 skipped · sapper clear.

🤖 Generated with Claude Code

Stage 1 of docs/parameter_spec_proposal.md, which is the stage that costs
nobody anything: the objects exist, the generator accepts one, and no call site
has to move. Every existing keyword call produces exactly what it did before.

RecordingSpec / BackgroundModel / CoordinationModel in a new src/bugarach/spec.py.
The acceptance test is the one that matters and it is a test, not a promise: the
spec path and the keyword path produce byte-identical trains, planted times,
participants and realized onsets at the same seed. If that ever fails, migrating
a call site changes the data while looking like a refactor.

Three decisions taken to get it built, all reversible and all flagged as open in
the proposal:

- Recording shape (n_roi, duration_sec, grid_sec) lives in the spec with the
  fitted models rather than beside them. One object is easier to hand between
  stages; the argument for two is that it separates what is measured from what
  is configured. grid_sec has NO default here on purpose — it cannot be
  recovered from onsets, so a default would bake a guess about someone's
  microscope into a value object that then travels.
- Keywords keep working with no deprecation warning yet. Several sessions are
  mid-flight and warning-spamming their runs to make a point about an API they
  have not been asked to adopt is a poor trade.
- Passing a spec AND a field the spec owns is a TypeError naming the field,
  rather than one silently winning. That is how a figure ends up labelled with
  settings it was not drawn at.

The probe and the distractors stay out of the spec, which is the part worth more
than the object: they are test constructs nobody can measure from tissue, so
they belong to the bench. That puts the generator/bench boundary in code after a
week of it being conflated in conversation, twice by me.

_SIGNATURE_DEFAULTS is derived by inspecting the signature rather than written
out, so the clash check cannot end up comparing against a stale default.

Not done, and next: bench moves to the spec form, the fitting stage returns one,
a sapper rule against new bg_* call sites, and then the slow-epoch axis as the
first change that costs no caller anything.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@syncytium2
syncytium2 merged commit 44365a6 into main Aug 17, 2026
3 checks passed
@syncytium2
syncytium2 deleted the close-out-session branch August 20, 2026 16:08
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.

2 participants