Repository navigation
Conversation
job.metadata.commit already identifies the code a run was trained with, but only as a hash, and only when fairchem.core sits in a git repo: a released install has no repo, so get_commit_hash() reports "core:None". Record two more read-only fields alongside it: - metadata.branch, from `git branch --show-current` in the fairchem.core checkout. None for a released install and for a detached HEAD, both of which have no branch to report. - metadata.version, the installed fairchem-core version. "2.21.1" for a release, "2.21.1.dev50+gdfbfb7044" for a dev checkout, so it pins a released install that has no commit. Note that for an editable install the version is resolved when the package is installed, so its embedded hash can lag behind metadata.commit.
mshuaibii
approved these changes
Oct 7, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 9, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 10, 2026
This branch has not been deployed
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
job.metadata.commitalready identifies the code a run was trained with, but only as a hash, and only whenfairchem.coresits in a git repo — a released install has no repo, soget_commit_hash()reportscore:None.This adds two more read-only fields next to it, both populated in
JobConfig.__post_init__:metadata.branch— fromgit branch --show-currentin thefairchem.corecheckout.Nonefor a released install and for a detached HEAD, neither of which has a branch to report.metadata.version— the installedfairchem-coreversion.2.21.1for a release,2.21.1.dev50+gdfbfb7044for a dev checkout, so it pins a released install that has no commit.commitbranchversioncore:db9b17fc6,experimental:NAmain2.21.1.dev50+gdfbfb7044core:None,experimental:NANone2.21.1Both fields are
Optional[str] = None, so existing configs and anything readingMetadataare unaffected.One caveat worth knowing: for an editable install the version is resolved when the package is installed, so its embedded hash can lag behind
metadata.commit.commitremains the accurate one.Motivation
Makes a checkpoint's provenance self-describing: given a trained model you can tell exactly which fairchem code produced it, including for models trained from a PyPI install where no commit is recoverable today. Downstream checkpoint tooling can then surface it rather than asking the person who trained the model.
Test plan
New tests in
tests/core/common/test_utils_.pycoverget_branch_for_repoon a branch, on a detached HEAD, and outside a git repo, plusget_package_version.