What changed, and why it matters
This commit only rewrites code comments and removes an early-return check that previously skipped git detection when running on the SeedSigner OS. The actual behavior of the version detection function is unchanged for the normal case, and no security-sensitive code is modified.
No security action required; treat as a routine documentation/comment cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in src/seedsigner/controller.py is purely cosmetic: it updates docstrings and inline comments for get_version() and removes the if Settings.HOSTNAME == Settings.SEEDSIGNER_OS: return name guard. The remaining logic still reads .git/HEAD and falls back to the hard-coded VERSION if the file is absent. No input parsing, cryptography, network, or privilege logic is altered.
Changed components
src/seedsigner/controller.pyInspect captured patch +7 / −8
diff --git a/src/seedsigner/controller.py b/src/seedsigner/controller.py
index 6284a46..f325a34 100644
--- a/src/seedsigner/controller.py
+++ b/src/seedsigner/controller.py
@@ -482,15 +482,13 @@ class Controller(Singleton):
def get_version(self) -> str:
"""
- Returns either the hard-coded Controller.VERSION or a dynamically detected
- version string for display in the UI. In local dev will return either the
- current git branch name or commit hash.
+ Will attempt to read the current git branch name or commit hash from
+ .git/HEAD. But if there's no git info available, it will fall back to the
+ hard-coded Controller.VERSION.
"""
name = f"v{VERSION}"
- if Settings.HOSTNAME == Settings.SEEDSIGNER_OS:
- return name
- # We're in local dev; pull info from .git/HEAD if we can
+ # .git/HEAD will be in the project root, if it exists
git_HEAD_dir = os.getcwd()
# Main app runs from src/ dir, tests and screenshot generator from project root
@@ -502,10 +500,11 @@ class Controller(Singleton):
with open(git_HEAD_path, "r") as f:
git_ref = f.read().strip()
if git_ref.startswith("ref:"):
- # get the branch name
+ # HEAD format: "ref: refs/heads/some_branch_name"
name = git_ref.split("/")[-1]
else:
- # get the commit hash
+ # If we're on a detached HEAD, the contents will just be the current
+ # commit hash.
name = git_ref[:7]
return name
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.