← Back to Pull requests

Preserve original version strings in core metadata #2385

Open
aryansk opened this pull request with 28 lines diff across 3 files
View on GitHub
aryansk aryansk commented on Aug 12, 2026 10:22 UTC
Author

Fixes #2384

Summary

  • Preserve the original project version string in generated Core Metadata.

  • Retain the normalized PEP 440 version for internal version handling and distribution naming.

  • Add a regression test for 2026.08.10 and metadata round-tripping.
  • Tests

  • Hatch metadata test suite: 334 passed.
  • This PR was prepared with AI assistance and the implementation and test results were reviewed locally.

    Diff: 28 lines (+22 / -6) across 3 files Reviewer: cjames23 Review duration: 98087m
    All Vouch review confidence checks passed
    Residual risk 0.04 = Change Risk (0.33) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 28 lines diff across 3 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 1 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    87%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.201
    Real PR Conversation Timeline
    3 items
    cjames23 cjames23 commented on code on Aug 13, 2026 00:38 UTC
    Code Review
    backend/src/hatchling/metadata/core.py:1
    @@ -153,6 +154,12 @@ def version(self) -> str:
     
             return self._version
     
    +    @property
    +    def raw_version(self) -> str:
    +        """Return the version string before PEP 440 normalization."""
    +        _ = self.version
    +        return cast(str, self._raw_version)
    +
         @property

    Why the wrapper function and why is self.version being assigned to a throwaway inside this function that does not require it at all. This looks like you did not review this AI generated code at all.

    cjames23 cjames23 requested changes on Aug 13, 2026 00:38 UTC
    Changes Requested Reviewer

    Requested changes.

    Reviewers
    Assignees
    aryansk aryansk
    Labels
    risk: low confidence: 87.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 33.1% (LOW) · Higher = larger blast radius
    33.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 87.1% · Lower = rushed or shallow review
    87.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.3% · Safe to merge
    4.3%
    Repository