Repository navigation
refactor: Simplify core provenance, preparation, and application layer - #373
Merged
ericchansen merged 1 commit intoOct 19, 2026
Merged
Conversation
ericchansen
force-pushed
the
ericchansen-simplify-core-and-application-layer
branch
from
October 19, 2026 22:44
314c823 to
d18d160
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Credential screening now accepts previously blocked auth keys, allowing opaque credentials into saved manifests.
1 open issue
What changed in this PR
Simplifies shared provenance, preparation, and application code by reusing normalization, validation, and serialization helpers.
Changes:
- Consolidates JSON handling and credential screening.
- Reuses parameter-space operations and settings serialization.
- Shares execution validation and simplifies persistence staging.
| File | Description |
|---|---|
| q2mm/settings.py | Reuses JSON thawing for options and serialization. |
| q2mm/preparation.py | Reuses parameter-space helpers and settings exports. |
| q2mm/application/persistence.py | Simplifies manifest construction and staged writes. |
| q2mm/application/optimization.py | Consolidates gradient resolution and validation. |
| q2mm/application/models.py | Shares validators and simplifies provenance capture. |
| q2mm/application/configuration.py | Passes configured finite-difference step directly. |
| q2mm/_provenance.py | Adds shared thawing and changes credential-key screening. |
| q2mm/_canonical.py | Consolidates recursive JSON normalization. |
Review effort: Balanced
Consolidate credential-key screening and JSON thawing in q2mm._provenance, factor recursive normalization in q2mm._canonical, reuse ActiveParameterSpace and QFuerzaSettings helpers in q2mm.preparation, and eliminate redundant gradient-mode and payload wrappers across q2mm.application. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ericchansen
force-pushed
the
ericchansen-simplify-core-and-application-layer
branch
from
October 19, 2026 22:55
d18d160 to
9d89bc5
Compare
ericchansen
deleted the
ericchansen-simplify-core-and-application-layer
branch
October 19, 2026 22:58
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
Simplify the core provenance, canonicalization, settings, preparation, and application modules (
177 insertions, 346 deletions,-169net lines) while preserving all public, architectural, and lazy-import contracts.Changes
_CREDENTIAL_KEYregex +startswith/endswithcheck inq2mm/_provenance.pywith a normalized alphanumeric substring check against_CREDENTIAL_KEY_TERMS, and exportthaw_json_valuefor reuse inq2mm/settings.py(includingBackendSettings.factory_options()).q2mm/_canonical.py(json_value) to eliminate repeated keyword-argument forwarding and_screen_keyboilerplate.ActiveParameterSpace.pack/expand/with_baseline,QFuerzaSettings.model_dump(), andPreparationProvenance.__post_init__freezing inq2mm/preparation.py._validate_execution_controlsand_validate_result_vectorsacrossq2mm/application/models.pyandq2mm/application/optimization.py, collapse_result_gradient_modeand_settings_gradient_modeinto one function, replace manual dataclass-to-dict reconstructions inOptimizationRun.from_resultand_manifest_payloadwithvars(...), and inline_install_stagedinq2mm/application/persistence.py.Testing
python -m pytest test/ -x -q -m "not (openmm or tinker or jax or jax_md or psi4)"(7582 passed, 185 skipped)python -m ruff check q2mm/ test/ scripts/(All checks passed!)python -m ruff format --check q2mm test scripts examples(288 files already formatted)python -m mypy q2mm/(Success: no issues found in 109 source files)