← Back to Pull requests

Make it a Django package: real dependencies, no scaffold, pre-commit #11

Closed
unknown closed this pull request without merging on Jul 29, 2026 09:33 UTC
View on GitHub
unknown unknown commented on Jul 29, 2026 09:29 UTC
Author

Two related changes, one ADR each.

ADR-0003 — real dependencies, scaffold deleted

The distribution described itself as something it isn't: dependencies = ["typer", "rich"], a [project.scripts] console entry point, and three placeholder modules.

That last part wasn't cosmetic — docs/reference.md renders ::: django_stateless_mcp through mkdocstrings, so as soon as Read the Docs builds, utils.do_something_useful() ("Replace this with a utility function") becomes the package's published API reference.

  • django>=5.2 as the supported floor. Django 4.2 reached EOL on 2026-04-07 and 5.1 in December 2025, so only 5.2 LTS (to Apr 2028) and 6.0 (to Apr 2027) are supported upstream. The build plan's "Django 4.2 / 5.x" matrix is out of date.

  • cli.py, utils.py, __main__.py and the entry point deleted.

  • Classifiers now name Django 5.2/6.0 and Python 3.12–3.14.
  • mcp deliberately not declared yet

    mcp==2.0.0 went GA on 2026-07-28. exclude-newer = "1 week" currently anchors at 2026-07-22, so the resolver can't see it — it fails with "only mcp<=2.0.0b2 is available".

    No code imports mcp yet, so declaring it buys nothing today, and the window clears on its own around 2026-08-04. Suppressing a supply-chain guard to add an unused dependency is a bad trade, and the guard catching a one-day-old release is it working as designed.

    ⚠️ The first code PR must add mcp — if written before ~4 Aug it inherits this problem rather than a solution.

    ADR-0004 — pre-commit

    There was no pre-commit config at all, despite the build plan assuming one. Modelled on adamchainz/django-crawl, minus its reST-specific hooks: file hygiene, pyproject-fmt, ruff check+format, blacken-docs, django-upgrade --target-version 5.2, and mypy.

    mypy runs as a local hook (uv run mypy) rather than mirrors-mypy. The conventional approach duplicates the dependency list into additional_dependencies, which drifts from pyproject.toml silently. Running against the project env needs no second list and runs exactly what CI runs.

    Test plan

  • uv run pre-commit run --all-files → all hooks pass, idempotent

  • uv run mypy src/ tests/ → Success

  • uv run pytest → 1 passed; coverage 100%

  • uv run --group docs mkdocs build --strict → clean

  • CI green
  • Known follow-ups (not in this PR)

  • README.md is stale — advertises Zensical and the GitHub Pages URL, Features is TODO, and it's where the spec-version support policy belongs.

  • CHANGELOG/0.1.0.md still describes the Typer CLI and ty. Never published to PyPI, so it can be corrected.

  • No doc link checking yet; blacken-docs covers code blocks only.
  • Diff: 339 lines (+254 / -85) across 4 files Reviewer: BenA-SA Review duration: 4m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.42) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 339 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 49% · Reviewer familiarity: 35%
    43%
    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.349
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #11"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.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: 42.3% (MEDIUM) · Higher = larger blast radius
    42.3%
    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: 43.4% · Lower = rushed or shallow review
    43.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: 23.9% · Safe to merge
    23.9%