← Back to Pull requests

build: migrate to pyproject.toml with src layout #8

Closed
unknown closed this pull request without merging on Oct 16, 2026 03:29 UTC
View on GitHub
unknown unknown commented on Oct 15, 2026 12:33 UTC
Author

Summary

Migrate the project to PEP 621 packaging (pyproject.toml) with a src layout. Previously the repo only worked when cloned into a directory named patio (emulated by the Dockerfile COPY . /app/patio trick): a fresh clone could neither run python -m patio.app nor execute the test suite.

Changes

  • Move the package into src/patio/ (pure git mv, no code changes; all internal patio.* imports unchanged)

  • Add pyproject.toml: setuptools backend, patio-runtime package, requires-python >= 3.10, dependencies, dev extra, patio console script, pytest config

  • Remove requirements.txt and requirements-dev.txt (superseded by project metadata)

  • Dockerfile: pip install /app instead of requirements + PYTHONPATH workaround; ENTRYPOINT uses the patio console script

  • Remove the obsolete conftest.py sys.path hack

  • Fix 5 pre-existing test bugs surfaced once tests could actually run locally: engine tests awaited an AsyncMock response instance (raising TypeError into the error branch) and the metrics test pinned an old prometheus-client exposition version

  • Update README installation, structure, and testing sections

  • Ruff format Python codebase
  • Test Plan

  • pip install -e ".[dev]" then pytest — 61 passed (previously the suite could not run at all from a fresh clone)

  • uv build --wheel — wheel contains only the patio/ package, no tests/doc

  • Smoke test: patio --port 19091 starts and /health, / respond correctly
  • Diff: 189 lines (+141 / -48) across 2 files Reviewer: cheyang Review duration: 895m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.59) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 189 lines diff across 2 files
    0.59
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.314
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.059
    Real PR Conversation Timeline
    1 comments
    "Review active on #8"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 59% (MEDIUM) · Higher = larger blast radius
    59%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 23.3% · Safe to merge
    23.3%