← Back to Pull requests

test(hooks): testmon-selected unit tests in the pre-push guard #414

Merged
smith-xyz merged 6 files (40 lines) on Nov 10, 2026 15:28 UTC
View on GitHub
smith-xyz smith-xyz commented on Nov 10, 2026 14:43 UTC
Author

What

  • The pre-push hook now runs make lint + make test-changed (pytest-testmon --testmon-forceselect) instead of make lint + make coverage — only the tests whose executed code the diff touches run locally (~5–15s typical vs 2.5–3.5 min).

  • FULL=1 git push runs the complete unit suite through the hook; make test remains the manual full run; make coverage moves to CI-only (CI already ran the same checks the hook duplicated — the hook header said so itself).

  • .testmondata ignored; first run per checkout builds the baseline (~60–85s, one-time); stale/missing data falls back to a full run — worst case is today's speed, never a silent skip.
  • Decisions

  • --testmon-forceselect, not --testmon: plain testmon silently deactivates selection under -m filters (-m "not integration" forces noselect → always a full run).

  • Coverage gate to CI: sync guard for breakage (the common failure), async guard for coverage erosion (the slow one); nothing enforced today stops being enforced.

  • Accepted limitation: import-time code (model configs, class attributes, constants) is executed during collection and attributed to no test, so coverage-based selection can't see it — changes there rely on CI's full suite. Verified empirically: flipping Model.model_config extra= selects zero tests.

  • Verified end-to-end: a behavioral change to a service helper selected its 30 tests and failed them in ~14s through the real hook; clean tree passes in ~6s; FULL=1 runs all 11,971 tests in ~57s.
  • Tests

  • make lint green; full unit suite green (11,971 passed) via the FULL=1 hook path on this exact tree.

  • Qodo pre-ready pass run; all three findings are the accepted tradeoffs above, except the lockfile-format downgrade, which is fixed (re-locked with uv 0.13.7 — 15 added lines, no revision churn).
  • Plan: none — developer-workflow change, no work item.

    Diff: 40 lines (+35 / -5) across 6 files Reviewer: gurnben Review duration: 45m
    All Vouch review confidence checks passed
    Residual risk 0.09 = Change Risk (0.33) × (1 − Review Confidence (0.72)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.33 · 40 lines diff across 6 files
    0.33
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.60 · 4 substantive comment(s)
    0.60
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    72%
    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.222
    Real PR Conversation Timeline
    6 items
    qodo-for-traust-sci[bot] qodo-for-traust-sci[bot] commented on Nov 10, 2026 14:44 UTC
    Bot

    <h3>PR Summary by Qodo</h3>

    Run testmon-selected unit tests in the pre-push hook

    <code>✨ Enhancement</code> <code>⚙️ Configuration changes</code> <code>🕐 10-20 Minutes</code>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">

    <details>
    <summary>AI Description</summary>

    <dl>
    <dd>
    <br/>

    ><pre>
    >• Replace the pre-push coverage run with testmon-selected unit tests to shorten routine pushes.
    >• Keep lint on every push and offer FULL=1 for a complete local unit run.
    >• Leave full-suite, coverage, and integration enforcement in CI.
    ></pre>

    </dd>
    </dl>

    </details>

    <details>
    <summary>Diagram</summary>

    <dl>
    <dd>

    <br/>

    graph TD
      Push["git push"] --> Hook["Pre-push hook"] --> Lint["make lint"] --> Mode{"FULL=1?"}
      Mode -->|No| Selected["Testmon unit tests"] --> CI["CI full gates"]
      Mode -->|Yes| Full["Full unit suite"] --> CI
    

    </dd>
    </dl>

    </details>

    <details>
    <summary>High-Level Assessment</summary>

    <dl>
    <dd>

    <br/>

    >The following are alternative approaches to this PR:

    <details>
    <summary><b>1. Run only lint locally and rely on CI for tests</b></summary>

    <dl>
    <dd>

  • ➕ Makes pushes faster without maintaining a local test-selection baseline.

  • ➖ Defers behavioral regression feedback until CI.
  • </dd>
    </dl>

    </details>

    <details>
    <summary><b>2. Keep the complete local coverage gate</b></summary>

    <dl>
    <dd>

  • ➕ Catches coverage erosion and import-time regressions before a push.

  • ➖ Retains the multi-minute delay on every push and duplicates CI checks.
  • </dd>
    </dl>

    </details>

    >Recommendation: Keep the proposed split: selected tests provide useful local feedback without repeating CI&#x27;s full coverage run. Reviewers should accept that import-time changes may not select local tests and will depend on CI; FULL=1 remains available when a complete local run is warranted.

    </dd>
    </dl>

    </details>

    <details>
    <summary> Files changed (5) <code> +32 / -2 </code> </summary>

    <dl>
    <dd>

    <br/>

    <details>
    <summary>Enhancement (2) <code> +15 / -2 </code></summary>

    <dl>
    <dd>

    <details>
    <summary>pre-push<code>Select fast unit tests by default on push</code> <code>+11/-2</code></summary>

    <br/>

    >Select fast unit tests by default on push

    ><pre>

    >• Runs lint followed by test-changed instead of coverage. FULL=1 switches the hook to the complete non-integration unit suite.
    ></pre>
    ><a href='https://github.com/traust-security/traust-core/pull/414/files#diff-d98b367aa518731b4158dd028ca94d051dfe32fefe54c4affde19f591ebc5fb6'>.githooks/pre-push</a>

    </details>

    <details>
    <summary>Makefile<code>Add a testmon-selected unit-test target</code> <code>+4/-0</code></summary>

    <br/>

    >Add a testmon-selected unit-test target

    ><pre>

    >• Adds and documents make test-changed, using pytest-testmon forced selection with the existing parallel, non-integration unit-test settings. The existing full-test and coverage targets remain available.
    ></pre>
    ><a href='https://github.com/traust-security/traust-core/pull/414/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52'>Makefile</a>

    </details>

    </dd>
    </dl>

    </details>

    <details>
    <summary>Other (3) <code> +17 / -0 </code></summary>

    <dl>
    <dd>

    <details>
    <summary>.gitignore<code>Ignore testmon&#x27;s local selection data</code> <code>+1/-0</code></summary>

    <br/>

    >Ignore testmon&#x27;s local selection data

    ><pre>

    >• Excludes .testmondata from version control so the local test-selection database stays checkout-specific.
    ></pre>
    ><a href='https://github.com/traust-security/traust-core/pull/414/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947'>.gitignore</a>

    </details>

    <details>
    <summary>pyproject.toml<code>Declare pytest-testmon as a development dependency</code> <code>+1/-0</code></summary>

    <br/>

    >Declare pytest-testmon as a development dependency

    ><pre>

    >• Adds pytest-testmon to the dev dependency group for the new local test target.
    ></pre>
    ><a href='https://github.com/traust-security/traust-core/pull/414/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711'>pyproject.toml</a>

    </details>

    <details>
    <summary>uv.lock<code>Lock pytest-testmon 2.3.0</code> <code>+15/-0</code></summary>

    <br/>

    >Lock pytest-testmon 2.3.0

    ><pre>

    >• Adds the pytest-testmon package and records it in the project&#x27;s locked dev dependencies without unrelated package revisions.
    ></pre>
    ><a href='https://github.com/traust-security/traust-core/pull/414/files#diff-84321598744d84dbee2318e634c74c9aae39a1c253f1c4bd17ebf9ef2f807b11'>uv.lock</a>

    </details>

    </dd>
    </dl>

    </details>

    </dd>
    </dl>

    </details>

    qodo-for-traust-sci[bot] qodo-for-traust-sci[bot] commented on Nov 10, 2026 14:45 UTC
    Bot

    <h3>Code Review by Qodo</h3>

    <br/>

    <details><summary><ins><strong>View low (1)</strong></ins></summary><br/>
    <img src="https://img.shields.io/badge/Low-634FD1?style=flat-square" height="20px" alt="Informational">

    <details>
    <summary> 1. Local push no longer enforces the 80% coverage gate <code>🐞 Bug</code> <code>⭐ New</code> <code>👈 Shift left</code></summary>

    <br/>

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    >The hook drops <b><i>make coverage</i></b> and so no longer fails a push that takes coverage below the
    ><b><i>fail_under</i></b> threshold in pyproject. Coverage regressions are now detected only after the push, in
    >the CI job that runs <b><i>make coverage</i></b>.
    ></pre>
    ></details>

    <details>

    ><summary>Agent prompt</summary>
    ><br/>
    >
    >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
    >
    >## Issue description
    >The pre-push hook no longer runs the coverage gate, so a push that drops coverage below 80% is accepted locally and only fails in CI.
    >
    >## Fix Focus Areas
    >- .githooks/pre-push[1-16]
    >
    >## Recommended Fix
    >This is an intentional trade-off; keep it but make the header and any contributor docs say that coverage is enforced only in CI, and point developers to `make coverage` before large changes.
    >

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>

    ></details>

    Dismiss ↗ | View ↗

    </details>

    </details>

    <br/>

    <!-- qodo-self-review-slot -->
    <!-- https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520 -->

    qodo-code-review[bot] qodo-code-review[bot] commented on Nov 10, 2026 14:46 UTC
    Bot

    <h3>Code Review by Qodo</h3>

    <code>🐞 Bugs (1)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">

    <br/>

    <img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">

    <details>
    <summary> 1. Data-file changes can pass the push guard <code>🐞 Bug</code> <code>≡ Correctness</code></summary>

    <br/>

    <details open>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    ><b><i>test-changed</i></b> selects tests from executed-code dependencies, so it does not select a test merely
    >because that test reads a changed YAML file or parses changed Python source as text. If a shipped
    >YAML file becomes invalid, or an import violates a rule checked by the source-reading architecture
    >tests, the default hook can pass without running the relevant test; CI&#x27;s full suite still runs it.
    ></pre>
    ></details>

    <details>

    ><summary>Code</summary>
    ><br/>
    ><code>[Makefile[65]](https://github.com/traust-security/traust-core/pull/414/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R65-R65)</code>

    >
    >+	uv run pytest tests/ -q -n auto -m "not integration" --testmon-forceselect
    >

    ></details>

    <details>

    ><summary>Evidence</summary>
    ><br/>
    ><pre>

    >The shipped-file test reads and validates YAML, while the architecture tests read Python files with
    ><b><i>read_text()</i></b> and parse them; neither operation executes the changed input as test-covered code.
    >Testmon&#x27;s maintainer confirms that ordinary file I/O is not tracked as a dependency. The hook now
    >relies on this selection by default, whereas CI still runs <b><i>make coverage</i></b>.
    ></pre>
    > <code>[tests/v1/context/test_traust_yaml.py\[255-268\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/tests/v1/context/test_traust_yaml.py/#L255-L268)</code>

    <code>[tests/v1/test_architecture.py\[52-54\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/tests/v1/test_architecture.py/#L52-L54)</code>

    <code>[tests/v1/test_layering.py\[54-70\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/tests/v1/test_layering.py/#L54-L70)</code>

    <code>[.github/workflows/ci.yml\[27-44\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/.github/workflows/ci.yml/#L27-L44)</code>

    <code>🌐 The testmon maintainer states that reading a data file does not register it as a code dependency.</code>

    ></details>

    <details>

    ><summary>Agent prompt</summary>
    ><br/>
    >
    >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
    >
    >## Issue description
    >The selected-test push guard misses tests whose changed inputs are read as data rather than executed as Python code.
    >
    >## Fix Focus Areas
    >- Makefile[64-65]
    >- .githooks/pre-push[11-16]
    >
    >## Recommended Fix
    >Run the shipped-configuration validation and source-reading architecture tests in addition to the testmon selection, or add a reliable changed-input mapping for them. Add a guard regression that changes a shipped YAML file and confirms its validation test runs.
    >

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>

    ></details>

    Dismiss ↗ | View ↗

    <hr/>
    </details>

    <details>
    <summary> 2. <s>A local filename can skip push tests</s> <code>✓ Resolved</code></summary>

    <br/>

    <p><b>Resolving commit:</b> <a href="https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520"><code>8378b7f</code></a></p>

    <details>

    ><summary>Resolution reason</summary>
    ><br/>
    ><pre>

    >Added <b><i>test-changed</i></b> to the Makefile&#x27;s .PHONY declaration, so make always runs the target&#x27;s pytest
    >recipe regardless of any same-named file or directory at the repository root.
    ></pre>
    ></details>

    <!-- qodo-finding-reference
    <code>↗ Makefile[R64-65]</code>
    -->

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    ><b><i>test-changed</i></b> is added as a Make target but not to the existing <b><i>.PHONY</i></b> declaration. If a file or
    >directory named <b><i>test-changed</i></b> exists at the repository root, Make treats the target as up to date,
    >and the default pre-push hook proceeds without invoking pytest.
    ></pre>
    ></details>

    <hr/>
    </details>

    <br/>

    <img src="https://img.shields.io/badge/Low-634FD1?style=flat-square" height="20px" alt="Informational">

    <details>
    <summary> 3. <s>Push guidance still promises coverage</s> <code>✓ Resolved</code></summary>

    <br/>

    <p><b>Resolving commit:</b> <a href="https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520"><code>8378b7f</code></a></p>

    <details>

    ><summary>Resolution reason</summary>
    ><br/>
    ><pre>

    >The setup message in Makefile and the README development section now describe the selected-test
    >default, the FULL=1 full-suite option, and CI coverage, instead of promising local coverage on push.
    ></pre>
    ></details>

    <!-- qodo-finding-reference
    <code>↗ .githooks/pre-push[L7]</code>
    -->

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    >The hook replaces <b><i>make coverage</i></b> with <b><i>make test-changed</i></b> by default and <b><i>make test</i></b> under
    ><b><i>FULL=1</i></b>, but the setup message and developer instructions still say the pre-push hook runs
    >coverage. Developers and agents following those instructions are therefore told that a local
    >coverage gate ran when coverage is now enforced by CI instead.
    ></pre>
    ></details>

    <hr/>
    </details>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">

    <!-- qodo-self-review-slot -->

    <!-- qodo-context:start -->
    <details><summary><strong>Context sources</strong></summary>

    <div>Review mode: <code>Auto: 🚀 Fast</code>: Makefile .PHONY, help and echo text plus README line; no logic change.</div>
    <div>&#x2705; Fix-loop round: <code>fix loop</code></div>
    <!-- qodo-context:end -->
    </details>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">

    <!-- qodo-daily-tip:start -->

    <details>
    <summary><strong>Tip of the day</strong></summary>

    <br/>

    <pre>💡 Did you know, you can move or hide resolved findings to focus on what still needs action</pre>

    <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a>

    </details>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
    <!-- qodo-daily-tip:end -->

    <!-- https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520 -->

    <!-- qodo-previous-reviews:start -->
    <!-- FOLDED_SECTION_START -->

    <details>
    <summary><strong>Previous reviews</strong></summary>

    <br/>

    Review updated until commit <a href="https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520">8378b7f</a>

    <details><summary>Results up to commit 3bde9ff <code>⚖️ Balanced</code></summary>

    <br><code>🐞 Bugs (1)</code> <code>📘 Rule violations (0)</code> <code>📎 Requirement gaps (0)</code> <code>🎨 UX issues (0)</code> <code>🔗 Cross-repo conflicts (0)</code> <code>📜 Skill insights (0)</code>

    <br/>

    <img src="https://img.shields.io/badge/Medium-634FD1?style=flat-square" height="20px" alt="Remediation recommended">

    <details>
    <summary> 1. Data-file changes can pass the push guard <code>🐞 Bug</code> <code>≡ Correctness</code></summary>

    <br/>

    <details open>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    ><b><i>test-changed</i></b> selects tests from executed-code dependencies, so it does not select a test merely
    >because that test reads a changed YAML file or parses changed Python source as text. If a shipped
    >YAML file becomes invalid, or an import violates a rule checked by the source-reading architecture
    >tests, the default hook can pass without running the relevant test; CI&#x27;s full suite still runs it.
    ></pre>
    ></details>

    <details>

    ><summary>Code</summary>
    ><br/>
    ><code>[Makefile[65]](https://github.com/traust-security/traust-core/pull/414/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R65-R65)</code>

    >
    >+	uv run pytest tests/ -q -n auto -m "not integration" --testmon-forceselect
    >

    ></details>

    <details>

    ><summary>Evidence</summary>
    ><br/>
    ><pre>

    >The shipped-file test reads and validates YAML, while the architecture tests read Python files with
    ><b><i>read_text()</i></b> and parse them; neither operation executes the changed input as test-covered code.
    >Testmon&#x27;s maintainer confirms that ordinary file I/O is not tracked as a dependency. The hook now
    >relies on this selection by default, whereas CI still runs <b><i>make coverage</i></b>.
    ></pre>
    > <code>[tests/v1/context/test_traust_yaml.py\[255-268\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/tests/v1/context/test_traust_yaml.py/#L255-L268)</code>

    <code>[tests/v1/test_architecture.py\[52-54\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/tests/v1/test_architecture.py/#L52-L54)</code>

    <code>[tests/v1/test_layering.py\[54-70\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/tests/v1/test_layering.py/#L54-L70)</code>

    <code>[.github/workflows/ci.yml\[27-44\]](https://github.com/traust-security/traust-core/blob/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520/.github/workflows/ci.yml/#L27-L44)</code>

    <code>🌐 The testmon maintainer states that reading a data file does not register it as a code dependency.</code>

    ></details>

    <details>

    ><summary>Agent prompt</summary>
    ><br/>
    >
    >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
    >
    >## Issue description
    >The selected-test push guard misses tests whose changed inputs are read as data rather than executed as Python code.
    >
    >## Fix Focus Areas
    >- Makefile[64-65]
    >- .githooks/pre-push[11-16]
    >
    >## Recommended Fix
    >Run the shipped-configuration validation and source-reading architecture tests in addition to the testmon selection, or add a reliable changed-input mapping for them. Add a guard regression that changes a shipped YAML file and confirms its validation test runs.
    >

    <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code>

    ></details>

    Dismiss ↗ | View ↗

    <hr/>
    </details>

    <details>
    <summary> 2. <s>A local filename can skip push tests</s> <code>✓ Resolved</code></summary>

    <br/>

    <p><b>Resolving commit:</b> <a href="https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520"><code>8378b7f</code></a></p>

    <details>

    ><summary>Resolution reason</summary>
    ><br/>
    ><pre>

    >Added <b><i>test-changed</i></b> to the Makefile&#x27;s .PHONY declaration, so make always runs the target&#x27;s pytest
    >recipe regardless of any same-named file or directory at the repository root.
    ></pre>
    ></details>

    <!-- qodo-finding-reference
    <code>↗ Makefile[R64-65]</code>
    -->

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    ><b><i>test-changed</i></b> is added as a Make target but not to the existing <b><i>.PHONY</i></b> declaration. If a file or
    >directory named <b><i>test-changed</i></b> exists at the repository root, Make treats the target as up to date,
    >and the default pre-push hook proceeds without invoking pytest.
    ></pre>
    ></details>

    <hr/>
    </details>

    <br/>

    <img src="https://img.shields.io/badge/Low-634FD1?style=flat-square" height="20px" alt="Informational">

    <details>
    <summary> 3. <s>Push guidance still promises coverage</s> <code>✓ Resolved</code></summary>

    <br/>

    <p><b>Resolving commit:</b> <a href="https://github.com/traust-security/traust-core/commit/8378b7ff2f881d7fd33a0f2c7fa3e491fde2c520"><code>8378b7f</code></a></p>

    <details>

    ><summary>Resolution reason</summary>
    ><br/>
    ><pre>

    >The setup message in Makefile and the README development section now describe the selected-test
    >default, the FULL=1 full-suite option, and CI coverage, instead of promising local coverage on push.
    ></pre>
    ></details>

    <!-- qodo-finding-reference
    <code>↗ .githooks/pre-push[L7]</code>
    -->

    <details>

    ><summary>Description</summary>
    ><br/>
    ><pre>

    >The hook replaces <b><i>make coverage</i></b> with <b><i>make test-changed</i></b> by default and <b><i>make test</i></b> under
    ><b><i>FULL=1</i></b>, but the setup message and developer instructions still say the pre-push hook runs
    >coverage. Developers and agents following those instructions are therefore told that a local
    >coverage gate ran when coverage is now enforced by CI instead.
    ></pre>
    ></details>

    <hr/>
    </details>

    <!-- qodo-self-review-slot -->

    </details>

    </details>

    <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider">
    <!-- qodo-previous-reviews:end -->

    <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>

    qodo-code-review[bot] qodo-code-review[bot] commented on Nov 10, 2026 14:49 UTC
    Bot
    gurnben gurnben approved these changes on Nov 10, 2026 15:11 UTC
    Approved Reviewer

    /lgtm

    Reviewers
    Assignees
    smith-xyz smith-xyz
    Labels
    risk: low confidence: 72.4% 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: 32.5% (LOW) · Higher = larger blast radius
    32.5%
    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: 72.4% · Lower = rushed or shallow review
    72.4%
    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: 9.0% · Safe to merge
    9.0%