← Back to Pull requests

tests: requirements-unit.txt, the unit tests' hash-locked lock for heavy's sanctioned venv (regalia-kms-kow) #790

Open
unknown opened this pull request with 426 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 25, 2026 13:39 UTC
Author

Bead: regalia-kms-kow (GA ruling (b), 2026-11-25).

The fleet's heavy admission rule now bans temporary venvs and pip without --require-hashes: every far Python run uses a sanctioned venv built once from a committed, hash-locked lock. regalia-kms had none for its unit tests. CI's "python guards" step runs the ubuntu-26.04 image's system python3, which imports PyYAML from the OS. heavy-pool-h4i-2's system python3 has no yaml, so #788's and #r1s.12's proofs can't run there yet. This lock unblocks them; dfat then builds the sanctioned venv from it.

The lock (tests/requirements-unit.txt, --require-hashes)


  • PyYAML 6.0.3. Ubuntu 26.04's python3-yaml is 6.0.3-1build1 (packages.ubuntu.com/resolute). actions/runner-images' Ubuntu2604-Readme (image 20261116.202.1) lists no pip-installed PyYAML. So the OS package is the one CI's python imports. The source is cited in the file's header.

  • cryptography 50.0.1, cffi 2.1.1, pycparser 3.0. The same versions and hashes as tools/bench/requirements.txt, plus cffi's CPython 3.14 wheel (CI's Python).

  • Files covered: manylinux x86_64 wheels for CPython 3.12–3.14, plus each sdist. Hashes are PyPI's.
  • Test (tests/test_requirements_unit.py, stdlib only)


  • Every line is pinned with == and hashed, with no duplicate hashes.

  • PyYAML is 6.0.3, and cryptography's runtime dependencies are present.

  • The packages both locks share have one version, and every bench hash is here too.

  • The header cites the PyYAML source.

  • The parser sees unpinned and unhashed lines, and normalises names.
  • Heavy proof (owner pre-run rule; bar amendment 7)


    heavy-pool-h4i-2, run 20261125T133904-Jonathans-MacBook-Pro-92886, at HEAD e8faa740493532b4fad190e2e06149de0e65c846.

    Amendment 7.

  • FAR_TREE e1198812070db078082314a03aa6343e40a39fb2, printed far-side.

  • The local rebuild (head tree minus the 22 refused paths, list sha256 572cbc90a6e6348f48ad099eeb0b72f22af5e89a6bf41e41ede37985e4efc829) gives e1198812…: a match.

  • git diff --name-only equals the refused list exactly.
  • Environment.

  • SigIgn 0000000000000001.

  • memBound 43% at start.

  • The host's system python3 3.13.5, stdlib only. No venv, no pip.
  • Suite. tests.test_requirements_unit: Ran 6 tests, OK, rc=0.

    Mutants, each killed by named tests.

    | Mutant | Killed by |
    |---|---|
    | M1, cryptography 50.0.2 | test_it_is_in_step_with_the_bench_lock (cryptography) |
    | M2, a bench cffi hash dropped | test_it_is_in_step_with_the_bench_lock (cffi) |
    | M3, pycparser unhashed | test_every_requirement_is_pinned_and_hashed (pycparser), plus in-step |

    Not proven on heavy. The rest of the Python suite needs PyYAML, which h4i-2 doesn't have until this lock's venv exists. Hosted CI confirms it here.

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Tests
    Added checks that unit-test and benchmark requirement files use pinned versions and valid, consistent hashes.
    Added coverage for requirement parsing, including comments, continuations, and package-name normalization.

    Documentation
    * Clarified the unit-test environment and installation requirements, including Python and package-build coverage.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 426 lines (+319 / -107) across 5 files Reviewer: jobordu Review duration: 15041m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.45) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 426 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.362
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #790"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 45.1% (MEDIUM) · Higher = larger blast radius
    45.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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 24% · Safe to merge
    24%