Skip to content

feat: Add unified system for handling runtime assets like pseudopotentials and model weights - #169

Open
sigilmakes wants to merge 26 commits into
test/mutation-scorefrom
feat/168-runtime-assets
Open

feat: Add unified system for handling runtime assets like pseudopotentials and model weights#169
sigilmakes wants to merge 26 commits into
test/mutation-scorefrom
feat/168-runtime-assets

Conversation

@sigilmakes

@sigilmakes sigilmakes commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

This PR unifies model weight downloading and the new pseudopotential download system behind a single asset store, rather than having duplicating systems that could end up downloading assets to different locations on the disk.

To do this, the PR introduces a new assets package with an AssetStore class which handles downloads, asset integrity checks, and other various responsibilities of a store. All weights, pseudopotentials and any future assets will be stored in XDG_DATA_HOME/goldilocks/assets (which will usually resolve to ~/.local/share/goldilocks/assets). Fallback and manually specified locations for the asset store are also available.

The model registry has then been moved into the ml package, and refactored to make use of this new asset store. The pseudopotential registry has also been added to pseudos.

Other minor changes include a rename of the cli to goldilocks from goldilocks-core, the addition of the new goldilocks assets commands for acquiring assets, and improvements and rewrites to documentation as needed.

(Pseudopotential asset system originally written by Junwen for #160, based on the existing model weights registry system. This is a unification and simplification of the two systems into something reusable and maintainable)

N.B. The MCP/HTTP and python API surfaces do expose the asset store to the user/client, but don't currently expose tools for downloading assets. I'm deferring that until we've built the frontend so I have a proper idea of how I want to handle that. For now, goldilocks assets is the only entrypoint for that.

Closes #168

@sigilmakes
sigilmakes force-pushed the feat/168-runtime-assets branch from 312fdab to eaa0b69 Compare August 14, 2026 11:40
Replace mutable PseudoMetadata (library, source_set, is_sssp,
sssp_recommended_cutoff) with frozen PseudoMetadata carrying
PseudoCutoffs (ecutwfc_ry, ecutrho_ry) and typed table_id.

Rename PseudopotentialAdvice to PseudopotentialRequirements and
pseudo_mode to pseudo_accuracy. Add PseudoAccuracy, PseudoType, and
RelativisticTreatment literal types. Add table_id to PseudoMetadata
replacing the stringly-typed pseudo_info dict lookup.

Remove AvailablePseudos (source and table_id fields were write-only).
Add PseudoDojo and SSSP importers that validate report/header/table
agreement, verify MD5 per UPF, and produce one normalized installed
manifest. Add pseudo/registry.toml with 15 validated table declarations.

Replace pp_selector.py with source.py: source_for_request returns a
Callable resolving one of three sources (explicit metadata, local
root, installed table). PseudoTableMismatch reports the specific
unsatisfied requirement and matching alternatives.

Remove write-only PseudoCutoffs.provenance and hints_ry (PseudoDojo
hint levels remain in the installed manifest per #168). Remove unused
PseudoTable fields (upstream_url, transfer_bytes, installed_bytes,
record, note, covers method).
…tional consistency

Merge the Resolve Pseudos graph stage into Select — the stage adapter
calls the source resolver and passes metadata to select_pseudopotentials
in one step. Select is pure: takes PseudopotentialRequirements and
Sequence[PseudoMetadata], returns SelectionRecord with specific
diagnostics for each unsatisfied requirement.

Add functional consistency enforcement at QE generation: requirement
functional must match intent functional, selection coverage must match
structure elements, every selected pseudo must have filename and both
cutoffs.

Rename advise_pseudopotentials to advise_pseudopotential_requirements.
CoreRuntime gains asset_store and pseudo_registry_path parameters.
Add --pseudo-table, --pseudo-accuracy, and --fetch-missing CLI options.
Add assets install/status/verify lifecycle commands.

Map PseudoTableMismatch (422), AssetCorrupt (424), and
AssetNotInstalled (424) to structured HTTP responses. Wrap
PseudoTableMismatch, PseudoImportError, AssetCorrupt, and
AssetNotInstalled in MCP ToolError for structured tool failures.

Update server request deserializer and MCP pydantic schemas for the
new PseudoMetadata and PseudoCutoffs shapes.
…acts

Update conftest, server conftest, and all test fixtures to use
PseudoCutoffs (ecutwfc_ry, ecutrho_ry) without provenance/hints_ry.
Update PseudoTable fixtures without dead fields. Update selection,
generation, runtime, CLI, transport, and integration tests for the
renamed types and merged graph stage.

Add HTTP tests for PseudoTableMismatch (422) and AssetCorrupt (424).
Add MCP tests for table mismatch and missing-asset ToolError.

Strengthen asset store: checksum validation, AssetInstallation/
AssetPreparer protocol, atomic corrupt repair.
Document the normalized table lifecycle, source resolution model,
--pseudo-table/--pseudo-accuracy CLI options, asset store root, and
the simplified SCF pipeline. Update changelog, conventions, tutorial,
pipeline, and README examples.
@sigilmakes
sigilmakes force-pushed the feat/168-runtime-assets branch from eaa0b69 to b9ce02f Compare August 14, 2026 11:47
@sigilmakes sigilmakes closed this Aug 14, 2026
@sigilmakes sigilmakes reopened this Aug 14, 2026
urllib has no timeout, no retry, and no streaming control — it will
hang silently on a slow connection and fail without retry on a
transient 503. Replace with requests (stream=True, timeout=300s).
Drop certifi as a direct dependency; requests bundles its own trust
store.
@sigilmakes
sigilmakes force-pushed the feat/168-runtime-assets branch from 0c70e44 to dbd5720 Compare August 14, 2026 12:41
@sigilmakes
sigilmakes marked this pull request as ready for review August 14, 2026 12:43
The Resolve Pseudos stage was merged into Select. Tutorial updated to
use pseudo_root instead of the removed load_pseudo_metadata + tuple
pattern.
Selection now filters lanthanide/actinide elements to SSSP candidates unconditionally, and ranks SSSP ahead of PseudoDojo for equal candidates, restoring the scientific behavior lost in the asset-store unification.

Fallback warnings for these elements explain the 4f-freezing and actinide coverage reasons and name the install and select commands to run.
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.

feat(assets): unify model and pseudopotential acquisition

1 participant