CLI: --version, logging with --quiet/--verbose, ephemeris verification wiring, and --resume (items 15 + 16)#14
Merged
Conversation
…--resume Item 15: - argparse --version prints package version, MODEL_VERSION, and kernel name. - Stage progress messages use the logging module (INFO default, --quiet for warnings only, --verbose for debug). Data outputs (json dumps, headline) stay on stdout. terminal_summary.txt is byte-identical. Deferred #12 follow-ups: - --allow-unverified-ephemeris is wired through every mode's load_ephemeris. - events.json records the kernel digest from the verified context (no re-hash) plus the new verified flag. - run_manifest.json command string reflects the real entry point (the old string referenced run_search.py, deleted in #10) and records resume use. Item 16: - --resume reuses per-stage artifacts in --output when a resume_manifest records matching model_version, config sha256, and kernel sha256; refuses to resume across any mismatch. Stages 1 (enumeration/screening), 2 (validation), 3 (optimized design), and 5 (stability) are checkpointable; stage 4 is always recomputed because fixed-system ground tracks are not serialized and downstream figures need them. - New tests cover parser flags, the version string, a --version subprocess run, and the pure resume-guard helper.
This was referenced Jul 25, 2026
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
Grouped implementation of work-plan items 15 and 16 (grouped because the
--resumeguard rides on the samecli.pyplumbing), plus the two CLI follow-ups deferred from #12.Item 15 — CLI ergonomics
--versionprints the package version (from installed distribution metadata, single-sourced per chore: single-source the package version; pin CITATION.cff to it in tests #11),MODEL_VERSION, and the ephemeris kernel name.loggingmodule: INFO by default,--quietfor warnings/errors only,--verbosefor debug.--quiet/--verboseare mutually exclusive. Data outputs (validation JSON, headlines, mode summaries) stay on stdout as plain prints.terminal_summary.txtcontent is byte-identical.--versionmirrorsload_ephemeris's default literally rather than importing a new constant fromephemeris.py, to avoid conflicting with item 14's upcomingephemeris.pychanges; a test pins the two together.#12 follow-ups
--allow-unverified-ephemerisis wired throughload_ephemeris(..., allow_unverified=...)in every mode.events.json's ephemeris block now recordscontext.kernel_sha256(verified once at load; no second re-hash of the kernel) and a new"verified"flag fromcontext.kernel_verified.run_manifest.json"command"string, which still referencedrun_search.py(deleted in chore: entry-point cleanup — delete run_search.py, prune one-off console scripts #10); it now records thechained-eclipseentry point and whether--resumewas used plus which stages were reused.Item 16 —
--resumeresume_manifest.jsonrecordingmodel_version, the config file's SHA-256, and the kernel's SHA-256, plus the stage-3 design targets (second-maximum TT JD, latitude, longitude) needed to rebuild downstream inputs.--resume, stages are reused only when their artifacts exist and all three identity values match; any mismatch (differentMODEL_VERSION, edited config, different kernel) refuses the resume with an explicit error rather than silently mixing runs.RealEclipserows are reconstructed fromreal_moon_eclipses.json), 2 (validation report), 3 (optimized design viaoptimized_system.yaml+design_mode_event.json+ manifest targets), and 5 (stability, with the failure guard re-applied to the reloaded result). Stage 4 (fixed-system search) is always recomputed: its ground tracks are not serialized and the figure stage needs them.Scientific impact
All numerical stages call the same functions with the same arguments; this PR only changes orchestration, logging, and provenance metadata. Reused resume artifacts are byte-identical outputs of a previous identical-identity run. New
events.json/run_manifest.jsonfields are additive.Checklist
--quiet+--verboserejection, version string contents, a real--versionsubprocess run, and the pure resume-identity guard (kernel-hash, model-version, and empty-manifest refusals).terminal_summary.txtcontent unchanged.