Repository navigation
v0.2.0: settings (Spec ADR 0011) and the entry on a feature output (ADR 0007 E8) - #667
Merged
Merged
Conversation
…coverage.settings ObjectiveConfig (with its RareTarget) and CalibrationSettings as the sections [objective], [rare] and [calibration]; [common] holds the entry's settings. The ADR 0011 module is vendored byte for byte with its own PIN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
morphocoverage.run_folder(feature_output, ...) and the console script morphocoverage run|check|settings. The one path is a feature brick's output (MorphoFeature's run folder with its MorphoCoverage export), read by its tables' structure; no run folder is opened and no MorphoBricks library is imported. The guided session's answers are the settings of [common], recorded in morphobricks_entry.json (the shared schema, written with MorphoCoverage's own code), with reuse or refusal by identity. The ENTRY_* texts are copied from preprocessing's constructors and tested against them, and the record against its checker, when preprocessing's entry pieces are installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…entry AGENTS section 3 now names the morphocoverage console script of ADR 0007 J2 beside the guided session; section 5 describes the entry's output and record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…B7 Q7) Owner decision of 2 December 2026: every file the entry reads (coverage.json, objects, fovs, each feature table) is hashed and compared with the SHA-256 that run_manifest.json records for it before any of its values is read. A changed byte, a file without a digest, or no readable manifest is refused with coverage_export_malformed, naming the file. The test fixture writes the manifest as MorphoFeature does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision of 2 December 2026: `morphocoverage settings -o FILE --feature-output FEATURE_OUTPUT` is the documented form (first in the help and the README); `--run-folder`, every brick's name for the input, is still accepted; giving both is refused with ENTRY_SETTING_INVALID (exit 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision of 2 December 2026: the three sections are declared, settable, recorded and in the identity like [common]'s, no longer accepted only at their default. Off unless given (objective.objective loses its defaults.toml default; objective_config still gives ObjectiveConfig's population when absent). Given, they are Setup's new fields sampling_objective (the objective a stop must cover, in place of the one the declared targets make; the declaration says so) and calibration (CalibrationSettings, passed to the report's sufficiency_report; it needs a definition of new, and fov_counts below its min_fovs is refused up front by calibration.check_calibration), and Setup.rare (a whole RareTarget, in place of the guided preset). E3 and E6 tests: the values reach the Setup and the report, a rerun reuses, a changed value is ENTRY_OUTPUT_EXISTS naming it. The file to fill names every optional setting in a comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner decision of 2 December 2026: workflows/_entry_inventory.py lists every Setup field as a setting, made from settings, a fact of the export, or fixed at Setup's default (refused as a setting, never ignored), with run_folder's parameters and the command line's flags. Tests pin it against dataclasses.fields(Setup), the declaration, and the Setup of entry runs, and refuse every Setup field that is no setting when a settings file names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MorphoCoverage 0.2.0, the MorphoBricks v0.10.0 release. It depends on no MorphoBricks package, so nothing is re-pinned. Co-Authored-By: Claude Opus 5.5 <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.
Release v0.2.0 (3 December 2026)
Release commit
5dbdfe9dates the CHANGELOG. MorphoCoverage depends on no MorphoBricks package, so nothing is re-pinned. Local gateb25rel(all bricks together, every suite, smoke and the Formin end-to-end run) onfb3e52e, the same code: no new failure. Merged and taggedv0.2.0with the owner's approval.MorphoCoverage's part of the MorphoBricks v0.10.0 wave: the ADR 0011 settings (migration row 7), the ADR 0007 entry on a feature output (J2, conformance row E8), and version 0.1.0 -> 0.2.0. Draft. Do not merge or tag until the wave is released.
1. Settings (Spec ADR 0011, row 7)
src/morphocoverage/_brick_settings.pyis vendored byte for byte from Spectools/brick_settings.py, with_brick_settings.PIN(Speca86653b) and the template pin test.defaults.toml(package data) has these sections:[common]: the entry's settings. These are the object set, the guided session's answers (aim,features,readout,observation_unit, the controls,positive,fingerprint_tolerance,rare_label,scales,experiment,targets) andn_jobs.[objective]and[rare]:ObjectiveConfigand itsRareTarget; in the entry,Setup.sampling_objectiveandSetup.rare.[calibration]:CalibrationSettings; in the entry,Setup.calibration.default).morphocoverage.settingsprovides the usual functions:load_settings,update_settings,save_settings(TOML or JSON),request_parametersanddeclared. It also providesobjective_config(settings)andcalibration_settings(settings). A value that the configuration objects refuse is refused when the file is read, withSettingsErrornaming the setting.objective_configthen givesObjectiveConfig()), the load, save and load round trip, and the refusals.2. The entry on a feature output (Spec ADR 0007 "MorphoCoverage", J2, E8)
morphocoverage.run_folder(feature_output, output=None, *, check=False, settings=None). It is loaded lazily, soimport morphocoveragestill loads no plotting library.morphocoverage run|check <feature_output> [--output] [--settings FILE|OUTPUT] [--set section.key=TOML]andmorphocoverage settings -o FILE [--feature-output FEATURE_OUTPUT](--run-folderis its other name; both given is refused).code,message,fix,subjects).coverage/<set>/coverage.json(schema 3) plusobjects,fovsand the feature tables, in CSV or Parquet.run_manifest.jsonis read for its file digests only: every file read is verified against them first (round 5).v03export already intests/morphofeature_exports. Nothing imports MorphoFeature at test time.DescriptionRefused: version, not exported, malformed block,DISAGREES;coverage_export_missing: no export at the path (which also covers a run folder given in its place), or a table is missing;coverage_export_malformed(including a file whose digest does not matchrun_manifest.jsonor is missing there);coverage_tables_refused.defaults.tomlplusentry_settings.json.given,record,fixedandexecution_default(only forn_jobs, which RE7 allows;tests/test_parallel.pyshows the results do not depend on it).defaults.tomldefaults are never applied.ENTRY_SETTING_INVALIDlists every problem;ENTRY_SETTING_MISSINGlists every missing setting with its allowed values.--settings <earlier output>takes the recorded settings again.Setupfield,run_folderparameter and CLI flag is in the E5 inventory (workflows/_entry_inventory.py, round 5).<feature output name>__morphocoverage. It holds the guided report (report.html,figures/,report_short.txt,report_full.txt,scan.txt),morphocoverage_answers.json(the saved answers, which are the recorded[common]settings),settings_used.tomland, written last,morphobricks_entry.json. It is published by one exclusive rename.affects_values. A moved feature output with the same tables is therefore reused.ENTRY_OUTPUT_EXISTS, naming the field.ENTRY_OUTPUT_INCOMPLETE.ENTRY_IDENTITY_UNCERTAIN.ENTRY_*texts are copied from preprocessing'sentry_errorsand compared with its constructors.check_entry_recordandidentity_digest.580ef54(Plane histograms schema version 6 for preprocessing (Spec ADR 0008); v0.10.0 morphobricks-preprocessing#612) and normalization62eb84e(Plane histograms schema version 6: plane_histograms.parquet (Spec ADR 0008); v0.10.0 morphobricks-normalization#125) on the path.3. Version and documents
tools/baselines/layers.jsonadmits one recorded edge:__init__ -> workflows.entry (local), which is the lazyrun_folder.Owner questions: answered (2 December 2026)
run_folder.plane_histogramsis{}. Answered: records keep it, and preprocessing now pins that its checker accepts it (Plane histograms schema version 6 for preprocessing (Spec ADR 0008); v0.10.0 morphobricks-preprocessing#612 at580ef54). The conformance tests pass against that head (below).sourcevsrun_folder). Accepted as built.coverage_*codes. Accepted as built.[objective],[rare],[calibration](Q4). Answered: "become normal entry settings: declared, settable, recorded, in the identity." Done (round 5, below).--run-folder/--feature-output(Q5). Answered: "--feature-outputalias of--run-folder, documented first in help and README; both accepted; both given is refused." Done (round 5, below).Setupinventory (Q6). Answered: "every config field, option and parameter is declared or refused." Done (round 5, below).run_manifest.jsondigests." Done (round 5, below).Also unchanged (wave decisions): settings sections as built, entry outputs in CSV/text as built,
fov_subsetwaits for resolver contract 4. MorphoCoverage still pins no MorphoBricks package (its dependencies are unchanged).Round 5 changes (owner decisions of 2 December 2026)
run_manifest.json(Q7) (11810c4). Every file the entry reads (coverage.json,objects,fovs, each feature table) is hashed and compared with the SHA-256 that MorphoFeature'srun_manifest.json(itsfiles, keyed by the path relative to the feature output) records for it, before any of its values is read (coverage.jsonbefore it is parsed, each table before it is opened). A changed byte, a file the manifest has no digest for, or no readable manifest withfilesis refused withcoverage_export_malformed, naming the file. Tests: a changed byte in each of the four files, a spy showing the changed table is never parsed, and a missing entry, digest,filesand manifest. Checked by hand on a real MorphoFeature run (its owntest_coverage_morphocoverageworkflow onclaude/vigilant-gauss-9m0e6o, Parquet and CSV): the check passes, and one appended byte givescoverage_export_malformednamingcoverage/Cells/objects.<fmt>.--feature-output(Q5) (2edee8e).morphocoverage settings -o FILE --feature-output FEATURE_OUTPUT, first in the help and README;--run-folderis still accepted as its other name; both given isENTRY_SETTING_INVALID(exit 1, one JSON on stderr). The copiedENTRY_SETTING_MISSINGtext keeps naming--run-folder(it is preprocessing's text, which still works).[objective],[rare],[calibration]are entry settings (Q4) (5489899). Declared inentry_settings.jsonwithaffects_values: true(theoutside_entrymechanism is gone), optional and off unless given, recorded with their source, part of the identity. Given, they become:objective.objective-> newSetup.sampling_objective: the objective a stop must cover, in place of the one the declared targets make (Setup.objective()returns it, its rare componentSetup.rare). The declaration says "a stop needs the targets of the declared objective, ..." instead of "every declared target".[rare]->Setup.rare, a wholeRareTarget, in place of the guided preset thatcommon.rare_labelmakes.[calibration]-> newSetup.calibration:CalibrationSettingspassed to the report'ssufficiency_report; it needs a definition of new, andfov_countsbelow the definition'smin_fovsis refused up front (newcalibration.check_calibration), not when the report runs.ENTRY_SETTING_INVALIDbefore anything is computed.settings_used.toml; theSetupthe entry builds equals what the library takes (RareTarget(**...),calibration_settings(...),ObjectiveConfig("balanced", rare=...)); E3: the report shows the rare target, the objective and the calibration check, and the plain run does not; E6: a rerun reuses and a changed value in each section isENTRY_OUTPUT_EXISTSnamingsettings.<section>.<key>; refusals.objective.objectiveloses itsdefaults.tomldefault"population", so that an entry file filled fromsettings -odoes not override the targets' objective.objective_configwithout[objective]still givesObjectiveConfig()(population). The file to fill now names every optional setting in a comment.Setup(Q6) (fb3e52e).workflows/_entry_inventory.pylists everySetupfield as a setting, made from settings (tolerances,fingerprint,noveltyfrom the aim, features and positive control), a fact of the export (fov_col,group_cols,feature_tables,explainable_tables,described) or fixed atSetup's default (normalize,novelty_target,few_fovs,hierarchy,effort_strata,acquisition_order_col,stage_cols,rules,random_state,minimum_detection,fields_independent,contrasts,intensity_features), withrun_folder's parameters and the CLI flags. Tests pin it againstdataclasses.fields(Setup)and the declaration, check every fixed field's value in entry runs, and refuse everySetupfield that is no[common]setting when a settings file names it (ENTRY_SETTING_INVALID, never ignored).New owner questions
objective.objectivelost itsdefaults.tomldefault. Kept,settings -owould writeobjective = "population"and an entry run filled from it would judge a fingerprint aim under the population objective.objective_configkeeps the library's behaviour (population when absent). OK?Setupfieldssampling_objectiveandcalibration(both defaultNone, so nothing changes for existing callers), and the publiccalibration.check_calibration. They are how the entry passes[objective]and[calibration]to the report. Alternatively,report()could take them as arguments.[rare]is all or nothing. Given, it must be a wholeRareTargetand replaces the guided preset ofcommon.rare_label. It never fills in the missing fields from the preset. Field-by-field override of the preset is the alternative.[objective]equal to the targets' objective is still identity. For example,populationwithaim = "population"is another output than leaving it out (R2: a given setting is recorded and identity). OK?Setupfields are fixed because the guided answers never offered them, for examplerandom_state(0),rules,normalize,stage_colsandacquisition_order_col(the export carries no order or stage columns). Should any of them become an entry setting now?For MorphoFeature's wave PR (CellMigrationLab/MorphoFeature#297)
coverage/<set>/{coverage.json, objects.<fmt>, fovs.<fmt>, <tables[*].file>}, withtable_format,identity_columns,observation_unitandtables.{file, tag, units}incoverage.json(schema 3, with its experiment block).run_manifest.jsonat the run folder's root withfiles[<path relative to the root>].sha256for every file of the export,coverage.jsonincluded, as it does today: MorphoCoverage now verifies each file it reads against it and refuses an export without it (coverage_export_malformed).morphobricks_entry.jsonat the run folder's root, MorphoCoverage records that identity (information).open_feature_outputmust follow.Checks (on this branch's last commit,
fb3e52e)python -m ruff check src tests dataandpython -m ruff format --check src tests datapass (ruff 0.17.2 in the environment; the pin is 0.16.8).python tools/audit.py --check-against origin/main: baselines only tightened; the one admitted layer edge is the lazyrun_folderabove. The function index is regenerated.pytest, every CPU), with this branch'ssrc, preprocessing580ef54and normalization62eb84efirst onPYTHONPATH, in the shared gate environment:fdf0ca7, same environment and path: 4890 passed, 2 skipped, 6 xfailed.tests/test_morphobricks_constants.py, which reads the installed preprocessing's metadata (0.9.1) and needs 0.3.4. That is an environment effect.🤖 Generated with Claude Code